org.jhotdraw.draw.print
Class DrawingPageable
- java.lang.Object
-
- org.jhotdraw.draw.print.DrawingPageable
-
- All Implemented Interfaces:
- java.awt.print.Pageable
public class DrawingPageable extends java.lang.Object implements java.awt.print.PageableDrawingPageablecan be used to print aDrawingusing the java.awt.print API.Usage:
Pageable pageable = new DrawingPageable(aDrawing); PrinterJob job = PrinterJob.getPrinterJob(); job.setPageable(pageable); if (job.printDialog()) { try { job.print(); } catch (PrinterException e) { ...inform the user that we couldn't print... } }- See Also:
PrintFileAction
-
-
Constructor Summary
Constructors Constructor and Description DrawingPageable(Drawing drawing)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetNumberOfPages()java.awt.print.PageFormatgetPageFormat(int pageIndex)java.awt.print.PrintablegetPrintable(int pageIndex)intprintPage(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
-
-
-
Constructor Detail
-
DrawingPageable
public DrawingPageable(Drawing drawing)
Creates a new instance.
-
-
Method Detail
-
getNumberOfPages
public int getNumberOfPages()
- Specified by:
getNumberOfPagesin interfacejava.awt.print.Pageable
-
getPageFormat
public java.awt.print.PageFormat getPageFormat(int pageIndex) throws java.lang.IndexOutOfBoundsException- Specified by:
getPageFormatin interfacejava.awt.print.Pageable- Throws:
java.lang.IndexOutOfBoundsException
-
getPrintable
public java.awt.print.Printable getPrintable(int pageIndex) throws java.lang.IndexOutOfBoundsException- Specified by:
getPrintablein interfacejava.awt.print.Pageable- Throws:
java.lang.IndexOutOfBoundsException
-
printPage
public int printPage(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex) throws java.awt.print.PrinterException- Throws:
java.awt.print.PrinterException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG