Class CombineArrayPlotter<S extends CombineArrayPlotter.CombineArrayStyle>
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.AbstractPlotter<S>
-
- uk.ac.starlink.ttools.plot2.layer.CombineArrayPlotter<S>
-
- All Implemented Interfaces:
Plotter<S>
- Direct Known Subclasses:
LineCombineArrayPlotter
,MarkCombineArrayPlotter
public abstract class CombineArrayPlotter<S extends CombineArrayPlotter.CombineArrayStyle> extends AbstractPlotter<S>
Partial Plotter implementation for plot types that combine multiple all the array-valued X and Y coordinates in a data set, and make some plot from the resulting combination. Combination is typically a mean, but can be something else.This plotter is written to cope with blank values for one or other of the X/Y coordinates; if one is blank, it taken to indicate a sequence of values 0, 1, 2, ..., which is probably reasonable for a plot. At present, it will never be fed null values, since FloatingArrayCoord.X/Y are marked required, but if the input coordinates are changed to be optional at some point, it ought to work with that.
- Since:
- 25 Jan 2022
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CombineArrayPlotter.CombineArrayStyle
Partial Style implementation for use with this class.
-
Field Summary
Fields Modifier and Type Field Description static ConfigKey<Combiner>
XCOMBINER_KEY
Configuration key for X coordinate combination mode.static ReportKey<double[]>
XS_REPKEY
Report key for combined X array values.static ConfigKey<Combiner>
YCOMBINER_KEY
Configuration key for Y coordinate combination mode.static ReportKey<double[]>
YS_REPKEY
Report key for combined Y array values.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CombineArrayPlotter(java.lang.String name, javax.swing.Icon icon)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlotLayer
createLayer(DataGeom geom, DataSpec dataSpec, CombineArrayPlotter.CombineArrayStyle style)
Creates a PlotLayer based on the given geometry, data and style.java.lang.Object
getRangeStyleKey(S style)
The AbstractPlotter implementation returns null.-
Methods inherited from class uk.ac.starlink.ttools.plot2.layer.AbstractPlotter
getCoordGroup, getPlotterIcon, getPlotterName, hasReports
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.ac.starlink.ttools.plot2.Plotter
createStyle, getPlotterDescription, getStyleKeys
-
-
-
-
Field Detail
-
XCOMBINER_KEY
public static final ConfigKey<Combiner> XCOMBINER_KEY
Configuration key for X coordinate combination mode.
-
YCOMBINER_KEY
public static final ConfigKey<Combiner> YCOMBINER_KEY
Configuration key for Y coordinate combination mode.
-
XS_REPKEY
public static final ReportKey<double[]> XS_REPKEY
Report key for combined X array values.
-
YS_REPKEY
public static final ReportKey<double[]> YS_REPKEY
Report key for combined Y array values.
-
-
Method Detail
-
createLayer
public PlotLayer createLayer(DataGeom geom, DataSpec dataSpec, CombineArrayPlotter.CombineArrayStyle style)
Description copied from interface:Plotter
Creates a PlotLayer based on the given geometry, data and style.The
style
parameter is the result of a call toPlotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap)
.The
dataSpec
parameter must contain the coordinates defined by this plotter's CoordGroup.The
pointDataGeom
parameter is only used if theCoordGroup.getBasicPositionCount()
orCoordGroup.getExtraPositionCount()
method from this plotter's CoordGroup return 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:
geom
- indicates base position coordinates and their mapping to points in the data spacedataSpec
- specifies the data required for the plotstyle
- data style as obtained fromcreateStyle
- Returns:
- new plot layer, or null if no drawing will take place
-
getRangeStyleKey
public java.lang.Object getRangeStyleKey(S style)
Description copied from class:AbstractPlotter
The AbstractPlotter implementation returns null.- Specified by:
getRangeStyleKey
in interfacePlotter<S extends CombineArrayPlotter.CombineArrayStyle>
- Overrides:
getRangeStyleKey
in classAbstractPlotter<S extends CombineArrayPlotter.CombineArrayStyle>
- Parameters:
style
- plot style to assess- Returns:
- opaque object with equality semantics, or null if axis range is not a function of style
-
-