Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.tree
Class AggregateRow

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.sciapp.tree.TreeTableRow
          extended by com.sciapp.tree.AggregateRow
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode
Direct Known Subclasses:
FooterRow, HeaderRow

public abstract class AggregateRow
extends TreeTableRow

A specialized TreeTableRow subclass that represents an aggregate row of a TreeTable.

Aggregate rows can either correspond to the group rows of the TreeTable (header rows, that can be expanded), or to rows that are placed at the bottom of each tree hierarchy, so called footer rows. An aggregate row is not associated with the data of the ListTableModel, but can provide information about the rows that are below it or above it (header or footer row respectively). This is done with the help of an Aggregator.

Aggregate rows store cumulative row information in an Object array, so that the calculations need not be performed every time the TreeTable is repainted.

See Also:
Serialized Form

Field Summary
protected  Object[] aggregateValues
          The object array which is used to store aggregate information.
 
Fields inherited from class com.sciapp.tree.TreeTableRow
modelIndex
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
AggregateRow(Object o, int modelIndex)
          Constructs an AggregateRow object.
 
Method Summary
 Object getAggregateValue(int rowIndex, int columnIndex)
          Returns the aggregate value for the row at rowIndex and column at columnIndex.
 boolean isAggregate()
          Returns true.
 void setAggregateValue(Object value, int rowIndex, int columnIndex)
          Sets the aggregate value for the object at rowIndex and columnIndex.
 
Methods inherited from class com.sciapp.tree.TreeTableRow
getModelIndex, isFooter, isHeader
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aggregateValues

protected Object[] aggregateValues
The object array which is used to store aggregate information.

Constructor Detail

AggregateRow

public AggregateRow(Object o,
                    int modelIndex)
Constructs an AggregateRow object.

Method Detail

getAggregateValue

public Object getAggregateValue(int rowIndex,
                                int columnIndex)
Returns the aggregate value for the row at rowIndex and column at columnIndex. This method will return null by default.

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
Returns:
the aggregate value at (rowIndex, columnIndex)

isAggregate

public boolean isAggregate()
Returns true.

Returns true if this node represents an aggregate row in the tree data structure created by TreeTableModel.

Specified by:
isAggregate in class TreeTableRow
Returns:
true if this node is an aggregate row, false otherwise.

setAggregateValue

public void setAggregateValue(Object value,
                              int rowIndex,
                              int columnIndex)
Sets the aggregate value for the object at rowIndex and columnIndex.

Parameters:
value - the aggregate value to set
rowIndex - the index of the row
columnIndex - the index of the column

Copyright © 2005 Scientific Applications. All Rights Reserved.