Package mgui.interfaces.plots.sgt
Class SgtAxis<A extends gov.noaa.pmel.sgt.Axis>
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.plots.sgt.SgtAxis<A>
- All Implemented Interfaces:
AttributeListener
,InterfaceObject
,NamedObject
,TreeObject
,CleanableObject
public class SgtAxis<A extends gov.noaa.pmel.sgt.Axis> extends AbstractInterfaceObject implements AttributeListener
Interface for displaying an axis on a plot. Holds an SGT axis objects and allows
display attributes to be specified for it.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected AttributeList
attributes
protected A
axis
protected SgtPlotFunctions.AxisType
type
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes
-
Constructor Summary
Constructors Constructor Description SgtAxis(java.lang.String name, A axis, SgtPlotFunctions.AxisType type)
-
Method Summary
Modifier and Type Method Description void
attributeUpdated(AttributeEvent e)
Called when an Attribute's value has been updated.int
getAutoInterval()
Returns the number of intervals to use when constructing an automatic range.A
getAxis()
Returns the SGT axis.java.lang.String
getLabel()
gov.noaa.pmel.util.SoTValue
getOrigin()
Returns the origin of this axis, which depends on its range and its position.java.lang.String
getPosition()
Returns the position of this axis, relative to the graph.gov.noaa.pmel.util.SoTRange
getRange()
Returns the X axis range, from a string of the formjava.lang.String
getTreeLabel()
Returns the label text to appear in a tree node.SgtPlotFunctions.AxisType
getType()
Returns the type of this axis; one of: X Yboolean
isAutoRange()
Indicates whether this axis automatically adjusts its range to its data.boolean
isFlushToMain()
Determines whether this axis should appear flush with the main opposing axis.boolean
isReversed()
Determines whether the ordinates on this axis are reversed.void
setFlushToMain(boolean b)
Sets whether this axis should appear flush with the main opposing axis.void
setLabel(java.lang.String label)
Set the label for the axis.void
setLocation(double x, double y)
Sets the origin of this axis, in physical coordinates.void
setLocation(gov.noaa.pmel.util.SoTPoint p)
Sets the origin of this axis, in physical coordinates.void
setPosition(java.lang.String pos)
void
setRange(gov.noaa.pmel.util.SoTRange range)
Sets this axis's range fromrange
.void
setRange(gov.noaa.pmel.util.SoTRange range, boolean listeners)
Sets this axis's range fromrange
.void
setReversed(boolean b)
Sets whether this axis' ordinates are reversed.void
setTreeNode(InterfaceTreeNode treeNode)
Sets the children for this node'sInterfaceTreeNode
.void
update()
Updates the appearance of this axis from its attributes.Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, getName, isDestroyed, issueTreeNode, setName, updateTreeNodes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
axis
-
attributes
-
type
-
-
Constructor Details
-
SgtAxis
-
-
Method Details
-
attributeUpdated
Description copied from interface:AttributeListener
Called when an Attribute's value has been updated.- Specified by:
attributeUpdated
in interfaceAttributeListener
-
update
Updates the appearance of this axis from its attributes.- Throws:
PlotException
-
isReversed
public boolean isReversed()Determines whether the ordinates on this axis are reversed.- Returns:
-
setReversed
public void setReversed(boolean b)Sets whether this axis' ordinates are reversed.- Parameters:
b
-
-
isFlushToMain
public boolean isFlushToMain()Determines whether this axis should appear flush with the main opposing axis.- Returns:
-
setFlushToMain
public void setFlushToMain(boolean b)Sets whether this axis should appear flush with the main opposing axis.- Parameters:
b
-
-
setLocation
public void setLocation(double x, double y)Sets the origin of this axis, in physical coordinates.- Parameters:
x
-y
-
-
setLocation
public void setLocation(gov.noaa.pmel.util.SoTPoint p)Sets the origin of this axis, in physical coordinates.- Parameters:
x
-y
-
-
getType
Returns the type of this axis; one of:- X
- Y
- Returns:
-
getPosition
public java.lang.String getPosition()Returns the position of this axis, relative to the graph.- Returns:
-
setPosition
public void setPosition(java.lang.String pos) -
getOrigin
public gov.noaa.pmel.util.SoTValue getOrigin()Returns the origin of this axis, which depends on its range and its position.- Returns:
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObject
Returns the label text to appear in a tree node.- Specified by:
getTreeLabel
in interfaceTreeObject
- Overrides:
getTreeLabel
in classAbstractInterfaceObject
- Returns:
-
getAxis
Returns the SGT axis.- Returns:
-
setRange
public void setRange(gov.noaa.pmel.util.SoTRange range)Sets this axis's range fromrange
.- Parameters:
range
-
-
setRange
public void setRange(gov.noaa.pmel.util.SoTRange range, boolean listeners)Sets this axis's range fromrange
.- Parameters:
range
-whether
- to fire attribute listeners
-
getRange
public gov.noaa.pmel.util.SoTRange getRange()Returns the X axis range, from a string of the form[min] [max] [step]
- Returns:
-
setTreeNode
Description copied from interface:TreeObject
Sets the children for this node'sInterfaceTreeNode
.- Specified by:
setTreeNode
in interfaceTreeObject
- Overrides:
setTreeNode
in classAbstractInterfaceObject
-
setLabel
public void setLabel(java.lang.String label)Set the label for the axis.- Parameters:
label
-
-
getLabel
public java.lang.String getLabel() -
isAutoRange
public boolean isAutoRange()Indicates whether this axis automatically adjusts its range to its data.- Returns:
-
getAutoInterval
public int getAutoInterval()Returns the number of intervals to use when constructing an automatic range.- Returns:
-