jcckit
Class Graphics2DPlotCanvas

java.lang.Object
  extended byjcckit.plot.PlotCanvas
      extended byjcckit.GraphicsPlotCanvas
          extended byjcckit.GraphicsPlotCanvas2
              extended byjcckit.Graphics2DPlotCanvas
All Implemented Interfaces:
PlotListener

public class Graphics2DPlotCanvas
extends GraphicsPlotCanvas2

A subclass of GraphicsPlotCanvas for the Graphics2DRenderer.

Author:
Franz-Josef Elmer

Nested Class Summary
protected  class Graphics2DPlotCanvas.Graphics2DCanvas
           
protected  class Graphics2DPlotCanvas.Graphics2DJPanel
           
protected  class Graphics2DPlotCanvas.Graphics2DPainter
          Painter which draw the plot into a Graphics2D instance.
 
Nested classes inherited from class jcckit.GraphicsPlotCanvas2
GraphicsPlotCanvas2.GraphicsJPanel
 
Nested classes inherited from class jcckit.GraphicsPlotCanvas
GraphicsPlotCanvas.GraphicsCanvas, GraphicsPlotCanvas.GraphicsPainter
 
Field Summary
protected  java.lang.String _renderer
           
static java.lang.String ANTI_ALIASINGD_KEY
          Key of a configuration parameter.
 
Fields inherited from class jcckit.GraphicsPlotCanvas2
_jPanel
 
Fields inherited from class jcckit.GraphicsPlotCanvas
_canvas, BACKGROUND_KEY, DOUBLE_BUFFERING_KEY, FOREGROUND_KEY
 
Fields inherited from class jcckit.plot.PlotCanvas
HORIZONTAL_ANCHOR_KEY, PAPER_KEY, PLOT_KEY, VERTICAL_ANCHOR_KEY
 
Constructor Summary
Graphics2DPlotCanvas(ConfigParameters config)
          Creates an instance from the specified configuration parameters.
 
Method Summary
protected  void createGraphicsCanvas()
          Creates an instance of Graphics2DPlotCanvas.Graphics2DCanvas which wraps the rendered plot.
protected  void createGraphicsJPanel()
          Creates an instance of Graphics2DPlotCanvas.Graphics2DJPanel which wraps the rendered plot.
 void draw2DInto(java.awt.Image image)
          Draws the plot into the specified image by using Java2D API.
static void main(java.lang.String[] args)
          Shows a plot in a Frame.
 GraphPoint mapCursorPosition(int x, int y)
          Maps the cursor position onto a point in device-independent coordinates.
 
Methods inherited from class jcckit.GraphicsPlotCanvas2
getGraphicsJPanel, plotChanged
 
Methods inherited from class jcckit.GraphicsPlotCanvas
drawInto, getGraphicsCanvas, run, setDoubleBuffering, setMarker, setRenderer
 
Methods inherited from class jcckit.plot.PlotCanvas
connect, getHorizontalAnchor, getPaper, getPlot, getVerticalAnchor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANTI_ALIASINGD_KEY

public static final java.lang.String ANTI_ALIASINGD_KEY
Key of a configuration parameter.

See Also:
Constant Field Values

_renderer

protected java.lang.String _renderer
Constructor Detail

Graphics2DPlotCanvas

public Graphics2DPlotCanvas(ConfigParameters config)
Creates an instance from the specified configuration parameters.
Key & Default ValueTypeMandatory Description
antiAliasing = true booleanno If true everything will be rendererd anti-aliasing.
In addition the configuration parameters of the s constructor of the superclass GraphicsPlotCanvas apply.

Method Detail

createGraphicsCanvas

protected void createGraphicsCanvas()
Creates an instance of Graphics2DPlotCanvas.Graphics2DCanvas which wraps the rendered plot.

Overrides:
createGraphicsCanvas in class GraphicsPlotCanvas

createGraphicsJPanel

protected void createGraphicsJPanel()
Creates an instance of Graphics2DPlotCanvas.Graphics2DJPanel which wraps the rendered plot.

Overrides:
createGraphicsJPanel in class GraphicsPlotCanvas2

draw2DInto

public void draw2DInto(java.awt.Image image)
Draws the plot into the specified image by using Java2D API. Can be used for off-screen renderering if double-buffering is switched off. Otherwise NullPointerException will be thrown.


mapCursorPosition

public GraphPoint mapCursorPosition(int x,
                                    int y)
Maps the cursor position onto a point in device-independent coordinates.

Overrides:
mapCursorPosition in class GraphicsPlotCanvas
Parameters:
x - X-coordinate of the cursor.
y - Y-coordinate of the cursor.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Shows a plot in a Frame. The plot (data and layout) is defined in the .properties file specified by the first command line argument.

Usage: java jcckit.Graphics2DPlotCanvas [-r <renderer class>] <properties file>

Throws:
java.lang.Exception