Package hec.geometry

Class Axis

All Implemented Interfaces:
AdjustmentListener, Serializable, EventListener
Direct Known Subclasses:
CategoryAxis, LogAxis, ProbabilityAxis, TSAxis

public class Axis extends Observable implements AdjustmentListener, Serializable
A single coordinate axis.
See Also:
  • Field Details

  • Constructor Details

    • Axis

      public Axis(String n)
      Default Constructor
      Parameters:
      n -
  • Method Details

    • getType

      public int getType()
    • setMinMax

      public void setMinMax(double min, double max)
    • setScaleLimits

      public void setScaleLimits(double min, double max)
    • getOrigin

      public double getOrigin()
    • getScaleMin

      public double getScaleMin()
    • getScaleMax

      public double getScaleMax()
    • setViewLimits

      public void setViewLimits(double min, double max)
    • getViewMin

      public double getViewMin()
    • getViewMax

      public double getViewMax()
    • unZoom

      public void unZoom()
    • setRatingFunction

      public void setRatingFunction(RatingFunction f)
      Sets a rating function for the axis. This value can be null to turn off axis rating.
      Parameters:
      f - the function to set.
    • setRatingFunction

      public void setRatingFunction(RatingFunction f, boolean axisObjectRating)
      Sets a rating function for the axis. This value can be null to turn off axis rating.
      Parameters:
      f - the function to set.
      axisObjectRating - true if this rating function is based on exsiting data or false if it was user entered or another type of rating. Needed when saving properties because the next time around the rating be generated by the existing objects
    • getRatingFunction

      public RatingFunction getRatingFunction()
    • rateAxis

      public boolean rateAxis()
    • getRatedValue

      protected double getRatedValue(double baseValue)
    • getUnRatedValue

      protected double getUnRatedValue(double ratedValue)
    • getObserverList

      public Vector getObserverList()
    • addObserver

      public void addObserver(Observer o)
      Overrides:
      addObserver in class Observable
    • deleteObserver

      public void deleteObserver(Observer o)
      Overrides:
      deleteObserver in class Observable
    • deleteObservers

      public void deleteObservers()
      Overrides:
      deleteObservers in class Observable
    • getOldDisplayUnitSystem

      public int getOldDisplayUnitSystem()
    • setDisplayUnitSystem

      public void setDisplayUnitSystem(int system)
    • setDataUnitSystem

      public void setDataUnitSystem(int system)
    • setParameterId

      public void setParameterId(int id)
    • setDisplayScaleFactor

      public void setDisplayScaleFactor(int paramId, double scale)
    • getDisplayUnitSystem

      public int getDisplayUnitSystem()
    • getDataUnitSystem

      public int getDataUnitSystem()
    • getParameterId

      public int getParameterId()
    • isReversed

      public boolean isReversed()
    • getDisplayUnitsString

      public String getDisplayUnitsString(int system)
    • setAxisProp

      public void setAxisProp(AxisProp prop)
    • setDefaultExtents

      protected void setDefaultExtents(double min, double max)
    • getThousScale

      public double getThousScale()
    • getThousPow

      public double getThousPow()
    • getSigFig

      public int getSigFig()
    • setMaximumFactionDigits

      public void setMaximumFactionDigits(int numDigits)
    • computeScrollPosition

      public int computeScrollPosition()
      Computes an integer value based on the max/min and the current view max/min that represents a position on a scroll bar
      Returns:
    • adjustmentValueChanged

      public void adjustmentValueChanged(AdjustmentEvent e)
      Specified by:
      adjustmentValueChanged in interface AdjustmentListener
    • updateRatedFunctionScroll

      public void updateRatedFunctionScroll(Axis baseAxis, AdjustmentEvent e)
    • zoomInUnMod

      public void zoomInUnMod(double wmin, double wmax)
      Zooms based on world coordinates
      Parameters:
      wmin -
      wmax -
    • zoomIn

      public void zoomIn(double wmin, double wmax)
      Zooms based on world coordinates
      Parameters:
      wmin -
      wmax -
    • zoomIn

      public void zoomIn(int imin, int imax)
      Zooms in based on local coordinates
      Parameters:
      imin -
      imax -
    • zoomByFactor

      public void zoomByFactor(double factor)
      Change the zoom scaling by the given factor
      Parameters:
      factor -
    • computeAutoViewValues

      protected void computeAutoViewValues()
    • setReversedOn

      @Deprecated public void setReversedOn()
      Deprecated.
    • setReversedOff

      @Deprecated public void setReversedOff()
      Deprecated.
    • setReversed

      public void setReversed(boolean r)
    • getReversed

      public boolean getReversed()
      Returns:
      * @deprecated
    • setNumTicLabelLevels

      public void setNumTicLabelLevels(int r)
    • getNumTicLabelLevels

      public int getNumTicLabelLevels()
    • setLabel

      public void setLabel(String label)
    • getLabel

      public String getLabel()
    • pushLabel

      public void pushLabel()
    • popLabel

      public void popLabel()
    • getName

      public String getName()
    • setName

      public void setName(String n)
    • getScaledLabel

      public String getScaledLabel()
    • getZoom

      public double getZoom()
    • getWorldRange

      public double getWorldRange()
    • invalidateWorldExtents

      public void invalidateWorldExtents()
    • setWorldExtents

      public void setWorldExtents(double min, double max)
    • setWorldMinExtent

      public void setWorldMinExtent(double min)
    • growWorldExtents

      public void growWorldExtents(double min, double max)
    • getWorldExtents

      public WorldPt getWorldExtents()
    • getMin

      public double getMin()
    • getMax

      public double getMax()
      Returns the maximum value for this axis. This differes from the data max because the data max may be 9.75 and the Axis displays a max value of 10.
      Returns:
    • getDataMax

      public double getDataMax()
      Returns the maximum data value for the axis.
      Returns:
    • getDataMin

      public double getDataMin()
      Returns the minimum data value for the axis.
      Returns:
    • getActMin

      public double getActMin()
    • getActMax

      public double getActMax()
    • getMajorTic

      public double getMajorTic()
    • getMinorTic

      public double getMinorTic()
    • getAxisProp

      public AxisProp getAxisProp()
    • computeScaling

      public void computeScaling(double min, double max)
      computes the scaling based on the min and max values in world coordinates
      Parameters:
      min -
      max -
    • computeScaling

      public void computeScaling()
    • computeScaling

      public void computeScaling(int iview)
    • w2l

      public int w2l(double w)
      returns the local value for the given world value
      Parameters:
      w -
      Returns:
    • w2lE

      public double w2lE(double w)
      returns the local value for the given world value
      Parameters:
      w -
      Returns:
    • l2w

      public double l2w(int l)
      returns the world value for the given local value
      Parameters:
      l -
      Returns:
    • l2wE

      public double l2wE(double l)
      returns the world value for the given local value
      Parameters:
      l -
      Returns:
    • computeNiceMinMax

      public void computeNiceMinMax()
      Find a nice tic interval
    • computeTicInterval

      public void computeTicInterval()
      Find a nice tic interval
    • getTicColor

      public Color getTicColor()
      get the color of the tics
      Returns:
      the tic color
    • getTicColorString

      public String getTicColorString()
      get the color of the tics as a String
      Returns:
      the tic color string
    • setTicColor

      public void setTicColor(String colorString)
      set the tic color to the color represented by colorString
      Parameters:
      colorString - the color to set the tics to
    • setTicColor

      public void setTicColor(Color c)
      set the tic color
      Parameters:
      c - the new tic color
    • getTicTextColor

      public Color getTicTextColor()
      get the tic text color
      Returns:
      the tic text color
    • getTicTextColorString

      public String getTicTextColorString()
      get the tic text color as a String
      Returns:
      the tic text color String
    • setTicTextColor

      public void setTicTextColor(String colorString)
      set the tic text color to the color represented by colorString
      Parameters:
      colorString - the color to set the tic text to
    • setTicTextColor

      public void setTicTextColor(Color c)
      set the tic text color to c
      Parameters:
      c - the new tic text color
    • setUseDefaultLimitsOn

      public void setUseDefaultLimitsOn()
      set this Axis to use defaults limits
    • setUseDefaultLimitsOff

      public void setUseDefaultLimitsOff()
      set this Axis not to use defaults limits
    • isUsingDefaultLimits

      public boolean isUsingDefaultLimits()
      get whether this Axis is using it's default limits
      Returns:
    • setMinimumLimit

      public void setMinimumLimit(double min)
      set the minimum limit for this Axis to min
      Parameters:
      min - the new minimum limit
    • setMaximumLimit

      public void setMaximumLimit(double max)
      set the maximum limit for this Axis to max
      Parameters:
      max - the new maximum limit
      See Also:
    • setMajorTicInterval

      public void setMajorTicInterval(double interval)
      set the major tic interval for this Axis to interval
      Parameters:
      interval - the new major tic interval
      See Also:
    • setMinorTicInterval

      public void setMinorTicInterval(double interval)
      set the minor tic interval for this Axis to interval
      Parameters:
      interval - the new minor tic interval
      See Also:
    • setNumberOfTicLabelLayers

      public void setNumberOfTicLabelLayers(int layers)
      set the numver of tic label layers to layers max number of tic label layers. -1 is unrestricted. Most important for time series axis.
      Parameters:
      layers - the number of tic label layers
      See Also:
    • setActualMaximumValue

      public void setActualMaximumValue(double value)
      set the actual maximum value for this Axis to value
      Parameters:
      value - the new maximum value
      See Also:
    • setOrigin

      public void setOrigin(double origin)
    • setActualMinimumValue

      public void setActualMinimumValue(double value)
      set the actual minimum value for this Axis to value
      Parameters:
      value - the new minimum value
      See Also:
    • setAutomaticMaximumOn

      public void setAutomaticMaximumOn()
      set the Axis to use the maximum value from it's DataSets
      See Also:
    • setAutomaticMaximumOff

      public void setAutomaticMaximumOff()
      set the Axis to use the user supplied maximum value
      See Also:
    • setAutomaticMinimumOn

      public void setAutomaticMinimumOn()
      set the Axis to use the minimum value from it's DataSets
      See Also:
    • isUsingAutomaticMinimum

      public boolean isUsingAutomaticMinimum()
    • setAutomaticMinimumOff

      public void setAutomaticMinimumOff()
      set the Axis to use the user supplied minimum value
      See Also:
    • setAutomaticViewMaximumOn

      public void setAutomaticViewMaximumOn()
    • isUsingAutomaticMaximum

      public boolean isUsingAutomaticMaximum()
    • setAutomaticViewMaximumOff

      public void setAutomaticViewMaximumOff()
    • isUsingAutomaticViewMaximum

      public boolean isUsingAutomaticViewMaximum()
    • setAutomaticViewMinimumOn

      public void setAutomaticViewMinimumOn()
    • setAutomaticViewMinimumOff

      public void setAutomaticViewMinimumOff()
    • isUsingAutomaticViewMinimum

      public boolean isUsingAutomaticViewMinimum()
    • setComputeMajorTics

      public void setComputeMajorTics(boolean state)
      Parameters:
      state - true to autocompute tics
      See Also:
    • setComputeMajorTicsOn

      @Deprecated public void setComputeMajorTicsOn()
      Deprecated.
    • setComputeMajorTicsOff

      @Deprecated public void setComputeMajorTicsOff()
      Deprecated.
    • isComputingMajorTics

      public boolean isComputingMajorTics()
    • setComputeMinorTics

      public void setComputeMinorTics(boolean state)
      Parameters:
      state -
      See Also:
    • setComputeMinorTicsOn

      @Deprecated public void setComputeMinorTicsOn()
      Deprecated.
    • setComputeMinorTicsOff

      @Deprecated public void setComputeMinorTicsOff()
      Deprecated.
    • isComputingMinorTics

      public boolean isComputingMinorTics()
    • growToGlyphBounds

      public void growToGlyphBounds(double min, double max)
    • setUnit

      public void setUnit(String unit)