ui.recognizer
Class PlotCalibration
java.lang.Object
java.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.Rectangle
ui.recognizer.Calibration
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
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 |
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 |
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.
PlotCalibration
public PlotCalibration(Rectangle aBorder,
Rectangle aTicZone,
double xMinimum,
double xMaximum,
double yMinimum,
double yMaximum)
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.