com.jrefinery.chart
Class TickUnits

java.lang.Object
  extended by com.jrefinery.chart.TickUnits

public class TickUnits
extends java.lang.Object

A collection of tick units.


Field Summary
protected  java.util.List units
          Storage for the tick units.
 
Constructor Summary
TickUnits()
          Constructs a new collection of tick units.
 
Method Summary
 void add(TickUnit unit)
          Adds a tick unit to the collection.
static TickUnits createIntegerTickUnits()
          Returns a collection of tick units for integer values.
static TickUnits createStandardTickUnits()
          Creates the standard tick units.
 TickUnit getCeilingTickUnit(double size)
          Returns the tick unit in the collection that is greater than or equal to the specified size.
 TickUnit getCeilingTickUnit(TickUnit unit)
          Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.
 TickUnit getLargerTickUnit(TickUnit unit)
          Returns a tick unit that is larger than the supplied unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

units

protected java.util.List units
Storage for the tick units.

Constructor Detail

TickUnits

public TickUnits()
Constructs a new collection of tick units.

Method Detail

add

public void add(TickUnit unit)
Adds a tick unit to the collection.

The tick units are maintained in ascending order.


getLargerTickUnit

public TickUnit getLargerTickUnit(TickUnit unit)
Returns a tick unit that is larger than the supplied unit.

Parameters:
unit - The unit.

getCeilingTickUnit

public TickUnit getCeilingTickUnit(TickUnit unit)
Returns the tick unit in the collection that is greater than or equal to (in size) the specified unit.

Parameters:
unit - The unit.
Returns:
A unit from the collection.

getCeilingTickUnit

public TickUnit getCeilingTickUnit(double size)
Returns the tick unit in the collection that is greater than or equal to the specified size.

Parameters:
size - The size.
Returns:
A unit from the collection.

createStandardTickUnits

public static TickUnits createStandardTickUnits()
Creates the standard tick units.

If you don't like these defaults, create your own instance of TickUnits and then pass it to the setStandardTickUnits(...) method in the NumberAxis class.


createIntegerTickUnits

public static TickUnits createIntegerTickUnits()
Returns a collection of tick units for integer values.



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.