Interface Plotter<S extends Style>
-
- All Known Subinterfaces:
ModePlotter<S>
- All Known Implementing Classes:
AbstractKernelDensityPlotter,AbstractPlotter,ContourPlotter,DensogramPlotter,FillPlotter,FixedKernelDensityPlotter,FunctionPlotter,GridPlotter,HealpixPlotter,HistogramPlotter,KnnKernelDensityPlotter,LabelPlotter,Line3dPlotter,LinearFitPlotter,LinePlotter,Pixel1dPlotter,ShapePlotter,ShapePlotter.ShapeModePlotter,SimpleDecalPlotter,SkyDensityPlotter,SkyGridPlotter,SpectrogramPlotter,SphereGridPlotter,SpotPlotter,Stats1Plotter,TracePlotter
public interface Plotter<S extends Style>A Plotter can produce PlotLayers given data and appropriate configuration. It can also report what data coordinates and style configuration information are needed for the plot. This self-describing nature means that a plotting framework can largely build a user interface automatically from a Plotter instance.A Plotter also acts as part of an identifier for the type of plot being performed, which is necessary for determining PlotLayer equality; two PlotLayers are equivalent if they match in point of DataSpec, Style and Plotter.
- Since:
- 11 Feb 2013
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PlotLayercreateLayer(DataGeom pointDataGeom, DataSpec dataSpec, S style)Creates a PlotLayer based on the given geometry, data and style.ScreateStyle(ConfigMap config)Creates a style that can be used when creating a plot layer.CoordGroupgetCoordGroup()Returns an object describing which data coordinates are used for this plotter and how they are arranged in supplied DataSpec objects.java.lang.StringgetPlotterDescription()Returns an XML description of this plotter.javax.swing.IcongetPlotterIcon()Returns an icon for this plotter for use in user interface.java.lang.StringgetPlotterName()Returns the name of this plotter for use in user interface.ConfigKey<?>[]getStyleKeys()Returns the configuration keys used to configure style for this plotter.booleanhasReports()Indicates whether the drawings produced by this plotter will return general interest report information to upstream plotting code.
-
-
-
Method Detail
-
getPlotterName
java.lang.String getPlotterName()
Returns the name of this plotter for use in user interface.- Returns:
- user-directed plotter name
-
getPlotterIcon
javax.swing.Icon getPlotterIcon()
Returns an icon for this plotter for use in user interface.- Returns:
- plotter icon
-
getPlotterDescription
java.lang.String getPlotterDescription()
Returns an XML description of this plotter.Note: really this should appear at the LayerType level.
- Returns:
- one or more <p> elements
-
getCoordGroup
CoordGroup getCoordGroup()
Returns an object describing which data coordinates are used for this plotter and how they are arranged in supplied DataSpec objects.- Returns:
- coordinate group
-
getStyleKeys
ConfigKey<?>[] getStyleKeys()
Returns the configuration keys used to configure style for this plotter. The keys in the return value are used in the map supplied to thecreateStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap)method.- Returns:
- keys used when creating a style for this plotter.
-
createStyle
S createStyle(ConfigMap config) throws ConfigException
Creates a style that can be used when creating a plot layer. The keys that are significant in the supplied config map are those returned bygetStyleKeys(). The return value can be used as input tocreateLayer(uk.ac.starlink.ttools.plot2.DataGeom, uk.ac.starlink.ttools.plot2.data.DataSpec, S).- Parameters:
config- map of style configuration items- Returns:
- plotter-specific plot style
- Throws:
ConfigException
-
hasReports
boolean hasReports()
Indicates whether the drawings produced by this plotter will return general interest report information to upstream plotting code.- Returns:
- true if the plot report may return interesting information
- See Also:
Drawing.getReport(java.lang.Object)
-
createLayer
PlotLayer createLayer(DataGeom pointDataGeom, DataSpec dataSpec, S style)
Creates a PlotLayer based on the given geometry, data and style.The
styleparameter is the result of a call tocreateStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap).The
dataSpecparameter must contain the coordinates defined by this plotter's CoordGroup.The
pointDataGeomparameter is only used ifgetCoordGroup().getPositionCountreturns a non-zero value, otherwise the plot does not have point positions.It is legal to supply null for any of the parameters; if insufficient data is supplied to generate a plot, then the method should return null.
Creating a layer should be cheap; layers may be created and not used.
- Parameters:
pointDataGeom- indicates base position coordinates and their mapping to points in the data space; if non-null, the data geom'sDataGeom.hasPosition()method will return truedataSpec- specifies the data required for the plotstyle- data style as obtained fromcreateStyle- Returns:
- new plot layer, or null if no drawing will take place
-
-