de.betabeans.scroogexhtml
Class ScroogeXHTMLDocText
java.lang.Object
|
+--de.betabeans.scroogexhtml.ScroogeXHTMLDocText
- public class ScroogeXHTMLDocText
- extends java.lang.Object
ScroogeXHTML splits the RTF text into small pieces which have the same
character properties, for example a sequence of underlined characters.
Every piece is stored in an instance of the ScroogeXHTMLDocText class.
This class has methods to set the character properties and to call the
converter which generates the output code for it.
If a text element listener has been defined using
ScroogeXHTMLBase.addAfterTextConversionListener()
,
the text element listener will receive each piece of text in the textElement
method before it is converted.
It is possible to modify the text and / or the text properties there.
Note: the design of this class might be changed in a future implementation,
for example using an iterator in the converter class instead of a call of
the converter from the toString() method.
- See Also:
ScroogeXHTMLDocParagraph
,
ScroogeXHTMLDocument
Method Summary |
void |
add(char c)
add a character to the text object |
protected void |
add(java.lang.String text)
add a string to the text object |
java.lang.String |
getText()
get the text of the text object |
void |
setText(java.lang.String newValue)
set the text of the text object |
protected void |
setTextProperties(boolean bold,
boolean italic,
boolean underline,
boolean strike,
java.lang.String font,
java.lang.String fgcolor,
java.lang.String bgcolor,
java.lang.String hlcolor,
int size,
boolean subscript,
boolean superscript)
set the text properties of the text object |
java.lang.String |
toString()
call the converter for this piece of text |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
paragraph
protected ScroogeXHTMLDocParagraph paragraph
buffer
protected java.lang.StringBuffer buffer
bold
protected boolean bold
underline
protected boolean underline
italic
protected boolean italic
strike
protected boolean strike
subscript
protected boolean subscript
superscript
protected boolean superscript
font
protected java.lang.String font
color
protected java.lang.String color
bgcolor
protected java.lang.String bgcolor
hlcolor
protected java.lang.String hlcolor
size
protected int size
ScroogeXHTMLDocText
public ScroogeXHTMLDocText(ScroogeXHTMLDocParagraph paragraph)
- Constructor for the ScroogeXHTMLDocText object
toString
public java.lang.String toString()
- call the converter for this piece of text
- Overrides:
toString
in class java.lang.Object
- Returns:
- converted text
add
public void add(char c)
- add a character to the text object
- Parameters:
c
- Description of Parameter
setTextProperties
protected void setTextProperties(boolean bold,
boolean italic,
boolean underline,
boolean strike,
java.lang.String font,
java.lang.String fgcolor,
java.lang.String bgcolor,
java.lang.String hlcolor,
int size,
boolean subscript,
boolean superscript)
- set the text properties of the text object
- Parameters:
bold
- the flag for bold textitalic
- the flag for itialic textunderline
- the flag for underlined textstrike
- the flag for strike-out textfont
- the flag for the text font namefgcolor
- the flag for the text foreground colorbgcolor
- the flag for the text background colorsize
- the flag for the text sizesubscript
- the flag for subscripted textsuperscript
- the flag for superscripted text
add
protected void add(java.lang.String text)
- add a string to the text object
- Parameters:
text
- Description of Parameter
setText
public void setText(java.lang.String newValue)
- set the text of the text object
- Parameters:
newValue
-
getText
public java.lang.String getText()
- get the text of the text object
- Returns:
- the text