|
||||||||||
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 |
---|
Sequence.Tree<T> |
Constructor Summary | |
---|---|
Element()
|
|
Element(Element element,
boolean recursive)
|
Method Summary | |
---|---|
int |
add(Node node)
Adds an item to the sequence. |
void |
dumpOffsets()
|
abstract Element |
duplicate(boolean recursive)
Creates a copy of this node. |
Node |
get(int index)
Retrieves the item at the given 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. |
ListenerList<ElementListener> |
getElementListeners()
|
Font |
getFont()
|
Color |
getForegroundColor()
Gets the currently foreground color, or null if no color is foreground. |
int |
getLength()
Returns the length of the sequence. |
int |
getNodeAt(int offset)
Determines the index of the child node at a given offset. |
Sequence<Integer> |
getPathAt(int offset)
Determines the path of the descendant node at a given offset. |
Element |
getRange(int offset,
int characterCountArgument)
Returns a range from the node. |
int |
indexOf(Node node)
Returns the index of an item in the sequence. |
void |
insert(Node node,
int index)
Inserts an item into the sequence at a specific 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 characterCountArgument)
Called to notify a node that a range has been inserted. |
protected void |
rangeRemoved(int offset,
int characterCountArgument)
Called to notify a node that a range has been removed. |
Sequence<Node> |
remove(int index,
int count)
Removes one or more items from the sequence. |
int |
remove(Node node)
Removes the first occurrence of the given item from the sequence. |
Node |
removeRange(int offset,
int characterCountArgument)
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)
Updates the item at the given index. |
Methods inherited from class org.apache.pivot.wtk.text.Node |
---|
getDocumentOffset, getDocumentSpan, 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 characterCountArgument)
Node
removeRange
in class Node
public Element getRange(int offset, int characterCountArgument)
Node
getRange
in class Node
public abstract Element duplicate(boolean recursive)
Node
duplicate
in class Node
public char getCharacterAt(int offset)
Node
getCharacterAt
in class Node
public int getCharacterCount()
Node
getCharacterCount
in class Node
public int add(Node node)
Sequence
add
in interface Sequence<Node>
node
- The item to be added to the sequence.
public void insert(Node node, int index)
Sequence
insert
in interface Sequence<Node>
node
- The item to be added to the sequence.index
- The index at which the item should be inserted. Must be a value between
0 and getLength().public Node update(int index, Node node)
Sequence
update
in interface Sequence<Node>
index
- The index of the item to update.node
- The item that will replace any existing value at the given index.
public int remove(Node node)
Sequence
remove
in interface Sequence<Node>
node
- The item to remove.
Sequence.remove(int, int)
public Sequence<Node> remove(int index, int count)
Sequence
remove
in interface Sequence<Node>
index
- The starting index to remove.count
- The number of items to remove, beginning with index.
public Node get(int index)
Sequence
get
in interface Sequence<Node>
index
- The index of the item to retrieve.public int indexOf(Node node)
Sequence
indexOf
in interface Sequence<Node>
node
- The item to locate.
public int getLength()
Sequence
getLength
in interface Sequence<Node>
public int getNodeAt(int offset)
offset
-
public Sequence<Integer> getPathAt(int offset)
offset
-
public Node getDescendantAt(int offset)
offset
-
protected void rangeInserted(int offset, int characterCountArgument)
Node
rangeInserted
in class Node
protected void rangeRemoved(int offset, int characterCountArgument)
Node
rangeRemoved
in class Node
public 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 ListenerList<ElementListener> getElementListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |