package uk.ac.starlink.ttools.plot2.task;

import uk.ac.starlink.task.Environment;
import uk.ac.starlink.task.Parameter;
import uk.ac.starlink.ttools.plot2.Plotter;
import uk.ac.starlink.ttools.plot2.config.ConfigKey;
import uk.ac.starlink.ttools.plot2.data.Coord;
import uk.ac.starlink.ttools.plot2.data.CoordGroup;

/**
 * LayerType representing a single Plotter.
 *
 * @author   Mark Taylor
 * @since    15 Sep 2014
 */
public class SimpleLayerType implements LayerType {

    private final Plotter<?> plotter_;

    /**
     * Constructor.
     *
     * @param  plotter  plotter
     */
    public SimpleLayerType( Plotter<?> plotter ) {
        plotter_ = plotter;
    }

    public String getName() {
        return plotter_.getPlotterName();
    }

    public String getXmlDescription() {
        return plotter_.getPlotterDescription();
    }

    public Parameter<?>[] getAssociatedParameters( String suffix ) {
        return new Parameter<?>[ 0 ];
    }

    public Plotter<?> getPlotter( Environment env, String suffix ) {
        return plotter_;
    }

    /**
     * Returns this layer type's single plotter.
     *
     * @return  plotter
     */
    public Plotter<?> getPlotter() {
        return plotter_;
    }

    public CoordGroup getCoordGroup() {
        return plotter_.getCoordGroup();
    }

    public Coord[] getExtraCoords() {
        return plotter_.getCoordGroup().getExtraCoords();
    }

    public ConfigKey<?>[] getStyleKeys() {
        return plotter_.getStyleKeys();
    }
}

