Package hec.gfx2d

Class AxisLabel

All Implemented Interfaces:
G2dToolbarListener, ImageObserver, MenuContainer, Serializable, Observer, Accessible, UnitsComponent

public class AxisLabel extends G2dLabel implements Observer, UnitsComponent
A component that displays the label of an Axis.
See Also:
  • Constructor Details

    • AxisLabel

      public AxisLabel(G2dPanel p, Axis ax, int align)
      Drawing properties
  • Method Details

    • getPopupMenuTitle

      protected String getPopupMenuTitle()
      Overrides:
      getPopupMenuTitle in class G2dLabel
    • setDisplayUnitsSystem

      public void setDisplayUnitsSystem(int units)
      Sets the display unit system for this label. This allows the Axis Label to replace Units Templates with the correct unit string values. If this value is undefined the units template will be replaced with a blank string.
      Specified by:
      setDisplayUnitsSystem in interface UnitsComponent
      Parameters:
      units - a valid units system such as ENGLISH_ID,SI_ID, or UNDEF_ID
    • setDisplayScaleFactor

      public void setDisplayScaleFactor(int paramId, double scaleFactor)
      Sets the scaling factor for the data. The radio button does not render data but rather renders a units string in a given unit system so this method is defined, but un-implemented
      Specified by:
      setDisplayScaleFactor in interface UnitsComponent
      Parameters:
      scaleFactor -
      paramId - This is the identifier of the paramater to scale. If the data is not of this type then it is ignored
    • getDisplayUnitsString

      public String getDisplayUnitsString(int v)
      Description copied from interface: UnitsComponent
      This method allows the retrieves the units string for a given units system
      Specified by:
      getDisplayUnitsString in interface UnitsComponent
      See Also:
    • update

      public void update(Observable o, Object arg)
      Specified by:
      update in interface Observer
      Overrides:
      update in class G2dLabel
    • objectPopupMenu

      public boolean objectPopupMenu(LocalPt pt, int modifiers)
      Overrided here to disable the object popup menu for the Axis Labels. The properties editor panels are now in the AxisTics popup menu.
      Overrides:
      objectPopupMenu in class G2dLabel
      Parameters:
      pt -
      modifiers -
      Returns:
    • editProperties

      public void editProperties()
      Overrides:
      editProperties in class G2dLabel
    • getPreferredSizeLocal

      public Dimension getPreferredSizeLocal()
      Description copied from class: G2dLabel
      Compute the preferred size based on label size and orientation
      Overrides:
      getPreferredSizeLocal in class G2dLabel
      Returns:
      Dimension preferred sized of the component
    • paintGfx

      public void paintGfx(Graphics g)
      Paints this label to a given graphics context. Any units templates are removed and replaced with the correct units string.
      Overrides:
      paintGfx in class G2dLabel
      Parameters:
      g - the graphics context to draw to.
    • getTextSubstitutionObjects

      public Object[] getTextSubstitutionObjects()
      Overrides:
      getTextSubstitutionObjects in class G2dLabel