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 AttributeListattributesprotected Aaxisprotected SgtPlotFunctions.AxisTypetypeFields 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 voidattributeUpdated(AttributeEvent e)Called when an Attribute's value has been updated.intgetAutoInterval()Returns the number of intervals to use when constructing an automatic range.AgetAxis()Returns the SGT axis.java.lang.StringgetLabel()gov.noaa.pmel.util.SoTValuegetOrigin()Returns the origin of this axis, which depends on its range and its position.java.lang.StringgetPosition()Returns the position of this axis, relative to the graph.gov.noaa.pmel.util.SoTRangegetRange()Returns the X axis range, from a string of the formjava.lang.StringgetTreeLabel()Returns the label text to appear in a tree node.SgtPlotFunctions.AxisTypegetType()Returns the type of this axis; one of: X YbooleanisAutoRange()Indicates whether this axis automatically adjusts its range to its data.booleanisFlushToMain()Determines whether this axis should appear flush with the main opposing axis.booleanisReversed()Determines whether the ordinates on this axis are reversed.voidsetFlushToMain(boolean b)Sets whether this axis should appear flush with the main opposing axis.voidsetLabel(java.lang.String label)Set the label for the axis.voidsetLocation(double x, double y)Sets the origin of this axis, in physical coordinates.voidsetLocation(gov.noaa.pmel.util.SoTPoint p)Sets the origin of this axis, in physical coordinates.voidsetPosition(java.lang.String pos)voidsetRange(gov.noaa.pmel.util.SoTRange range)Sets this axis's range fromrange.voidsetRange(gov.noaa.pmel.util.SoTRange range, boolean listeners)Sets this axis's range fromrange.voidsetReversed(boolean b)Sets whether this axis' ordinates are reversed.voidsetTreeNode(InterfaceTreeNode treeNode)Sets the children for this node'sInterfaceTreeNode.voidupdate()Updates the appearance of this axis from its attributes.Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, getName, isDestroyed, issueTreeNode, setName, updateTreeNodesMethods 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:AttributeListenerCalled when an Attribute's value has been updated.- Specified by:
attributeUpdatedin 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:TreeObjectReturns the label text to appear in a tree node.- Specified by:
getTreeLabelin interfaceTreeObject- Overrides:
getTreeLabelin 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:TreeObjectSets the children for this node'sInterfaceTreeNode.- Specified by:
setTreeNodein interfaceTreeObject- Overrides:
setTreeNodein 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:
-