|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pivot.wtk.text.Node
org.apache.pivot.wtk.text.Element
public abstract class Element
Abstract base class for elements.
TODO Add style properties.
TODO Add style class property.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence |
|---|
org.apache.pivot.collections.Sequence.Tree<T> |
| Constructor Summary | |
|---|---|
Element()
|
|
Element(Element element,
boolean recursive)
|
|
| Method Summary | |
|---|---|
int |
add(Node node)
|
void |
dumpOffsets()
|
abstract Element |
duplicate(boolean recursive)
Creates a copy of this node. |
Node |
get(int index)
|
Color |
getBackgroundColor()
Gets the currently background color, or null if no color is background. |
char |
getCharacterAt(int offset)
Returns the character at the given offset. |
int |
getCharacterCount()
Returns the number of characters in this node. |
Node |
getDescendantAt(int offset)
Determines the descendant node at a given offset. |
org.apache.pivot.util.ListenerList<ElementListener> |
getElementListeners()
|
Font |
getFont()
|
Color |
getForegroundColor()
Gets the currently foreground color, or null if no color is foreground. |
int |
getLength()
|
int |
getNodeAt(int offset)
Determines the index of the child node at a given offset. |
org.apache.pivot.collections.Sequence<Integer> |
getPathAt(int offset)
Determines the path of the descendant node at a given offset. |
Element |
getRange(int offset,
int characterCount)
Returns a range from the node. |
int |
indexOf(Node node)
|
void |
insert(Node node,
int index)
|
void |
insertRange(Node range,
int offset)
Inserts a range into the node. |
boolean |
isStrikethrough()
|
boolean |
isUnderline()
|
Iterator<Node> |
iterator()
|
protected void |
rangeInserted(int offset,
int characterCount)
Called to notify a node that a range has been inserted. |
protected void |
rangeRemoved(int offset,
int characterCount)
Called to notify a node that a range has been removed. |
org.apache.pivot.collections.Sequence<Node> |
remove(int index,
int count)
|
int |
remove(Node node)
|
Node |
removeRange(int offset,
int characterCount)
Removes a range from the node. |
void |
setBackgroundColor(Color backgroundColor)
Sets the currently background color. |
void |
setBackgroundColor(String backgroundColor)
Sets the currently background color. |
void |
setFont(Font font)
|
void |
setFont(String font)
|
void |
setForegroundColor(Color foregroundColor)
Sets the currently foreground color. |
void |
setForegroundColor(String foregroundColor)
Sets the currently foreground color. |
void |
setStrikethrough(boolean strikethrough)
|
void |
setUnderline(boolean underline)
|
Node |
update(int index,
Node node)
|
| Methods inherited from class org.apache.pivot.wtk.text.Node |
|---|
getDocumentOffset, getNodeListeners, getOffset, getParent, nodeInserted, nodesRemoved, replaceRange, setOffset, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Element()
public Element(Element element,
boolean recursive)
| Method Detail |
|---|
public void insertRange(Node range,
int offset)
Node
insertRange in class Node
public Node removeRange(int offset,
int characterCount)
Node
removeRange in class Node
public Element getRange(int offset,
int characterCount)
Node
getRange in class Nodepublic abstract Element duplicate(boolean recursive)
Node
duplicate in class Nodepublic char getCharacterAt(int offset)
Node
getCharacterAt in class Nodepublic int getCharacterCount()
Node
getCharacterCount in class Nodepublic int add(Node node)
add in interface org.apache.pivot.collections.Sequence<Node>
public void insert(Node node,
int index)
insert in interface org.apache.pivot.collections.Sequence<Node>
public Node update(int index,
Node node)
update in interface org.apache.pivot.collections.Sequence<Node>public int remove(Node node)
remove in interface org.apache.pivot.collections.Sequence<Node>
public org.apache.pivot.collections.Sequence<Node> remove(int index,
int count)
remove in interface org.apache.pivot.collections.Sequence<Node>public Node get(int index)
get in interface org.apache.pivot.collections.Sequence<Node>public int indexOf(Node node)
indexOf in interface org.apache.pivot.collections.Sequence<Node>public int getLength()
getLength in interface org.apache.pivot.collections.Sequence<Node>public int getNodeAt(int offset)
offset -
public org.apache.pivot.collections.Sequence<Integer> getPathAt(int offset)
offset -
public Node getDescendantAt(int offset)
offset -
protected void rangeInserted(int offset,
int characterCount)
Node
rangeInserted in class Node
protected void rangeRemoved(int offset,
int characterCount)
Node
rangeRemoved in class Nodepublic Iterator<Node> iterator()
iterator in interface Iterable<Node>public void dumpOffsets()
public Font getFont()
public void setFont(Font font)
public final void setFont(String font)
public Color getForegroundColor()
public void setForegroundColor(Color foregroundColor)
foregroundColor - The foreground color, or null to specify no selectionpublic void setForegroundColor(String foregroundColor)
foregroundColor - The foreground colorpublic Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
backgroundColor - The background color, or null to specify no selectionpublic void setBackgroundColor(String backgroundColor)
backgroundColor - The background colorpublic boolean isUnderline()
public void setUnderline(boolean underline)
public boolean isStrikethrough()
public void setStrikethrough(boolean strikethrough)
public org.apache.pivot.util.ListenerList<ElementListener> getElementListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||