All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.data2.GraphSet

java.lang.Object
   |
   +----crw.data2.GraphSet

public class GraphSet
extends Object
Represents a graphical unit on Canvas, consisting of x-axis, y-axis, x-conversion and y-conversion factors, and one or more Data2 objects. The init() method should be called henever changes occur to affect the axis scaling or data conversion behavior. The draw(Graphics g) should be called whenever changes occur in physical Data or re-plot is made necessary. Otherwise (no changes in data or axis), use an Image object to hold the plot and use Graphics.drawImage().

Version:
1.01
Author:
C.R.Wie

Variable Index

 o axes
 o conv
 o currentX
 o data
 o dataColor
 o dataColorAll
 o diffColor
 o dirtyFlag
 o showSpot

Constructor Index

 o GraphSet()

Method Index

 o draw(Graphics)
 o drawAxes(Graphics)
Draws the axis, ticks, and labels.
 o drawData(Graphics)
Draws the data.
 o drawSpot(Graphics)
Draws a spot on a curve
 o getAxes()
 o getAxisX()
 o getAxisY()
 o getConv()
 o getData()
 o init()
 o isDirty()
Returns true if something has changed.
 o isShowSpot()
 o set(Data2[])
Sets the physical data to plot in this GraphSet.
 o setAxisX(AxisX)
 o setAxisY(AxisY)
 o setCurrentX(double)
 o setDataColor(Color)
Sets a single color for all curves in this data set.
 o setDataColor(Color[])
Sets color for each curve.
 o setDirty(boolean)
Sets true if anything in this GrapghSet has changed.
 o translate(double[], double)

Variables

 o axes
 protected Axis2 axes[]
 o data
 protected Data2 data[]
 o conv
 protected Conversion2 conv[]
 o dirtyFlag
 protected boolean dirtyFlag
 o dataColor
 protected Color dataColor[]
 o dataColorAll
 protected Color dataColorAll
 o diffColor
 protected boolean diffColor
 o currentX
 protected double currentX
 o showSpot
 protected boolean showSpot

Constructors

 o GraphSet
 public GraphSet()

Methods

 o init
 public void init()
 o draw
 public void draw(Graphics g)
 o drawAxes
 public void drawAxes(Graphics g)
Draws the axis, ticks, and labels.

 o drawData
 public void drawData(Graphics g)
Draws the data.

 o drawSpot
 public void drawSpot(Graphics g)
Draws a spot on a curve

Parameters:
g - Graphics context
 o set
 public void set(Data2 dat[])
Sets the physical data to plot in this GraphSet.

Parameters:
dat - the array of physical data (Data2 subclass).
 o setDataColor
 public void setDataColor(Color c)
Sets a single color for all curves in this data set.

 o setDataColor
 public void setDataColor(Color c[])
Sets color for each curve. The dimension must agree with the number of different data.

 o setAxisX
 public void setAxisX(AxisX x)
 o setAxisY
 public void setAxisY(AxisY y)
 o setDirty
 public void setDirty(boolean dirty)
Sets true if anything in this GrapghSet has changed.

Parameters:
dirty - true if anything changed.
 o isDirty
 public boolean isDirty()
Returns true if something has changed.

Returns:
true if anything changed and need replot.
 o getData
 public Data2[] getData()
 o getAxisX
 public AxisX getAxisX()
 o getAxisY
 public AxisY getAxisY()
 o getConv
 public Conversion2[] getConv()
 o getAxes
 public Axis2[] getAxes()
 o isShowSpot
 public boolean isShowSpot()
 o setCurrentX
 public void setCurrentX(double currentX)
 o translate
 protected double[] translate(double v[],
                              double v0)

All Packages  Class Hierarchy  This Package  Previous  Next  Index