All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.data.DataWrapper

java.lang.Object
   |
   +----crw.data.DataWrapper

public class DataWrapper
extends Object
A Data wrapper class, is the holding place for all physical data and prepares them for plot. A DataWrapper object is associated with one PlotCanvas object. This object uses a Conversion object which is created based on the data range, xRange and yRange, and the size of the PlotCanvas. One DataWrapper object can hold many physical Data objects in a Vector. This class is responsible for plotting all data in the PlotCanvas drawing area. This class is not usually used in an application, but used by the system (in PlotCanvas). A DataWrapper object is obtained by calling PlotCanvas.getData() method. This class is compatible with JDK1.0. In order to make it compatible with JDK1.1, replace all occurences of size() by getSize().

Version:
1.0 10/2/1998
Author:
C.R.Wie

Method Index

 o add(Data)
Adds a data object into this wrapper class.
 o drawCurrent(Graphics, Color)
Draws a curve corresponding to the current parameter value using the Color provided.
 o drawFull(Graphics)
Draws all data curves for all parameter values in the background image object.
 o drawSpot(Graphics, Color)
Draws the current spot with the given color.
 o getLogOrigin()
Returns the value at the axis origin if log scale plot is employed.
 o getOrigin()
 o getRangeX()
 o getRangeY()
 o isEmpty()
 o remove(Data)
Removes a Data object.
 o removeAll()
Removes all data object stored in the vector.
 o setCurrentP(double)
Sets the current parameter value.
 o setCurrentX(double)
Sets the current x-value.
 o setRange()
Finds the range of all physical data based on the function of array data.
 o showCurrentSpot(boolean)
Whether to show the current spot or not.

Methods

 o removeAll
 public void removeAll()
Removes all data object stored in the vector.

 o remove
 public boolean remove(Data d)
Removes a Data object.

Parameters:
d - the Data object to remove from this.
 o add
 public void add(Data d)
Adds a data object into this wrapper class.

Parameters:
d - the Data object to plot.
 o setRange
 public void setRange()
Finds the range of all physical data based on the function of array data. When the function parameters change, i.e. when the data changes, this method should be called in the application code.

 o drawFull
 public void drawFull(Graphics g)
Draws all data curves for all parameter values in the background image object.

Parameters:
g - the Graphics context.
 o drawCurrent
 public void drawCurrent(Graphics g,
                         Color c)
Draws a curve corresponding to the current parameter value using the Color provided.

Parameters:
g - the Graphics context.
c - the Color of the curve.
 o showCurrentSpot
 public void showCurrentSpot(boolean show)
Whether to show the current spot or not.

Parameters:
show - true if wish to show
 o drawSpot
 public void drawSpot(Graphics g,
                      Color c)
Draws the current spot with the given color.

Parameters:
g - the Graphics context
c - the Color of the current spot.
 o setCurrentP
 public void setCurrentP(double p)
Sets the current parameter value.

Parameters:
p - the new parameter value.
 o setCurrentX
 public void setCurrentX(double x)
Sets the current x-value.

Parameters:
x - the x-value.
 o isEmpty
 public boolean isEmpty()
Returns:
true if there is no data to plot.
 o getRangeX
 public FloatRange getRangeX()
Returns:
the total range of x-values.
 o getRangeY
 public FloatRange getRangeY()
Returns:
the total range of y-values.
 o getOrigin
 public FloatPoint getOrigin()
Returns:
x and y-values at the origin.
 o getLogOrigin
 public Point getLogOrigin()
Returns the value at the axis origin if log scale plot is employed. Used by Axis.

Returns:
the log value at origin.

All Packages  Class Hierarchy  This Package  Previous  Next  Index