public class NumberTickSelector extends java.lang.Object implements TickSelector, java.io.Serializable
TickSelector implementation that selects tick units in multiples
of 1, 2 and 5.
| Constructor and Description |
|---|
NumberTickSelector()
Creates a new instance.
|
NumberTickSelector(boolean percentage)
Creates a new instance, with the option to display the tick values as
percentages.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.
|
java.text.Format |
getCurrentTickLabelFormat()
Returns the tick formatter associated with the tick size that the
cursor is currently referencing.
|
double |
getCurrentTickSize()
Returns the tick size that the cursor is currently referencing.
|
boolean |
next()
Move the cursor to the next (larger) tick size, if there is one.
|
boolean |
previous()
Move the cursor to the previous (smaller) tick size, if there is one.
|
double |
select(double reference)
Selects and returns a standard tick size that is greater than or equal to
the specified reference value and, ideally, as close to it as possible
(to minimise the number of iterations used by axes to determine the tick
size to use).
|
public NumberTickSelector()
public NumberTickSelector(boolean percentage)
percentage - format the tick values as percentages.public double select(double reference)
getCurrentTickSize() method should return the selected tick
size (there is a "pointer" to this tick size), the next()
method should move the pointer to the next (larger) standard tick size,
and the previous() method should move the pointer to the
previous (smaller) standard tick size.select in interface TickSelectorreference - the reference value (must be positive and finite).public boolean next()
true in the case that the cursor is moved, and
false where there are a finite number of tick sizes and the
current tick size is the largest available.next in interface TickSelectorpublic boolean previous()
true in the case that the cursor is moved, and
false where there are a finite number of tick sizes and the
current tick size is the smallest available.previous in interface TickSelectorpublic double getCurrentTickSize()
TickSelectorgetCurrentTickSize in interface TickSelectorpublic java.text.Format getCurrentTickLabelFormat()
TickSelectorgetCurrentTickLabelFormat in interface TickSelectorpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).