net.grelf.grip
Class Calibration

java.lang.Object
  extended by net.grelf.grip.Calibration

public class Calibration
extends java.lang.Object

This class is concerned with distance calibration which should be done before measuring an image, in order to measure in real physical units rather than in pixels.


Constructor Summary
Calibration()
          Default constructor sets the units to pixels and the scale factor to 1.0 and isCalibrated () will return false.
Calibration(Calibration other)
          Copy constructor, for copying calibration from one Im to another.
Calibration(java.lang.String someUnits, double aScale)
          Constructor setting fields from the arguments.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 double getScale()
           
 java.lang.String getUnits()
           
 java.lang.String getValue()
          Get the calibration as text suitable for display.
 java.lang.String getValue(boolean html)
          Get the calibration as text or HTML suitable for display.
 int hashCode()
          Enable objects of this class to be used as hash keys.
 boolean isCalibrated()
           
 void setCalibrated(boolean calibrated)
           
 void setScale(double scale)
           
 void setUnits(java.lang.String units)
           
 void setValue(double scale, java.lang.String units, boolean calibrated)
          Set the calibration.
 void show()
          Display the calibration in a message box.
 java.lang.String toString()
          Get a simple description of the Calibration object
 void uncalibrate()
          Set this calibration as if it has not been calibrated.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Calibration

public Calibration()
Default constructor sets the units to pixels and the scale factor to 1.0 and isCalibrated () will return false.


Calibration

public Calibration(java.lang.String someUnits,
                   double aScale)
Constructor setting fields from the arguments. On this object isCalibrated () will return true.


Calibration

public Calibration(Calibration other)
Copy constructor, for copying calibration from one Im to another.

Method Detail

isCalibrated

public boolean isCalibrated()

setCalibrated

public void setCalibrated(boolean calibrated)

getUnits

public java.lang.String getUnits()

setUnits

public void setUnits(java.lang.String units)

getScale

public double getScale()

setScale

public void setScale(double scale)

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Enable objects of this class to be used as hash keys.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Get a simple description of the Calibration object

Overrides:
toString in class java.lang.Object

getValue

public java.lang.String getValue()
Get the calibration as text suitable for display.


getValue

public java.lang.String getValue(boolean html)
Get the calibration as text or HTML suitable for display.


setValue

public void setValue(double scale,
                     java.lang.String units,
                     boolean calibrated)
Set the calibration.


show

public void show()
Display the calibration in a message box.


uncalibrate

public void uncalibrate()
Set this calibration as if it has not been calibrated. Units will be "pixels" and the scale will be 1.0.