jsky.image.gui
Class ImagePrintDialog

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

public class ImagePrintDialog
extends Object
implements Printable, 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
protected  MainImageDisplay imageDisplay
          The target image display
protected  ProgressPanel progressPanel
          Panel used to display print progress
 
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(ActionEvent e)
          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(Graphics g, PageFormat pf, int pageIndex)
          For the Printable interface: Render the image contents onto a printable graphics context.
 void startPrint(String msg)
          Initialize printing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageDisplay

protected MainImageDisplay imageDisplay
The target image display


progressPanel

protected ProgressPanel progressPanel
Panel used to display print progress

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(ActionEvent e)
Called for the Print button in the preview window

Specified by:
actionPerformed in interface ActionListener

print

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


print

public int print(Graphics g,
                 PageFormat pf,
                 int pageIndex)
          throws 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 Printable
Throws:
PrinterException

startPrint

public void startPrint(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


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.