Package jcckit
Class GraphicsPlotCanvas
java.lang.Object
jcckit.plot.PlotCanvas
jcckit.GraphicsPlotCanvas
- All Implemented Interfaces:
PlotListener
Class which handles plotting into a Graphics context based on the
{link 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 {link #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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey of a configuration parameter.static final Stringstatic final StringFields inherited from class jcckit.plot.PlotCanvas
HORIZONTAL_ANCHOR_KEY, PAPER_KEY, PLOT_KEY, VERTICAL_ANCHOR_KEY -
Constructor Summary
ConstructorsConstructorDescriptionGraphicsPlotCanvas(ConfigParameters config, BufferedImage img3) Creates an instance from the specified configuration parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalculate the transformation form device-independent coordinates into device-dependent coordinates according to the specified canvas size.protected RendererCreates an appropriatedRendererfor the specified Graphics context.voidpaint()Paints the plot.protected voidprepare()Prepare graphics context before drawing the pre-rendered view of the coordinate system.voidsetMarker(GraphicalElement marker) Defines a graphical marker which will be drawn on top of the plot.voidsetRenderer(String className) Sets the renderer used to render the plot.Methods inherited from class jcckit.plot.PlotCanvas
connect, getHorizontalAnchor, getPaper, getPlot, getVerticalAnchor, plotChanged
-
Field Details
-
BACKGROUND_KEY
Key of a configuration parameter.- See Also:
-
FOREGROUND_KEY
- See Also:
-
DOUBLE_BUFFERING_KEY
- See Also:
-
-
Constructor Details
-
GraphicsPlotCanvas
Creates an instance from the specified configuration parameters.
In addition the configuration parameters of the constructor of the superclassKey & 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. PlotCanvasapply.
-
-
Method Details
-
paint
public void paint()Paints the plot. If {link GraphicsPlotCanvas#_doubleBuffering} is set double-buffering and pre-rendered view of the coordinate system is used. -
prepare
protected void prepare()Prepare graphics context before drawing the pre-rendered view of the coordinate system. Does nothing but will be used in subclasses. -
calculateTransformation
Calculate the transformation form device-independent coordinates into device-dependent coordinates according to the specified canvas size. -
createRenderer
Creates an appropriatedRendererfor the specified Graphics context. -
setRenderer
Sets the renderer used to render the plot. The default value is {link GraphicsRenderer}.- Parameters:
className- Fully qualified name of the renderer class.
-
setMarker
Defines a graphical marker which will be drawn on top of the plot. To remove the marker call this method with argument null.- Parameters:
marker- Marker element. Can be null.
-