util
Class Axis

java.lang.Object
  extended by util.Axis

public class Axis
extends java.lang.Object

This class defines the basic axis structure that can be used by plot to display the plot data.


Constructor Summary
Axis(java.lang.String axis_title)
          Constructor, expects the scale to be set later.
 
Method Summary
 double getAdjustedValueMax()
          Retrieve the adjusted maximum (display maximum) value for the axis data values.
 double getAdjustedValueMin()
          Retrieve the adjusted minimum (display minimum) value for the axis data values.
 double getAdjustedValueRange()
          Retrieve the adjusted range (display range) for the axis data values.
 boolean getDisplayGrid()
          Checks for the display_grid flag setting.
 boolean getDisplayMinorTics()
          Checks for the display_minor_tics flag setting.
 boolean getDisplayTics()
          Checks for the display_tics flag setting.
 java.util.ArrayList<java.lang.Double> getMajorTics()
          Retrieve the major tic location values for the axis.
 java.util.ArrayList<java.lang.Double> getMinorTics()
          Retrieve the minor tic location values for the axis.
 java.util.ArrayList<java.lang.String> getTicLabels()
          Retrieve the major tic labels for the axis.
 java.lang.String getTitle()
          Gets the title string for the axis.
 boolean isLog()
          Retrieve the is_log flag value for the axis.
 void setDisplayGrid(boolean display_grid)
          Sets the display_grid flag.
 void setDisplayMinorTics(boolean display_minor_tics)
          Sets the display_minor_tics flag.
 void setDisplayTics(boolean display_tics)
          Sets the display_tics flag.
 void setLog(boolean is_log)
          Set the is_log flag value for the axis.
 void setupLinear()
          Sets up the linear axis values for use in a plot.
 void setupLog()
          Sets up the log axis values for use in a plot.
 void updateAxis(java.lang.String axis_title, double value_min, double value_max, boolean is_log, boolean include_zero)
          Updates the scales and tics for an existing plot axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Axis

public Axis(java.lang.String axis_title)
Constructor, expects the scale to be set later.

Parameters:
axis_title - the title to label this axis.
Method Detail

getTitle

public java.lang.String getTitle()
Gets the title string for the axis.

Returns:
the title string.

isLog

public boolean isLog()
Retrieve the is_log flag value for the axis.

Returns:
the value of the is_log flag.

setLog

public void setLog(boolean is_log)
Set the is_log flag value for the axis.

Parameters:
is_log - is true to make the axis be a log axis.

getDisplayTics

public boolean getDisplayTics()
Checks for the display_tics flag setting.

Returns:
true if the display_tics flag is set.

setDisplayTics

public void setDisplayTics(boolean display_tics)
Sets the display_tics flag.

Parameters:
display_tics - flag for displaying tics.

getDisplayMinorTics

public boolean getDisplayMinorTics()
Checks for the display_minor_tics flag setting.

Returns:
true if the display_minor_tics flag is set.

setDisplayMinorTics

public void setDisplayMinorTics(boolean display_minor_tics)
Sets the display_minor_tics flag.

Parameters:
display_minor_tics - flag for displaying minor tics.

getDisplayGrid

public boolean getDisplayGrid()
Checks for the display_grid flag setting.

Returns:
true if the display_grid flag is set.

setDisplayGrid

public void setDisplayGrid(boolean display_grid)
Sets the display_grid flag.

Parameters:
display_grid - flag for displaying the grid.

updateAxis

public void updateAxis(java.lang.String axis_title,
                       double value_min,
                       double value_max,
                       boolean is_log,
                       boolean include_zero)
                throws java.lang.Exception
Updates the scales and tics for an existing plot axis.

Parameters:
axis_title - the title to label this axis.
value_min - the minimum value to cover with this axis.
value_max - the maximum value to cover with this axis.
is_log - if true the axis is to use a log scale.
include_zero - if true include zero even if the data doesn't.
Throws:
java.lang.Exception - if log of non-positive values requested.

setupLinear

public void setupLinear()
Sets up the linear axis values for use in a plot. Gets stats and values for the plot.


setupLog

public void setupLog()
Sets up the log axis values for use in a plot. Gets stats and values for the plot.


getMajorTics

public java.util.ArrayList<java.lang.Double> getMajorTics()
Retrieve the major tic location values for the axis.

Returns:
the location values for each of the major tic marks.

getTicLabels

public java.util.ArrayList<java.lang.String> getTicLabels()
Retrieve the major tic labels for the axis.

Returns:
the labels for each of the major tic marks.

getMinorTics

public java.util.ArrayList<java.lang.Double> getMinorTics()
Retrieve the minor tic location values for the axis.

Returns:
the location values for each of the minor tic marks.

getAdjustedValueMin

public double getAdjustedValueMin()
Retrieve the adjusted minimum (display minimum) value for the axis data values. If the axis is_log then this is the log of the smallest value to include in the display, otherwise it is the value of the smallest value to include in the display.

Returns:
the adjusted minimum value for the axis.

getAdjustedValueMax

public double getAdjustedValueMax()
Retrieve the adjusted maximum (display maximum) value for the axis data values. If the axis is_log then this is the log of the largest value to include in the display, otherwise it is the value of the largest value to include in the display.

Returns:
the adjusted maximum value for the axis.

getAdjustedValueRange

public double getAdjustedValueRange()
Retrieve the adjusted range (display range) for the axis data values. If the axis is_log then this is the range of the logs of the extreme values to include in the display, otherwise it is the range of the extreme values to include in the display.

Returns:
the adjusted range value for the axis.