class FileBrowser.Browser.MyTreeModel extends java.lang.Object implements javax.swing.tree.TreeModel
Modifier and Type | Field and Description |
---|---|
(package private) javax.swing.event.EventListenerList |
listenerList |
(package private) static long |
serialVersionUID |
(package private) javax.swing.event.TreeModelEvent |
treeModelEvent |
Constructor and Description |
---|
MyTreeModel() |
Modifier and Type | Method and Description |
---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener l) |
protected void |
fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children) |
protected void |
fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children) |
FileBrowser.MyTreeNode |
getChild(java.lang.Object parent,
int index) |
int |
getChildCount(java.lang.Object parent) |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child) |
(package private) FileBrowser.MyTreeNode[] |
getPathToRoot(FileBrowser.MyTreeNode aNode)
Builds the parents of node up to and including the root node,
where the original node is the last element in the returned
array.
|
(package private) FileBrowser.MyTreeNode[] |
getPathToRoot(FileBrowser.MyTreeNode aNode,
int depth)
Builds the parents of node up to and including the root node,
where the original node is the last element in the returned
array.
|
FileBrowser.MyTreeNode |
getRoot() |
boolean |
isLeaf(java.lang.Object node) |
(package private) void |
nodesWereInserted(FileBrowser.MyTreeNode node,
int childIndex) |
(package private) void |
nodesWereRemoved(FileBrowser.MyTreeNode node,
int childIndex,
FileBrowser.MyTreeNode removedChild) |
(package private) void |
reload(javax.swing.tree.TreePath treePath) |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener l) |
void |
valueForPathChanged(javax.swing.tree.TreePath treePath,
java.lang.Object newValue) |
static final long serialVersionUID
javax.swing.event.EventListenerList listenerList
javax.swing.event.TreeModelEvent treeModelEvent
MyTreeModel()
public void addTreeModelListener(javax.swing.event.TreeModelListener l)
addTreeModelListener
in interface javax.swing.tree.TreeModel
public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
void reload(javax.swing.tree.TreePath treePath)
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public FileBrowser.MyTreeNode getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
public FileBrowser.MyTreeNode getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath treePath, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
void nodesWereInserted(FileBrowser.MyTreeNode node, int childIndex)
void nodesWereRemoved(FileBrowser.MyTreeNode node, int childIndex, FileBrowser.MyTreeNode removedChild)
FileBrowser.MyTreeNode[] getPathToRoot(FileBrowser.MyTreeNode aNode)
aNode
- the TreeNode to get the path forFileBrowser.MyTreeNode[] getPathToRoot(FileBrowser.MyTreeNode aNode, int depth)
aNode
- the TreeNode to get the path fordepth
- an int giving the number of steps already taken towards
the root (on recursive calls), used to size the returned arrayprotected void fireTreeNodesInserted(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
protected void fireTreeNodesRemoved(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)