Class ShadeAxis


  • public class ShadeAxis
    extends java.lang.Object
    Graphical representation of aux shading range which can be placed near the plot.
    Since:
    13 Feb 2013
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadeAxis​(Shader shader, Scaler scaler, java.lang.String label, Captioner captioner, double crowding, int rampWidth)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.swing.Icon createAxisIcon​(java.awt.Rectangle rampBounds)
      Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers).
      double getCrowding()
      Returns the crowding factor for this axis.
      double getDataHigh()
      Returns the maximum data value represented on this axis.
      double getDataLow()
      Returns the minimum data value represented on this axis.
      int getEndPadding()
      Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels.
      java.lang.String getLabel()
      Returns the text label for this axis.
      java.awt.Insets getRampInsets​(java.awt.Rectangle rampBounds)
      Returns the insets that the bounds icon would like to have for annotating the axis given the dimensions of the actual scale ramp graphic.
      int getRampWidth()
      Preferred number of pixels in the lateral direction for the axis colour ramp.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadeAxis

        public ShadeAxis​(Shader shader,
                         Scaler scaler,
                         java.lang.String label,
                         Captioner captioner,
                         double crowding,
                         int rampWidth)
        Constructor.
        Parameters:
        shader - object performing the actual shading
        scaler - maps data values to unit range
        label - axis label
        captioner - text rendering object
        crowding - 1 for normal tick density, lower for fewer labels, higher for more
        rampWidth - preferred number of pixels in the lateral direction for the the ramp icon; this value is not used by this class, but this class serves as a useful place to keep it
    • Method Detail

      • createAxisIcon

        @Equality
        public javax.swing.Icon createAxisIcon​(java.awt.Rectangle rampBounds)
        Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers). The supplied rectangle gives the dimensions of the actual scale ramp, not including annotations.
        Parameters:
        rampBounds - ramp position
        Returns:
        axis icon, with equality semantics
      • getRampInsets

        public java.awt.Insets getRampInsets​(java.awt.Rectangle rampBounds)
        Returns the insets that the bounds icon would like to have for annotating the axis given the dimensions of the actual scale ramp graphic.
        Parameters:
        rampBounds - ramp position
        Returns:
        insets surrounding rampBounds required for annotation
      • getEndPadding

        public int getEndPadding()
        Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels. This is currently half the height of a digit caption.
        Returns:
        ramp icon vertical padding for labels
      • getRampWidth

        public int getRampWidth()
        Preferred number of pixels in the lateral direction for the axis colour ramp. Not enforced by any behaviour of this class.
        Returns:
        preferred ramp width
      • getDataLow

        public double getDataLow()
        Returns the minimum data value represented on this axis.
        Returns:
        data lower limit
      • getDataHigh

        public double getDataHigh()
        Returns the maximum data value represented on this axis.
        Returns:
        data upper limit
      • getLabel

        public java.lang.String getLabel()
        Returns the text label for this axis.
        Returns:
        axis label
      • getCrowding

        public double getCrowding()
        Returns the crowding factor for this axis.
        Returns:
        1 for normal tick density, lower for fewer labels, higher for more