Package org.jfree.chart.axis
Class NumberTickUnitSource
- java.lang.Object
-
- org.jfree.chart.axis.NumberTickUnitSource
-
- All Implemented Interfaces:
java.io.Serializable,TickUnitSource
public class NumberTickUnitSource extends java.lang.Object implements TickUnitSource, java.io.Serializable
A tick unit source implementation that returns NumberTickUnit instances that are multiples of 1, 2 or 5 times some power of 10.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.text.DecimalFormatdfprivate java.text.DecimalFormatdf0private java.text.DecimalFormatdfNeg1private java.text.DecimalFormatdfNeg2private java.text.DecimalFormatdfNeg3private java.text.DecimalFormatdfNeg4private intfactorprivate java.text.NumberFormatformatterThe number formatter to use (an override, it can be null).private booleanintegersprivate intpower
-
Constructor Summary
Constructors Constructor Description NumberTickUnitSource()Creates a new instance.NumberTickUnitSource(boolean integers)Creates a new instance.NumberTickUnitSource(boolean integers, java.text.NumberFormat formatter)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)TickUnitgetCeilingTickUnit(double size)Returns the smallest tick unit available in the source that is greater than or equal to the specified size.TickUnitgetCeilingTickUnit(TickUnit unit)Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.TickUnitgetLargerTickUnit(TickUnit unit)Returns the smallest tick unit available in the source that is larger thanunitor, if there is no larger unit, returnsunit.private intgetMinorTickCount()private java.text.NumberFormatgetTickLabelFormat()private doublegetTickSize()private booleannext()private booleanprevious()
-
-
-
Field Detail
-
integers
private boolean integers
-
power
private int power
-
factor
private int factor
-
formatter
private java.text.NumberFormat formatter
The number formatter to use (an override, it can be null).
-
dfNeg4
private java.text.DecimalFormat dfNeg4
-
dfNeg3
private java.text.DecimalFormat dfNeg3
-
dfNeg2
private java.text.DecimalFormat dfNeg2
-
dfNeg1
private java.text.DecimalFormat dfNeg1
-
df0
private java.text.DecimalFormat df0
-
df
private java.text.DecimalFormat df
-
-
Constructor Detail
-
NumberTickUnitSource
public NumberTickUnitSource()
Creates a new instance.
-
NumberTickUnitSource
public NumberTickUnitSource(boolean integers)
Creates a new instance.- Parameters:
integers- show integers only.
-
NumberTickUnitSource
public NumberTickUnitSource(boolean integers, java.text.NumberFormat formatter)Creates a new instance.- Parameters:
integers- show integers only?formatter- a formatter for the axis tick labels (nullpermitted).
-
-
Method Detail
-
getLargerTickUnit
public TickUnit getLargerTickUnit(TickUnit unit)
Description copied from interface:TickUnitSourceReturns the smallest tick unit available in the source that is larger thanunitor, if there is no larger unit, returnsunit.- Specified by:
getLargerTickUnitin interfaceTickUnitSource- Parameters:
unit- the unit (nullnot permitted).- Returns:
- A tick unit that is larger than the supplied unit.
-
getCeilingTickUnit
public TickUnit getCeilingTickUnit(TickUnit unit)
Description copied from interface:TickUnitSourceReturns the tick unit in the collection that is greater than or equal to (in size) the specified unit.- Specified by:
getCeilingTickUnitin interfaceTickUnitSource- Parameters:
unit- the unit.- Returns:
- A unit from the collection.
-
getCeilingTickUnit
public TickUnit getCeilingTickUnit(double size)
Description copied from interface:TickUnitSourceReturns the smallest tick unit available in the source that is greater than or equal to the specified size. If there is no such tick unit, the method should return the largest available tick in the source.- Specified by:
getCeilingTickUnitin interfaceTickUnitSource- Parameters:
size- the size.- Returns:
- A unit from the collection (never
null).
-
next
private boolean next()
-
previous
private boolean previous()
-
getTickSize
private double getTickSize()
-
getTickLabelFormat
private java.text.NumberFormat getTickLabelFormat()
-
getMinorTickCount
private int getMinorTickCount()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-