|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.task.AbstractPlot2Task
public abstract class AbstractPlot2Task
Abstract superclass for tasks performing plot2 plots using STILTS. Concrete subclasses must supply the PlotType (perhaps from the environment), and may customise the visible task parameter set.
Field Summary | |
---|---|
static String |
EXAMPLE_LAYER_SUFFIX
|
static String |
LAYER_PREFIX
|
Constructor Summary | |
---|---|
protected |
AbstractPlot2Task()
Constructor with default animation capability. |
protected |
AbstractPlot2Task(boolean allowAnimate)
Constructor with explicit animation capability. |
Method Summary | ||
---|---|---|
protected abstract
|
createConfigParameter(Environment env,
ConfigKey<T> key,
String[] suffixes)
Returns a config parameter for a given config key that may be sensitive to the content of the execution environment. |
|
static StringParameter |
createDataParameter(Input input,
String suffix,
boolean fullDetail)
Returns a parameter for acquiring a column of data. |
|
Executable |
createExecutable(Environment env)
Creates an executable object which will do the work of this task in the given Environment. |
|
static FilterParameter |
createFilterParameter(String suffix,
InputTableParameter tableParam)
Returns a parameter for acquiring a filter applied to the table input for a given layer. |
|
static Parameter<String> |
createLabelParameter(String suffix)
Returns a parameter to get a textual label corresponding to the layer identified by a given layer suffix. |
|
static LayerTypeParameter |
createLayerTypeParameter(String suffix,
PlotContext context)
Returns a parameter for acquiring a plotter. |
|
PlotDisplay |
createPlotComponent(Environment env,
boolean caching)
Returns a graphical component that displays an interactive view of the plot described by a value-bearing execution environment. |
|
Icon |
createPlotIcon(Environment env)
Returns an Icon that paints the plot described by a value-bearing execution environment. |
|
static
|
createPlotIcon(PlotLayer[] layers,
SurfaceFactory<P,A> surfFact,
P profile,
A aspect,
Icon legend,
float[] legPos,
String title,
ShadeAxisFactory shadeFact,
Range shadeFixRange,
PaperTypeSelector ptsel,
Compositor compositor,
DataStore dataStore,
int xpix,
int ypix,
Insets insets,
boolean forceBitmap)
Creates an icon which will paint the content of a plot. |
|
static InputTableParameter |
createTableParameter(String suffix)
Returns a parameter for acquiring a data table. |
|
Parameter[] |
getBasicParameters()
Returns the list of parameters supplied by the AbstractPlot2Task implementation. |
|
Parameter[] |
getContextParameters(Environment env)
Returns the parameters for this task in the context of a given execution environment. |
|
static List<Parameter> |
getKeyParams(ConfigKey[] keys)
Returns a list of non-suffixed parameters based on a list of ConfigKeys. |
|
Parameter |
getParameterByName(Environment env,
String paramName)
Attempts to find a parameter with a given name that might be used by this task in the content of the given environment. |
|
abstract PlotContext |
getPlotContext(Environment env)
Concrete subclasses must implement this method to provide the PlotType and other information from the environment that may not be available at construction time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface uk.ac.starlink.task.Task |
---|
getParameters, getPurpose |
Field Detail |
---|
public static final String LAYER_PREFIX
public static final String EXAMPLE_LAYER_SUFFIX
Constructor Detail |
---|
protected AbstractPlot2Task(boolean allowAnimate)
allowAnimate
- true iff animation options should be providedprotected AbstractPlot2Task()
Method Detail |
---|
public abstract PlotContext getPlotContext(Environment env) throws TaskException
env
- execution environment
TaskException
protected abstract <T> ConfigParameter createConfigParameter(Environment env, ConfigKey<T> key, String[] suffixes) throws TaskException
env
- execution environmentkey
- config key for which a parameter is requiredsuffixes
- ordered list of the plot layer suffixes
in use for the plot being performed
key
TaskException
public final Parameter[] getBasicParameters()
public Executable createExecutable(Environment env) throws TaskException
Task
env
, though this is not
absolutely prohibited.
createExecutable
in interface Task
env
- the environment in which the task will operate
TaskException
- if no executable can be created;
this should usually be a UsageException
or
some subclasspublic Icon createPlotIcon(Environment env) throws TaskException, IOException, InterruptedException
env
- execution environment
TaskException
IOException
InterruptedException
public PlotDisplay createPlotComponent(Environment env, boolean caching) throws TaskException, IOException, InterruptedException
env
- execution environmentcaching
- whether data and plot should be cached or re-read
at every repaint
TaskException
IOException
InterruptedException
public Parameter[] getContextParameters(Environment env) throws TaskException
DynamicTask
Task.getParameters()
, but found
settings of parameters in the presented environment may lead to
parameters being added to or removed from the list.
This ought not to result in additional prompts to the user.
getContextParameters
in interface DynamicTask
env
- execution environment
TaskException
public Parameter getParameterByName(Environment env, String paramName) throws TaskException
DynamicTask
This ought not to result in additional prompts to the user.
getParameterByName
in interface DynamicTask
env
- execution environmentparamName
- requested parameter name
TaskException
public static InputTableParameter createTableParameter(String suffix)
suffix
- layer-specific suffix
public static FilterParameter createFilterParameter(String suffix, InputTableParameter tableParam)
suffix
- layer-specific suffixtableParam
- input table parameter associated with the layer
public static Parameter<String> createLabelParameter(String suffix)
suffix
- layer suffix
public static LayerTypeParameter createLayerTypeParameter(String suffix, PlotContext context)
suffix
- parameter name suffixcontext
- plot context
public static StringParameter createDataParameter(Input input, String suffix, boolean fullDetail)
input
- specifies input value required from usersuffix
- layer-specific suffixfullDetail
- if true, extra detail is appended to the description
public static <P,A> Icon createPlotIcon(PlotLayer[] layers, SurfaceFactory<P,A> surfFact, P profile, A aspect, Icon legend, float[] legPos, String title, ShadeAxisFactory shadeFact, Range shadeFixRange, PaperTypeSelector ptsel, Compositor compositor, DataStore dataStore, int xpix, int ypix, Insets insets, boolean forceBitmap)
layers
- layers constituting plot contentsurfFact
- surface factoryprofile
- surface profileaspect
- surface aspectlegend
- legend icon, or null if none requiredlegPos
- 2-element array giving x,y fractional legend placement
position within plot (elements in range 0..1),
or null for external legendtitle
- plot title or nullshadeFact
- gets shader axis from range, or null if not requiredshadeFixRange
- fixed shader range,
or null for auto-range where requiredptsel
- paper type selectorcompositor
- compositor for pixel compositiondataStore
- data storage objectxpix
- horizontal size of icon in pixelsypix
- vertical size of icon in pixelsinsets
- may supply the inset space to be used for
axis decoration etc; if null, this will be worked out
automaticallyforceBitmap
- true to force bitmap output of vector graphics,
false to use default behaviour
public static List<Parameter> getKeyParams(ConfigKey[] keys)
keys
- config keys
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |