Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ix.iface.ui.tree
Class EditableTreeModel

    java.lang.Object
      javax.swing.tree.DefaultTreeModel
          ix.iface.ui.tree.EditableTreeModel

All Implemented Interfaces:
  DataChangeListener, java.io.Serializable, javax.swing.tree.TreeModel

Direct Known Subclasses:
  DomainTreeModel

    public abstract class EditableTreeModel

extends javax.swing.tree.DefaultTreeModel
implements DataChangeListener

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)

See Also:
  Serialized Form

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

### nodeMap

    java.util.HashMap nodeMap

  contains entries of (userNode - HashSet{IXTreeNodes})

### userNodes

    java.util.HashSet userNodes

  contains the set of user nodes that have been added to the tree

### isUpdating

    boolean isUpdating

Constructor Detail

### EditableTreeModel

    public EditableTreeModel()

### EditableTreeModel

    public EditableTreeModel(IXTreeNode root)

  Constructs a new instance with the given node as the root node of the tree.

  Parameters:
    `root` - The root node of the tree model.

### EditableTreeModel

    public 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. Assumes that the tree has been built already.

  Parameters:
    `root` - The root node of the tree model.
    `map` - the tree node map.

Method Detail

### isUserRoot

    public boolean isUserRoot(java.lang.Object userNode)

### getUserRoot

    public java.lang.Object getUserRoot()

### setUserRoot

    public void setUserRoot(java.lang.Object userNode)

### hasTreeNode

    public boolean hasTreeNode(java.lang.Object userNode,
                               java.lang.String parentName)

  Scroll and open the tree to make the given node visible. The old node may have been selected before, so if it is an ancestor, show the version of userNode that descends from it.

### getTreeNode

    public IXTreeNode getTreeNode(java.lang.Object userNode,
                                  java.lang.String parentName)

### ensureIXTreeNode

    public IXTreeNode ensureIXTreeNode(java.lang.Object userNode,
                                       java.lang.String parentName)

### makeIXTreeNode

    public IXTreeNode makeIXTreeNode(java.lang.Object userNode,
                                     java.lang.String parentName)

### ensureMapEntry

    public void ensureMapEntry(IXTreeNode node,
                               java.lang.String parentName)

### buildTree

    public void buildTree(java.lang.Object parentNode,
                          java.lang.String preParent)

### buildSubTree

    protected void buildSubTree(IXTreeNode parent)

  Only call this if the sub-tree really needs to be built. Collects user children, makes their TNs, adds them to TN parent, and builds their sub-trees (if needed)

### findStringTreeNode

    public IXTreeNode findStringTreeNode(java.lang.String nodeName)

### findTreeNode

    public IXTreeNode findTreeNode(java.lang.Object userObject)

### findTreeNodes

    protected java.util.Collection findTreeNodes(java.lang.Object userObject)

### startUpdate

    public void startUpdate()

### stopUpdate

    public void stopUpdate()

### ignoreUpdate

    public void ignoreUpdate()

  End update without firing

### setRoot

    public void setRoot(IXTreeNode root)

### newTreeChild

    public IXTreeNode newTreeChild(UIObject userParent)

### newTreeChild

    public IXTreeNode newTreeChild(IXTreeNode parent)

### addTreeParent

    public IXTreeNode addTreeParent(IXTreeNode parent,
                                    UIObject userChild)

### addTreeParent

    public IXTreeNode addTreeParent(IXTreeNode parent,
                                    IXTreeNode child)

### reloadData

    public void reloadData()

### clearModel

    public void clearModel()

### newIXTreeNode

    public abstract IXTreeNode newIXTreeNode(java.lang.Object userNode)

  Creates a new instance of a suitable IXTreeNode from the user object

### isOwnUserObject

    public abstract boolean isOwnUserObject(java.lang.Object object)

### findUserObjects

    public abstract java.util.List findUserObjects()

### findUserNode

    public abstract java.lang.Object findUserNode(java.lang.String name)

### makeUserObject

    public abstract java.lang.Object makeUserObject(java.lang.String name)

### makeUserObject

    public abstract java.lang.Object makeUserObject(java.lang.String name,
                                                    java.util.List children)

### getUserChildren

    public abstract java.util.List getUserChildren(java.lang.Object userParent)

### addUserChild

    public abstract void addUserChild(java.lang.Object userParent,
                                      java.lang.Object newChild)

### removeUserChild

    public abstract void removeUserChild(java.lang.Object userParent,
                                         java.lang.Object oldChild)

### getUserParents

    public abstract java.util.List getUserParents(java.lang.Object userObject)

### addUserParent

    public abstract void addUserParent(java.lang.Object userObject,
                                       java.lang.Object newParent)

### removeUserParent

    public abstract void removeUserParent(java.lang.Object userObject,
                                          java.lang.Object oldParent)

### reload

    public void reload()

  Overrides:
    `reload` in class `javax.swing.tree.DefaultTreeModel`

### reload

    public void reload(IXTreeNode node)

### dataChanged

    public void dataChanged(EditableObject obj,
                            java.lang.String field,
                            java.lang.Object oldVal,
                            java.lang.Object newVal)

  Specified by:
    `dataChanged` in interface `DataChangeListener`

### userNodeChanged

    public void userNodeChanged(ObjectChangeEvent oce)

### userNodeRemoved

    public void userNodeRemoved(java.lang.Object userNode)

### userNodeAdded

    public void userNodeAdded(java.lang.Object userNode,
                              ObjectChangeEvent oce)

  This only works if the added node already has a parent

### insertNodeInto

    public void insertNodeInto(javax.swing.tree.MutableTreeNode c,
                               javax.swing.tree.MutableTreeNode p,
                               int i)

  Overrides:
    `insertNodeInto` in class `javax.swing.tree.DefaultTreeModel`

### getTreeParent

    public IXTreeNode getTreeParent(IXTreeNode treeNode)

### printSubTree

    public java.lang.String printSubTree()

### printSubTree

    public java.lang.String printSubTree(java.lang.Object userNode)

### fireNodeChanged

    public void fireNodeChanged(IXTreeNode treeNode,
                                ObjectChangeEvent oce)

### fireNodeAdded

    public void fireNodeAdded(IXTreeNode treeNode)

### fireTreeNodesInserted

    public void fireTreeNodesInserted(java.lang.Object s,
                                      java.lang.Object[] p,
                                      int[] i,
                                      java.lang.Object[] c)

  Overrides:
    `fireTreeNodesInserted` in class `javax.swing.tree.DefaultTreeModel`

### fireTreeNodesChanged

    public void fireTreeNodesChanged(java.lang.Object s,
                                     java.lang.Object[] p,
                                     int[] i,
                                     java.lang.Object[] c)

  Overrides:
    `fireTreeNodesChanged` in class `javax.swing.tree.DefaultTreeModel`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD