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
-
axes
-
-
conv
-
-
currentX
-
-
data
-
-
dataColor
-
-
dataColorAll
-
-
diffColor
-
-
dirtyFlag
-
-
showSpot
-
-
GraphSet()
-
-
draw(Graphics)
-
-
drawAxes(Graphics)
- Draws the axis, ticks, and labels.
-
drawData(Graphics)
- Draws the data.
-
drawSpot(Graphics)
- Draws a spot on a curve
-
getAxes()
-
-
getAxisX()
-
-
getAxisY()
-
-
getConv()
-
-
getData()
-
-
init()
-
-
isDirty()
- Returns true if something has changed.
-
isShowSpot()
-
-
set(Data2[])
- Sets the physical data to plot in this GraphSet.
-
setAxisX(AxisX)
-
-
setAxisY(AxisY)
-
-
setCurrentX(double)
-
-
setDataColor(Color)
- Sets a single color for all curves in this
data set.
-
setDataColor(Color[])
- Sets color for each curve.
-
setDirty(boolean)
- Sets true if anything in this GrapghSet has changed.
-
translate(double[], double)
-
axes
protected Axis2 axes[]
data
protected Data2 data[]
conv
protected Conversion2 conv[]
dirtyFlag
protected boolean dirtyFlag
dataColor
protected Color dataColor[]
dataColorAll
protected Color dataColorAll
diffColor
protected boolean diffColor
currentX
protected double currentX
showSpot
protected boolean showSpot
GraphSet
public GraphSet()
init
public void init()
draw
public void draw(Graphics g)
drawAxes
public void drawAxes(Graphics g)
- Draws the axis, ticks, and labels.
drawData
public void drawData(Graphics g)
- Draws the data.
drawSpot
public void drawSpot(Graphics g)
- Draws a spot on a curve
- Parameters:
- g - Graphics context
set
public void set(Data2 dat[])
- Sets the physical data to plot in this GraphSet.
- Parameters:
- dat - the array of physical data (Data2 subclass).
setDataColor
public void setDataColor(Color c)
- Sets a single color for all curves in this
data set.
setDataColor
public void setDataColor(Color c[])
- Sets color for each curve. The dimension must agree
with the number of different data.
setAxisX
public void setAxisX(AxisX x)
setAxisY
public void setAxisY(AxisY y)
setDirty
public void setDirty(boolean dirty)
- Sets true if anything in this GrapghSet has changed.
- Parameters:
- dirty - true if anything changed.
isDirty
public boolean isDirty()
- Returns true if something has changed.
- Returns:
- true if anything changed and need replot.
getData
public Data2[] getData()
getAxisX
public AxisX getAxisX()
getAxisY
public AxisY getAxisY()
getConv
public Conversion2[] getConv()
getAxes
public Axis2[] getAxes()
isShowSpot
public boolean isShowSpot()
setCurrentX
public void setCurrentX(double currentX)
translate
protected double[] translate(double v[],
double v0)
All Packages Class Hierarchy This Package Previous Next Index