uk.ac.starlink.ttools.plottask
Class PlotTask

java.lang.Object
  extended by uk.ac.starlink.ttools.plottask.PlotTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
TableHistogram, TablePlot2D, TablePlot3D

public abstract class PlotTask
extends Object
implements Task

Abstract superclass for tasks which generate plots from table data.

Since:
22 Apr 2008
Author:
Mark Taylor

Constructor Summary
PlotTask(String purpose, PlotStateFactory stateFactory, TablePlot plot)
          Constructor.
 
Method Summary
 Executable createExecutable(Environment env)
          Creates an executable object which will do the work of this task in the given Environment.
protected  List<Parameter> getParameterList()
           
 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.
 Parameter getXpixParameter()
          Returns the parameter used for setting plot output X dimension.
 Parameter getYpixParameter()
          Returns the parameter used for setting plot output Y dimension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotTask

public PlotTask(String purpose,
                PlotStateFactory stateFactory,
                TablePlot plot)
Constructor.

Parameters:
purpose - short (one-line) task purpose
stateFactory - PlotStateFactory for use with this plot
plot - plot component for use with this plot
Method Detail

getParameterList

protected List<Parameter> getParameterList()

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

getXpixParameter

public Parameter getXpixParameter()
Returns the parameter used for setting plot output X dimension.

Returns:
xpix parameter

getYpixParameter

public Parameter getYpixParameter()
Returns the parameter used for setting plot output Y dimension.

Returns:
ypix parameter

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


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