|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.treetable.AbstractTreeTableModel
public abstract class AbstractTreeTableModel
AbstractTreeTableModel provides an implementation of
TreeTableModel
as a convenient starting
point in defining custom data models for JXTreeTable
.
Field Summary | |
---|---|
static Class |
hierarchicalColumnClass
Value returned by getColumnClass
for the hierarchical column. |
protected EventListenerList |
listenerList
Event listener list |
protected Object |
root
Root node of the model |
Constructor Summary | |
---|---|
AbstractTreeTableModel()
Constructs an AbstractTreeTableModel with a null root node |
|
AbstractTreeTableModel(Object root)
Constructs an AbstractTreeTableModel with the specified node
as the root node. |
Method Summary | |
---|---|
void |
addTreeModelListener(TreeModelListener l)
|
protected void |
fireTreeNodesChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children)
|
protected void |
fireTreeNodesInserted(Object source,
Object[] path,
int[] childIndices,
Object[] children)
|
protected void |
fireTreeNodesRemoved(Object source,
Object[] path,
int[] childIndices,
Object[] children)
|
protected void |
fireTreeStructureChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children)
|
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 in the specified parent node. |
Class |
getColumnClass(int column)
|
int |
getColumnCount()
|
String |
getColumnName(int column)
|
int |
getIndexOfChild(Object parent,
Object child)
Returns the index of child in parent. |
EventListener[] |
getListeners(Class listenerType)
Returns an array of all the objects currently registered as FooListener s
upon this model. |
Object |
getRoot()
|
TreeModelListener[] |
getTreeModelListeners()
|
boolean |
isCellEditable(Object node,
int column)
|
boolean |
isLeaf(Object node)
Returns true if the specified node is a leaf node; false otherwise. |
void |
removeTreeModelListener(TreeModelListener l)
|
void |
valueForPathChanged(TreePath path,
Object newValue)
Called when value for the item identified by path has been changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jdesktop.swingx.treetable.TreeTableModel |
---|
getValueAt, setValueAt |
Field Detail |
---|
public static final Class hierarchicalColumnClass
getColumnClass
for the hierarchical
column.
protected Object root
protected EventListenerList listenerList
Constructor Detail |
---|
public AbstractTreeTableModel()
AbstractTreeTableModel
with a null root node
public AbstractTreeTableModel(Object root)
AbstractTreeTableModel
with the specified node
as the root node.
root
- root nodeMethod Detail |
---|
public Class getColumnClass(int column)
getColumnClass
in interface TreeTableModel
public String getColumnName(int column)
getColumnName
in interface TreeTableModel
public Object getRoot()
getRoot
in interface TreeModel
public Object getChild(Object parent, int index)
getChild
in interface TreeModel
parent
- a node in the tree, obtained from this data source
TreeNode
.public int getChildCount(Object parent)
getChildCount
in interface TreeModel
parent
- node whose child count is being requested
public int getColumnCount()
getColumnCount
in interface TreeTableModel
public int getIndexOfChild(Object parent, Object child)
null
, returns -1.
getIndexOfChild
in interface TreeModel
parent
- a note in the tree, obtained from this data sourcechild
- the node we are interested in
null
public boolean isCellEditable(Object node, int column)
isCellEditable
in interface TreeTableModel
public boolean isLeaf(Object node)
isLeaf
in interface TreeModel
node
- node to test
public void valueForPathChanged(TreePath path, Object newValue)
treeNodesChanged
event.
valueForPathChanged
in interface TreeModel
path
- path to the node that has changednewValue
- the new value from the TreeCellEditor
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener
in interface TreeModel
public void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener
in interface TreeModel
public TreeModelListener[] getTreeModelListeners()
protected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
protected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
public EventListener[] getListeners(Class listenerType)
FooListener
s
upon this model.
FooListener
s are registered using the
addFooListener
method.
You can specify the listenerType
argument
with a class literal,
such as
FooListener.class
.
For example, you can query a
DefaultTreeModel
m
for its tree model listeners with the following code:
TreeModelListener[] tmls = (TreeModelListener[])(m.getListeners(TreeModelListener.class));If no such listeners exist, this method returns an empty array.
listenerType
- the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListener
s on this component,
or an empty array if no such
listeners have been added
ClassCastException
- if listenerType
doesn't specify a class or interface that implements
java.util.EventListener
getTreeModelListeners()
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |