|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--randsburg.GraphMethods
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 float[] |
findGrid(double lowValue,
double highValue,
int graphPixels)
Find good grid values for scales and grid lines |
static void |
paintScale(java.awt.Graphics g,
GraphInfo gi,
int direction,
boolean labelAxes)
static method to paint a reasonable scale on a graph grid should be found be a call to findGrid above |
static void |
paintVerticalGrid(java.awt.Graphics g,
double[] scaledVGrid,
int offsetLeft,
int graphWidth,
java.awt.Color gridColor)
Before using the grid to paint a vertical grid, need to scale locally |
protected static int |
scale(double value,
double lowValue,
double highValue,
int direction,
int offset,
int graphSize)
|
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 |
public static final int HORIZONTAL
public static final int VERTICAL
public static final int LOW
public static final int HIGH
| Constructor Detail |
public GraphMethods()
| Method Detail |
public static int setMaxFractionDigits(double max,
double min)
public static float[] findGrid(double lowValue,
double highValue,
int graphPixels)
lowValue - The lower endpoint of the scalehighValue - iThe upper endpoint of the scalegraphPixels - The dimension of the scale in pixel space
public static void paintVerticalGrid(java.awt.Graphics g,
double[] scaledVGrid,
int offsetLeft,
int graphWidth,
java.awt.Color gridColor)
public static void paintScale(java.awt.Graphics g,
GraphInfo gi,
int direction,
boolean labelAxes)
g - the Graphics object of the graphgi - GraphInfo objectdirection - one of VERTICAL or HORIZONTALlabelAxes - whether to label axes
protected static int scale(double value,
double lowValue,
double highValue,
int direction,
int offset,
int graphSize)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||