Interface IScaleProvider

All Known Implementing Classes:
Axis, DAxis, LinearScale

public interface IScaleProvider
Provides a scale for drawing tick marks. This allows the scale to draw tick marks different to the range which the scale is operating over.
  • Method Details

    • getFont

      org.eclipse.swt.graphics.Font getFont()
      Returns:
      font
    • getForegroundColor

      org.eclipse.swt.graphics.Color getForegroundColor()
      Returns:
      foreground color
    • isLogScaleEnabled

      boolean isLogScaleEnabled()
      Returns:
      True if log scale is enabled
    • getScaleRange

      Range getScaleRange()
      Returns:
      scale range
    • isDateEnabled

      boolean isDateEnabled()
      Returns:
      True if date is enabled
    • format

      java.lang.String format​(java.lang.Object obj)
      Formats the given object as a DateFormat if Date is enabled or as a DecimalFormat. This is based on an internal format pattern given the object in parameter.
      Parameters:
      obj - the object
      Returns:
      the formatted string
    • format

      java.lang.String format​(java.lang.Object obj, boolean minOrMaxDate)
      Formats the given object as a DateFormat if Date is enabled or as a DecimalFormat. This is based on an internal format pattern given the object in parameter. When formatting a date, if minOrMaxDate is true as well as autoFormat, then the SimpleDateFormat us used to format the object.
      Parameters:
      obj - the object
      minOrMaxDate - true if it is the min or max date on the scale.
      Returns:
      the formatted string
    • isAutoFormat

      boolean isAutoFormat()
      Returns:
      True if auto format is on
    • setAutoFormat

      void setAutoFormat​(boolean autoFormat)
      Parameters:
      autoFormat - the autoFormat to set
    • getFormatPattern

      java.lang.String getFormatPattern()
      Returns:
      format pattern string
    • getMargin

      int getMargin()
      Returns:
      margin
    • isHorizontal

      boolean isHorizontal()
      Returns:
      True if scale is horizontal
    • getMajorGridStep

      double getMajorGridStep()
      Returns:
      major grid step
    • getMajorTickMarkStepHint

      int getMajorTickMarkStepHint()
      Returns:
      major tick mark step hint
    • getMinorTickMarkStepHint

      int getMinorTickMarkStepHint()
      Returns:
      minor tick mark step hint
    • getTimeUnit

      int getTimeUnit()
      Returns:
      time unit
    • getLength

      int getLength()
      Returns:
      length
    • getDimension

      org.eclipse.draw2d.geometry.Dimension getDimension​(java.lang.Object obj)
      Parameters:
      obj -
      Returns:
      dimension of object that has been formatted as a string in current font
    • isPrimary

      boolean isPrimary()
      Returns:
      true if axis is a primary one (i.e. left for y and bottom for x)
    • hasTicksAtEnds

      boolean hasTicksAtEnds()
      Returns:
      true if ticks at end of axis are shown
    • getLabel

      double getLabel​(double value)
      If the scale has labels, this will return the label for the tick value, otherwise returns the value given in parameter.
      Parameters:
      value -
      Returns:
      double value of label
    • isLabelCustomised

      boolean isLabelCustomised()
      Returns:
      true if axis labels are customised
    • getTicksProvider

      ITicksProvider getTicksProvider()
      Gets the ticks provider
      Returns:
      tick provider