uk.ac.starlink.ttools.plot2.layer
Class UnplannedDrawing

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.UnplannedDrawing
All Implemented Interfaces:
Drawing

public abstract class UnplannedDrawing
extends Object
implements Drawing

Convenience partial implementation of Drawing where no plan is used. Concrete impleentations have to provide an implementation of the plan-less paintData(Paper,DataStore) method.

Since:
15 Feb 2013
Author:
Mark Taylor

Constructor Summary
UnplannedDrawing()
           
 
Method Summary
 Object calculatePlan(Object[] knownPlans, DataStore dataStore)
          Returns null.
 ReportMap getReport(Object plan)
          Obtains information associated with the plot.
 void paintData(Object plan, Paper paper, DataStore dataStore)
          Calls paintData(Paper,DataStore).
protected abstract  void paintData(Paper paper, DataStore dataStore)
          Performs the drawing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnplannedDrawing

public UnplannedDrawing()
Method Detail

calculatePlan

public Object calculatePlan(Object[] knownPlans,
                            DataStore dataStore)
Returns null.

Specified by:
calculatePlan in interface Drawing
Parameters:
knownPlans - list of zero or more plans that may have been previously calculated by this class
dataStore - data-bearing object
Returns:
plan to present to the paintData method

paintData

public void paintData(Object plan,
                      Paper paper,
                      DataStore dataStore)
Calls paintData(Paper,DataStore).

Specified by:
paintData in interface Drawing
Parameters:
plan - drawing plan, from calculatePlan
paper - graphics destination
dataStore - data-bearing object

getReport

public ReportMap getReport(Object plan)
Description copied from interface: Drawing
Obtains information associated with the plot. The plan argument must be the result of an earlier call to this object's Drawing.calculatePlan(java.lang.Object[], uk.ac.starlink.ttools.plot2.data.DataStore) method. The hasReports method of the corresponding Plotter indicates whether the return value may contain general-interest reports; special-purpose reports may be returned in any case.

If there is nothing interesting to report, which will often be the case, the return value may be null, which is shorthand for an empty map.

This ought not to be an expensive operation.

Specified by:
getReport in interface Drawing
Parameters:
plan - drawing plan, from calculatePlan
Returns:
information generated by the plot, or null
See Also:
Plotter.hasReports()

paintData

protected abstract void paintData(Paper paper,
                                  DataStore dataStore)
Performs the drawing. Invoked by paintData(Object,Paper,DataStore).

Parameters:
paper - graphics destination
dataStore - data-bearing object


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