|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.text.AbstractElement
AbstractElement is a generic base class for Element based implementations. It
implements the Element interface by providing the basic mechanism for nesting
Elements and setting/getting the textual representation as a
string.
| Nested Class Summary |
| Nested classes inherited from class com.tensegrity.graphics.text.Element |
Element.ElementIterator |
| Constructor Summary | |
AbstractElement()
Constructor for AbstractElement. |
|
AbstractElement(java.lang.String s)
Creates a new Element from the given string by calling the setText method. |
|
| Method Summary | |
void |
addElement(Element element)
Method addElement adds an element to this Element. |
abstract java.util.List |
getCharacters()
Method getCharacters should return a List with all CharacterElements of this Element implementation. |
Element |
getElement(int index)
Method getElement returns the Element at position index. |
int |
getElementCount()
Method getElementCount returns the number of elements contained by this Element as integer. |
FontFormat |
getFontFormat()
Method getFontFormat returns the FontFormat instance associated with this element. |
java.lang.String |
getHtmlText()
The default implementation of getHtmlText simply returns
getText as html string.
|
java.lang.String |
getText()
Concats all containing Elements and returns it as String. |
boolean |
isEmpty()
Method isEmpty returns true, if this Element doesn't contain any TextElements. |
java.util.Iterator |
iterator()
Method iterator returns an iterator which allows to iterate
through all elements of this Element. |
void |
remove(int index)
Method remove removes the element at position index. |
protected void |
removeTextElements()
Method removeTextElements removes all CharacterElements from the internal elements list. |
void |
setFontFormat(FontFormat fontFormat)
Sets the format for this element and all subelements. |
void |
setText(java.lang.String text)
Removes all TextElements from the elements list and fills
the the array up with the new ones. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractElement()
public AbstractElement(java.lang.String s)
setText method.
s - A String to create a new Element from.| Method Detail |
public FontFormat getFontFormat()
Element
getFontFormat in interface Elementpublic void setFontFormat(FontFormat fontFormat)
setFontFormat in interface ElementfontFormat - The FontFormat instance to be set.Element.setFontFormat(FontFormat)public void addElement(Element element)
Element
addElement in interface Elementelement - the new Element to add.public Element getElement(int index)
Elementindex.
within this Element.
getElement in interface Elementindex - the index of the element.
index.public int getElementCount()
Element
getElementCount in interface Elementpublic java.util.Iterator iterator()
Elementiterator returns an iterator which allows to iterate
through all elements of this Element.
iterator in interface Elementpublic abstract java.util.List getCharacters()
public final void setText(java.lang.String text)
elements list and fills
the the array up with the new ones. This method is by intention final,
because we dont want to allow any misinterpretation of the
setText method within the whole text model.
setText in interface Elementtext - the text of this Element as String.Element.setText(String)public java.lang.String getText()
getText in interface ElementElement.getText()public java.lang.String getHtmlText()
getHtmlText simply returns
getText as html string.
NOTE:An atomic html text element might be responsible to
provide the right character encoding of its character!
At this point a < character would return its specific html
representation.
getHtmlText in interface ElementElement.getHtmlText()public void remove(int index)
Elementindex.
remove in interface Elementindex - the position of the element to remove.public boolean isEmpty()
Elementreturn getElementCount() == 0;
isEmpty in interface Elementprotected void removeTextElements()
elements list.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||