Package docking.widgets.tree.internal
Class GTreeModel
- java.lang.Object
-
- docking.widgets.tree.internal.GTreeModel
-
- All Implemented Interfaces:
javax.swing.tree.TreeModel
public class GTreeModel extends java.lang.Object implements javax.swing.tree.TreeModel
-
-
Constructor Summary
Constructors Constructor Description GTreeModel(GTreeNode root)
Constructs a GTreeModel with the given root node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTreeModelListener(javax.swing.event.TreeModelListener l)
void
dispose()
void
fireNodeAdded(GTreeNode parentNode, GTreeNode newNode)
void
fireNodeDataChanged(GTreeNode changedNode)
void
fireNodeRemoved(GTreeNode parentNode, GTreeNode removedNode, int index)
void
fireNodeStructureChanged(GTreeNode changedNode)
java.lang.Object
getChild(java.lang.Object parent, int index)
int
getChildCount(java.lang.Object parent)
int
getIndexOfChild(java.lang.Object parent, java.lang.Object child)
GTreeNode
getModelRoot()
java.lang.Object
getRoot()
boolean
isLeaf(java.lang.Object node)
void
privateSwingSetRootNode(GTreeNode newRoot)
Sets the models root node.void
removeTreeModelListener(javax.swing.event.TreeModelListener l)
void
setEventsEnabled(boolean b)
void
valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
-
-
-
Constructor Detail
-
GTreeModel
public GTreeModel(GTreeNode root)
Constructs a GTreeModel with the given root node.- Parameters:
root
- The root of the tree.
-
-
Method Detail
-
privateSwingSetRootNode
public void privateSwingSetRootNode(GTreeNode newRoot)
Sets the models root node. NOTE: this is intended to only be called from theGTree
- Parameters:
newRoot
- the new tree model root. It will either be the actual root or a root of a filtered sub-tree
-
getRoot
public java.lang.Object getRoot()
- Specified by:
getRoot
in interfacejavax.swing.tree.TreeModel
-
getModelRoot
public GTreeNode getModelRoot()
-
addTreeModelListener
public void addTreeModelListener(javax.swing.event.TreeModelListener l)
- Specified by:
addTreeModelListener
in interfacejavax.swing.tree.TreeModel
-
removeTreeModelListener
public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
- Specified by:
removeTreeModelListener
in interfacejavax.swing.tree.TreeModel
-
getChild
public java.lang.Object getChild(java.lang.Object parent, int index)
- Specified by:
getChild
in interfacejavax.swing.tree.TreeModel
-
getChildCount
public int getChildCount(java.lang.Object parent)
- Specified by:
getChildCount
in interfacejavax.swing.tree.TreeModel
-
getIndexOfChild
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
- Specified by:
getIndexOfChild
in interfacejavax.swing.tree.TreeModel
-
isLeaf
public boolean isLeaf(java.lang.Object node)
- Specified by:
isLeaf
in interfacejavax.swing.tree.TreeModel
-
valueForPathChanged
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
- Specified by:
valueForPathChanged
in interfacejavax.swing.tree.TreeModel
-
fireNodeStructureChanged
public void fireNodeStructureChanged(GTreeNode changedNode)
-
fireNodeDataChanged
public void fireNodeDataChanged(GTreeNode changedNode)
-
fireNodeRemoved
public void fireNodeRemoved(GTreeNode parentNode, GTreeNode removedNode, int index)
-
dispose
public void dispose()
-
setEventsEnabled
public void setEventsEnabled(boolean b)
-
-