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

Variable Index

 o L10

Method Index

 o draw(Graphics)
Draws the axis.
 o 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-.
 o getOrigin()
Returns the coordinate of origin in this drawing area.
 o init()
Called to initialize the Data reference in this class.
 o isLogX()
 o isLogY()
 o setAutoRange(boolean)
Sets whether the axis range is set manually or automatically.
 o setFormatX(Format)
Sets new display format for x-axis tick values.
 o setFormatY(Format)
Sets new display format for y-axis tick values.
 o setGrid(boolean)
Whether to show grid in the plot diagram or not.
 o setNameX(String)
Sets new name for x-axis.
 o setNameY(String)
Sets new name for y-axis.
 o setRangeX(double, double)
Sets the x-axis range.
 o setRangeY(double, double)
Sets the y-axis range.
 o setScaleChanged(boolean)
Called by PlotCanvas if the canvas size is changed.
 o setXLog(boolean)
Sets x-axis to log-scale.
 o setYLog(boolean)
Sets y-axis to log-scale.

Variables

 o L10
 public static final double L10

Methods

 o init
 public void init()
Called to initialize the Data reference in this class.

 o draw
 public void draw(Graphics g)
Draws the axis.

Parameters:
g - the Graphics context.
 o setGrid
 public void setGrid(boolean show)
Whether to show grid in the plot diagram or not.

Parameters:
show - true to show the grid.
 o 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.
 o isLogX
 public boolean isLogX()
Returns:
true if x-axis is in log scale.
 o isLogY
 public boolean isLogY()
Returns:
true if y-axis is in log scale.
 o 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.

 o setNameX
 public void setNameX(String xaxis)
Sets new name for x-axis.

Parameters:
xaxis - the new axis name.
 o setNameY
 public void setNameY(String yaxis)
Sets new name for y-axis.

Parameters:
yaxis - the new axis name.
 o setFormatX
 public void setFormatX(Format fx)
Sets new display format for x-axis tick values.

Parameters:
fx - the new display format.
 o setFormatY
 public void setFormatY(Format fy)
Sets new display format for y-axis tick values.

Parameters:
fy - the new display format.
 o setAutoRange
 public void setAutoRange(boolean auto)
Sets whether the axis range is set manually or automatically.

Parameters:
auto - true if automatic axis range.
 o setScaleChanged
 public void setScaleChanged(boolean scale)
Called by PlotCanvas if the canvas size is changed.

Parameters:
scale - true if axis needs re-initialization.
 o 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.
 o 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.
 o 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.
 o 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