All Packages Class Hierarchy This Package Previous Next Index
class XCoor implements AxisCoor {
private int[] location;
public XCoor() {
location = new int[3];
}
public void change() {
for (int i=0; i
-
getCoordinate(int)
- Returns the screen position information for drawing Axis.
getCoordinate
public abstract int getCoordinate(int indexID)
- Returns the screen position information for drawing Axis.
The class may need to provide position for several different
axes; thus the int argument i is used to separately
provide different axes locations. If the axis is an x-axis, then
location info may be axis's y-coordinate, beginning x, or the
ending x coordinate.
If int[] location is used to hold the location
information of several axes, then a possible implementation
is
public int getCoordinate(int i) {
if (i < location.length)
return location[i];
else
return 10;
}
- Parameters:
- indexID - index of the chosen axis. Application programs
must make sure that this method returns proper axis coordinates
for the Axis.
All Packages Class Hierarchy This Package Previous Next Index