Class UnplannedDrawing
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.UnplannedDrawing
-
- All Implemented Interfaces:
Drawing
public abstract class UnplannedDrawing extends java.lang.Object implements Drawing
Convenience partial implementation of Drawing where no plan is used. Concrete impleentations have to provide an implementation of the plan-lesspaintData(Paper,DataStore)
method.- Since:
- 15 Feb 2013
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description UnplannedDrawing()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
calculatePlan(java.lang.Object[] knownPlans, DataStore dataStore)
Returns null.ReportMap
getReport(java.lang.Object plan)
Obtains information associated with the plot.void
paintData(java.lang.Object plan, Paper paper, DataStore dataStore)
CallspaintData(Paper,DataStore)
.protected abstract void
paintData(Paper paper, DataStore dataStore)
Performs the drawing.
-
-
-
Method Detail
-
calculatePlan
public java.lang.Object calculatePlan(java.lang.Object[] knownPlans, DataStore dataStore)
Returns null.- Specified by:
calculatePlan
in interfaceDrawing
- Parameters:
knownPlans
- list of zero or more plans that may have been previously calculated by this classdataStore
- data-bearing object- Returns:
- plan to present to the
paintData
method
-
paintData
public void paintData(java.lang.Object plan, Paper paper, DataStore dataStore)
CallspaintData(Paper,DataStore)
.
-
getReport
public ReportMap getReport(java.lang.Object plan)
Description copied from interface:Drawing
Obtains information associated with the plot. Theplan
argument must be the result of an earlier call to this object'sDrawing.calculatePlan(java.lang.Object[], uk.ac.starlink.ttools.plot2.data.DataStore)
method. ThehasReports
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 interfaceDrawing
- Parameters:
plan
- drawing plan, fromcalculatePlan
- 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 bypaintData(Object,Paper,DataStore)
.- Parameters:
paper
- graphics destinationdataStore
- data-bearing object
-
-