net.grelf.grip
Class DefaultMeasurementHandler

java.lang.Object
  extended by net.grelf.grip.DefaultMeasurementHandler
All Implemented Interfaces:
java.awt.print.Printable, MeasurementHandler

public class DefaultMeasurementHandler
extends java.lang.Object
implements MeasurementHandler, java.awt.print.Printable

An implementation of MeasurementHandler. Displays measurements in a message dialogue, formatting them appropriately. In the case of histograms and profiles that involves plotting graphs.


Field Summary
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
DefaultMeasurementHandler()
           
 
Method Summary
static javax.print.attribute.HashPrintRequestAttributeSet getAtts()
           
static java.lang.String powerPrefix(int power)
          Get a prefix to put in front of the calibration units, depending on the power.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageNo)
          Print the message, which is simple HTML with br elements only.
 void process(ImFrame imf, PointList ps, java.util.List<Measurement> ml)
          Simply displays measurements in a message dialogue, formatting them appropriately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMeasurementHandler

public DefaultMeasurementHandler()
Method Detail

getAtts

public static javax.print.attribute.HashPrintRequestAttributeSet getAtts()

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pageNo)
          throws java.awt.print.PrinterException
Print the message, which is simple HTML with br elements only.

Specified by:
print in interface java.awt.print.Printable
Throws:
java.awt.print.PrinterException

process

public void process(ImFrame imf,
                    PointList ps,
                    java.util.List<Measurement> ml)
Simply displays measurements in a message dialogue, formatting them appropriately. In the case of histograms and profiles that involves plotting graphs.

Specified by:
process in interface MeasurementHandler

powerPrefix

public static java.lang.String powerPrefix(int power)
Get a prefix to put in front of the calibration units, depending on the power. Eg, an area measurement needs "sq. " in front of the units.