public class GraphicsPlotCanvas extends PlotCanvas
jcckit.renderer.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.
| Modifier and Type | Field and Description |
|---|---|
static String |
BACKGROUND_KEY
Key of a configuration parameter.
|
static String |
DOUBLE_BUFFERING_KEY |
static String |
FOREGROUND_KEY |
HORIZONTAL_ANCHOR_KEY, PAPER_KEY, PLOT_KEY, VERTICAL_ANCHOR_KEY| Constructor and Description |
|---|
GraphicsPlotCanvas(ConfigParameters config,
BufferedImage img3)
Creates an instance from the specified configuration parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateTransformation(Dimension size)
Calculate the transformation form device-independent coordinates into
device-dependent coordinates according to the specified canvas size.
|
protected Renderer |
createRenderer()
Creates an appropriated
Renderer for the specified
Graphics context. |
void |
paint()
Paints the plot.
|
protected void |
prepare()
Prepare graphics context before drawing the pre-rendered view of the
coordinate system.
|
void |
setMarker(GraphicalElement marker)
Defines a graphical marker which will be drawn on top of the plot.
|
void |
setRenderer(String className)
Sets the renderer used to render the plot.
|
connect, getHorizontalAnchor, getPaper, getPlot, getVerticalAnchor, plotChangedpublic static final String BACKGROUND_KEY
public static final String FOREGROUND_KEY
public static final String DOUBLE_BUFFERING_KEY
public GraphicsPlotCanvas(ConfigParameters config, BufferedImage img3)
| 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.public void paint()
GraphicsPlotCanvas#_doubleBuffering is set
double-buffering and pre-rendered view of the coordinate system is used.protected void prepare()
protected void calculateTransformation(Dimension size)
protected Renderer createRenderer()
Renderer for the specified
Graphics context.public void setRenderer(String className)
GraphicsRenderer.className - Fully qualified name of the renderer class.public void setMarker(GraphicalElement marker)
marker - Marker element. Can be null.Copyright © 2016. All Rights Reserved.