|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.axis.SimpleNumericTickCalculator
public class SimpleNumericTickCalculator
This class makes it easy to create custom ticks on a numeric axis by specifying an initial value for the location of a major tick and then specifying increments for major and (optionally) minor ticks. Note that the class has been designed so that the major tick increment does not have to be a multiple of the minor tick increment, although this is still the most common situation.
The class is called a SimpleNumericTickCalculator because it makes no provision for changing the distance between ticks when zooming. Zooming is well catered for by the DefaultNumericTickCalculator, which you get by default on a NumericAxis.
Field Summary | |
---|---|
static String |
PROPERTY_MAJOR_TICK_INTERVAL
|
static String |
PROPERTY_MINOR_TICK_INTERVAL
|
static String |
PROPERTY_NUMBER_FORMAT
|
static String |
PROPERTY_START
|
Constructor Summary | |
---|---|
SimpleNumericTickCalculator()
Create a SimpleNumericTickCalculator |
|
SimpleNumericTickCalculator(double start,
double majorTickInterval)
Create a SimpleNumericTickCalculator using the supplied start and majorTickInterval values. |
|
SimpleNumericTickCalculator(double start,
double majorTickInterval,
double minorTickInterval)
Create a SimpleNumericTickCalculator using the supplied start, majorTickInterval and minorTickInterval values. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers the supplied object as interested in property changes on this object |
Tick[] |
calculateTicks(Range<Double> range)
Calculates the ticks and their labels according to the start and tick interval settings supplied |
double |
getMajorTickInterval()
Returns the major tick interval used for calculating tick positions |
int |
getMaxTickCount()
Returns the upper limit on the number of ticks that can be generated. |
Double |
getMinorTickInterval()
Returns the minor tick interval used in calculating tick positions |
NumberFormat |
getNumberFormat()
Returns the number format used for tick labels |
double |
getStart()
Returns the initial lowest value used for calculating ticks |
void |
removePropertyChangeListener(PropertyChangeListener listener)
De-registers the supplied object as interested in property changes on this object |
void |
setMajorTickInterval(double majorTickInterval)
Specify the major tick interval used for calculating tick positions |
void |
setMaxTickCount(int maxTickCount)
Set an upper limit on the number of ticks that can be generated. |
void |
setMinorTickInterval(Double minorTickInterval)
Specifies the minor tick interval used in calculating tick positions |
void |
setNumberFormat(NumberFormat numberFormat)
Specify the number format used when generating tick labels |
void |
setNumberFormat(String numberFormat)
Uses the supplied string as a number format specifier as if supplied to the DecimalFormat class. |
void |
setStart(double start)
Specifies the initial lowest value used for calculating ticks |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_NUMBER_FORMAT
public static final String PROPERTY_START
public static final String PROPERTY_MAJOR_TICK_INTERVAL
public static final String PROPERTY_MINOR_TICK_INTERVAL
Constructor Detail |
---|
public SimpleNumericTickCalculator()
public SimpleNumericTickCalculator(double start, double majorTickInterval)
start
- the lowest numeric tick value - assumed to be a major tickmajorTickInterval
- the interval before the next major tickpublic SimpleNumericTickCalculator(double start, double majorTickInterval, double minorTickInterval)
start
- the lowest numeric tick value - assumed to be a major tickmajorTickInterval
- the interval before the next major tickminorTickInterval
- the interval before the next minor tick and the distance between subsequent minor ticksMethod Detail |
---|
public NumberFormat getNumberFormat()
getNumberFormat
in interface NumericTickCalculator
public void setNumberFormat(NumberFormat numberFormat)
setNumberFormat
in interface NumericTickCalculator
numberFormat
- the number format to use for tick labelspublic void setNumberFormat(String numberFormat)
setNumberFormat
in interface NumericTickCalculator
numberFormat
- a numberFormat string as used by the DecimalFormat classpublic double getStart()
public void setStart(double start)
start
- the initial lowest value used for calculating tickspublic double getMajorTickInterval()
public void setMajorTickInterval(double majorTickInterval)
majorTickInterval
- the interval between major tickspublic Double getMinorTickInterval()
public void setMinorTickInterval(Double minorTickInterval)
minorTickInterval
- the interval between minor tickspublic int getMaxTickCount()
public void setMaxTickCount(int maxTickCount)
maxTickCount
- the maximum number of ticks to generatepublic Tick[] calculateTicks(Range<Double> range)
calculateTicks
in interface TickCalculator<Double>
range
- the range for which ticks need to be calculated and returned
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface TickCalculator<Double>
listener
- the interested objectpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface TickCalculator<Double>
listener
- the object that is no longer interested in property changes on this object
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |