jsky.image.gui
Class ImagePrintDialog

java.lang.Object
  extended by jsky.image.gui.ImagePrintDialog
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.print.Printable, java.util.EventListener

public class ImagePrintDialog
extends java.lang.Object
implements java.awt.print.Printable, java.awt.event.ActionListener

Displays a print dialog box for printing the current image display and handles the details of printing the image and graphics.


Nested Class Summary
protected  class ImagePrintDialog.PrintWorker
          Performs all the print calculations in a separate thread.
 
Field Summary
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
ImagePrintDialog(MainImageDisplay imageDisplay)
          Initialize with the target image display object.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Called for the Print button in the preview window
 void preview()
          Display a preview of the image to be printed in a popup window.
 void print()
          Prints the contents of the current image display image area.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          For the Printable interface: Render the image contents onto a printable graphics context.
 void startPrint(java.lang.String msg)
          Initialize printing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImagePrintDialog

public ImagePrintDialog(MainImageDisplay imageDisplay)
Initialize with the target image display object.

Method Detail

preview

public void preview()
Display a preview of the image to be printed in a popup window.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Called for the Print button in the preview window

Specified by:
actionPerformed in interface java.awt.event.ActionListener

print

public void print()
           throws java.awt.print.PrinterException
Prints the contents of the current image display image area. Prompts user with standard print dialog boxes first.

Throws:
java.awt.print.PrinterException

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pageIndex)
          throws java.awt.print.PrinterException
For the Printable interface: Render the image contents onto a printable graphics context. Provides the ability to print the image canvas contents.

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

startPrint

public void startPrint(java.lang.String msg)
Initialize printing. This method must be called at the beginning of any print operation because the print() method will be called multiple times.

Parameters:
msg - the message for the progress dialog