org.strbio.util.graph
Class YAxisScale

java.lang.Object
  extended by org.strbio.util.graph.YAxisScale
All Implemented Interfaces:
AxisScale

public class YAxisScale
extends java.lang.Object
implements AxisScale

A scale to go along the y axis of a graph.

  Version 1.0, 4/20/99 - original version.
  

Version:
1.0, 4/20/99
Author:
JMC

Constructor Summary
YAxisScale(java.awt.Font f, java.awt.FontMetrics fmet)
           
 
Method Summary
 void drawMajorTic(java.awt.Graphics g, java.awt.Rectangle r, double y)
          Draw a major tic at a given y position.
 void drawMinorTic(java.awt.Graphics g, java.awt.Rectangle r, double y)
          Draw a minor tic at a given y position
 int getParallelSpace()
          How much space parallel to the axis is required to draw the scale, outside the graph box?
 int getPerpendicularSpace()
          How much space is required perpendicular to the axis, outside the graph box?
 void paintAxisScale(java.awt.Graphics g, java.awt.Rectangle r)
          Draw the axis scale, relative to a given rectangle containing the graph.
 void setFlipped(boolean fl)
          Flip this axis from normal java orientation (left->right, top->bottom).
 void setFont(java.awt.Font f, java.awt.FontMetrics fmet)
          set the font labels will be printed in.
 void setFormat(java.lang.String x)
          set the format labels will be printed in.
 void setMajorTics(int n)
          Sets the number of major tics on the axis.
 void setMajorTicsOn(double n)
          puts major tics everywhere on the axis that's divisible by this number.
 void setMax(double x)
          set the maximum value that will be graphed.
 void setMin(double x)
          set the minimum value that will be graphed.
 void setMinorTics(int n)
          sets the number of minor tics between each major tic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YAxisScale

public YAxisScale(java.awt.Font f,
                  java.awt.FontMetrics fmet)
Method Detail

setFlipped

public void setFlipped(boolean fl)
Flip this axis from normal java orientation (left->right, top->bottom). Default is true for Y, false for X.

Specified by:
setFlipped in interface AxisScale

setMajorTics

public void setMajorTics(int n)
Sets the number of major tics on the axis. if non-zero, puts this many major (labelled) tics on the axis, plus one at the left side. i.e. majorTics == 1 marks only the left and right sides. 0 turns off axis labelling, unless majorTicsOn is on. This takes precedence over numbers set by setMajorTicsOn.


setMajorTicsOn

public void setMajorTicsOn(double n)
puts major tics everywhere on the axis that's divisible by this number. NaN == off. This is ignored if setMajorTics is turned on.


setMinorTics

public void setMinorTics(int n)
sets the number of minor tics between each major tic.


setMin

public void setMin(double x)
set the minimum value that will be graphed.

Specified by:
setMin in interface AxisScale

setMax

public void setMax(double x)
set the maximum value that will be graphed.

Specified by:
setMax in interface AxisScale

setFormat

public void setFormat(java.lang.String x)
set the format labels will be printed in.

Specified by:
setFormat in interface AxisScale

setFont

public void setFont(java.awt.Font f,
                    java.awt.FontMetrics fmet)
set the font labels will be printed in.

Specified by:
setFont in interface AxisScale

getParallelSpace

public int getParallelSpace()
How much space parallel to the axis is required to draw the scale, outside the graph box?

Specified by:
getParallelSpace in interface AxisScale

getPerpendicularSpace

public int getPerpendicularSpace()
How much space is required perpendicular to the axis, outside the graph box?

Specified by:
getPerpendicularSpace in interface AxisScale

drawMajorTic

public void drawMajorTic(java.awt.Graphics g,
                         java.awt.Rectangle r,
                         double y)
Draw a major tic at a given y position.


drawMinorTic

public void drawMinorTic(java.awt.Graphics g,
                         java.awt.Rectangle r,
                         double y)
Draw a minor tic at a given y position


paintAxisScale

public void paintAxisScale(java.awt.Graphics g,
                           java.awt.Rectangle r)
Draw the axis scale, relative to a given rectangle containing the graph.

Specified by:
paintAxisScale in interface AxisScale