public class CASAFileTreeModel extends Object implements TreeModel
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Field and Description |
---|---|
private CASAFile |
file |
private Vector |
treeModelListeners |
Constructor and Description |
---|
CASAFileTreeModel() |
CASAFileTreeModel(CASAFile file) |
Modifier and Type | Method and Description |
---|---|
void |
addTreeModelListener(TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes.
|
protected void |
fireTreeStructureChanged()
This event is fired when the entire tree has been changed.
|
protected void |
fireTreeStructureChanged(TreePath path)
This event is fired when only a portion of the tree is modified.
|
Object |
getChild(Object parent,
int index)
Returns the child of parent at index index in the parent's child array.
|
int |
getChildCount(Object parent)
Returns the number of children of parent.
|
CASAFile |
getFile() |
int |
getIndexOfChild(Object parent,
Object child)
Returns the index of child in parent.
|
Object |
getRoot()
Returns the root of the tree.
|
boolean |
isLeaf(Object node)
Returns true if node is a leaf.
|
void |
removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with addTreeModelListener().
|
void |
setFile(CASAFile file) |
void |
valueForPathChanged(TreePath path,
Object newValue)
Messaged when the user has altered the value for the item identified by
path to newValue.
|
public CASAFileTreeModel()
public CASAFileTreeModel(CASAFile file) throws CASAIOException
CASAIOException
public void setFile(CASAFile file) throws CASAIOException
file
- CASAIOException
public CASAFile getFile()
public Object getRoot()
public Object getChild(Object parent, int index)
public int getChildCount(Object parent)
getChildCount
in interface TreeModel
public boolean isLeaf(Object node)
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener
in interface TreeModel
public void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener
in interface TreeModel
protected void fireTreeStructureChanged()
protected void fireTreeStructureChanged(TreePath path)