API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.table. DefaultTableColumnModel View Source
Author(s)
Alan Chung
Philip Milne
Since
Version
1.52 11/30/05
Serial
Hierarchy
 Object
      DefaultTableColumnModel
Implements
 TableColumnModel
 PropertyChangeListener
 ListSelectionListener
 Serializable
Subclasses
Description
public class DefaultTableColumnModel
  The standard column-handler for a JTable.
See also:    JTable
Constructors
public DefaultTableColumnModel ()
Creates a default table column model.
Methods
Hide/Show inherited methods
public void addColumn (TableColumn aColumn) [Specified in TableColumnModel]
  Appends aColumn to the end of the tableColumns array.
public void addColumnModelListener (TableColumnModelListener x) [Specified in TableColumnModel]
  Adds a listener for table column model events.
protected ListSelectionModel createSelectionModel ()
Creates a new default list selection model.
protected void fireColumnAdded (TableColumnModelEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireColumnMarginChanged ()
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireColumnMoved (TableColumnModelEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireColumnRemoved (TableColumnModelEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireColumnSelectionChanged (ListSelectionEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
public TableColumn getColumn (int columnIndex) [Specified in TableColumnModel]
  Returns the TableColumn object for the column at columnIndex.
public int getColumnCount () [Specified in TableColumnModel]
  Returns the number of columns in the tableColumns array.
public int getColumnIndex (Object identifier) [Specified in TableColumnModel]
  Returns the index of the first column in the tableColumns array whose identifier is equal to identifier, when compared using equals.
public int getColumnIndexAtX (int x) [Specified in TableColumnModel]
  Returns the index of the column that lies at position x, or -1 if no column covers this point.
public int getColumnMargin () [Specified in TableColumnModel]
  Returns the width margin for TableColumn.
public TableColumnModelListener getColumnModelListeners ()
  Returns an array of all the column model listeners registered on this model.
public Enumeration<TableColumn> getColumns () [Specified in TableColumnModel]
  Returns an Enumeration of all the columns in the model.
public boolean getColumnSelectionAllowed () [Specified in TableColumnModel]
  Returns true if column selection is allowed, otherwise false.
public T getListeners (Class< T> listenerType)
  Returns an array of all the objects currently registered as FooListeners upon this model.
public int getSelectedColumnCount () [Specified in TableColumnModel]
  Returns the number of columns selected.
public int getSelectedColumns () [Specified in TableColumnModel]
  Returns an array of selected columns.
public ListSelectionModel getSelectionModel () [Specified in TableColumnModel]
  Returns the ListSelectionModel that is used to maintain column selection state.
public int getTotalColumnWidth () [Specified in TableColumnModel]
  Returns the total combined width of all columns.
public void moveColumn (int columnIndex, int newIndex) [Specified in TableColumnModel]
  Moves the column and heading at columnIndex to newIndex.
public void propertyChange (PropertyChangeEvent evt) [Specified in PropertyChangeListener]
  Property Change Listener change method.
protected void recalcWidthCache ()
  Recalculates the total combined width of all columns.
public void removeColumn (TableColumn column) [Specified in TableColumnModel]
  Deletes the column from the tableColumns array.
public void removeColumnModelListener (TableColumnModelListener x) [Specified in TableColumnModel]
  Removes a listener for table column model events.
public void setColumnMargin (int newMargin) [Specified in TableColumnModel]
  Sets the column margin to newMargin.
public void setColumnSelectionAllowed (boolean flag) [Specified in TableColumnModel]
  Sets whether column selection is allowed.
public void setSelectionModel (ListSelectionModel newModel) [Specified in TableColumnModel]
  Sets the selection model for this TableColumnModel to newModel and registers for listener notifications from the new selection model.
public void valueChanged (ListSelectionEvent e) [Specified in ListSelectionListener]
  A ListSelectionListener that forwards ListSelectionEvents when there is a column selection change.
Fields
Hide/Show inherited fields
protectedtransient ChangeEvent changeEvent
Change event (only one needed)
protected int columnMargin
Width margin between each column
protected boolean columnSelectionAllowed
Column selection allowed in this column model
protected EventListenerList listenerList
List of TableColumnModelListener
protected ListSelectionModel selectionModel
Model for keeping track of column selections
protected Vector<TableColumn> tableColumns
Array of TableColumn objects in this model
protected int totalColumnWidth
A local cache of the combined width of all columns
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar