pisgah
Class GraphMethods

java.lang.Object
  |
  +--pisgah.GraphMethods

public class GraphMethods
extends java.lang.Object

static methods for graph classes


Field Summary
static int HIGH
           
static int HORIZONTAL
           
static int LOW
           
static int VERTICAL
           
 
Constructor Summary
GraphMethods()
           
 
Method Summary
static void paintScale(java.awt.Graphics g, int scalePosition, float[] grid, int direction, double lowValue, double highValue, int offset, int graphSize, java.awt.Color scaleColor, java.awt.Font f, java.awt.Color fontColor, boolean labelAxes, java.lang.String axisLabel)
           
protected static int scale(double value, double lowValue, double highValue, int direction, int offset, int graphSize)
           
static float[] setGrid(float lowValue, float highValue)
          try to find nice grid values for axes
static int setMaxFractionDigits(double max, double min)
          try to determine a reasonable number of decimal places to show in labels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values

LOW

public static final int LOW
See Also:
Constant Field Values

HIGH

public static final int HIGH
See Also:
Constant Field Values
Constructor Detail

GraphMethods

public GraphMethods()
Method Detail

setMaxFractionDigits

public static int setMaxFractionDigits(double max,
                                       double min)
try to determine a reasonable number of decimal places to show in labels


setGrid

public static float[] setGrid(float lowValue,
                              float highValue)
try to find nice grid values for axes

Parameters:
lowValue - is the lower endpoint of the scale
highValue - is the upper endpoint of the scale

paintScale

public static void paintScale(java.awt.Graphics g,
                              int scalePosition,
                              float[] grid,
                              int direction,
                              double lowValue,
                              double highValue,
                              int offset,
                              int graphSize,
                              java.awt.Color scaleColor,
                              java.awt.Font f,
                              java.awt.Color fontColor,
                              boolean labelAxes,
                              java.lang.String axisLabel)

scale

protected static int scale(double value,
                           double lowValue,
                           double highValue,
                           int direction,
                           int offset,
                           int graphSize)