TreeTableRows

Top  Previous  Next

 

DynamicTreeTableModel nodes consist of instances of the abstract class TreeTableRow, which extends DefaultMutableTreeNode. They are divided in:

 

1.DataRows: nodes that are associated with the actual data of the underlying ListTableModel. The association is made through the modelIndex attribute.These nodes cannot have children.
2.AggregateRows: nodes that are not associated with the data of the underlying ListTableModel, but that may provide information about several rows of the table. These are further classifed into:
HeaderRows: branch nodes that have children and that can be expanded. HeaderRows usually contain information about their children.
FooterRows: nodes placed at the bottom of each tree level. FooterRows usually contain information about the rows above them. They are added to the tree as long as a Footer is defined in the DynamicTreeTableModel.

 

A TreeTableRow is constructed by specifying the data row object and the index that corresponds to that object in the data list of the underlying ListTableModel:

 

public TreeTableRow(Object o, int modelIndex);

 

TreeTableRow also has methods that determine its type:

 

public boolean isAggregate();

public boolean isHeader();

public boolean isFooter();

 

Finally, there are methods for getting and setting the aggregate values:

 

public Object getAggregateValue(int rowIndex, int columnIndex);

public void setAggregateValue(Object value, int rowIndex, int columnIndex);