jfig.gui
Class PrintManager.Manager2D
java.lang.Object
jfig.gui.PrintManager.Manager2D
- All Implemented Interfaces:
- java.awt.print.Printable
- Enclosing class:
- PrintManager
- class PrintManager.Manager2D
- extends java.lang.Object
- implements java.awt.print.Printable
inner class for printing via Java2D. Because this class is not
loaded unless Java2D is available, our parent class should still
work in a Java 1.1 environment.
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Method Summary |
void |
checkChangeBorderWidth(java.awt.print.PageFormat pf)
|
void |
doPrint()
callback to actually print FIG objects. |
java.lang.String |
dumpPageFormat(java.awt.print.PageFormat pf)
|
int |
print(java.awt.Graphics _g,
java.awt.print.PageFormat pf,
int pagenum)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrintManager.Manager2D
PrintManager.Manager2D()
print
public int print(java.awt.Graphics _g,
java.awt.print.PageFormat pf,
int pagenum)
throws java.awt.print.PrinterException
- Specified by:
print
in interface java.awt.print.Printable
- Throws:
java.awt.print.PrinterException
doPrint
public void doPrint()
- callback to actually print FIG objects. This calls getPrinterJob()
in turn, which displays the default dialog to select the printer,
printer and page options, etc.
Next, we try to fit all FIG objects onto a DIN A4 size page,
with 5 mm borders on each side. This should allow printing on most
laser and inkjet printers.
The orientation and justification are taken from the
corresponding settings in jfig.objects.FigAttribs.
In jfig.gui.Editor, these can be changed and set via the
Options->Edit global attributes dialog.
Note that printing uses the current foreground thread, typical
the AWT callback thread. Therefore, the jfig GUI will not respond
until object rendering in the printer format is done.
checkChangeBorderWidth
public void checkChangeBorderWidth(java.awt.print.PageFormat pf)
dumpPageFormat
public java.lang.String dumpPageFormat(java.awt.print.PageFormat pf)