org.geotools.axis
Interface TickIterator

All Known Implementing Classes:
Axis2D.TickIterator

public interface TickIterator

Provides the mechanism for Graduation objects to return the values and labels of their ticks one tick at a time. This interface returns tick values from some minimal value up to some maximal value, using some increment value. Note that the increment value may not be constant. For example, a graduation for the time axis may use a slightly variable increment between differents months, since all months doesn't have the same number of days.

Since:
2.0
Version:
$Id: TickIterator.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Method Summary
 java.lang.String currentLabel()
          Returns the label for current tick.
 double currentPosition()
          Returns the position where to draw the current tick.
 double currentValue()
          Returns the value for current tick.
 java.util.Locale getLocale()
          Returns the locale used for formatting tick labels.
 boolean hasNext()
          Tests if the iterator has more ticks.
 boolean isMajorTick()
          Tests if the current tick is a major one.
 void next()
          Moves the iterator to the next minor or major tick.
 void nextMajor()
          Moves the iterator to the next major tick.
 void rewind()
          Reset the iterator on its first tick.
 

Method Detail

hasNext

public boolean hasNext()
Tests if the iterator has more ticks.


isMajorTick

public boolean isMajorTick()
Tests if the current tick is a major one.

Returns:
if current tick is a major tick, or if it is a minor tick.

currentPosition

public double currentPosition()
Returns the position where to draw the current tick. The position is scaled from the graduation's minimum to maximum. This is usually the same number than currentValue(). The mean exception is for logarithmic graduation, in which the tick position is not proportional to the tick value.


currentValue

public double currentValue()
Returns the value for current tick. The current tick may be major or minor.


currentLabel

public java.lang.String currentLabel()
Returns the label for current tick. This method is usually invoked only for major ticks, but may be invoked for minor ticks as well. This method returns if it can't produces a label for current tick.


next

public void next()
Moves the iterator to the next minor or major tick.


nextMajor

public void nextMajor()
Moves the iterator to the next major tick. This move ignore any minor ticks between current position and the next major tick.


rewind

public void rewind()
Reset the iterator on its first tick. All other properties are left unchanged.


getLocale

public java.util.Locale getLocale()
Returns the locale used for formatting tick labels.



Copyright © GeoTools. All Rights Reserved.