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 form
    java.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 Y
    boolean 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 from range.
    void setRange​(gov.noaa.pmel.util.SoTRange range, boolean listeners)
    Sets this axis's range from range.
    void setReversed​(boolean b)
    Sets whether this axis' ordinates are reversed.
    void setTreeNode​(InterfaceTreeNode treeNode)
    Sets the children for this node's InterfaceTreeNode.
    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

  • Constructor Details

  • Method Details

    • attributeUpdated

      public void attributeUpdated​(AttributeEvent e)
      Description copied from interface: AttributeListener
      Called when an Attribute's value has been updated.
      Specified by:
      attributeUpdated in interface AttributeListener
    • update

      public void update() throws PlotException
      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

      public SgtPlotFunctions.AxisType 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 interface TreeObject
      Overrides:
      getTreeLabel in class AbstractInterfaceObject
      Returns:
    • getAxis

      public A getAxis()
      Returns the SGT axis.
      Returns:
    • setRange

      public void setRange​(gov.noaa.pmel.util.SoTRange range)
      Sets this axis's range from range.
      Parameters:
      range -
    • setRange

      public void setRange​(gov.noaa.pmel.util.SoTRange range, boolean listeners)
      Sets this axis's range from range.
      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

      public void setTreeNode​(InterfaceTreeNode treeNode)
      Description copied from interface: TreeObject
      Sets the children for this node's InterfaceTreeNode.
      Specified by:
      setTreeNode in interface TreeObject
      Overrides:
      setTreeNode in class AbstractInterfaceObject
    • 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: