Package hec.gfx2d

Class AxisTics

All Implemented Interfaces:
G2dToolbarListener, G2dZoomComponent, ImageObserver, MenuContainer, Serializable, Observer, Accessible
Direct Known Subclasses:
CategoryAxisTics, LogAxisTics, ProbabilityAxisTics, TSAxisTics

public class AxisTics extends G2dComponent implements Observer, G2dZoomComponent
Graphic Component that displays tic marks and tic labels for an Axis.
See Also:
  • Constructor Details

  • Method Details

    • setAxis

      public void setAxis(Axis axis)
    • getViewport

      public Viewport getViewport()
    • buildMenu

      protected void buildMenu(Container c)
    • setLinear

      public void setLinear()
    • setLogarithmic

      public void setLogarithmic()
    • setLogarithmic

      public void setLogarithmic(AxisTics.AxisSwapValidator validator)
    • computeRatingFromOpositeAxis

      @Deprecated public void computeRatingFromOpositeAxis()
      Deprecated.
      See following method with correct spelling
    • computeRatingFromOppositeAxis

      public void computeRatingFromOppositeAxis()
      This method only works when in the RIGHT alignment position
    • createPopupMenu

      public void createPopupMenu()
      Overrides:
      createPopupMenu in class G2dComponent
    • createEditMenu

      public JMenu createEditMenu()
    • setProperties

      public void setProperties(AxisTicsDrawProp prop)
    • getProperties

      public AxisTicsDrawProp getProperties()
    • update

      public void update(Observable o, Object arg)
      Specified by:
      update in interface Observer
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • getPreferredSizeLocal

      public Dimension getPreferredSizeLocal()
      Overrides:
      getPreferredSizeLocal in class G2dComponent
    • paintGfx

      public void paintGfx(Graphics g)
      Description copied from class: G2dComponent
      Paints the contents of the panel.
      Overrides:
      paintGfx in class G2dComponent
    • drawTicsRight

      protected void drawTicsRight(Graphics g)
    • drawTicsLeft

      protected void drawTicsLeft(Graphics g)
    • drawTicsTop

      protected void drawTicsTop(Graphics g)
    • drawTicsBottom

      protected void drawTicsBottom(Graphics g)
    • drawAxisLabelsBottom

      protected void drawAxisLabelsBottom(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc)
    • drawAxisLabelsTop

      protected void drawAxisLabelsTop(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc)
    • getAxis

      public Axis getAxis()
      Returns a reference to the axis that this object draws.
    • setFontSizes

      public void setFontSizes(int sz, int tiny, int min, int max)
    • getFontSizes

      public int[] getFontSizes()
      get the fonts sizes used by this label
      Returns:
      [0] the normal font size
      [1] the tiny font size
      [2] the min font size
      [3] the max font size
    • objectPopupMenu

      public boolean objectPopupMenu(LocalPt pt, int modifiers)
      Overrides:
      objectPopupMenu in class G2dComponent
    • getToolTipText

      public String getToolTipText(MouseEvent e)
      Returns a tool tip text for the given mouse location. In this method we loop over the glyphs and see if they have any tool tips. The first one that has one is returned;
      Overrides:
      getToolTipText in class G2dComponent
    • getCanSwapAxis

      protected boolean getCanSwapAxis()
    • getAxisSwapped

      protected boolean getAxisSwapped()
    • translateFromAlignmentToAxisPosition

      protected int translateFromAlignmentToAxisPosition(int alignment)
    • editProperties

      public void editProperties()
      Overrides:
      editProperties in class G2dComponent
    • editProperties

      public void editProperties(int selectedTab)
    • getPropertiesOKListener

      public hec.gfx2d.AxisTics.PropertiesOKListener getPropertiesOKListener(ScalePropertiesPanel scalePanel, G2dAxisLabelPropertiesPanel labelPanel)
    • zoomIn

      public void zoomIn(LocalRect rc)
      Zooms the axis to the bounds of the local rectangle. The local rectangle is in the coorinate system of the AxisTics.
      Specified by:
      zoomIn in interface G2dZoomComponent
      Parameters:
      rc - - the rectangle of the new zoom area in local coordinates
    • zoomByFactor

      public void zoomByFactor(double factor)
      Description copied from interface: G2dZoomComponent
      Defines a new zoom region by a given factor
      Specified by:
      zoomByFactor in interface G2dZoomComponent
    • setMajorTicsVisible

      public void setMajorTicsVisible(boolean state)
      set the the visibility of major tics
    • setDrawMajorTicsOn

      @Deprecated public void setDrawMajorTicsOn()
      Deprecated.
      set the major tics to draw
    • setDrawMajorTicsOff

      @Deprecated public void setDrawMajorTicsOff()
      Deprecated.
      set the major tics not to draw
    • areMajorTicsVisible

      public boolean areMajorTicsVisible()
      get whether the major tics are visible
      Returns:
      whether the major tics are visible
    • areMajorTicsDrawn

      @Deprecated public boolean areMajorTicsDrawn()
      Deprecated.
      get whether the major tics are drawn
    • setMajorTicLabelsVisible

      public void setMajorTicLabelsVisible(boolean state)
      set the visibility of major tic labels
    • setDrawMajorTicLabelsOn

      @Deprecated public void setDrawMajorTicLabelsOn()
      Deprecated.
      set the major tic labels to draw
    • setDrawMajorTicLabelsOff

      @Deprecated public void setDrawMajorTicLabelsOff()
      Deprecated.
      set the major tic labels not to draw
    • areMajorTicLabelsVisible

      public boolean areMajorTicLabelsVisible()
      get whether the major tic labels are visible
      Returns:
      whether the major tic labels are visible
    • areMajorTicLabelsDrawn

      @Deprecated public boolean areMajorTicLabelsDrawn()
      Deprecated.
      get whether the major tic labels are drawn
    • setMinorTicsVisible

      public void setMinorTicsVisible(boolean state)
      set the the visibility of minor tics
    • setDrawMinorTicsOn

      @Deprecated public void setDrawMinorTicsOn()
      Deprecated.
      set the minor tics to draw
    • setDrawMinorTicsOff

      @Deprecated public void setDrawMinorTicsOff()
      Deprecated.
      set the minor tics not to draw
    • areMinorTicsVisible

      public boolean areMinorTicsVisible()
      get whether the minor tics are visible
      Returns:
      whether the minor tics are visible
    • areMinorTicsDrawn

      @Deprecated public boolean areMinorTicsDrawn()
      Deprecated.
      get whether the minor tics are drawn
    • setMinorTicLabelsVisible

      public void setMinorTicLabelsVisible(boolean state)
      set the visibility of minor tic labels
    • setDrawMinorTicLabelsOn

      @Deprecated public void setDrawMinorTicLabelsOn()
      Deprecated.
      set the minor tic labels to draw
    • setDrawMinorTicLabelsOff

      @Deprecated public void setDrawMinorTicLabelsOff()
      Deprecated.
      set the minor tic labels not to draw
    • areMinorTicLabelsVisible

      public boolean areMinorTicLabelsVisible()
      get whether the minor tic labels are visible
      Returns:
      whether the minor tic labels are visible
    • areMinorTicLabelsDrawn

      @Deprecated public boolean areMinorTicLabelsDrawn()
      Deprecated.
      get whether the minor tic labels are drawn
    • setMajorTicLength

      public void setMajorTicLength(int ticLength)
      set the major tic length
      Parameters:
      ticLength - the major tic length
    • getMajorTicLength

      public int getMajorTicLength()
      get the major tic length
      Returns:
      the major tic length
    • setMinorTicLength

      public void setMinorTicLength(int ticLength)
      set the minor tic length
      Parameters:
      ticLength - the minor tic length
    • getMinorTicLength

      public int getMinorTicLength()
      get the minor tic length
      Returns:
      the minor tic length
    • setAxisTicColor

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

      public Color getAxisTicColor()
      get the Axis Tic Color
      Returns:
      the Axis Tic color
    • getAxisTicColorString

      public String getAxisTicColorString()
      get the Axis Tic Color as a String
      Returns:
      the Axis Tic color string
    • getMaxBounds

      protected WorldRect getMaxBounds()