|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
org.iids.aos.gui.structs.Struct
public abstract class Struct
Parent object for all structs. These form a tree which is doubly linked and can be searched for name occurrences of children. Allows for removal of subtrees. Cleanup operations can be supplied in the respective struct implementation class.
AServiceWrapper can be linked to a struct. This way a Struct and
a service can be associated with each other. This is especially useful for
services because now they automatically become part of the tree structure.
This is the abstract super class of all struct implementations. To
implement a struct it is required to implement the functions
refreshImpl() and getChildClass().
| Field Summary | |
|---|---|
protected java.util.List<Struct> |
children
|
protected java.lang.String |
name
|
protected Struct |
parent
|
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
allowsChildren, EMPTY_ENUMERATION, userObject |
| Constructor Summary | |
|---|---|
Struct(java.lang.String name)
Creates a named orphan Struct (no parent, no children) |
|
Struct(java.lang.String name,
Struct parent,
ServiceWrapper sw)
Creates a named struct with a parent and a service wrapper. |
|
| Method Summary | ||
|---|---|---|
|
addChild(T child)
Add a child to this Struct. |
|
boolean |
allowsChildren()
|
|
boolean |
automaticChildShutdown()
Indicates whether children are automatically shut down whenever the parent structure shuts down. |
|
java.util.Enumeration |
children()
|
|
int |
compareTo(java.lang.Object o)
|
|
boolean |
contains(java.lang.String name)
|
|
boolean |
equals(java.lang.Object o)
See if this struct equals a certain struct. |
|
java.util.List<Struct> |
find(java.lang.String name)
|
|
java.util.List<Struct> |
find(java.lang.String name,
java.util.List<Struct> result)
Search recursively through descendants for a name containing the String find. |
|
Struct |
findChild(java.lang.String name)
Find structs non recursively. |
|
Struct |
findStructByPath(java.lang.String path)
|
|
Struct |
findStructByQueue(java.util.Queue<java.lang.String> names)
|
|
boolean |
getAllowsChildren()
|
|
java.lang.String |
getCanonicalPath()
|
|
javax.swing.tree.TreeNode |
getChildAt(int index)
|
|
abstract java.lang.Class<? extends Struct> |
getChildClass()
Returns the allowed Class type for child nodes. |
|
int |
getChildCount()
|
|
java.util.List<Struct> |
getChildren()
Get a list of all children of this Struct. |
|
Host |
getHost()
|
|
int |
getIndex(javax.swing.tree.TreeNode node)
|
|
Location |
getLocation()
|
|
java.lang.String |
getName()
|
|
Struct |
getParent()
Obtain parent Struct. |
|
Root |
getRoot()
|
|
ServiceWrapper |
getService()
|
|
java.util.List<Struct> |
getSiblings()
|
|
javax.swing.tree.TreePath |
getTreePath()
Obtain the tree path for a certain struct in the tree. |
|
World |
getWorld()
|
|
boolean |
hasLocalService()
|
|
boolean |
hasRemoteService()
|
|
boolean |
isExpanded()
|
|
boolean |
isLeaf()
|
|
boolean |
isShuttingDown()
|
|
boolean |
refresh()
The refresh method queries all of the services below for a refresh. |
|
boolean |
refresh(boolean newNode)
Refresh service info from this struct instance. |
|
protected abstract boolean |
refreshImpl()
Refresh implementation. |
|
void |
removeChild(Struct child)
Remove a child from this Struct. |
|
void |
setExpanded(boolean expanded)
|
|
void |
setName(java.lang.String name)
Changed name for this Struct. |
|
void |
setParent(Struct parent)
Set the parent struct for this Struct. |
|
void |
setReadOnly()
Set struct to readonly. |
|
void |
setService(ServiceWrapper service)
|
|
void |
shutdown()
Delete the struct and shut down its associated service (if any). |
|
boolean |
subtreeHasLocalService()
|
|
boolean |
subtreeIsRefreshing()
A method that can be used to find out whether a subtree of this tree is (at this moment) executing its refresh() method. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
add, breadthFirstEnumeration, clone, depthFirstEnumeration, getChildAfter, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected Struct parent
protected java.util.List<Struct> children
| Constructor Detail |
|---|
public Struct(java.lang.String name)
public Struct(java.lang.String name,
Struct parent,
ServiceWrapper sw)
parent - Structs organize themselves in a tree structure. Changes are
propagated to the parent structures (if any), searches may
descend down to children structures etc. If parent is not null
then this struct is automatically registered with the parent
and vice-versa (doubly linked tree).sw - The ServiceWrapper associated with this struct. The wrapper
will be associated with this struct, and this struct will also be
associated with sw. This way, the corresponding struct can
always be obtained from the service and vice-versa.| Method Detail |
|---|
public abstract java.lang.Class<? extends Struct> getChildClass()
public void setReadOnly()
public java.lang.String getName()
public void setName(java.lang.String name)
public Struct getParent()
getParent in interface javax.swing.tree.TreeNodegetParent in class javax.swing.tree.DefaultMutableTreeNodepublic void setParent(Struct parent)
public <T extends Struct> void addChild(T child)
public void removeChild(Struct child)
public final void shutdown()
public boolean automaticChildShutdown()
public boolean isShuttingDown()
public java.util.List<Struct> getChildren()
public java.util.List<Struct> getSiblings()
public java.util.List<Struct> find(java.lang.String name,
java.util.List<Struct> result)
find. A list with all the nodes that match the
criteria is returned.
public java.util.List<Struct> find(java.lang.String name)
public boolean contains(java.lang.String name)
public Struct findChild(java.lang.String name)
public javax.swing.tree.TreePath getTreePath()
public final java.lang.String getCanonicalPath()
public Struct findStructByPath(java.lang.String path)
public Struct findStructByQueue(java.util.Queue<java.lang.String> names)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic java.lang.String toString()
toString in class javax.swing.tree.DefaultMutableTreeNodepublic java.util.Enumeration children()
children in interface javax.swing.tree.TreeNodechildren in class javax.swing.tree.DefaultMutableTreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNodeisLeaf in class javax.swing.tree.DefaultMutableTreeNodepublic int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodegetChildCount in class javax.swing.tree.DefaultMutableTreeNodepublic javax.swing.tree.TreeNode getChildAt(int index)
getChildAt in interface javax.swing.tree.TreeNodegetChildAt in class javax.swing.tree.DefaultMutableTreeNodepublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodegetIndex in class javax.swing.tree.DefaultMutableTreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodegetAllowsChildren in class javax.swing.tree.DefaultMutableTreeNodepublic boolean allowsChildren()
public ServiceWrapper getService()
public void setService(ServiceWrapper service)
public boolean isExpanded()
public void setExpanded(boolean expanded)
public Host getHost()
public Location getLocation()
public World getWorld()
public Root getRoot()
getRoot in class javax.swing.tree.DefaultMutableTreeNodepublic final boolean refresh()
public final boolean refresh(boolean newNode)
public final boolean subtreeIsRefreshing()
refresh() method.
We do not need to revalidate the tree (thus, no multiple updates)
so that the tree is only revalidated once the tree is done updating.
public final boolean subtreeHasLocalService()
public boolean hasRemoteService()
public boolean hasLocalService()
protected abstract boolean refreshImpl()
refresh(). This makes sure that no duplicate refresh
operations are performed (??? is this still needed ??? XXX).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||