Class StandardTickUnitSource

java.lang.Object
org.jfree.chart.axis.StandardTickUnitSource
All Implemented Interfaces:
TickUnitSource

public class StandardTickUnitSource
extends Object
implements TickUnitSource
A source that can used by the NumberAxis class to obtain a suitable TickUnit.
  • Constructor Details

    • StandardTickUnitSource

      public StandardTickUnitSource()
  • Method Details

    • getLargerTickUnit

      public TickUnit getLargerTickUnit​(TickUnit unit)
      Returns a tick unit that is larger than the supplied unit.
      Specified by:
      getLargerTickUnit in interface TickUnitSource
      Parameters:
      unit - the unit.
      Returns:
      A tick unit that is larger than the supplied unit.
    • stringReplace

      public static String stringReplace​(String s, String find, String replace)
      Replace occurrences of a substring. http://ostermiller.org/utils/StringHelper.html StringHelper.replace("1-2-3", "-", "|");
      result: "1|2|3"
      StringHelper.replace("-1--2-", "-", "|");
      result: "|1||2|"
      StringHelper.replace("123", "", "|");
      result: "123"
      StringHelper.replace("1-2---3----4", "--", "|");
      result: "1-2|-3||4"
      StringHelper.replace("1-2---3----4", "--", "---");
      result: "1-2----3------4"
      Parameters:
      s - String to be modified.
      find - String to find.
      replace - String to replace.
      Returns:
      a string with all the occurrences of the string to find replaced.
      Throws:
      NullPointerException - if s is null.
    • getDecimalFormat

      public static DecimalFormat getDecimalFormat​(String pattern)
    • getCeilingTickUnit

      public TickUnit getCeilingTickUnit​(TickUnit unit)
      Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.
      Specified by:
      getCeilingTickUnit in interface TickUnitSource
      Parameters:
      unit - the unit.
      Returns:
      A unit from the collection.
    • getCeilingTickUnit

      public TickUnit getCeilingTickUnit​(double size)
      Returns the tick unit in the collection that is greater than or equal to the specified size.
      Specified by:
      getCeilingTickUnit in interface TickUnitSource
      Parameters:
      size - the size.
      Returns:
      A unit from the collection.