jimmc.swing
Class ComponentPrintDialog

java.lang.Object
  |
  +--jimmc.swing.ComponentPrintDialog
All Implemented Interfaces:
java.awt.print.Printable

public class ComponentPrintDialog
extends java.lang.Object
implements java.awt.print.Printable


Field Summary
protected  java.awt.print.PageFormat pageFormat
          Our page format.
protected  javax.swing.JPanel panel
          Our dialog panel.
protected  java.awt.Component parent
          Our parent.
protected  java.awt.print.PrinterJob printerJob
          Our PrinterJob.
protected  ResourceSource res
          Our resource source.
protected  java.awt.Component target
          The component to print.
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
ComponentPrintDialog(java.awt.Component parent, ResourceSource res, java.awt.Component target)
          Create our object.
 
Method Summary
protected  javax.swing.JPanel buildPanel()
          Create our dialog panel.
 void print()
          Print.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          Print our target component.
 boolean printDialog()
          Put up the dialog and let the user set his options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected java.awt.Component parent
Our parent.

res

protected ResourceSource res
Our resource source.

target

protected java.awt.Component target
The component to print.

printerJob

protected java.awt.print.PrinterJob printerJob
Our PrinterJob.

pageFormat

protected java.awt.print.PageFormat pageFormat
Our page format.

panel

protected javax.swing.JPanel panel
Our dialog panel.
Constructor Detail

ComponentPrintDialog

public ComponentPrintDialog(java.awt.Component parent,
                            ResourceSource res,
                            java.awt.Component target)
Create our object.
Method Detail

buildPanel

protected javax.swing.JPanel buildPanel()
Create our dialog panel.

printDialog

public boolean printDialog()
Put up the dialog and let the user set his options.
Returns:
The PrinterJob ready for a call to it's print method, or null if cancelled.

print

public void print()
           throws java.awt.print.PrinterException
Print.

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pageIndex)
Print our target component.
Specified by:
print in interface java.awt.print.Printable