uk.ac.starlink.ttools.plot2.layer
Class SimpleDecalPlotter<S extends Style>

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.AbstractPlotter<S>
      extended by uk.ac.starlink.ttools.plot2.layer.SimpleDecalPlotter<S>
All Implemented Interfaces:
Plotter<S>
Direct Known Subclasses:
LinePlotter

public abstract class SimpleDecalPlotter<S extends Style>
extends AbstractPlotter<S>

Abstract Plotter implementation that does all its painting using a Decal, no Glyphs.

Since:
15 Feb 2013
Author:
Mark Taylor

Constructor Summary
protected SimpleDecalPlotter(String name, Icon icon, CoordGroup cgrp, boolean hasReports)
          Constructor.
 
Method Summary
 PlotLayer createLayer(DataGeom geom, DataSpec dataSpec, S style)
          Creates a PlotLayer based on the given geometry, data and style.
protected abstract  LayerOpt getLayerOpt(S style)
          Indicates the layer optimisation options that apply to a given style.
protected abstract  void paintData2D(Surface surface, DataStore dataStore, DataGeom geom, DataSpec dataSpec, S style, Graphics g, PaperType paperType)
          Called during Decal painting to perform the actual plot.
 
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
 

Constructor Detail

SimpleDecalPlotter

protected SimpleDecalPlotter(String name,
                             Icon icon,
                             CoordGroup cgrp,
                             boolean hasReports)
Constructor.

Parameters:
name - plotter name
icon - plotter icon
cgrp - coordinate group
hasReports - whether plot reports are generated
Method Detail

createLayer

public PlotLayer createLayer(DataGeom geom,
                             DataSpec dataSpec,
                             S 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 to Plotter.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 getCoordGroup(). getPositionCount returns 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 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

getLayerOpt

protected abstract LayerOpt getLayerOpt(S style)
Indicates the layer optimisation options that apply to a given style.

Parameters:
style - plot style
Returns:
layer options

paintData2D

protected abstract void paintData2D(Surface surface,
                                    DataStore dataStore,
                                    DataGeom geom,
                                    DataSpec dataSpec,
                                    S style,
                                    Graphics g,
                                    PaperType paperType)
Called during Decal painting to perform the actual plot.

Parameters:
surface - plot surface
dataStore - data storage object
geom - data geometry
style - plot style
g - graphics context
paperType - paper type


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