|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultTreeModel ix.iface.ui.tree.EditableTreeModel
public abstract class EditableTreeModel
A DefaultTreeModel for Named objects that can be edited. Abstract methods to define: ---finding and creating user objects and tree nodes IXTreeNode newIXTreeNode(Object userNode) create a node for this model boolean isOwnUserObject(Object object) check for userObject of this modl List findUserObjects() Object findUserNode(String name) as in getNamedObject Object makeUserObject(String name) create a user object Object makeUserObject(String name, List children) ditto ---to manipulate tree structure List getUserChildren(Object userParent) void addUserChild(Object userParent, Object newChild) void removeUserChild(Object userParent, Object oldChild) List getUserParents(Object userObject) void addUserParent(Object userObject, Object newParent) void removeUserParent(Object userObject, Object oldParent)
Field Summary | |
---|---|
(package private) boolean |
isUpdating
|
(package private) java.util.HashMap |
nodeMap
contains entries of (userNode - HashSet{IXTreeNodes}) |
(package private) java.util.HashSet |
userNodes
contains the set of user nodes that have been added to the tree |
Fields inherited from class javax.swing.tree.DefaultTreeModel |
---|
asksAllowsChildren, listenerList, root |
Constructor Summary | |
---|---|
EditableTreeModel()
|
|
EditableTreeModel(IXTreeNode root)
Constructs a new instance with the given node as the root node of the tree. |
|
EditableTreeModel(IXTreeNode root,
java.util.HashSet userNodes,
java.util.HashMap nodeMap)
Constructs a new instance with the given node as the root node of the tree. |
Method Summary | |
---|---|
IXTreeNode |
addTreeParent(IXTreeNode parent,
IXTreeNode child)
|
IXTreeNode |
addTreeParent(IXTreeNode parent,
UIObject userChild)
|
abstract void |
addUserChild(java.lang.Object userParent,
java.lang.Object newChild)
|
abstract void |
addUserParent(java.lang.Object userObject,
java.lang.Object newParent)
|
protected void |
buildSubTree(IXTreeNode parent)
Only call this if the sub-tree really needs to be built. |
void |
buildTree(java.lang.Object parentNode,
java.lang.String preParent)
|
void |
clearModel()
|
void |
dataChanged(EditableObject obj,
java.lang.String field,
java.lang.Object oldVal,
java.lang.Object newVal)
|
IXTreeNode |
ensureIXTreeNode(java.lang.Object userNode,
java.lang.String parentName)
|
void |
ensureMapEntry(IXTreeNode node,
java.lang.String parentName)
|
IXTreeNode |
findStringTreeNode(java.lang.String nodeName)
|
IXTreeNode |
findTreeNode(java.lang.Object userObject)
|
protected java.util.Collection |
findTreeNodes(java.lang.Object userObject)
|
abstract java.lang.Object |
findUserNode(java.lang.String name)
|
abstract java.util.List |
findUserObjects()
|
void |
fireNodeAdded(IXTreeNode treeNode)
|
void |
fireNodeChanged(IXTreeNode treeNode,
ObjectChangeEvent oce)
|
void |
fireTreeNodesChanged(java.lang.Object s,
java.lang.Object[] p,
int[] i,
java.lang.Object[] c)
|
void |
fireTreeNodesInserted(java.lang.Object s,
java.lang.Object[] p,
int[] i,
java.lang.Object[] c)
|
IXTreeNode |
getTreeNode(java.lang.Object userNode,
java.lang.String parentName)
|
IXTreeNode |
getTreeParent(IXTreeNode treeNode)
|
abstract java.util.List |
getUserChildren(java.lang.Object userParent)
|
abstract java.util.List |
getUserParents(java.lang.Object userObject)
|
java.lang.Object |
getUserRoot()
|
boolean |
hasTreeNode(java.lang.Object userNode,
java.lang.String parentName)
Scroll and open the tree to make the given node visible. |
void |
ignoreUpdate()
End update without firing |
void |
insertNodeInto(javax.swing.tree.MutableTreeNode c,
javax.swing.tree.MutableTreeNode p,
int i)
|
abstract boolean |
isOwnUserObject(java.lang.Object object)
|
boolean |
isUserRoot(java.lang.Object userNode)
|
IXTreeNode |
makeIXTreeNode(java.lang.Object userNode,
java.lang.String parentName)
|
abstract java.lang.Object |
makeUserObject(java.lang.String name)
|
abstract java.lang.Object |
makeUserObject(java.lang.String name,
java.util.List children)
|
abstract IXTreeNode |
newIXTreeNode(java.lang.Object userNode)
Creates a new instance of a suitable IXTreeNode from the user object |
IXTreeNode |
newTreeChild(IXTreeNode parent)
|
IXTreeNode |
newTreeChild(UIObject userParent)
|
java.lang.String |
printSubTree()
|
java.lang.String |
printSubTree(java.lang.Object userNode)
|
void |
reload()
|
void |
reload(IXTreeNode node)
|
void |
reloadData()
|
abstract void |
removeUserChild(java.lang.Object userParent,
java.lang.Object oldChild)
|
abstract void |
removeUserParent(java.lang.Object userObject,
java.lang.Object oldParent)
|
void |
setRoot(IXTreeNode root)
|
void |
setUserRoot(java.lang.Object userNode)
|
void |
startUpdate()
|
void |
stopUpdate()
|
void |
userNodeAdded(java.lang.Object userNode,
ObjectChangeEvent oce)
This only works if the added node already has a parent |
void |
userNodeChanged(ObjectChangeEvent oce)
|
void |
userNodeRemoved(java.lang.Object userNode)
|
Methods inherited from class javax.swing.tree.DefaultTreeModel |
---|
addTreeModelListener, asksAllowsChildren, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.HashMap nodeMap
java.util.HashSet userNodes
boolean isUpdating
Constructor Detail |
---|
public EditableTreeModel()
public EditableTreeModel(IXTreeNode root)
root
- The root node of the tree model.public EditableTreeModel(IXTreeNode root, java.util.HashSet userNodes, java.util.HashMap nodeMap)
root
- The root node of the tree model.map
- the tree node map.Method Detail |
---|
public boolean isUserRoot(java.lang.Object userNode)
public java.lang.Object getUserRoot()
public void setUserRoot(java.lang.Object userNode)
public boolean hasTreeNode(java.lang.Object userNode, java.lang.String parentName)
public IXTreeNode getTreeNode(java.lang.Object userNode, java.lang.String parentName)
public IXTreeNode ensureIXTreeNode(java.lang.Object userNode, java.lang.String parentName)
public IXTreeNode makeIXTreeNode(java.lang.Object userNode, java.lang.String parentName)
public void ensureMapEntry(IXTreeNode node, java.lang.String parentName)
public void buildTree(java.lang.Object parentNode, java.lang.String preParent)
protected void buildSubTree(IXTreeNode parent)
public IXTreeNode findStringTreeNode(java.lang.String nodeName)
public IXTreeNode findTreeNode(java.lang.Object userObject)
protected java.util.Collection findTreeNodes(java.lang.Object userObject)
public void startUpdate()
public void stopUpdate()
public void ignoreUpdate()
public void setRoot(IXTreeNode root)
public IXTreeNode newTreeChild(UIObject userParent)
public IXTreeNode newTreeChild(IXTreeNode parent)
public IXTreeNode addTreeParent(IXTreeNode parent, UIObject userChild)
public IXTreeNode addTreeParent(IXTreeNode parent, IXTreeNode child)
public void reloadData()
public void clearModel()
public abstract IXTreeNode newIXTreeNode(java.lang.Object userNode)
public abstract boolean isOwnUserObject(java.lang.Object object)
public abstract java.util.List findUserObjects()
public abstract java.lang.Object findUserNode(java.lang.String name)
public abstract java.lang.Object makeUserObject(java.lang.String name)
public abstract java.lang.Object makeUserObject(java.lang.String name, java.util.List children)
public abstract java.util.List getUserChildren(java.lang.Object userParent)
public abstract void addUserChild(java.lang.Object userParent, java.lang.Object newChild)
public abstract void removeUserChild(java.lang.Object userParent, java.lang.Object oldChild)
public abstract java.util.List getUserParents(java.lang.Object userObject)
public abstract void addUserParent(java.lang.Object userObject, java.lang.Object newParent)
public abstract void removeUserParent(java.lang.Object userObject, java.lang.Object oldParent)
public void reload()
reload
in class javax.swing.tree.DefaultTreeModel
public void reload(IXTreeNode node)
public void dataChanged(EditableObject obj, java.lang.String field, java.lang.Object oldVal, java.lang.Object newVal)
dataChanged
in interface DataChangeListener
public void userNodeChanged(ObjectChangeEvent oce)
public void userNodeRemoved(java.lang.Object userNode)
public void userNodeAdded(java.lang.Object userNode, ObjectChangeEvent oce)
public void insertNodeInto(javax.swing.tree.MutableTreeNode c, javax.swing.tree.MutableTreeNode p, int i)
insertNodeInto
in class javax.swing.tree.DefaultTreeModel
public IXTreeNode getTreeParent(IXTreeNode treeNode)
public java.lang.String printSubTree()
public java.lang.String printSubTree(java.lang.Object userNode)
public void fireNodeChanged(IXTreeNode treeNode, ObjectChangeEvent oce)
public void fireNodeAdded(IXTreeNode treeNode)
public void fireTreeNodesInserted(java.lang.Object s, java.lang.Object[] p, int[] i, java.lang.Object[] c)
fireTreeNodesInserted
in class javax.swing.tree.DefaultTreeModel
public void fireTreeNodesChanged(java.lang.Object s, java.lang.Object[] p, int[] i, java.lang.Object[] c)
fireTreeNodesChanged
in class javax.swing.tree.DefaultTreeModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |