com.tensegrity.graphics.text
Class Paragraph

java.lang.Object
  extended bycom.tensegrity.graphics.text.AbstractElement
      extended bycom.tensegrity.graphics.text.Paragraph
All Implemented Interfaces:
Element

public class Paragraph
extends AbstractElement

A Paragraph represents a structure within a TextSection consisting of a Title, CharacterElements and other Paragraphs.

Version:
$Id: Paragraph.java,v 1.5 2004/07/14 16:15:33 GillesIachelini Exp $
Author:
Gilles Iachelini

Nested Class Summary
 
Nested classes inherited from class com.tensegrity.graphics.text.Element
Element.ElementIterator
 
Field Summary
static int CENTER
          Alignment constants.
static int JUSTIFY
          Alignment constants.
static int LEFT
          Alignment constants.
static int RIGHT
          Alignment constants.
 
Constructor Summary
Paragraph(java.lang.String s)
          Default constructor for a Paragraph.
 
Method Summary
protected  java.lang.String getAlignmentTag()
          Method getAlignmentTag returns the currently set alignment of this paragraph as HTML constant string.
 int getCharacterCount()
          Method getTextElementCount returns the number of CharacterElements in this paragraph including the title, all CharacterElements and all subparagraphs.
 java.util.List getCharacters()
          Returns all elements from the title, all CharacterElement and all subparagraphs.
 java.lang.String getHtmlText()
          Returns this paragraph as html text.
protected  Title getTitle()
          Method getTitle returns the first found title from the elements list.
 void setAlignment(int align)
          Method setAlignment sets the alignment for this paragraph.
 java.lang.String toString()
           
 
Methods inherited from class com.tensegrity.graphics.text.AbstractElement
addElement, getElement, getElementCount, getFontFormat, getText, isEmpty, iterator, remove, removeTextElements, setFontFormat, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Alignment constants.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Alignment constants.

See Also:
Constant Field Values

CENTER

public static final int CENTER
Alignment constants.

See Also:
Constant Field Values

JUSTIFY

public static final int JUSTIFY
Alignment constants.

See Also:
Constant Field Values
Constructor Detail

Paragraph

public Paragraph(java.lang.String s)
Default constructor for a Paragraph. Creates a new Paragraph with no SubElements, default font and an empty string.

Parameters:
s - the text for this paragraph as String.
Method Detail

getHtmlText

public java.lang.String getHtmlText()
Returns this paragraph as html text.

Specified by:
getHtmlText in interface Element
Overrides:
getHtmlText in class AbstractElement
See Also:
Element.getHtmlText()

setAlignment

public void setAlignment(int align)
Method setAlignment sets the alignment for this paragraph. This doesnt affect the sub paragraphs (Hmm?)

Parameters:
align - the alignement constant.

getCharacterCount

public int getCharacterCount()
Method getTextElementCount returns the number of CharacterElements in this paragraph including the title, all CharacterElements and all subparagraphs.

Returns:
int

getTitle

protected Title getTitle()
Method getTitle returns the first found title from the elements list.

Returns:
Title

getAlignmentTag

protected java.lang.String getAlignmentTag()
Method getAlignmentTag returns the currently set alignment of this paragraph as HTML constant string.

Returns:
String

toString

public java.lang.String toString()
See Also:
Object.toString()

getCharacters

public java.util.List getCharacters()
Returns all elements from the title, all CharacterElement and all subparagraphs.

Specified by:
getCharacters in class AbstractElement
Returns:
List with all CharacterElements within this Element and all of its subelements.
See Also:
AbstractElement.getCharacters()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.