Package net.sf.paperclips
Class StyledTextPrint
java.lang.Object
net.sf.paperclips.StyledTextPrint
- All Implemented Interfaces:
Print
A class for printing styled text. Text of varying size and style are aligned
along the baseline.
- Author:
- Matthew Hall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends the given text to the end of the document, using the default style.Appends the given text to the end of the document, using the given style.Appends the given element to the document.boolean
int
hashCode()
iterator
(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc) Returns a PrintIterator for laying out the contents of this Print.newline()
Appends a line break to the document.Sets the text style that will be applied to text added through theappend(String)
-
Constructor Details
-
StyledTextPrint
public StyledTextPrint()Constructs a new StyledTextPrint.
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
setStyle
Sets the text style that will be applied to text added through theappend(String)
- Parameters:
style
- the new text style.- Returns:
- this StyledTextPrint, for chaining method calls.
-
append
Appends the given text to the end of the document, using the default style. This method is equivalent to calling append(text, getStyle()).- Parameters:
text
- the text to append.- Returns:
- this StyledTextPrint, for chaining method calls.
-
append
Appends the given text to the end of the document, using the given style.- Parameters:
text
- the text to append.style
- the text style.- Returns:
- this StyledTextPrint, for chaining method calls.
-
newline
Appends a line break to the document. If a line break produces a blank line, that line will take the height of the font in the default text style.- Returns:
- this StyledTextPrint, for chaining method calls.
-
append
Appends the given element to the document.- Parameters:
element
- the element to append.- Returns:
- this StyledTextPrint, for chaining method calls.
-
iterator
public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc) Description copied from interface:Print
Returns a PrintIterator for laying out the contents of this Print. The iterator uses a snapshot of the print at the time this method is invoked, so subsequent changes to the Print will not affect the output of the iterator.
-