unbbayes.gui.table
Class GroupableTableColumnModel

java.lang.Object
  extended by javax.swing.table.DefaultTableColumnModel
      extended by unbbayes.gui.table.GroupableTableColumnModel
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, ListSelectionListener, TableColumnModel

public class GroupableTableColumnModel
extends DefaultTableColumnModel

Class which extends the functionality of DefaultColumnTableModel to also provide capabilities to group columns. This can be used for instance to aid in the layout of groupable table headers.

See Also:
Serialized Form

Field Summary
protected  ArrayList columnGroups
          Hold the list of ColumnGroups which define what group each normal column is within, if any.
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
GroupableTableColumnModel()
           
 
Method Summary
 void addColumnGroup(ColumnGroup columnGroup)
          Add a new columngroup.
 Iterator columnGroupIterator()
          Provides an Iterator to iterate over the ColumnGroup list.
 ColumnGroup getColumnGroup(int index)
          Returns a ColumnGroup specified by an index.
 Iterator getColumnGroups(TableColumn col)
          Provides and iterator for accessing the ColumnGroups associated with a column.
 
Methods inherited from class javax.swing.table.DefaultTableColumnModel
addColumn, addColumnModelListener, createSelectionModel, fireColumnAdded, fireColumnMarginChanged, fireColumnMoved, fireColumnRemoved, fireColumnSelectionChanged, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumnModelListeners, getColumns, getColumnSelectionAllowed, getListeners, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, moveColumn, propertyChange, recalcWidthCache, removeColumn, removeColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnGroups

protected ArrayList columnGroups
Hold the list of ColumnGroups which define what group each normal column is within, if any.

Constructor Detail

GroupableTableColumnModel

public GroupableTableColumnModel()
Method Detail

addColumnGroup

public void addColumnGroup(ColumnGroup columnGroup)
Add a new columngroup.

Parameters:
columnGroup - new ColumnGroup

columnGroupIterator

public Iterator columnGroupIterator()
Provides an Iterator to iterate over the ColumnGroup list.

Returns:
Iterator over ColumnGroups

getColumnGroup

public ColumnGroup getColumnGroup(int index)
Returns a ColumnGroup specified by an index.

Parameters:
index - index of ColumnGroup
Returns:
ColumnGroup

getColumnGroups

public Iterator getColumnGroups(TableColumn col)
Provides and iterator for accessing the ColumnGroups associated with a column.

Parameters:
col - Column
Returns:
ColumnGroup iterator


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.