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

Field Summary
protected  java.lang.String bgcolor
           
protected  boolean bold
           
protected  java.lang.StringBuffer buffer
           
protected  java.lang.String color
           
protected  java.lang.String font
           
protected  java.lang.String hlcolor
           
protected  boolean italic
           
protected  ScroogeXHTMLDocParagraph paragraph
           
protected  int size
           
protected  boolean strike
           
protected  boolean subscript
           
protected  boolean superscript
           
protected  boolean underline
           
 
Constructor Summary
ScroogeXHTMLDocText(ScroogeXHTMLDocParagraph paragraph)
          Constructor for the ScroogeXHTMLDocText object
 
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
 

Field Detail

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
Constructor Detail

ScroogeXHTMLDocText

public ScroogeXHTMLDocText(ScroogeXHTMLDocParagraph paragraph)
Constructor for the ScroogeXHTMLDocText object
Method Detail

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 text
italic - the flag for itialic text
underline - the flag for underlined text
strike - the flag for strike-out text
font - the flag for the text font name
fgcolor - the flag for the text foreground color
bgcolor - the flag for the text background color
size - the flag for the text size
subscript - the flag for subscripted text
superscript - 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