edu.buffalo.fs7.qsymbol2
Class GateTableColumnModel

java.lang.Object
  |
  +--javax.swing.table.DefaultTableColumnModel
        |
        +--edu.buffalo.fs7.qsymbol2.GateTableColumnModel
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener, java.beans.PropertyChangeListener, java.io.Serializable, javax.swing.table.TableColumnModel

public class GateTableColumnModel
extends javax.swing.table.DefaultTableColumnModel

class replacing the DefaultTableColumnModel for the GateTable class. It implements methods to add and remove gateContainers to the ColumnModel and sets the correct renderer classes. It as well implements methods to increase and decrease the width of the table columns.

See Also:
GateTable, GateTableModel, QubitRenderer, QubitHeaderRenderer, Serialized Form

Field Summary
protected  int columnWidth
           
protected  javax.swing.table.TableCellRenderer headerRenderer
           
protected  javax.swing.table.TableCellRenderer renderer
           
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
GateTableColumnModel()
          creates the GateTableColumnModel
 
Method Summary
 void addGateContainer(GateContainer gateContainer)
          creates a TableColumn object for the given GateContainer object.
 void changeColumnWidth(int delta)
          changes the column width of each column.
 int getPreferredColumnWidth()
          returns the preferred width of a column
 void removeGateContainer(GateContainer gateContainer)
          removes the correspondig TableColumn object from the TableColumn model.
 
Methods inherited from class javax.swing.table.DefaultTableColumnModel
addColumn, addColumnModelListener, createSelectionModel, fireColumnAdded, fireColumnMarginChanged, fireColumnMoved, fireColumnRemoved, fireColumnSelectionChanged, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, 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

renderer

protected javax.swing.table.TableCellRenderer renderer

headerRenderer

protected javax.swing.table.TableCellRenderer headerRenderer

columnWidth

protected int columnWidth
Constructor Detail

GateTableColumnModel

public GateTableColumnModel()
creates the GateTableColumnModel
Method Detail

addGateContainer

public void addGateContainer(GateContainer gateContainer)
creates a TableColumn object for the given GateContainer object. Sets the cell renderer to QubitRenderer and the HeaderRenderer to QubitHeaderRenderer. Sets the column header to the top level name of the gateContainer.
See Also:
GateContainer

removeGateContainer

public void removeGateContainer(GateContainer gateContainer)
removes the correspondig TableColumn object from the TableColumn model.

getPreferredColumnWidth

public int getPreferredColumnWidth()
returns the preferred width of a column

changeColumnWidth

public void changeColumnWidth(int delta)
changes the column width of each column. This method takes care that grouped columns do have the correct width (n*single column).