Class StyledTextPrint
java.lang.Object
org.eclipse.nebula.paperclips.core.text.StyledTextPrint
- All Implemented Interfaces:
Print
public class StyledTextPrint extends java.lang.Object implements Print
A class for printing styled text. Text of varying size and style are aligned
along the baseline.
-
Constructor Summary
Constructors Constructor Description StyledTextPrint()
Constructs a new StyledTextPrint. -
Method Summary
Modifier and Type Method Description StyledTextPrint
append(java.lang.String text)
Appends the given text to the end of the document, using the default style.StyledTextPrint
append(java.lang.String text, TextStyle style)
Appends the given text to the end of the document, using the given style.StyledTextPrint
append(Print element)
Appends the given element to the document.boolean
equals(java.lang.Object obj)
int
hashCode()
PrintIterator
iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
Returns a PrintIterator for laying out the contents of this Print.StyledTextPrint
newline()
Appends a line break to the document.StyledTextPrint
setStyle(TextStyle style)
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()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
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.
-