All Packages Class Hierarchy This Package Previous Next Index
Class crw.data.SimpleCurveAnywhere
java.lang.Object
|
+----crw.data.SimpleCurveAnywhere
- public abstract class SimpleCurveAnywhere
- extends Object
This class draws or fill a simple curve(without axis) according to
the user-defined function.
The simple curve can be put anywhere(x,y) with different alignments.
It can be moved to a new position during run time.
- Version:
- 0.2 3/30/1999
- Author:
- Hongyu Lu
-
SimpleCurveAnywhere(int, int, int, int, char)
-
Creates a simple curve object
-
draw(Graphics, Color)
-
Draws the curve with specified color.
-
fillArea(Graphics, Color)
-
Fills the area between 'axises' and the curve
-
fX(double)
-
This abstract mehtod should be overrided by user to provide the function
for the curve.
-
getYi(int)
-
Gets the double value of y according to x
-
getYiInt(int)
-
Gets the int value of y according to x and yRange
-
getYRange()
-
Gets range of y
-
quantization()
-
Calculates points for the output curve according to
the user-defined function.
-
setXInit(int)
-
Changes the x0 position of the curve during run time.
See also draw() method.
-
setXRange(int)
-
Sets x range(pixels).
-
setYInit(int)
-
Changes the y0 position of the curve during run time.
-
setYRange(int)
-
Sets y range(pixels).
SimpleCurveAnywhere
public SimpleCurveAnywhere(int xInit,
int yInit,
int xRange,
int yRange,
char orientation)
- Creates a simple curve object
- Parameters:
- xInit - x0 of the curve
- yInit - y0 of the curve
- xRange - pixels in x direction
- yRange - pixels in y direction
- orientation - put the curve on the screen accordingly
fX
protected abstract double fX(double x)
- This abstract mehtod should be overrided by user to provide the function
for the curve.
setXInit
public void setXInit(int xInit)
- Changes the x0 position of the curve during run time.
See also draw() method.
- Parameters:
- xInit - new x0
setYInit
public void setYInit(int yInit)
- Changes the y0 position of the curve during run time.
- Parameters:
- yInit - new y0
See also draw() method.
setXRange
public void setXRange(int xRange)
- Sets x range(pixels).
- Parameters:
- xRange - new x range
setYRange
public void setYRange(int yRange)
- Sets y range(pixels).
- Parameters:
- yRange - new y range
getYi
public double getYi(int i)
- Gets the double value of y according to x
- Parameters:
- i - x index
- Returns:
- Returns y value
getYiInt
public int getYiInt(int i)
- Gets the int value of y according to x and yRange
- Parameters:
- i - x index
- Returns:
- Returns y value
getYRange
public int getYRange()
- Gets range of y
- Returns:
- Returns yRange
draw
public void draw(Graphics g,
Color c)
- Draws the curve with specified color.
- Parameters:
- g - the graphics context
- c - foreground color for the curve
fillArea
public void fillArea(Graphics g,
Color c)
- Fills the area between 'axises' and the curve
- Parameters:
- g - the graphics context
- c - foreground color for the curve
quantization
public void quantization()
- Calculates points for the output curve according to
the user-defined function.
All Packages Class Hierarchy This Package Previous Next Index