Class DocumentPrintable
java.lang.Object
DocumentPrintable
- All Implemented Interfaces:
- java.awt.print.Printable
public class DocumentPrintable
- extends java.lang.Object
- implements java.awt.print.Printable
The implementation of Printable. Prints the StyledDocument.
- Version:
- 07.08.2007
- Author:
- Marc Seidemann
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary |
DocumentPrintable(java.lang.Integer[] pageBreaks,
java.lang.Integer[] lineBreaks,
int linesPerPage,
int lineHeight,
javax.swing.text.StyledDocument d,
int fontsize)
Creates a DocumentPrintable-object |
Method Summary |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pageIndex)
Prints the StyledDocument |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentPrintable
DocumentPrintable(java.lang.Integer[] pageBreaks,
java.lang.Integer[] lineBreaks,
int linesPerPage,
int lineHeight,
javax.swing.text.StyledDocument d,
int fontsize)
- Creates a DocumentPrintable-object
- Parameters:
pageBreaks
- The indices of the pagebreakslineBreaks
- The indices of the lineBreakslinesPerPage
- The number of lines per pagelineHeight
- The height of a lined
- The StyledDocument that should be printedfontsize
- The fontsize of the print
print
public int print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pageIndex)
- Prints the StyledDocument
- Specified by:
print
in interface java.awt.print.Printable
- Parameters:
g
- The Graphics-object of the PrinterJobpf
- The PageFormat of the PrinterJobpageIndex
- The page-index