com.pcauto.gui.table
Class RowHeaderColumnModel

java.lang.Object
  extended byjavax.swing.table.DefaultTableColumnModel
      extended bycom.pcauto.gui.table.ProxyColumnModel
          extended bycom.pcauto.gui.table.RowHeaderColumnModel
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener, java.beans.PropertyChangeListener, java.io.Serializable, javax.swing.table.TableColumnModel, javax.swing.event.TableColumnModelListener

public class RowHeaderColumnModel
extends ProxyColumnModel
implements javax.swing.table.TableColumnModel, javax.swing.event.TableColumnModelListener

The RowHeaderColumnModel is used by the EntityTable to store all the columns that correspond to the row header of the table. The row header of the table contains all those columns that are both visible and locked. A locked column is displayed even when the user pans across the other columns.

The EntityTableColumnModel that is provided to some of the methods in this class, is used to retrieve the visible and locked columns that will be stored in this RowHeaderColumnModel.

A virtual column is an extra column that appears to the left of all columns. It can be used to select rows, if row selection is enabled, and to display useful information about the row, such as the row number or the row index.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.pcauto.gui.table.ProxyColumnModel
origModel
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
RowHeaderColumnModel()
          Constructs a new RowHeaderColumnModel.
RowHeaderColumnModel(EntityTableColumnModel m)
          Constructs a new RowHeaderColumnModel with the given EntityTableColumnModel.
 
Method Summary
protected  int getRealColumnCount()
          Returns the number of non-virtual columns in this RowHeaderColumnModel.
 boolean isVirtualColumnEnabled()
          Returns true if the virtual column is enabled, false otherwise.
 void setModel(EntityTableColumnModel m)
          Sets the EntityTableColumnModel that is used to define the columns of the table and their properties.
 void setVirtualColumnEnabled(boolean v)
          Enables or disables the virtual column.
 
Methods inherited from class com.pcauto.gui.table.ProxyColumnModel
columnAdded, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, getModel, revalidate
 
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
 
Methods inherited from interface javax.swing.table.TableColumnModel
addColumn, addColumnModelListener, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumns, getColumnSelectionAllowed, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, moveColumn, removeColumn, removeColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel
 
Methods inherited from interface javax.swing.event.TableColumnModelListener
columnAdded, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged
 

Constructor Detail

RowHeaderColumnModel

public RowHeaderColumnModel()
Constructs a new RowHeaderColumnModel.


RowHeaderColumnModel

public RowHeaderColumnModel(EntityTableColumnModel m)
Constructs a new RowHeaderColumnModel with the given EntityTableColumnModel. The EntityTableColumnModel is used to set the columns that will be displayed in the table and their attributes. See EntityTableColumnModel for more information.

Parameters:
m - the EntityTableColumnModel which holds the columns for the table
Method Detail

setModel

public void setModel(EntityTableColumnModel m)
Sets the EntityTableColumnModel that is used to define the columns of the table and their properties. The EntityTableColumnModel is used to generate the row header. The columns in the EntityTableColumnModel parameter that are visible and locked will be added to this RowHeaderColumnModel. The columns added to this RowHeaderColumnModel specify the row header.

Overrides:
setModel in class ProxyColumnModel
Parameters:
m - the EntityTableColumnModel representing all the columns in the table

isVirtualColumnEnabled

public boolean isVirtualColumnEnabled()
Returns true if the virtual column is enabled, false otherwise. See the description of this class for information about virtual columns.

Returns:
true if the virtual column is enabled, false otherwise

setVirtualColumnEnabled

public void setVirtualColumnEnabled(boolean v)
Enables or disables the virtual column. See the description of this class for information about virtual columns.

Parameters:
v - enabled if true, disabled otherwise

getRealColumnCount

protected int getRealColumnCount()
Returns the number of non-virtual columns in this RowHeaderColumnModel. See the description of this class for information about virtual columns.

Overrides:
getRealColumnCount in class ProxyColumnModel
Returns:
int the number of columns that are not virtual