gate.print
Class JComponentPrinter
java.lang.Object
gate.print.JComponentPrinter
- All Implemented Interfaces:
- Pageable
- public class JComponentPrinter
- extends Object
- implements Pageable
Will scale the component so it fits on a page horizontally
Method Summary |
int |
getNumberOfPages()
Returns the number of pages over which the canvas
will be drawn. |
PageFormat |
getPageFormat(int pageIndex)
Returns the PageFormat of the page specified by
pageIndex. |
Printable |
getPrintable(int pageIndex)
Returns the Printable instance responsible for
rendering the page specified by pageIndex . |
JComponentPrinter
public JComponentPrinter(JComponent component,
PageFormat format)
getNumberOfPages
public int getNumberOfPages()
- Returns the number of pages over which the canvas
will be drawn.
- Specified by:
getNumberOfPages
in interface Pageable
getPageFormat
public PageFormat getPageFormat(int pageIndex)
throws IndexOutOfBoundsException
- Returns the PageFormat of the page specified by
pageIndex. The PageFormat is the same for all pages.
- Specified by:
getPageFormat
in interface Pageable
- Parameters:
pageIndex
- the zero based index of the page whose
PageFormat is being requested
- Returns:
- the PageFormat describing the size and
orientation.
- Throws:
IndexOutOfBoundsException
- the Pageable does not contain the requested
page.
getPrintable
public Printable getPrintable(int pageIndex)
throws IndexOutOfBoundsException
- Returns the
Printable
instance responsible for
rendering the page specified by pageIndex
.
- Specified by:
getPrintable
in interface Pageable
- Parameters:
pageIndex
- the zero based index of the page whose
Printable is being requested
- Returns:
- the Printable that renders the page.
- Throws:
IndexOutOfBoundsException
- the Pageable does not contain the requested
page.