|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.noaa.pmel.sgt.Axis
public abstract class Axis
Abstract base class for Cartesian axes. Cartesian axes are
designed to be used with
the CartesianGraph
class. Axes and AxisTransform
s
can be registed with an Axis
. This allows changes in both
the physical range and user range to be immediatedly updated
for the registered AxisTransform
s and axes.
Cartesian axes can have their user coordinates be double values or time (as
GeoDate
objects). These have been separated into
two child objects.
SpaceAxis
,
TimeAxis
Field Summary | |
---|---|
static int |
AUTO
|
static int |
BOTH_SIDES
Draw the tics on both sides of the axes. |
protected CartesianGraph |
graph_
|
static int |
HORIZONTAL
Draw a horizontal axis. |
protected java.awt.Color |
labelColor_
|
protected java.awt.Font |
labelFont_
|
protected java.lang.String |
labelFormat_
|
protected double |
labelHeight_
|
protected int |
labelInterval_
|
protected int |
labelPosition_
|
protected double |
largeTicHeight_
|
protected java.awt.Color |
lineColor_
|
static int |
NEGATIVE_SIDE
Place the label and/or tic on the negative side of the axis. |
static int |
NO_LABEL
Do not draw a label and/or tic. |
protected int |
numSmallTics_
|
protected int |
orientation_
|
static int |
POSITIVE_SIDE
Place the label and/or tic on the positive side of the axis. |
protected Range2D |
pRange_
|
protected java.util.Vector |
registeredAxes_
|
protected java.util.Vector |
registeredTransforms_
|
protected boolean |
selectable_
|
protected boolean |
selected_
|
protected int |
sigDigits_
|
protected double |
smallTicHeight_
|
protected boolean |
space_
|
protected double |
thickTicWidth_
|
protected int |
ticPosition_
|
protected SGLabel |
title_
|
static int |
VERTICAL
Draw a vertical axis. |
protected boolean |
visible_
|
Constructor Summary | |
---|---|
Axis()
Default constructor for Axis. |
|
Axis(java.lang.String id)
Constructor for Axis. |
Method Summary | |
---|---|
void |
clear(Axis axis)
Unregister an axis. |
void |
clear(AxisTransform trns)
Unregister an AxisTransform . |
void |
clearAllRegisteredAxes()
Unregister all axes. |
void |
clearAllRegisteredTransforms()
Unregister all AxisTransform s. |
abstract Axis |
copy()
Create a copy of the axis. |
protected void |
drawThickXTic(java.awt.Graphics g,
double xp,
double yp,
double ticHeight)
|
protected void |
drawThickYTic(java.awt.Graphics g,
double xp,
double yp,
double ticHeight)
|
protected void |
drawXTic(java.awt.Graphics g,
double xp,
double yp,
double ticHeight)
|
protected void |
drawYTic(java.awt.Graphics g,
double xp,
double yp,
double ticHeight)
|
abstract java.awt.Rectangle |
getBounds()
Get the bounding box for the axis in device units. |
CartesianGraph |
getGraph()
Get the Graph associated with the axis. |
java.lang.String |
getId()
Get the axis identifier. |
java.awt.Color |
getLabelColor()
Get the label color. |
java.awt.Font |
getLabelFont()
Get the label font. |
double |
getLabelHeightP()
Get the label height. |
int |
getLabelPosition()
Get the label position. |
double |
getLargeTicHeightP()
Get the large tic height. |
java.awt.Color |
getLineColor()
Get the line color. |
int |
getNumberRegisteredAxes()
Get the number of currently registered axes. |
int |
getNumberRegisteredTransforms()
Get the number of currently registered transforms. |
int |
getNumberSmallTics()
Get the number of small tics between large tics. |
int |
getOrientation()
Get axis orientation |
AbstractPane |
getPane()
Get the parent pane. |
Range2D |
getRangeP()
Get the physical range. |
double |
getSmallTicHeightP()
Get the small tic height. |
abstract SoTPoint |
getSoTLocationU()
Get current axis location. |
abstract SoTRange |
getSoTRangeU()
Get user range. |
double |
getThickTicWidthP()
Get the thick tic width. |
int |
getTicPosition()
Get the tic position. |
SGLabel |
getTitle()
Get the axis title. |
boolean |
isSelectable()
Determines if the axis is selectable. |
boolean |
isSelected()
Determines if the axis has been selected. |
boolean |
isSpace()
Tests if axis is space. |
boolean |
isTime()
Tests if axis is time. |
boolean |
isVisible()
Determines if the axis is visible. |
void |
modified(java.lang.String mess)
Used internally by sgt. |
void |
register(Axis axis)
Register an axis. |
void |
register(AxisTransform trns)
Register an AxisTransform . |
void |
setId(java.lang.String id)
Set the axis identifier. |
void |
setLabelColor(java.awt.Color color)
Set the label color. |
void |
setLabelFont(java.awt.Font fnt)
Set the label font. |
void |
setLabelHeightP(double lhgt)
Set the label height in physical units. |
void |
setLabelPosition(int labp)
Set the label position. |
void |
setLargeTicHeightP(double lthgt)
Set the large tic height in physical units. |
void |
setLineColor(java.awt.Color color)
Set the line and tick color. |
abstract void |
setLocationU(SoTPoint pt)
Set the axis location. |
void |
setNumberSmallTics(int nstic)
Set the number of small tics between large tics. |
void |
setOrientation(int or)
Set axis orientation. |
void |
setRangeP(Range2D pr)
Set the physical range. |
abstract void |
setRangeU(SoTRange range)
Set user range. |
void |
setSelectable(boolean select)
Set the selectable state. |
void |
setSelected(boolean sel)
Sets the selected property. |
void |
setSmallTicHeightP(double sthgt)
Set the small tic height in physical units. |
void |
setThickTicWidthP(double wid)
Set the thick tic width in physical units. |
void |
setTicPosition(int tpos)
Set the tic position. |
void |
setTitle(SGLabel title)
Set the axis title. |
void |
setVisible(boolean visible)
Set the visibility state. |
java.lang.String |
toString()
Get a String representation of the Axis . |
protected abstract void |
updateRegisteredAxes()
|
protected abstract void |
updateRegisteredTransforms()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected CartesianGraph graph_
protected java.util.Vector registeredAxes_
protected java.util.Vector registeredTransforms_
protected java.awt.Color lineColor_
protected int numSmallTics_
protected double largeTicHeight_
protected double smallTicHeight_
protected double thickTicWidth_
protected int ticPosition_
protected int labelPosition_
protected int labelInterval_
protected java.awt.Font labelFont_
protected java.awt.Color labelColor_
protected double labelHeight_
protected int sigDigits_
protected java.lang.String labelFormat_
protected SGLabel title_
protected Range2D pRange_
protected boolean space_
protected int orientation_
protected boolean selected_
protected boolean selectable_
protected boolean visible_
public static final int POSITIVE_SIDE
VERTICAL
axes and the top of
HORIZONTAL
axes.
public static final int NEGATIVE_SIDE
VERTICAL
axes and the bottom of
HORIZONTAL
axes.
public static final int NO_LABEL
public static final int BOTH_SIDES
public static final int HORIZONTAL
public static final int VERTICAL
public static final int AUTO
Constructor Detail |
---|
public Axis()
public Axis(java.lang.String id)
numberSmallTics = 0 largeTicHeightP = 0.1 smallTicHeightP = 0.05 thickTicWidth_ = 0.025 ticPosition = NEGATIVE_SIDE labelPosition = NEGATIVE_SIDE labelInterval = 2 labelFont = Font("Helvetica", Font.ITALIC, 10); labelColor = Color.black; labelHeightP = 0.15 significantDigits = 2; labelFormat = "" title = null orientation = HORIZONTAL selectable = true visible = true
id
- axis identifierMethod Detail |
---|
protected abstract void updateRegisteredTransforms()
protected abstract void updateRegisteredAxes()
protected void drawXTic(java.awt.Graphics g, double xp, double yp, double ticHeight)
protected void drawThickXTic(java.awt.Graphics g, double xp, double yp, double ticHeight)
protected void drawYTic(java.awt.Graphics g, double xp, double yp, double ticHeight)
protected void drawThickYTic(java.awt.Graphics g, double xp, double yp, double ticHeight)
public abstract Axis copy()
public CartesianGraph getGraph()
Graph
associated with the axis.
public AbstractPane getPane()
public void modified(java.lang.String mess)
public void register(Axis axis)
axis
- An Axis object.public void register(AxisTransform trns)
AxisTransform
. Registered
AxisTransform
s will be
notified of changes to the user coordinate range and physical
coordinate range.
trns
- A AxisTransform object.public void clear(Axis axis)
axis
- An Axis object.public void clear(AxisTransform trns)
AxisTransform
. The AxisTransform
will no longer be
notified of changes to the user or physical coordinate range.
trns
- A AxisTransform ojbect.public void clearAllRegisteredAxes()
public void clearAllRegisteredTransforms()
AxisTransform
s. No
AxisTransform
s will be
notified of changes in the user of physical range.
public int getNumberRegisteredTransforms()
public int getNumberRegisteredAxes()
public void setLargeTicHeightP(double lthgt)
lthgt
- large tic height.public double getLargeTicHeightP()
public void setNumberSmallTics(int nstic)
nstic
- number of small tics.public int getNumberSmallTics()
public void setSmallTicHeightP(double sthgt)
sthgt
- small tic height.public double getSmallTicHeightP()
public void setThickTicWidthP(double wid)
wid
- thick tic width.public double getThickTicWidthP()
public void setTicPosition(int tpos)
POSITIVE_SIDE
,
NEGATIVE_SIDE
, or BOTH_SIDES
.
tpos
- tic positionpublic int getTicPosition()
public void setLabelPosition(int labp)
POSITIVE_SIDE
,
NEGATIVE_SIDE
, and NO_LABEL
.
labp
- label position.public int getLabelPosition()
public void setLabelFont(java.awt.Font fnt)
fnt
- label fontpublic java.awt.Font getLabelFont()
public void setLineColor(java.awt.Color color)
color
- line and tick colorpublic java.awt.Color getLineColor()
public void setLabelColor(java.awt.Color color)
color
- label colorpublic java.awt.Color getLabelColor()
public void setLabelHeightP(double lhgt)
lhgt
- label height.public double getLabelHeightP()
public void setTitle(SGLabel title)
title
- axis titlepublic SGLabel getTitle()
public void setRangeP(Range2D pr)
Transform
s.
If no Transform
s are registered, the setRangeP
method has no effect.
pr
- physcial rangepublic Range2D getRangeP()
CartesianGraph
object and attached Transform
.
public void setId(java.lang.String id)
id
- identifierpublic java.lang.String getId()
public void setOrientation(int or)
HORIZONATAL
and VERTICAL
.
or
- orientationpublic int getOrientation()
public boolean isSpace()
public boolean isTime()
public abstract java.awt.Rectangle getBounds()
getBounds
in interface Selectable
public java.lang.String toString()
String
representation of the Axis
.
toString
in class java.lang.Object
String
representationpublic void setSelected(boolean sel)
Selectable
setSelected
in interface Selectable
sel
- true if selected, false if not.public boolean isSelected()
isSelected
in interface Selectable
public void setSelectable(boolean select)
setSelectable
in interface Selectable
select
- if true object is selectablepublic boolean isSelectable()
isSelectable
in interface Selectable
public boolean isVisible()
public void setVisible(boolean visible)
public abstract void setLocationU(SoTPoint pt)
public abstract SoTPoint getSoTLocationU()
public abstract void setRangeU(SoTRange range)
public abstract SoTRange getSoTRangeU()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |