com.pentec.adapt
Class Axes

java.lang.Object
  extended by com.pentec.adapt.Axes

public class Axes
extends java.lang.Object

This class is used by APanel to provide x and y axis controls for ADAPT

Author:
Pender Technology

Field Summary
private  java.lang.String[] a$YLabels
          The Y labels
private  int[] aiYLabelWidth
          The width of the Y labels
private  APanel apanel
          The APanel this set of axes belongs to
private  double dHeadXPxWid
          Data set sample spacing in axis units
private  double dHeadXStart
          Axis starting values
private  double dHeadYPxWid
          Data set sample spacing in axis units
private  double dHeadYStart
          Axis starting values
 double dXHi
          Axis endpoints actually used for scaling
 double dXLo
          Axis endpoints actually used for scaling
private  double dXStep
          Overlay grid step size
private  double dXTicMax
          Axis label endpoints
private  double dXTicMin
          Axis label endpoints
 double dYHi
          Axis endpoints actually used for scaling
 double dYLo
          Axis endpoints actually used for scaling
private  double dYStep
          Overlay grid step size
private  double dYTicMax
          Axis label endpoints
private  double dYTicMin
          Axis label endpoints
private  int iLabelHeight
          The height of the label text font
private  int iNumYTics
          The number of tics on the Y-axis
private static int iTICKLENGTH
          The length in pixels of axis tic marks
private  int iXExp
          The scaling exponent for the x-axis
private  int iYExp
          The scaling exponent for the y-axis
private static java.awt.Font labelFont
          Font for the labels
private static java.awt.FontMetrics labelFontMetrics
          Font metrics for the label font
private  DataFrame mainFrame
          The DataFrame the axes belong to
private static java.awt.Font superscriptFont
          Font for superscripts
private static java.awt.FontMetrics superscriptFontMetrics
          Font metrics for the superscript font
 
Constructor Summary
Axes(APanel apanel)
           
 
Method Summary
 void computeScale()
          Compute the scale factors for the plot or image
 double convertx(double dxin)
          Convert from raw dataset units to units used for x-axis
 double converty(double dyin)
          Convert from raw dataset units to units used for y-axis
protected  void copyXYRange(APanel target)
          Set the axes endpoints to be the same as some other panel
protected  void drawAxes(java.awt.Graphics2D graphics)
          Draw the axes using the current range & label
private  void drawGridLine(java.awt.Graphics2D g, int ix, int iy, int ixx, int iyy)
           
private  void drawTics(java.awt.Graphics2D g, int ix1, int iy1, int ix2, int iy2, int ix3, int iy3, int ix4, int iy4)
           
 java.awt.geom.Rectangle2D.Double getAoi()
           
 double getGridXSize()
           
 double getGridYSize()
           
 double getXPxWid()
          Return the horizontal pixel unit width
 double getYPxWid()
          Return the vertical pixel unit width
protected  void scrollX(double delta)
          Scroll the x-axis
protected  void scrollY(double delta)
          Scroll the y-axis
private  void setup()
           
 void setup(Header header)
           
 void setXRange(double dMin, double dMax)
          Set the plot's X range
 void setXYRange(double dLeft, double dRight, double dDown, double dUp)
          Set the axes endpoints
 void setYRange(double dMin, double dMax)
          Set the plot's Y range
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

a$YLabels

private java.lang.String[] a$YLabels
The Y labels


aiYLabelWidth

private int[] aiYLabelWidth
The width of the Y labels


apanel

private APanel apanel
The APanel this set of axes belongs to


dHeadXPxWid

private double dHeadXPxWid
Data set sample spacing in axis units


dHeadXStart

private double dHeadXStart
Axis starting values


dHeadYPxWid

private double dHeadYPxWid
Data set sample spacing in axis units


dHeadYStart

private double dHeadYStart
Axis starting values


dXHi

public double dXHi
Axis endpoints actually used for scaling


dXLo

public double dXLo
Axis endpoints actually used for scaling


dXStep

private double dXStep
Overlay grid step size


dXTicMax

private double dXTicMax
Axis label endpoints


dXTicMin

private double dXTicMin
Axis label endpoints


dYHi

public double dYHi
Axis endpoints actually used for scaling


dYLo

public double dYLo
Axis endpoints actually used for scaling


dYStep

private double dYStep
Overlay grid step size


dYTicMax

private double dYTicMax
Axis label endpoints


dYTicMin

private double dYTicMin
Axis label endpoints


iLabelHeight

private int iLabelHeight
The height of the label text font


iNumYTics

private int iNumYTics
The number of tics on the Y-axis


iTICKLENGTH

private static final int iTICKLENGTH
The length in pixels of axis tic marks

See Also:
Constant Field Values

iXExp

private int iXExp
The scaling exponent for the x-axis


iYExp

private int iYExp
The scaling exponent for the y-axis


labelFont

private static java.awt.Font labelFont
Font for the labels


labelFontMetrics

private static java.awt.FontMetrics labelFontMetrics
Font metrics for the label font


mainFrame

private DataFrame mainFrame
The DataFrame the axes belong to


superscriptFont

private static java.awt.Font superscriptFont
Font for superscripts


superscriptFontMetrics

private static java.awt.FontMetrics superscriptFontMetrics
Font metrics for the superscript font

Constructor Detail

Axes

public Axes(APanel apanel)
Method Detail

computeScale

public void computeScale()
Compute the scale factors for the plot or image


convertx

public double convertx(double dxin)
Convert from raw dataset units to units used for x-axis


converty

public double converty(double dyin)
Convert from raw dataset units to units used for y-axis


copyXYRange

protected void copyXYRange(APanel target)
Set the axes endpoints to be the same as some other panel


drawAxes

protected void drawAxes(java.awt.Graphics2D graphics)
Draw the axes using the current range & label


drawGridLine

private void drawGridLine(java.awt.Graphics2D g,
                          int ix,
                          int iy,
                          int ixx,
                          int iyy)

drawTics

private void drawTics(java.awt.Graphics2D g,
                      int ix1,
                      int iy1,
                      int ix2,
                      int iy2,
                      int ix3,
                      int iy3,
                      int ix4,
                      int iy4)

getAoi

public java.awt.geom.Rectangle2D.Double getAoi()

getGridXSize

public double getGridXSize()

getGridYSize

public double getGridYSize()

getXPxWid

public double getXPxWid()
Return the horizontal pixel unit width


getYPxWid

public double getYPxWid()
Return the vertical pixel unit width


scrollX

protected void scrollX(double delta)
Scroll the x-axis

Parameters:
delta - the scroll amount (positive values result in a scroll right; negative values result in a scroll left)

scrollY

protected void scrollY(double delta)
Scroll the y-axis

Parameters:
delta - the scroll amount (positive values result in a scroll up; negative values result in a scroll down)

setup

private void setup()

setup

public void setup(Header header)

setXRange

public void setXRange(double dMin,
                      double dMax)
Set the plot's X range


setXYRange

public void setXYRange(double dLeft,
                       double dRight,
                       double dDown,
                       double dUp)
Set the axes endpoints


setYRange

public void setYRange(double dMin,
                      double dMax)
Set the plot's Y range


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object