|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.noaa.pmel.sgt.Axis
gov.noaa.pmel.sgt.SpaceAxis
public abstract class 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 | |
---|---|
protected TimePoint |
tLocation_
|
protected Point2D.Double |
uLocation_
|
protected Range2D |
uRange_
|
Fields inherited from class gov.noaa.pmel.sgt.Axis |
---|
AUTO, BOTH_SIDES, graph_, HORIZONTAL, labelColor_, labelFont_, labelFormat_, labelHeight_, labelInterval_, labelPosition_, largeTicHeight_, lineColor_, NEGATIVE_SIDE, NO_LABEL, numSmallTics_, orientation_, POSITIVE_SIDE, pRange_, registeredAxes_, registeredTransforms_, selectable_, selected_, sigDigits_, smallTicHeight_, space_, thickTicWidth_, ticPosition_, title_, VERTICAL, visible_ |
Constructor Summary | |
---|---|
SpaceAxis()
Default constructor for SpaceAxis. |
|
SpaceAxis(java.lang.String id)
Constructor for Axis. |
Method Summary | |
---|---|
protected void |
drawSmallXTics(java.awt.Graphics g,
double xu,
double xtest,
double del,
double yp)
|
protected void |
drawSmallYTics(java.awt.Graphics g,
double xp,
double yu,
double ytest,
double del)
|
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. |
protected void |
updateRegisteredAxes()
|
protected void |
updateRegisteredTransforms()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Range2D uRange_
protected Point2D.Double uLocation_
protected TimePoint tLocation_
Constructor Detail |
---|
public SpaceAxis()
public SpaceAxis(java.lang.String id)
id
- axis identificationMethod Detail |
---|
protected void updateRegisteredTransforms()
updateRegisteredTransforms
in class Axis
protected void updateRegisteredAxes()
updateRegisteredAxes
in class Axis
protected void drawSmallXTics(java.awt.Graphics g, double xu, double xtest, double del, double yp)
protected void drawSmallYTics(java.awt.Graphics g, double xp, double yu, double ytest, double del)
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 Axis
public Range2D getRangeU()
public SoTRange getSoTRangeU()
Axis
getSoTRangeU
in class Axis
public void setDeltaU(double delta)
delta
- increment in user coordinatespublic double getDeltaU()
public void setLocationU(TimePoint uptt)
upt
- origin in user unitspublic void setLocationU(Point2D.Double upt)
upt
- origin in user unitspublic void setLocationU(SoTPoint upt)
Axis
setLocationU
in class Axis
public Point2D.Double getLocationU()
public TimePoint getTimeLocationU()
public SoTPoint getSoTLocationU()
Axis
getSoTLocationU
in class Axis
public abstract java.awt.Rectangle getBounds()
getBounds
in interface Selectable
getBounds
in class Axis
Rectangle
public void modified(java.lang.String mess)
Axis
modified
in class Axis
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |