Purple Code

com.purpletech.graph
Class GraphAxis

java.lang.Object
  |
  +--com.purpletech.graph.GraphAxis

public class GraphAxis
extends java.lang.Object


Field Summary
static int HORIZONTAL
          horizontal orientation (an x axis)
static int VERTICAL
          vertical orientation (a y axis)
 
Constructor Summary
GraphAxis(int orientation, Unit unit, int unitMin, int unitMax, int pixelLength, int pixelOffset, int spacingMin, int spacingMax, java.awt.FontMetrics fontMetrics)
           
 
Method Summary
 java.util.Iterator getLabelsIterator()
          returns an iterator returning all the label positions, in units (at the center of the label)
 int getMax()
           
 int getMin()
           
 java.util.Iterator getRulesIterator()
           
static void main(java.lang.String[] args)
           
 void paintLabels(java.awt.Graphics g, int pixelPos, java.awt.FontMetrics metrics)
           
 void paintRules(java.awt.Graphics g, boolean drawLine, int pixelPos, int length)
           
 int toPixels(int units)
           
 int toUnits(int pixels)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERTICAL

public static final int VERTICAL
vertical orientation (a y axis)

See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
horizontal orientation (an x axis)

See Also:
Constant Field Values
Constructor Detail

GraphAxis

public GraphAxis(int orientation,
                 Unit unit,
                 int unitMin,
                 int unitMax,
                 int pixelLength,
                 int pixelOffset,
                 int spacingMin,
                 int spacingMax,
                 java.awt.FontMetrics fontMetrics)
Parameters:
unitMin - the smallest unit you want on the scale
unitMax - the largest unit you want on the scale
Method Detail

getMin

public int getMin()

getMax

public int getMax()

toPixels

public int toPixels(int units)

toUnits

public int toUnits(int pixels)

getRulesIterator

public java.util.Iterator getRulesIterator()
Returns:
an iterator returning all the rule positions, in units

getLabelsIterator

public java.util.Iterator getLabelsIterator()
returns an iterator returning all the label positions, in units (at the center of the label)


paintRules

public void paintRules(java.awt.Graphics g,
                       boolean drawLine,
                       int pixelPos,
                       int length)

paintLabels

public void paintLabels(java.awt.Graphics g,
                        int pixelPos,
                        java.awt.FontMetrics metrics)

main

public static void main(java.lang.String[] args)

Documentation generated March 5 2003