ui.recognizer
Class PlotCalibration

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by ui.recognizer.Calibration
                  extended by ui.recognizer.PlotCalibration
All Implemented Interfaces:
Shape, Serializable, Cloneable

public class PlotCalibration
extends Calibration

A class containing plot calibration information necessary for the correct mapping from image coordinates to data coordinates. Plot specific knowlegde such as tic borders and tic location and spacing are part of the state.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float
 
Field Summary
protected  Rectangle2D.Double tic
          The tic is the x, y position corresponding to a tic center on both axes and whose width and height is the spacing between tics.
protected  Rectangle ticZone
          The tic zone is a 'safe' area without tics in image units.
 
Fields inherited from class ui.recognizer.Calibration
DEFAULT_MAXX, DEFAULT_MAXY, DEFAULT_MINX, DEFAULT_MINY, DEFAULT_UNITX, DEFAULT_UNITY, maxX, maxY, minX, minY, unitX, unitY
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
PlotCalibration(Rectangle aBorder, Rectangle aTicZone, double xMinimum, double xMaximum, double yMinimum, double yMaximum)
           
 
Method Summary
 Rectangle2D.Double getTic()
          Get the axis tics as x-y position and width/height of one tic interval.
 Rectangle getTic(int xTicNumber, int yTicNumber)
          Get the tic at xTicNumber and yTicNumber in integer units.
 Rectangle getTicZone()
          Get the tic zone or a 'safe' area without tics.
 void setTic(Rectangle2D.Double aTic)
          Set the first tic as an x-y position and a width/height of a tic interval.
 void setTicZone(Rectangle aTicZone)
          Set the tic zone or a 'safe' area without tics.
 
Methods inherited from class ui.recognizer.Calibration
getMaxX, getMaxY, getMinX, getMinY, getUnitX, getUnitY, map, map, mapInDataUnits, setMaxX, setMaxY, setMinX, setMinY, setUnitX, setUnitY
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Field Detail

ticZone

protected Rectangle ticZone
The tic zone is a 'safe' area without tics in image units.


tic

protected Rectangle2D.Double tic
The tic is the x, y position corresponding to a tic center on both axes and whose width and height is the spacing between tics.

Constructor Detail

PlotCalibration

public PlotCalibration(Rectangle aBorder,
                       Rectangle aTicZone,
                       double xMinimum,
                       double xMaximum,
                       double yMinimum,
                       double yMaximum)
Method Detail

getTicZone

public Rectangle getTicZone()
Get the tic zone or a 'safe' area without tics. This zone should be contained within the border zone however no checks are made.

Returns:
a rectangle in image units

setTicZone

public void setTicZone(Rectangle aTicZone)
Set the tic zone or a 'safe' area without tics.

Parameters:
aTicZone - a rectangle in image units

getTic

public Rectangle2D.Double getTic()
Get the axis tics as x-y position and width/height of one tic interval. The coordinates must be double precision because it is based on an average which requires subpixel precision to correctly scale after being multiplied by an integer. The getTic() method is equivalent to getTic(0, 0) but is coded more efficiently.

Returns:
a rectangle whose x, y position corresponds to a tic center on both axes and whose width and height is the spacing between tics.

setTic

public void setTic(Rectangle2D.Double aTic)
Set the first tic as an x-y position and a width/height of a tic interval. The coordinates must be double precision because it is based on an average which requires subpixel precision to correctly scale after being multiplied by an integer.

Parameters:
aTic - rectangle whose x, y position corresponds to a tic center on both axes and whose width and height is the spacing between tics.

getTic

public Rectangle getTic(int xTicNumber,
                        int yTicNumber)
Get the tic at xTicNumber and yTicNumber in integer units.

Returns:
a rectangle positioned at the chosen tic and with the tic spacing encoded as width and height.