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

Constructor Index

 o SimpleCurveAnywhere(int, int, int, int, char)
Creates a simple curve object

Method Index

 o draw(Graphics, Color)
Draws the curve with specified color.
 o fillArea(Graphics, Color)
Fills the area between 'axises' and the curve
 o fX(double)
This abstract mehtod should be overrided by user to provide the function
for the curve.
 o getYi(int)
Gets the double value of y according to x
 o getYiInt(int)
Gets the int value of y according to x and yRange
 o getYRange()
Gets range of y
 o quantization()
Calculates points for the output curve according to
the user-defined function.
 o setXInit(int)
Changes the x0 position of the curve during run time.
See also draw() method.
 o setXRange(int)
Sets x range(pixels).
 o setYInit(int)
Changes the y0 position of the curve during run time.
 o setYRange(int)
Sets y range(pixels).

Constructors

 o 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

Methods

 o fX
 protected abstract double fX(double x)
This abstract mehtod should be overrided by user to provide the function
for the curve.

 o setXInit
 public void setXInit(int xInit)
Changes the x0 position of the curve during run time.
See also draw() method.

Parameters:
xInit - new x0
 o setYInit
 public void setYInit(int yInit)
Changes the y0 position of the curve during run time.

Parameters:
yInit - new y0 See also draw() method.
 o setXRange
 public void setXRange(int xRange)
Sets x range(pixels).

Parameters:
xRange - new x range
 o setYRange
 public void setYRange(int yRange)
Sets y range(pixels).

Parameters:
yRange - new y range
 o getYi
 public double getYi(int i)
Gets the double value of y according to x

Parameters:
i - x index
Returns:
Returns y value
 o 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
 o getYRange
 public int getYRange()
Gets range of y

Returns:
Returns yRange
 o 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
 o 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
 o 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