|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcckit.plot.PlotCanvas jcckit.GraphicsPlotCanvas
Class which handles plotting into a Graphics context based on
the GraphicsRenderer
.
This class is not a subclass of java.awt.Component.
The actual AWT component presenting the plot is an innerclass. Its
instance wrapped by GraphicsPlotCanvas can be obtained with
getGraphicsCanvas()
.
The plot is painted by using double-buffering and pre-rendered view of the coordinate system. That is, the coordinate system is drawn into an off-screen image. It will be redrawn only if the size of the embedding AWT component is changed.
Nested Class Summary | |
protected class |
GraphicsPlotCanvas.GraphicsCanvas
AWT component which actually shows the rendered plot. |
protected class |
GraphicsPlotCanvas.GraphicsPainter
Class which does the actual painting. |
Field Summary | |
protected GraphicsPlotCanvas.GraphicsCanvas |
_canvas
Wrapped AWT component. |
static java.lang.String |
BACKGROUND_KEY
Key of a configuration parameter. |
static java.lang.String |
DOUBLE_BUFFERING_KEY
Key of a configuration parameter. |
static java.lang.String |
FOREGROUND_KEY
Key of a configuration parameter. |
Fields inherited from class jcckit.plot.PlotCanvas |
HORIZONTAL_ANCHOR_KEY, PAPER_KEY, PLOT_KEY, VERTICAL_ANCHOR_KEY |
Constructor Summary | |
GraphicsPlotCanvas(ConfigParameters config)
Creates an instance from the specified configuration parameters. |
Method Summary | |
protected void |
createGraphicsCanvas()
Creates an instance of GraphicsPlotCanvas.GraphicsCanvas
which wraps the rendered plot. |
void |
drawInto(java.awt.Image image)
Draws the plot into the specified image. |
java.awt.Canvas |
getGraphicsCanvas()
Returns an AWT component which wraps the rendered plot. |
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. |
void |
plotChanged(PlotEvent event)
Repaints the wrapping GUI component. |
protected static void |
run(java.lang.String[] args,
java.lang.String plotCanvas)
|
void |
setDoubleBuffering(boolean doubleBuffering)
Sets the flag for double buffering. |
void |
setMarker(GraphicalElement marker)
Defines a graphical marker which will be drawn on top of the plot. |
void |
setRenderer(java.lang.String className)
Sets the renderer used to render the plot. |
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 |
public static final java.lang.String BACKGROUND_KEY
public static final java.lang.String FOREGROUND_KEY
public static final java.lang.String DOUBLE_BUFFERING_KEY
protected GraphicsPlotCanvas.GraphicsCanvas _canvas
Constructor Detail |
public GraphicsPlotCanvas(ConfigParameters config)
Key & Default Value | Type | Mandatory | Description |
---|---|---|---|
background = default background color of the wrapped AWT component | Color | no | Background color of the wrapped AWT component. |
foreground = default foreground color of the wrapped AWT component | Color | no | Foreground color of the wrapped AWT component. |
doubleBuffering = true | boolean | no | If true the plot will be painted by using double-buffering and pre-rendered view of the coordinate system. |
PlotCanvas
apply.
Method Detail |
public void setRenderer(java.lang.String className)
GraphicsRenderer
.
className
- Fully qualified name of the renderer class.public void setDoubleBuffering(boolean doubleBuffering)
public void drawInto(java.awt.Image image)
protected void createGraphicsCanvas()
GraphicsPlotCanvas.GraphicsCanvas
which wraps the rendered plot.
public void plotChanged(PlotEvent event)
plotChanged
in interface PlotListener
plotChanged
in class PlotCanvas
public java.awt.Canvas getGraphicsCanvas()
public GraphPoint mapCursorPosition(int x, int y)
x
- X-coordinate of the cursor.y
- Y-coordinate of the cursor.public void setMarker(GraphicalElement marker)
marker
- Marker element. Can be null.public static void main(java.lang.String[] args) throws java.lang.Exception
Usage: java jcckit.GraphicsPlotCanvas [-r <renderer class>] <properties file>
java.lang.Exception
protected static void run(java.lang.String[] args, java.lang.String plotCanvas) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |