jcckit.plot
Class PlotCanvas

java.lang.Object
  extended byjcckit.plot.PlotCanvas
All Implemented Interfaces:
PlotListener
Direct Known Subclasses:
GraphicsPlotCanvas

public class PlotCanvas
extends java.lang.Object
implements PlotListener

An abstract canvas containg a single Plot. The canvas is specified by a ClippingRectangle, called paper. A horizontal and vertical Anchor determine the position of the paper on the actual device.

Author:
Franz-Josef Elmer

Field Summary
static java.lang.String HORIZONTAL_ANCHOR_KEY
          Configuration parameter key.
static java.lang.String PAPER_KEY
          Configuration parameter key.
static java.lang.String PLOT_KEY
          Configuration parameter key.
static java.lang.String VERTICAL_ANCHOR_KEY
          Configuration parameter key.
 
Constructor Summary
PlotCanvas(ConfigParameters config)
          Creates an instance from the specified configuration parameters.
 
Method Summary
 void connect(DataPlot dataPlot)
          Connects the wrapped Plot instance with the specified DataPlot.
 Anchor getHorizontalAnchor()
          Returns the horizontal anchor.
 ClippingRectangle getPaper()
          Returns the paper definition.
 Plot getPlot()
          Returns the plot.
 Anchor getVerticalAnchor()
          Returns the vertical anchor.
 void plotChanged(PlotEvent event)
          Handles the spcified event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAPER_KEY

public static final java.lang.String PAPER_KEY
Configuration parameter key.

See Also:
Constant Field Values

HORIZONTAL_ANCHOR_KEY

public static final java.lang.String HORIZONTAL_ANCHOR_KEY
Configuration parameter key.

See Also:
Constant Field Values

VERTICAL_ANCHOR_KEY

public static final java.lang.String VERTICAL_ANCHOR_KEY
Configuration parameter key.

See Also:
Constant Field Values

PLOT_KEY

public static final java.lang.String PLOT_KEY
Configuration parameter key.

See Also:
Constant Field Values
Constructor Detail

PlotCanvas

public PlotCanvas(ConfigParameters config)
Creates an instance from the specified configuration parameters.
Key & Default ValueTypeMandatory Description
horizontalAnchor = center Stringno Horizontal position of the paper relative to the device border. Possible values are left, center, and right.
paper = 0, 0, 1, 0.6 double[]no Rectangle defining the paper. The first two values determine the x- and y- coordinates (in device-independent units) of the lower-left corner. The last two values determine the upper-right corner.
plot = default values of Plot ConfigParametersno Definition of the Plot.
verticalAnchor = center Stringno Vertical position of the paper relative to the device border. Possible values are top, center, and bottom.

Note, that this instance registers itself at the wrapped Plot instance.

Method Detail

getPaper

public ClippingRectangle getPaper()
Returns the paper definition.


getHorizontalAnchor

public Anchor getHorizontalAnchor()
Returns the horizontal anchor.


getVerticalAnchor

public Anchor getVerticalAnchor()
Returns the vertical anchor.


getPlot

public Plot getPlot()
Returns the plot.


connect

public void connect(DataPlot dataPlot)
Connects the wrapped Plot instance with the specified DataPlot.

Parameters:
dataPlot - Data to be connected with this plot canvas. Can be null in order to disconnect this instance from a DataPlot.

plotChanged

public void plotChanged(PlotEvent event)
Handles the spcified event. Here nothing is done. But subclass may override this method.

Specified by:
plotChanged in interface PlotListener