jwo.utils.gui
Class JWAxisItem

java.lang.Object
  extended by jwo.utils.gui.JWAxisItem

public class JWAxisItem
extends Object

Object to hold graph axis information. Includes axis title, labels, and tic mark frequency.

Version:
2.3, 20th July, 2006
Author:
Jo Wood

Constructor Summary
JWAxisItem(float min, float max)
          Creates a default set of axis labels and tic marks (10 labels).
JWAxisItem(float min, float max, float labelInc)
          Creates a default set of axis labels and tic marks using the given interval between labels.
JWAxisItem(float min, float max, String[] newLabels)
          Creates a set of categorical axis labels and tic marks based on a given set of labels.
JWAxisItem(float min, float max, String[] newLabels, int measurementScale)
          Creates a set of axis labels and tic marks based on a given set of labels and a given measurement scale.
 
Method Summary
 String getLabel(int n)
          Returns a label associated with axis position.
 float getLabelPosition(int n)
          Returns a label position associated with label.
 int getMeasurementScale()
          Returns the measurement scale of the data on this axis.
 int getNumLabels()
          Returns the number of labels associated with axis.
 int getNumTicMarks()
          Returns the number of tic marks associated with axis.
 float getTicMarkPosition(int n)
          Returns a tic mark position associated with axis.
 String getTitle()
          Returns the title associated with axis.
 void setMeasurementScale(int scale)
          Sets the measurement scale of the data on this axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWAxisItem

public JWAxisItem(float min,
                  float max)
Creates a default set of axis labels and tic marks (10 labels).

Parameters:
min - Minimum axis value.
max - Maximum axis value.

JWAxisItem

public JWAxisItem(float min,
                  float max,
                  float labelInc)
Creates a default set of axis labels and tic marks using the given interval between labels.

Parameters:
min - Minimum axis value.
max - Maximum axis value.
labelInc - Increment between labels.

JWAxisItem

public JWAxisItem(float min,
                  float max,
                  String[] newLabels)
Creates a set of categorical axis labels and tic marks based on a given set of labels.

Parameters:
min - Minimum axis value.
max - Maximum axis value.
newLabels - Set of labels to attach to axis.

JWAxisItem

public JWAxisItem(float min,
                  float max,
                  String[] newLabels,
                  int measurementScale)
Creates a set of axis labels and tic marks based on a given set of labels and a given measurement scale.

Parameters:
min - Minimum axis value.
max - Maximum axis value.
newLabels - Set of labels to attach to axis.
measurementScale - Measurement scale to use. If NOMINAL or ORDINAL, gaps between boundaries are labelled, if INTERVAL or RATIO, boundaries are labeled.
Method Detail

getTitle

public String getTitle()
Returns the title associated with axis.

Returns:
Axis title.

getLabel

public String getLabel(int n)
Returns a label associated with axis position.

Parameters:
n - Index of label to return.
Returns:
Axis label.

getLabelPosition

public float getLabelPosition(int n)
Returns a label position associated with label.

Parameters:
n - Index of label to return position of.
Returns:
Axis label position.

getNumLabels

public int getNumLabels()
Returns the number of labels associated with axis.

Returns:
Number of axis labels.

getTicMarkPosition

public float getTicMarkPosition(int n)
Returns a tic mark position associated with axis.

Parameters:
n - Index of tic mark to return postion of.
Returns:
Position of tic mark.

getNumTicMarks

public int getNumTicMarks()
Returns the number of tic marks associated with axis.

Returns:
Number of axis tic marks.

getMeasurementScale

public int getMeasurementScale()
Returns the measurement scale of the data on this axis.

Returns:
Axis measurement scale (NOMINAL,ORDINAL etc.).

setMeasurementScale

public void setMeasurementScale(int scale)
Sets the measurement scale of the data on this axis.

Parameters:
scale - New measurement scale (NOMINAL,ORDINAL etc.).


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009