public class NodeListModel extends AbstractListModel implements ComboBoxModel
listenerList
Constructor and Description |
---|
NodeListModel()
Creates new model.
|
NodeListModel(Node root)
Creates new model.
|
Modifier and Type | Method and Description |
---|---|
int |
getDepth()
Getter for depth.
|
Object |
getElementAt(int i)
Child at given index.
|
int |
getIndex(Object o)
Finds index of given object.
|
Object |
getSelectedItem() |
int |
getSize()
Number of elements in the model.
|
void |
setDepth(int depth)
Depth of nodes to display.
|
void |
setNode(Node root)
Changes the root of the model.
|
void |
setSelectedItem(Object anObject)
Currently selected item.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListDataListener, removeListDataListener
public NodeListModel()
public NodeListModel(Node root)
root
- the root of the modelpublic void setNode(Node root)
root
- the root of the modelpublic void setDepth(int depth)
depth
- the depthpublic int getDepth()
public int getSize()
public Object getElementAt(int i)
getElementAt
in interface ListModel
public int getIndex(Object o)
o
- object produced by this modelpublic void setSelectedItem(Object anObject)
setSelectedItem
in interface ComboBoxModel
public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel