Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.treetable
Class AbstractTreeTableModel

java.lang.Object
  extended by com.citra.treetable.AbstractTreeTableModel
All Implemented Interfaces:
TreeTableModel, Serializable, TreeModel
Direct Known Subclasses:
AbstractDatabaseTreeTableModel, MutableTreeTableModel, TreeModelMap

public abstract class AbstractTreeTableModel
extends Object
implements TreeTableModel, Serializable

AbstractTreeTableModel provides an abstract treetablemodel implementation.

See Also:
Serialized Form

Field Summary
protected  EventListenerList listenerList
          the list of treemodel listeners.
protected  Object root
          the root
 
Fields inherited from interface com.citra.treetable.TreeTableModel
CHANGE_COLUMN_SOURCE
 
Constructor Summary
AbstractTreeTableModel(Object root)
          Constructs an AbstractTreeTableModel.
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
          Adds a listener for the TreeModelEvent posted after the tree changes.
 void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
          Notifies all listeners that have registered interest for notification on this event type.
 void fireTreeTableStructureChanged()
          Generates an event that notifies listeners that the whole treetable structure has changed: both row and column data.
 void fireTreeTableStructureChanged(boolean adapterStructureChange)
          Generates an event that notifies listeners that the whole treetable structure has changed: both row and column data.
 Object getRoot()
          Returns the root of the tree.
 boolean isAggregate(Object row)
          Determines if node is an aggregate row.
 boolean isFooter(Object row)
          Determines if node is a footer.
 boolean isHeader(Object row)
          Determines if node is a header.
 void removeTreeModelListener(TreeModelListener l)
          Removes a listener previously added with addTreeModelListener.
 void setRoot(Object newRoot)
          Assigns a new root to the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.citra.treetable.TreeTableModel
getColumnClass, getColumnCount, getColumnName, getValueAt, isCellEditable, setValueAt
 
Methods inherited from interface javax.swing.tree.TreeModel
getChild, getChildCount, getIndexOfChild, isLeaf, valueForPathChanged
 

Field Detail

listenerList

protected EventListenerList listenerList
the list of treemodel listeners.


root

protected Object root
the root

Constructor Detail

AbstractTreeTableModel

public AbstractTreeTableModel(Object root)
Constructs an AbstractTreeTableModel.

Method Detail

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes.

Specified by:
addTreeModelListener in interface TreeModel
Parameters:
l - the listener to add
See Also:
TreeModel.removeTreeModelListener(javax.swing.event.TreeModelListener)

fireTreeNodesChanged

public void fireTreeNodesChanged(Object source,
                                 Object[] path,
                                 int[] childIndices,
                                 Object[] children)
Notifies all listeners that have registered interest for notification on this event type.


fireTreeNodesInserted

public void fireTreeNodesInserted(Object source,
                                  Object[] path,
                                  int[] childIndices,
                                  Object[] children)
Notifies all listeners that have registered interest for notification on this event type.


fireTreeNodesRemoved

public void fireTreeNodesRemoved(Object source,
                                 Object[] path,
                                 int[] childIndices,
                                 Object[] children)
Notifies all listeners that have registered interest for notification on this event type.


fireTreeStructureChanged

public void fireTreeStructureChanged(Object source,
                                     Object[] path,
                                     int[] childIndices,
                                     Object[] children)
Notifies all listeners that have registered interest for notification on this event type.


getRoot

public Object getRoot()
Returns the root of the tree. Returns null only if the tree has no nodes.

Specified by:
getRoot in interface TreeModel
Returns:
the root of the tree

isAggregate

public boolean isAggregate(Object row)
Determines if node is an aggregate row.

Specified by:
isAggregate in interface TreeTableModel
Parameters:
row - the node to consider
Returns:
true if node is an aggregate row, false otherwise

isFooter

public boolean isFooter(Object row)
Determines if node is a footer.

Specified by:
isFooter in interface TreeTableModel
Parameters:
row - the row to consider
Returns:
true if node is a footer, false otherwise

isHeader

public boolean isHeader(Object row)
Determines if node is a header.

Specified by:
isHeader in interface TreeTableModel
Parameters:
row - the row to query
Returns:
true if node is a header, false otherwise

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with addTreeModelListener.

Specified by:
removeTreeModelListener in interface TreeModel
Parameters:
l - the listener to remove
See Also:
TreeModel.addTreeModelListener(javax.swing.event.TreeModelListener)

setRoot

public void setRoot(Object newRoot)
Assigns a new root to the model.

Parameters:
newRoot - the new root to assign

fireTreeTableStructureChanged

public void fireTreeTableStructureChanged()
Generates an event that notifies listeners that the whole treetable structure has changed: both row and column data. This event will trigger a structure change TableModelEvent. You can use fireTreeTableStructureChanged(false), if a data change event is to be triggered.


fireTreeTableStructureChanged

public void fireTreeTableStructureChanged(boolean adapterStructureChange)
Generates an event that notifies listeners that the whole treetable structure has changed: both row and column data. The adapterStructureChange argument is significant only if the model is contained within a TreeTableModelAdapter. In this case, using adapterStructureChange with a true value will make TreeTableModelAdapter fire a table structure event.

Parameters:
adapterStructureChange - true if this event will triger a structure change TableModelEvent, false otherwise

Copyright © 2011 Citra Technologies. All Rights Reserved.