de.betabeans.scroogexhtml.dom
Class FormattedText

java.lang.Object
  extended by de.betabeans.scroogexhtml.dom.FormattedText
All Implemented Interfaces:
DocumentNode, java.io.Serializable

public final class FormattedText
extends java.lang.Object
implements DocumentNode, java.io.Serializable

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 FormattedText 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.

Author:
Michael Justin
See Also:
Paragraph, Document, Serialized Form

Constructor Summary
FormattedText(Paragraph aparagraph)
          Constructor for the FormattedText object.
 
Method Summary
 void add(char c)
          Add a character to the text.
 void add(java.lang.String text)
          Add a string to the text.
 java.lang.String docTextToString()
          Call the converter for this text element.
 CharacterProperties getCP()
          Gets the character properties.
 Paragraph getParagraph()
          Gets the paragraph attribute.
 java.lang.String getText()
          get the text of the text object.
protected  boolean hasText()
          Checks if the text element is empty.
 boolean isEncoded()
          Gets the encoded attribute.
 void setEncoded(boolean e)
          Sets the encoded attribute.
 void setText(java.lang.String newValue)
          Set the text of the text object.
protected  void setTextProperties(CharacterProperties acp)
          set the text properties of the text object.
 java.lang.String toPlainText()
          Return plain text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.betabeans.scroogexhtml.dom.DocumentNode
toString
 

Constructor Detail

FormattedText

public FormattedText(Paragraph aparagraph)
Constructor for the FormattedText object.

Parameters:
aparagraph - The owner paragraph.
Method Detail

setEncoded

public void setEncoded(boolean e)
Sets the encoded attribute.

Parameters:
e - The new encoded value

setText

public void setText(java.lang.String newValue)
Set the text of the text object.

Parameters:
newValue - the new text

setTextProperties

protected void setTextProperties(CharacterProperties acp)
set the text properties of the text object.

Parameters:
acp - The new textProperties value

getCP

public CharacterProperties getCP()
Gets the character properties.

Returns:
The character properties

isEncoded

public boolean isEncoded()
Gets the encoded attribute.

Returns:
The encoded value

getText

public java.lang.String getText()
get the text of the text object.

Returns:
the text

getParagraph

public Paragraph getParagraph()
Gets the paragraph attribute.

Returns:
The paragraph value

add

public void add(char c)
Add a character to the text.

Specified by:
add in interface DocumentNode
Parameters:
c - The character to be added.

add

public void add(java.lang.String text)
Add a string to the text.

Specified by:
add in interface DocumentNode
Parameters:
text - The String to be added.

docTextToString

public java.lang.String docTextToString()
Call the converter for this text element.

Returns:
converted text

toPlainText

public java.lang.String toPlainText()
Return plain text.

Returns:
String

hasText

protected boolean hasText()
Checks if the text element is empty.

Returns:
True = the text element is not empty.


Copyright (c) 1998-2006 BetaSoft Michael Justin. All Rights Reserved.