public class TLcdLayerTreeModel extends Object implements TreeModel
A TreeModel
for a hierarchical layer structure of
ILcdLayerTreeNode
s and ILcdLayer
s, which can be used to visualise the
layer structure using a JTree
.
This model also adds a listener to the hierarchical layer structure, and converts all the
TLcdLayeredEvent
s originating from it into the corresponding TreeModelEvent
s which are passed to the TreeModelListener
s
registered to this model.
Constructor and Description |
---|
TLcdLayerTreeModel(ILcdLayerTreeNode aRootNode)
Creates a new
TreeModel for the tree with root node aRootNode . |
Modifier and Type | Method and Description |
---|---|
void |
addTreeModelListener(TreeModelListener l) |
Object |
getChild(Object parent,
int index) |
int |
getChildCount(Object parent) |
int |
getIndexOfChild(Object parent,
Object child) |
Object |
getRoot() |
boolean |
isLeaf(Object node) |
void |
removeTreeModelListener(TreeModelListener l) |
void |
valueForPathChanged(TreePath path,
Object newValue) |
public TLcdLayerTreeModel(ILcdLayerTreeNode aRootNode)
TreeModel
for the tree with root node aRootNode
.
Editing this tree model by using valueForPathChanged
is not supported.aRootNode
- the root node of the treepublic int getChildCount(Object parent)
getChildCount
in interface TreeModel
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