Class SpectrogramPlotter
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.SpectrogramPlotter
-
- All Implemented Interfaces:
Plotter<SpectrogramPlotter.SpectroStyle>
public class SpectrogramPlotter extends java.lang.Object implements Plotter<SpectrogramPlotter.SpectroStyle>
Plotter for spectrograms. A spectrogram is a spectrum represented as a vertical line of pixels at successive positions in a time series (time axis horizontal, spectral axis vertical).- Since:
- 16 Jul 2013
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSpectrogramPlotter.ChannelGridDefines the spectrum frequency channels.static classSpectrogramPlotter.SpectroStyleStyle subclass for SpectrogramPlotter.
-
Constructor Summary
Constructors Constructor Description SpectrogramPlotter(FloatingCoord xCoord)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlotLayercreateLayer(DataGeom geom, DataSpec dataSpec, SpectrogramPlotter.SpectroStyle style)The suppliedgeomis ignored.SpectrogramPlotter.SpectroStylecreateStyle(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.intgetExtentCoordIndex()Returns the coordinate index for the time extent coordinate.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.java.lang.ObjectgetRangeStyleKey(SpectrogramPlotter.SpectroStyle style)Returns an opaque object characterising the region of the plot surface covered when using a given plotter style.intgetSpectrumCoordIndex()Returns the coordinate index for the spectral coordinate.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.
-
-
-
Constructor Detail
-
SpectrogramPlotter
public SpectrogramPlotter(FloatingCoord xCoord)
Constructor.- Parameters:
xCoord- horizontal axis coordinate
-
-
Method Detail
-
getSpectrumCoordIndex
public int getSpectrumCoordIndex()
Returns the coordinate index for the spectral coordinate.- Returns:
- spectrum coordinate index
-
getExtentCoordIndex
public int getExtentCoordIndex()
Returns the coordinate index for the time extent coordinate.- Returns:
- time extent coordinate index
-
getPlotterName
public java.lang.String getPlotterName()
Description copied from interface:PlotterReturns the name of this plotter for use in user interface.- Specified by:
getPlotterNamein interfacePlotter<SpectrogramPlotter.SpectroStyle>- Returns:
- user-directed plotter name
-
getPlotterIcon
public javax.swing.Icon getPlotterIcon()
Description copied from interface:PlotterReturns an icon for this plotter for use in user interface.- Specified by:
getPlotterIconin interfacePlotter<SpectrogramPlotter.SpectroStyle>- Returns:
- plotter icon
-
getPlotterDescription
public java.lang.String getPlotterDescription()
Description copied from interface:PlotterReturns an XML description of this plotter.Note: really this should appear at the LayerType level.
- Specified by:
getPlotterDescriptionin interfacePlotter<SpectrogramPlotter.SpectroStyle>- Returns:
- one or more <p> elements
-
getCoordGroup
public CoordGroup getCoordGroup()
Description copied from interface:PlotterReturns an object describing which data coordinates are used for this plotter and how they are arranged in supplied DataSpec objects.- Specified by:
getCoordGroupin interfacePlotter<SpectrogramPlotter.SpectroStyle>- Returns:
- coordinate group
-
getStyleKeys
public ConfigKey<?>[] getStyleKeys()
Description copied from interface:PlotterReturns the configuration keys used to configure style for this plotter. The keys in the return value are used in the map supplied to thePlotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap)method.- Specified by:
getStyleKeysin interfacePlotter<SpectrogramPlotter.SpectroStyle>- Returns:
- keys used when creating a style for this plotter.
-
createStyle
public SpectrogramPlotter.SpectroStyle createStyle(ConfigMap config)
Description copied from interface:PlotterCreates a style that can be used when creating a plot layer. The keys that are significant in the supplied config map are those returned byPlotter.getStyleKeys(). The return value can be used as input toPlotter.createLayer(uk.ac.starlink.ttools.plot2.DataGeom, uk.ac.starlink.ttools.plot2.data.DataSpec, S).- Specified by:
createStylein interfacePlotter<SpectrogramPlotter.SpectroStyle>- Parameters:
config- map of style configuration items- Returns:
- plotter-specific plot style
-
getRangeStyleKey
public java.lang.Object getRangeStyleKey(SpectrogramPlotter.SpectroStyle style)
Description copied from interface:PlotterReturns an opaque object characterising the region of the plot surface covered when using a given plotter style. If this object changes between layers produced by this plotter, it provides a hint that it may be necessary to redetermine the axis ranges (usingextendCoordinateRanges).In many cases, such as scatter-plot-like plotters, the range is determined only by the coordinate data (managed by
DataSpecinputs) so a null value may be returned. This method is chiefly required by histogram-like plotters for which the region on the plot surface is not the union of the input positions.- Specified by:
getRangeStyleKeyin interfacePlotter<SpectrogramPlotter.SpectroStyle>- Parameters:
style- plot style to assess- Returns:
- opaque object with equality semantics, or null if axis range is not a function of style
-
hasReports
public boolean hasReports()
Description copied from interface:PlotterIndicates whether the drawings produced by this plotter will return general interest report information to upstream plotting code.- Specified by:
hasReportsin interfacePlotter<SpectrogramPlotter.SpectroStyle>- Returns:
- true if the plot report may return interesting information
- See Also:
Drawing.getReport(java.lang.Object)
-
createLayer
public PlotLayer createLayer(DataGeom geom, DataSpec dataSpec, SpectrogramPlotter.SpectroStyle style)
The suppliedgeomis ignored.- Specified by:
createLayerin interfacePlotter<SpectrogramPlotter.SpectroStyle>- Parameters:
geom- 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
-
-