edu.ucsb.nceas.morpho.plugins.printer
Class PrintFrame.PageableComponent
java.lang.Object
edu.ucsb.nceas.morpho.plugins.printer.PrintFrame.PageableComponent
- All Implemented Interfaces:
- java.awt.print.Pageable
- Direct Known Subclasses:
- PrintFrame.PrintableComponent
- Enclosing class:
- PrintFrame
- public class PrintFrame.PageableComponent
- extends java.lang.Object
- implements java.awt.print.Pageable
Fields inherited from interface java.awt.print.Pageable |
UNKNOWN_NUMBER_OF_PAGES |
Method Summary |
int |
getNumberOfPages()
Returns the number of pages over which the canvas
will be drawn. |
protected java.awt.print.PageFormat |
getPageFormat()
|
java.awt.print.PageFormat |
getPageFormat(int pageIndex)
Returns the PageFormat of the page specified by
pageIndex. |
java.awt.print.Printable |
getPrintable(int pageIndex)
Returns the Printable instance responsible for
rendering the page specified by pageIndex . |
protected void |
setPageFormat(java.awt.print.PageFormat pageFormat)
|
protected void |
setPrintable(java.awt.print.Printable painter)
|
protected void |
setSize(float width,
float height)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrintFrame.PageableComponent
public PrintFrame.PageableComponent(float width,
float height,
java.awt.print.Printable painter,
java.awt.print.PageFormat format)
- Create a java.awt.Pageable that will print
a canvas over as many pages as are needed.
*
- Parameters:
width
- The width of the canvas.height
- The height of the canvas.painter
- The printable object that will drawn the contentsformat
- The PageFormat description of the pages
PrintFrame.PageableComponent
protected PrintFrame.PageableComponent()
setPrintable
protected void setPrintable(java.awt.print.Printable painter)
setPageFormat
protected void setPageFormat(java.awt.print.PageFormat pageFormat)
setSize
protected void setSize(float width,
float height)
getNumberOfPages
public int getNumberOfPages()
- Returns the number of pages over which the canvas
will be drawn.
- Specified by:
getNumberOfPages
in interface java.awt.print.Pageable
getPageFormat
protected java.awt.print.PageFormat getPageFormat()
getPageFormat
public java.awt.print.PageFormat getPageFormat(int pageIndex)
throws java.lang.IndexOutOfBoundsException
- Returns the PageFormat of the page specified by
pageIndex. For a Pageable object the PageFormat
is the same for all pages.
- Specified by:
getPageFormat
in interface java.awt.print.Pageable
- Parameters:
pageIndex
- the zero based index of the page whose
PageFormat is being requested
- Returns:
- the PageFormat describing the size and
orientation.
- Throws:
java.lang.IndexOutOfBoundsException
- the Pageable does not contain the requested
page.
getPrintable
public java.awt.print.Printable getPrintable(int pageIndex)
throws java.lang.IndexOutOfBoundsException
- Returns the
Printable
instance responsible for
rendering the page specified by pageIndex
.
- Specified by:
getPrintable
in interface java.awt.print.Pageable
- Parameters:
pageIndex
- the zero based index of the page whose
Printable is being requested
- Returns:
- the Printable that renders the page.
- Throws:
IndexOutOfBoundsException,
- when the Pageable does not contain the requested
page.
java.lang.IndexOutOfBoundsException
Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.