All Packages Class Hierarchy This Package Previous Next Index
Class crw.data.Axis
java.lang.Object
|
+----crw.data.Axis
- public class Axis
- extends Object
This class encapsulates all axis-drawing activities of the system.
This is not used directly by the programmer, but is for use
by the data-plotting system.
This class is compatible with JDK1.0. In order to make it compatible with
JDK1.1, replace all size() by getSize().
- Version:
- 1.0 10/2/1998
- Author:
- C.R.Wie
-
L10
-
-
draw(Graphics)
- Draws the axis.
-
getLogCase()
- Returns 0 for x=(Lin, Log+) & y=(Lin, Log+);
1 for x=(Lin, Log+) & y=Log-; 2 for x=Log- &
y=(Lin, Log+); and 3 for x=Log- & y=Log-.
-
getOrigin()
- Returns the coordinate of origin in this drawing area.
-
init()
- Called to initialize the Data reference in this class.
-
isLogX()
-
-
isLogY()
-
-
setAutoRange(boolean)
- Sets whether the axis range is set manually or automatically.
-
setFormatX(Format)
- Sets new display format for x-axis tick values.
-
setFormatY(Format)
- Sets new display format for y-axis tick values.
-
setGrid(boolean)
- Whether to show grid in the plot diagram or not.
-
setNameX(String)
- Sets new name for x-axis.
-
setNameY(String)
- Sets new name for y-axis.
-
setRangeX(double, double)
- Sets the x-axis range.
-
setRangeY(double, double)
- Sets the y-axis range.
-
setScaleChanged(boolean)
- Called by PlotCanvas if the canvas size is changed.
-
setXLog(boolean)
- Sets x-axis to log-scale.
-
setYLog(boolean)
- Sets y-axis to log-scale.
L10
public static final double L10
init
public void init()
- Called to initialize the Data reference in this class.
draw
public void draw(Graphics g)
- Draws the axis.
- Parameters:
- g - the Graphics context.
setGrid
public void setGrid(boolean show)
- Whether to show grid in the plot diagram or not.
- Parameters:
- show - true to show the grid.
getOrigin
public Point getOrigin()
- Returns the coordinate of origin in this drawing area.
The coordinates are relative to the upper-left corner
in this Graphics context.
- Returns:
- the coordinate of origin.
isLogX
public boolean isLogX()
- Returns:
- true if x-axis is in log scale.
isLogY
public boolean isLogY()
- Returns:
- true if y-axis is in log scale.
getLogCase
public int getLogCase()
- Returns 0 for x=(Lin, Log+) & y=(Lin, Log+);
1 for x=(Lin, Log+) & y=Log-; 2 for x=Log- &
y=(Lin, Log+); and 3 for x=Log- & y=Log-.
Log- means that all values are negative, but plotted in
log scale.
setNameX
public void setNameX(String xaxis)
- Sets new name for x-axis.
- Parameters:
- xaxis - the new axis name.
setNameY
public void setNameY(String yaxis)
- Sets new name for y-axis.
- Parameters:
- yaxis - the new axis name.
setFormatX
public void setFormatX(Format fx)
- Sets new display format for x-axis tick values.
- Parameters:
- fx - the new display format.
setFormatY
public void setFormatY(Format fy)
- Sets new display format for y-axis tick values.
- Parameters:
- fy - the new display format.
setAutoRange
public void setAutoRange(boolean auto)
- Sets whether the axis range is set manually or automatically.
- Parameters:
- auto - true if automatic axis range.
setScaleChanged
public void setScaleChanged(boolean scale)
- Called by PlotCanvas if the canvas size is changed.
- Parameters:
- scale - true if axis needs re-initialization.
setRangeX
public void setRangeX(double min,
double max)
- Sets the x-axis range. Sould be called if
setAutoRange(false) is set.
- Parameters:
- min - the minimum value on x-axis.
- max - the maximum value on x-axis.
setRangeY
public void setRangeY(double min,
double max)
- Sets the y-axis range. Sould be called if
setAutoRange(false) is set.
- Parameters:
- min - the minimum value on y-axis.
- max - the maximum value on y-axis.
setXLog
public void setXLog(boolean log)
- Sets x-axis to log-scale. Make sure that x-values are
either all positive or all negative.
- Parameters:
- log - true if log(x) or false if linear x.
setYLog
public void setYLog(boolean log)
- Sets y-axis to log-scale. Make sure that y-values are
either all positive or all negative.
- Parameters:
- log - true if log(y) or false if linear y.
All Packages Class Hierarchy This Package Previous Next Index