|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object
|
+--gov.noaa.pmel.sgt.Axis
|
+--gov.noaa.pmel.sgt.SpaceAxis
Abstract base class for axes whose user coordinates are double values.
The following is an example of using a PlainAxis.
import gov.noaa.pmel.sgt.PlainAxis;
import gov.noaa.pmel.sgt.LinearTransform;
import gov.noaa.pmel.sgt.Graph;
...
Graph graph;
PlainAxis xbot, xtop;
LinearTransform xt;
Point2D.Double lowerleft = new Point2D.Double(10.0, 100.0);
...
//
// Instatiate xt and set it as the x transform.
//
xt = new LinearTransform(0.75, 3.5, 10.0, 100.0);
graph.setXTransform(xt);
...
//
// Instatiate xbot and set its range, delta, and
// location. Set xbot the numberSmallTics property
// for xbot.
//
xbot = new PlainAxis("Bottom Axis");
xbot.setRangeU(new Range2D(10.0, 100.0));
xbot.setDeltaU(20.0);
xbot.setNumberSmallTics(4);
xbot.setLocationU(lowerleft);
//
// Create title for xbot.
//
Font xbfont = new Font("Helvetica", Font.ITALIC, 14);
xbot.setLabelFont(xbfont);
SGLabel xtitle = new SGLabel("xaxis title",
"Test X-Axis Title",
new Point2D.Double(0.0, 0.0));
Font xtfont = new Font("Helvetica", Font.PLAIN, 14);
xtitle.setFont(xtfont);
xtitle.setHeightP(0.2);
xbot.setTitle(xtitle);
graph.setXAxis(xbot);
...
//
// Instatiate xtop and set its range, delta, and
// location. Set xtop properties on ticPosition and
// labelPosition.
//
xtop = new PlainAxis("Top Axis");
xtop.setRangeU(new Range2D(10.0, 100.0));
xtop.setDeltaU(20.0);
xtop.setNumberSmallTics(0);
xtop.setLocationU(new Point2D.Double(10.0, 300.0));
xtop.setLabelFont(xbfont);
xtop.setTicPosition(Axis.POSITIVE_SIDE);
xtop.setLabelPosition(Axis.NO_LABEL);
graph.setXAxis(xtop);
...
//
// Register the x transform and the top x axis with the bottom x axis.
// By registering xt and xtop, any updates to the user or physical range
// of xbot will be automatically performed on xt and xtop.
//
xbot.register(xt);
xbot.register(xtop);
Axis,
PlainAxis,
TimeAxis| Field Summary |
| Fields inherited from class gov.noaa.pmel.sgt.Axis |
AUTO, BOTH_SIDES, HORIZONTAL, NEGATIVE_SIDE, NO_LABEL, POSITIVE_SIDE, VERTICAL |
| Constructor Summary | |
SpaceAxis()
Default constructor for SpaceAxis. |
|
SpaceAxis(java.lang.String id)
Constructor for Axis. |
|
| Method Summary | |
abstract java.awt.Rectangle |
getBounds()
Get the bounding box for the axis in device units. |
double |
getDeltaU()
Get the increment between large tics. |
java.lang.String |
getLabelFormat()
Get the label format. |
int |
getLabelInterval()
Get the label interval. |
Point2D.Double |
getLocationU()
Get the origin in user units of the axis |
Range2D |
getRangeU()
Get the user range. |
int |
getSignificantDigits()
Get the number of significant digits in the label. |
SoTPoint |
getSoTLocationU()
Get current axis location. |
SoTRange |
getSoTRangeU()
Get user range. |
TimePoint |
getTimeLocationU()
Get the origin in user units of the axis |
void |
modified(java.lang.String mess)
Used internally by sgt. |
void |
setDeltaU(double delta)
Set the increment between large tics. |
void |
setLabelFormat(java.lang.String frmt)
Set the label format. |
void |
setLabelInterval(int lint)
Set the label interval. |
void |
setLocationU(Point2D.Double upt)
Set the origin in user units of the axis. |
void |
setLocationU(SoTPoint upt)
Set the axis location. |
void |
setLocationU(TimePoint uptt)
Set the origin in user units of the axis. |
void |
setRangeU(Range2D ur)
Set the user range to draw the axis. |
void |
setRangeU(SoTRange ur)
Set user range. |
void |
setSignificantDigits(int nsig)
Set the number of significant digits in the label. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SpaceAxis()
public SpaceAxis(java.lang.String id)
id - axis identification| Method Detail |
public void setSignificantDigits(int nsig)
nsig - number of significant digitspublic int getSignificantDigits()
public void setLabelInterval(int lint)
lint - label interval.public int getLabelInterval()
public void setLabelFormat(java.lang.String frmt)
Gary Cornell and Cay S. Horstmann, Core Java (Book/CD-ROM) Published By SunSoft Press/Prentice-Hall Copyright (C) 1996 Sun Microsystems Inc. All Rights Reserved. ISBN 0-13-596891-7
frmt - label format.public java.lang.String getLabelFormat()
public void setRangeU(Range2D ur)
ur - range in user coordinatespublic void setRangeU(SoTRange ur)
Axis
setRangeU in class Axispublic Range2D getRangeU()
public SoTRange getSoTRangeU()
Axis
getSoTRangeU in class Axispublic void setDeltaU(double delta)
delta - increment in user coordinatespublic double getDeltaU()
public void setLocationU(TimePoint uptt)
public void setLocationU(Point2D.Double upt)
upt - origin in user unitspublic void setLocationU(SoTPoint upt)
Axis
setLocationU in class Axispublic Point2D.Double getLocationU()
public TimePoint getTimeLocationU()
public SoTPoint getSoTLocationU()
Axis
getSoTLocationU in class Axispublic abstract java.awt.Rectangle getBounds()
getBounds in interface SelectablegetBounds in class AxisRectanglepublic void modified(java.lang.String mess)
Axis
modified in class Axis
|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||