Package org.fife.print
Class RPrintUtilities
- java.lang.Object
-
- org.fife.print.RPrintUtilities
-
public abstract class RPrintUtilities extends Object
A collection of static methods useful for printing text from Swing text components.
-
-
Constructor Summary
Constructors Constructor Description RPrintUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intprintDocumentMonospaced(Graphics g, Document doc, int fontSize, int pageIndex, PageFormat pageFormat, int tabSize)Prints aDocumentusing a monospaced font, and does no word wrapping (ie, words will wrap mid-word to the next line).static intprintDocumentMonospacedWordWrap(Graphics g, Document doc, int fontSize, int pageIndex, PageFormat pageFormat, int tabSize)Prints aDocumentusing a monospaced font, word wrapping on the characters ' ', '\t', '\n', ',', '.', and ';'.static intprintDocumentWordWrap(Graphics g, JTextComponent textComponent, Font font, int pageIndex, PageFormat pageFormat, int tabSize)Prints aDocumentusing the specified font, word wrapping on the characters ' ', '\t', '\n', ',', '.', and ';'.
-
-
-
Method Detail
-
printDocumentMonospaced
public static int printDocumentMonospaced(Graphics g, Document doc, int fontSize, int pageIndex, PageFormat pageFormat, int tabSize)
Prints aDocumentusing a monospaced font, and does no word wrapping (ie, words will wrap mid-word to the next line). This method is expected to be called from Printable 'print(Graphics g)' functions.- Parameters:
g- The graphics context to write to.doc- Thejavax.swing.text.Documentto print.fontSize- the point size to use for the monospaced font.pageIndex- The page number to print.pageFormat- The format to print the page with.tabSize- The number of spaces to expand tabs to.- See Also:
printDocumentMonospacedWordWrap(java.awt.Graphics, javax.swing.text.Document, int, int, java.awt.print.PageFormat, int)
-
printDocumentMonospacedWordWrap
public static int printDocumentMonospacedWordWrap(Graphics g, Document doc, int fontSize, int pageIndex, PageFormat pageFormat, int tabSize)
Prints aDocumentusing a monospaced font, word wrapping on the characters ' ', '\t', '\n', ',', '.', and ';'. This method is expected to be called from Printable 'print(Graphics g)' functions.- Parameters:
g- The graphics context to write to.doc- Thejavax.swing.text.Documentto print.fontSize- the point size to use for the monospaced font.pageIndex- The page number to print.pageFormat- The format to print the page with.tabSize- The number of spaces to expand tabs to.- See Also:
printDocumentMonospaced(java.awt.Graphics, javax.swing.text.Document, int, int, java.awt.print.PageFormat, int)
-
printDocumentWordWrap
public static int printDocumentWordWrap(Graphics g, JTextComponent textComponent, Font font, int pageIndex, PageFormat pageFormat, int tabSize)
Prints aDocumentusing the specified font, word wrapping on the characters ' ', '\t', '\n', ',', '.', and ';'. This method is expected to be called from Printable 'print(Graphics g)' functions.- Parameters:
g- The graphics context to write to.textComponent- Thejavax.swing.text.JTextComponentwhose text you're printing.font- The font to use for printing. Ifnull, thentextComponent's font is used.pageIndex- The page number to print.pageFormat- The format to print the page with.tabSize- The number of spaces to convert tabs to.
-
-