com.approximatrix.charting.coordsystem.ticklocator
Class ObjectTickLocator

java.lang.Object
  extended by com.approximatrix.charting.coordsystem.ticklocator.ObjectTickLocator
Direct Known Subclasses:
ObjectXTickLocator

public class ObjectTickLocator
extends java.lang.Object

Class for calculating the position of tick marks along an axis which uses simple integer values for positioning, like an axis plotting arbitrary Object labels.

Author:
armstrong

Field Summary
private  int first
           
private  boolean forceAll
           
private  int last
           
private  int maxTics
           
 
Constructor Summary
ObjectTickLocator(int first, int last, int maxTics)
          Constructs the locator object based on the first and last index of objects to be displayed.
ObjectTickLocator(int first, int last, int maxTics, boolean forceAll)
          Constructs the locator object based on the first and last index of objects to be displayed.
 
Method Summary
 int[] getTickMarkLocations()
          Returns an array of indices to display on the axes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

first

private int first

last

private int last

maxTics

private int maxTics

forceAll

private boolean forceAll
Constructor Detail

ObjectTickLocator

public ObjectTickLocator(int first,
                         int last,
                         int maxTics)
Constructs the locator object based on the first and last index of objects to be displayed. Constrains ticks to the maximum number.

Parameters:
first - the smallest index to allow
last - the largest index to allow
maxTics - the maximum number of ticks to display

ObjectTickLocator

public ObjectTickLocator(int first,
                         int last,
                         int maxTics,
                         boolean forceAll)
Constructs the locator object based on the first and last index of objects to be displayed. Constrains ticks to the maximum number. Setting forceAll allows all indices to be displayed.

Parameters:
first - the smallest index to allow
last - the largest index to allow
maxTics - the maximum number of ticks to display
forceAll - true to display all indices
Method Detail

getTickMarkLocations

public int[] getTickMarkLocations()
Returns an array of indices to display on the axes

Returns:
an array of indices to display on the axis