org.jhotdraw.draw
Class DrawingPageable
java.lang.Object
  
org.jhotdraw.draw.DrawingPageable
- All Implemented Interfaces: 
 - java.awt.print.Pageable
 
public class DrawingPageable
- extends java.lang.Object
- implements java.awt.print.Pageable
  
DrawingPageable can be used to print a Drawing using 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...
      }
 }
 
- Version:
 
  - 1.0 January 1, 2007 Created.
 
- Author:
 
  - Werner Randelshofer
 
- See Also:
 PrintAction
 
| Fields inherited from interface java.awt.print.Pageable | 
UNKNOWN_NUMBER_OF_PAGES | 
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
DrawingPageable
public DrawingPageable(Drawing drawing)
- Creates a new instance.
 
getNumberOfPages
public int getNumberOfPages()
- Specified by:
 getNumberOfPages in interface java.awt.print.Pageable
 
 
getPageFormat
public java.awt.print.PageFormat getPageFormat(int pageIndex)
                                        throws java.lang.IndexOutOfBoundsException
- Specified by:
 getPageFormat in interface java.awt.print.Pageable
 
- Throws:
 java.lang.IndexOutOfBoundsException
 
getPrintable
public java.awt.print.Printable getPrintable(int pageIndex)
                                      throws java.lang.IndexOutOfBoundsException
- Specified by:
 getPrintable in interface java.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
 
setRenderingHints
protected void setRenderingHints(java.awt.Graphics2D g)