Package org.jfree.chart.axis
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 Summary
Constructors Constructor Description StandardTickUnitSource()
-
Method Summary
Modifier and Type Method Description TickUnit
getCeilingTickUnit(double size)
Returns the tick unit in the collection that is greater than or equal to the specified size.TickUnit
getCeilingTickUnit(TickUnit unit)
Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.static DecimalFormat
getDecimalFormat(String pattern)
TickUnit
getLargerTickUnit(TickUnit unit)
Returns a tick unit that is larger than the supplied unit.static String
stringReplace(String s, String find, String replace)
Replace occurrences of a substring.
-
Constructor Details
-
StandardTickUnitSource
public StandardTickUnitSource()
-
-
Method Details
-
getLargerTickUnit
Returns a tick unit that is larger than the supplied unit.- Specified by:
getLargerTickUnit
in interfaceTickUnitSource
- Parameters:
unit
- the unit.- Returns:
- A tick unit that is larger than the supplied unit.
-
stringReplace
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
-
getCeilingTickUnit
Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.- Specified by:
getCeilingTickUnit
in interfaceTickUnitSource
- Parameters:
unit
- the unit.- Returns:
- A unit from the collection.
-
getCeilingTickUnit
Returns the tick unit in the collection that is greater than or equal to the specified size.- Specified by:
getCeilingTickUnit
in interfaceTickUnitSource
- Parameters:
size
- the size.- Returns:
- A unit from the collection.
-