All Packages Class Hierarchy This Package Previous Next Index
Class crw.data.PlotCanvas
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----crw.data.PlotCanvas
- public class PlotCanvas
- extends Canvas
Drawing canvas of data plot. Client codes add one or more Data object
(whether Functiondata or ArrayData) to this drawing area. The rest is
handled by the system. Namely, PlotCanvas puts the Data object
within a DataWrapper object which stores and prepares all Data objects
to plot. One and only one DataWrapper object is associated with
this PlotCanvas and holds (contains) all data objects to plot
in this drawing area. To plot an arbitrary data the client code only needs to
specifiy the Data (function or array) to plot and add the instance
objects into a PlotCanvas object using the addData() method.
All methods except for the addData() and the setChanged()
methods are for use by the system, not by the client.
JDK1.0-compatible. To make it compatible with JDK1.1, replace size() by
getSize().
- Version:
- 1.0 4/1/1998
- Author:
- C.R.Wie
-
PlotCanvas()
-
-
addData(Data)
- Adds the Data object to plot.
-
addNotify()
- After calling super.addNotify(), it calls the Axis.init().
-
getAxis()
- Used by the system.
-
getConversion()
- Used by the system.
-
getData()
- Returns the DataWrapper object which holds and prepares all physical
Data objects for plot.
-
paint(Graphics)
- Plots the data on this canvas.
-
removeAllData()
- Removes all data previously added.
-
removeData(Data)
- Removes a particular Data object.
-
setBkgd(boolean)
- Sets the background image either as a Full Data Plot or as
a naked Axis.
-
setChanged(boolean)
- When the physical data parameters change the data arrays need to
be recalculated and the background image need to be replotted.
-
update(Graphics)
- Only calls paint(g).
PlotCanvas
public PlotCanvas()
addNotify
public void addNotify()
- After calling super.addNotify(), it calls the Axis.init().
- Overrides:
- addNotify in class Canvas
addData
public void addData(Data d)
- Adds the Data object to plot. Each curve (or curve family)
corresponds to a Data object. Only one axis is plotted.
Make sure that it makes sense to plot them together.
- Parameters:
- d - the Data object to plot.
removeAllData
public void removeAllData()
- Removes all data previously added. This empties the
Vector in the DataWrapper object.
removeData
public void removeData(Data d)
- Removes a particular Data object.
- Parameters:
- d - the Data object to remove.
update
public void update(Graphics g)
- Only calls paint(g). No background erasing.
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- Plots the data on this canvas. Uses double buffering.
The constant image is saved in an Image object. This
contant image is first drawn, as a background, onto image
object in background memory for double buffering and then
the data are plotted such as current curve and current spot.
The completed image object is drawn by drawImage().
- Parameters:
- g - the graphics context of this Canvas.
- Overrides:
- paint in class Canvas
setBkgd
public void setBkgd(boolean isFullData)
- Sets the background image either as a Full Data Plot or as
a naked Axis.
- Parameters:
- isFullData - set to true if a full data plot is bkgrd.
getData
public DataWrapper getData()
- Returns the DataWrapper object which holds and prepares all physical
Data objects for plot. Used by the system.
- Returns:
- the DataWrapper object of this plot area.
getAxis
public Axis getAxis()
- Used by the system.
- Returns:
- the Axis object of this plot.
getConversion
public Conversion getConversion()
- Used by the system.
- Returns:
- the Conversion factor object.
setChanged
public void setChanged(boolean data)
- When the physical data parameters change the data arrays need to
be recalculated and the background image need to be replotted.
This PlotCanvas object is notified of the changes through this method.
- Parameters:
- data - set to true if physical data has changed.
All Packages Class Hierarchy This Package Previous Next Index