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

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.PixogramPlotter
All Implemented Interfaces:
Plotter<PixogramPlotter.PixoStyle>

public class PixogramPlotter
extends Object
implements Plotter<PixogramPlotter.PixoStyle>

Plotter that works like a histogram with pixel-sized bins. Only works with PlaneSurfaces.

Since:
17 Feb 2015
Author:
Mark Taylor

Nested Class Summary
static class PixogramPlotter.PixoStyle
          Style subclass for pixogram plots.
 
Field Summary
static ReportKey<double[]> BINS_KEY
          Report key for plotted bin height in data coordinates.
static ConfigKey<Boolean> FILL_KEY
          Config key for line/fill toggle.
static ConfigKey<Integer> SMOOTH_KEY
          Config key for smoothing width.
 
Constructor Summary
PixogramPlotter(FloatingCoord xCoord, boolean hasWeight)
          Constructor.
 
Method Summary
 PlotLayer createLayer(DataGeom geom, DataSpec dataSpec, PixogramPlotter.PixoStyle style)
          The supplied geom is ignored.
 PixogramPlotter.PixoStyle createStyle(ConfigMap config)
          Creates a style that can be used when creating a plot layer.
 CoordGroup getCoordGroup()
          Returns an object describing which data coordinates are used for this plotter and how they are arranged in supplied DataSpec objects.
 String getPlotterDescription()
          Returns an XML description of this plotter.
 Icon getPlotterIcon()
          Returns an icon for this plotter for use in user interface.
 String getPlotterName()
          Returns the name of this plotter for use in user interface.
 ConfigKey[] getStyleKeys()
          Returns the configuration keys used to configure style for this plotter.
 int getWeightCoordIndex()
          Returns the DataSpec coord index used for the weighting data for this plotter.
 boolean hasReports()
          Indicates whether the drawings produced by this plotter will return general interest report information to upstream plotting code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINS_KEY

public static final ReportKey<double[]> BINS_KEY
Report key for plotted bin height in data coordinates.


FILL_KEY

public static final ConfigKey<Boolean> FILL_KEY
Config key for line/fill toggle.


SMOOTH_KEY

public static final ConfigKey<Integer> SMOOTH_KEY
Config key for smoothing width.

Constructor Detail

PixogramPlotter

public PixogramPlotter(FloatingCoord xCoord,
                       boolean hasWeight)
Constructor.

Parameters:
xCoord - X axis coordinate
hasWeight - true to permit histogram weighting
Method Detail

getPlotterName

public String getPlotterName()
Description copied from interface: Plotter
Returns the name of this plotter for use in user interface.

Specified by:
getPlotterName in interface Plotter<PixogramPlotter.PixoStyle>
Returns:
user-directed plotter name

getPlotterIcon

public Icon getPlotterIcon()
Description copied from interface: Plotter
Returns an icon for this plotter for use in user interface.

Specified by:
getPlotterIcon in interface Plotter<PixogramPlotter.PixoStyle>
Returns:
plotter icon

getPlotterDescription

public String getPlotterDescription()
Description copied from interface: Plotter
Returns an XML description of this plotter.

Note: really this should appear at the LayerType level.

Specified by:
getPlotterDescription in interface Plotter<PixogramPlotter.PixoStyle>
Returns:
one or more <p> elements

getCoordGroup

public CoordGroup getCoordGroup()
Description copied from interface: Plotter
Returns an object describing which data coordinates are used for this plotter and how they are arranged in supplied DataSpec objects.

Specified by:
getCoordGroup in interface Plotter<PixogramPlotter.PixoStyle>
Returns:
coordinate group

getStyleKeys

public ConfigKey[] getStyleKeys()
Description copied from interface: Plotter
Returns the configuration keys used to configure style for this plotter. The keys in the return value are used in the map supplied to the Plotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap) method.

Specified by:
getStyleKeys in interface Plotter<PixogramPlotter.PixoStyle>
Returns:
keys used when creating a style for this plotter.

createStyle

public PixogramPlotter.PixoStyle createStyle(ConfigMap config)
Description copied from interface: Plotter
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 by Plotter.getStyleKeys(). The return value can be used as input to Plotter.createLayer(uk.ac.starlink.ttools.plot2.DataGeom, uk.ac.starlink.ttools.plot2.data.DataSpec, S).

Specified by:
createStyle in interface Plotter<PixogramPlotter.PixoStyle>
Parameters:
config - map of style configuration items
Returns:
plotter-specific plot style

hasReports

public boolean hasReports()
Description copied from interface: Plotter
Indicates whether the drawings produced by this plotter will return general interest report information to upstream plotting code.

Specified by:
hasReports in interface Plotter<PixogramPlotter.PixoStyle>
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,
                             PixogramPlotter.PixoStyle style)
The supplied geom is ignored.

Specified by:
createLayer in interface Plotter<PixogramPlotter.PixoStyle>
Parameters:
geom - indicates base position coordinates and their mapping to points in the data space; if non-null, the data geom's DataGeom.hasPosition() method will return true
dataSpec - specifies the data required for the plot
style - data style as obtained from createStyle
Returns:
new plot layer, or null if no drawing will take place

getWeightCoordIndex

public int getWeightCoordIndex()
Returns the DataSpec coord index used for the weighting data for this plotter. If weighting is not supported, a negative value is returned.

Returns:
weight coord index, or -1


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