uk.ac.starlink.ttools.plot2.task
Class Plot2Task

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.task.Plot2Task
All Implemented Interfaces:
Task

public class Plot2Task
extends Object
implements Task

STILTS Task for generic layer plots.

Since:
1 Mar 2013
Author:
Mark Taylor

Constructor Summary
Plot2Task()
          Constructor.
 
Method Summary
 Executable createExecutable(Environment env)
          Creates an executable object which will do the work of this task in the given Environment.
 JComponent 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
<P,A> Icon
createPlotIcon(PlotLayer[] layers, SurfaceFactory<P,A> surfFact, ConfigMap config, Icon legend, float[] legPos, ShadeAxis shadeAxis, 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.
 Parameter[] getParameters()
          Returns the list of parameters which may be used by this task.
 String getPurpose()
          Returns a short (one-line) description of the purpose of this task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plot2Task

public Plot2Task()
Constructor.

Method Detail

getPurpose

public String getPurpose()
Description copied from interface: Task
Returns a short (one-line) description of the purpose of this task.

Specified by:
getPurpose in interface Task
Returns:
plain text description of this task's purpose

getParameters

public Parameter[] getParameters()
Description copied from interface: Task
Returns the list of parameters which may be used by this task.

Specified by:
getParameters in interface Task
Returns:
an array of the Parameter objects this task may request values for during its invocation

createExecutable

public Executable createExecutable(Environment env)
                            throws TaskException
Description copied from interface: Task
Creates an executable object which will do the work of this task in the given Environment. This method should do all of the parameter processing and prepare an object which just executes. The idea is that any communication with the user related to the supplied parameter values can be done before the task starts to execute in earnest. Consequently, the returned Executable object ought not to make any reference to env, though this is not absolutely prohibited.

Specified by:
createExecutable in interface Task
Parameters:
env - the environment in which the task will operate
Throws:
TaskException - if no executable can be created; this should usually be a UsageException or some subclass

createPlotIcon

public Icon createPlotIcon(Environment env)
                    throws TaskException,
                           IOException,
                           InterruptedException
Returns an Icon that paints the plot described by a value-bearing execution environment. This utility method is not used for executing this class.

Parameters:
env - execution environment
Returns:
plot icon
Throws:
TaskException
IOException
InterruptedException

createPlotComponent

public JComponent createPlotComponent(Environment env,
                                      boolean caching)
                               throws TaskException,
                                      IOException,
                                      InterruptedException
Returns a graphical component that displays an interactive view of the plot described by a value-bearing execution environment. This utility method is not used for executing the task defined by this class.

Parameters:
env - execution environment
caching - whether data and plot should be cached or re-read at every repaint
Returns:
active plot view component
Throws:
TaskException
IOException
InterruptedException

createPlotIcon

public static <P,A> Icon createPlotIcon(PlotLayer[] layers,
                                        SurfaceFactory<P,A> surfFact,
                                        ConfigMap config,
                                        Icon legend,
                                        float[] legPos,
                                        ShadeAxis shadeAxis,
                                        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. This icon is expected to be painted once and then discarded, so it's not cached.

Parameters:
layers - layers constituting plot content
surfFact - surface factory
config - map containing surface profile and initial aspect configuration
legend - legend icon, or null if none required
legPos - 2-element array giving x,y fractional legend placement position within plot (elements in range 0..1), or null for external legend
shadeAxis - shader axis, or null if not required
shadeFixRange - fixed shader range, or null for auto-range where required
ptsel - paper type selector
compositor - compositor for pixel composition
dataStore - data storage object
xpix - horizontal size of icon in pixels
ypix - vertical size of icon in pixels
insets - may supply the inset space to be used for axis decoration etc; if null, this will be worked out automatically
forceBitmap - true to force bitmap output of vector graphics, false to use default behaviour
Returns:
icon icon for plotting


Copyright © 2014 Central Laboratory of the Research Councils. All Rights Reserved.