|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jas.util.tree.SimpleNode
A simple node represents a node in a tree. Each node has a number of properties:
Field Summary | |
protected jas.util.tree.SimpleNode.FlashVector |
children
Note, since many nodes are leaves, the children map is not created until at least one child is added. |
protected static java.util.Enumeration |
nullEnumeration
|
protected java.lang.Object |
object
|
Constructor Summary | |
SimpleNode()
Create a root node, with no name, type or flag |
|
SimpleNode(SimpleNode parent,
java.lang.String name,
java.lang.String type,
int flags,
java.lang.Object object)
Create a node |
|
SimpleNode(java.lang.String name,
java.lang.String type,
int flags,
java.lang.Object object)
Create a root node |
Method Summary | |
SimpleNode |
add(TreeItem item)
Add a node specified by a TreeItem. |
SimpleNode |
add(TreeItem item,
java.lang.Object object)
Add a node specified by a TreeItem, with an associated object. |
protected void |
addChild(SimpleNode child)
|
void |
addNodeListener(SimpleNodeListener l)
|
java.util.Enumeration |
children()
|
void |
clearFlags(int mask)
|
protected SimpleNode |
createNode(SimpleNode parent,
java.lang.String name,
java.lang.String type,
int flags,
java.lang.Object object)
Called to create a node when adding a TreeItem to the tree. |
void |
destroy()
Destroy a node (remove it from its parents list of children) No further use of a node or its chilren should be made after it has been destroyed |
java.util.Enumeration |
elements()
Returns an enumeration of the objects associated with the child nodes. |
SimpleNode |
find(TreeItem item)
Find a node specified by a TreeItem. |
SimpleNode |
findChild(java.lang.String name)
Find a child node with a given name |
SimpleNode |
getChild(int index)
|
int |
getChildCount()
|
int |
getFlags()
|
int |
getIndexOfChild(java.lang.Object child)
|
java.lang.String |
getName()
|
java.lang.Object |
getObject()
Get the associated object. |
SimpleNode |
getParent()
|
TreeItem |
getTreeItem(SimpleNode base)
Get a TreeItem describing this node, relative to a base node |
java.lang.String |
getType()
|
boolean |
isAncestorOf(SimpleNode root)
|
void |
remove(TreeItem item)
Remove a node specified by a TreeItem. |
protected void |
removeChild(SimpleNode child)
|
void |
removeNodeListener(SimpleNodeListener l)
|
protected void |
renameChild(SimpleNode child,
java.lang.String newName)
|
void |
setFlags(int mask)
|
java.lang.String |
toString()
|
protected void |
treeChanged(int extraFlags)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected jas.util.tree.SimpleNode.FlashVector children
protected java.lang.Object object
protected static final java.util.Enumeration nullEnumeration
Constructor Detail |
public SimpleNode()
public SimpleNode(java.lang.String name, java.lang.String type, int flags, java.lang.Object object)
name
- The name of the nodetype
- The type of the nodeobject
- The Object associated with the nodepublic SimpleNode(SimpleNode parent, java.lang.String name, java.lang.String type, int flags, java.lang.Object object)
parent
- The parent of this nodename
- The name of the nodetype
- The type of the nodeobject
- The Object associated with the nodeMethod Detail |
protected SimpleNode createNode(SimpleNode parent, java.lang.String name, java.lang.String type, int flags, java.lang.Object object)
protected void addChild(SimpleNode child)
protected void removeChild(SimpleNode child)
protected void renameChild(SimpleNode child, java.lang.String newName)
protected void treeChanged(int extraFlags)
public TreeItem getTreeItem(SimpleNode base)
base
- The base nodepublic SimpleNode findChild(java.lang.String name)
name
- The name to search forpublic void destroy()
public SimpleNode add(TreeItem item)
item
- The subnode to addpublic SimpleNode add(TreeItem item, java.lang.Object object)
item
- The subnode to addobject
- The associated objectpublic void remove(TreeItem item)
item
- The subnode to removepublic SimpleNode find(TreeItem item)
item
- The subnode to removepublic int getChildCount()
public SimpleNode getChild(int index)
public int getIndexOfChild(java.lang.Object child)
public java.util.Enumeration children()
public java.util.Enumeration elements()
public java.lang.Object getObject()
public void setFlags(int mask)
public void clearFlags(int mask)
public boolean isAncestorOf(SimpleNode root)
public java.lang.String getType()
public int getFlags()
public java.lang.String getName()
public SimpleNode getParent()
public void addNodeListener(SimpleNodeListener l)
public void removeNodeListener(SimpleNodeListener l)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |