All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.table.DefaultTableColumnModel

java.lang.Object
   |
   +----com.sun.java.swing.table.DefaultTableColumnModel

public class DefaultTableColumnModel
extends Object
implements TableColumnModel, PropertyChangeListener, ListSelectionListener, Serializable
See Also:
JTable

Variable Index

 o changeEvent
Change event (only one needed)
 o columnMargin
Width margin between each column
 o columnSelectionAllowed
Column selection allowed in this column model
 o emptySelectionAllowed
Empty selection allowed in this column model
 o listenerList
List of TableColumnModelListener
 o multipleSelectionAllowed
Multiple columns selected allowed in this column model
 o selectionModel
Model for keeping track of column selections
 o tableColumns
Array of TableColumn objects in this model
 o totalColumnWidth
A local cache of the combined width of all columns

Constructor Index

 o DefaultTableColumnModel()

Method Index

 o addColumn(TableColumn)
Appends aColumn to the end of the receiver's tableColumns array.
 o addColumnModelListener(TableColumnModelListener)
 o addColumnSelectionInterval(int, int)
 o clearSelection()
 o createSelectionModel()
 o fireColumnAdded(TableColumnModelEvent)
 o fireColumnMarginChanged()
 o fireColumnMoved(TableColumnModelEvent)
 o fireColumnRemoved(TableColumnModelEvent)
 o fireColumnSelectionChanged(ListSelectionEvent)
 o getColumn(int)
Returns the TableColumn object for the column at columnIndex
 o getColumn(Object)
Returns the TableColumn object for the column in the receiver's columns array whose identifier is equal to identifier, when compared using equals().
 o getColumnCount()
Returns the number of columns in the receiver's table columns array.
 o getColumnIndex(Object)
Returns the index of the first column in the receiver's columns array whose identifier is equal to identifier, when compared using equals().
 o getColumnIndexAtX(int)
Returns the index of the column that lies on the xPosition, or -1 if it lies outside the any of the column's bounds.
 o getColumnMargin()
Returns the width margin for TableColumn.
 o getColumns()
Returns an Enumeration of all the columns in the model
 o getColumnSelectionAllowed()
 o getEmptySelectionAllowed()
 o getMultipleSelectionAllowed()
 o getSelectedColumn()
 o getSelectedColumnCount()
 o getSelectedColumns()
 o getSelectionModel()
Returns the ListSelectionModel that is used to maintain column selection state.
 o getTotalColumnWidth()
 o isColumnSelected(int)
 o isColumnSelected(Object)
 o makeSelectionEmpty()
 o moveColumn(int, int)
Moves the column and heading at columnIndex to newIndex.
 o propertyChange(PropertyChangeEvent)
 o recalcWidthCache()
 o removeColumn(TableColumn)
Deletes the TableColumn column from the receiver's table columns array.
 o removeColumnModelListener(TableColumnModelListener)
 o removeColumnSelectionInterval(int, int)
 o selectAll()
 o setColumnMargin(int)
Sets the column margin to newMargin.
 o setColumnSelectionAllowed(boolean)
 o setColumnSelectionInterval(int, int)
 o setEmptySelectionAllowed(boolean)
 o setMultipleSelectionAllowed(boolean)
 o setSelectionModel(ListSelectionModel)
Sets the selection model for this TableColumnModel to newModel and registers with for listner notifications from the new selection model.
 o valueChanged(ListSelectionEvent)

Variables

 o tableColumns
 protected Vector tableColumns
Array of TableColumn objects in this model

 o selectionModel
 protected ListSelectionModel selectionModel
Model for keeping track of column selections

 o columnMargin
 protected int columnMargin
Width margin between each column

 o listenerList
 protected EventListenerList listenerList
List of TableColumnModelListener

 o changeEvent
 protected transient ChangeEvent changeEvent
Change event (only one needed)

 o multipleSelectionAllowed
 protected boolean multipleSelectionAllowed
Multiple columns selected allowed in this column model

 o emptySelectionAllowed
 protected boolean emptySelectionAllowed
Empty selection allowed in this column model

 o columnSelectionAllowed
 protected boolean columnSelectionAllowed
Column selection allowed in this column model

 o totalColumnWidth
 protected int totalColumnWidth
A local cache of the combined width of all columns

Constructors

 o DefaultTableColumnModel
 public DefaultTableColumnModel()

Methods

 o addColumn
 public void addColumn(TableColumn aColumn)
Appends aColumn to the end of the receiver's tableColumns array. This method also posts the columnAdded() event to its listeners.

Parameters:
column - The TableColumn to be added
Throws: IllegalArgumentException
if aColumn is null
See Also:
removeColumn
 o removeColumn
 public void removeColumn(TableColumn column)
Deletes the TableColumn column from the receiver's table columns array. This method will do nothing if column is not in the table's columns list. tile() is called to resize both the header and table views. This method also posts the columnRemoved() event to its listeners.

Parameters:
column - The TableColumn to be removed
See Also:
addColumn
 o moveColumn
 public void moveColumn(int columnIndex,
                        int newIndex)
Moves the column and heading at columnIndex to newIndex. The old column at columnIndex will now be found at newIndex, The column that used to be at newIndex is shifted left or right to make room. This will not move any columns if columnIndex equals newIndex. This method also posts the columnMoved() event to its listeners.

Parameters:
columnIndex - the index of column to be moved
newIndex - New index to move the column
Throws: IllegalArgumentException
if column or newIndex are not in the valid range
 o setColumnMargin
 public void setColumnMargin(int newMargin)
Sets the column margin to newMargin. This method also posts the columnMarginChanged() event to its listeners.

Parameters:
newMargin - the width margin of the column
See Also:
getColumnMargin, getTotalColumnWidth
 o getColumnCount
 public int getColumnCount()
Returns the number of columns in the receiver's table columns array.

Returns:
the number of columns in the receiver's table columns array
See Also:
getColumns
 o getColumns
 public Enumeration getColumns()
Returns an Enumeration of all the columns in the model

 o getColumnIndex
 public int getColumnIndex(Object identifier)
Returns the index of the first column in the receiver's columns array whose identifier is equal to identifier, when compared using equals(). Returns -1 if no column is found with the specified identifier.

Parameters:
identifier - the identifier object
Returns:
the index of the first table column in the receiver's tableColumns array whose identifier is equal to identifier, when compared using equals().
Throws: IllegalArgumentException
if identifier is null
See Also:
getColumn
 o getColumn
 public TableColumn getColumn(Object identifier)
Returns the TableColumn object for the column in the receiver's columns array whose identifier is equal to identifier, when compared using equals(). Returns null if no column is found with the specified identifier.

Parameters:
identifier - the identifier object
Returns:
the TableColumn object for the column in the receiver's tableColumns array whose identifier is equal to identifier, when compared using equals()
Throws: IllegalArgumentException
if identifier is null
See Also:
getColumnIndex
 o getColumn
 public TableColumn getColumn(int columnIndex)
Returns the TableColumn object for the column at columnIndex

Parameters:
columnIndex - the index of the column desired
Returns:
the TableColumn object for the column at columnIndex
 o getColumnMargin
 public int getColumnMargin()
Returns the width margin for TableColumn. The default columnMargin is 2.

Returns:
the maximum width for the TableColumn.
See Also:
setColumnMargin
 o getColumnIndexAtX
 public int getColumnIndexAtX(int xPosition)
Returns the index of the column that lies on the xPosition, or -1 if it lies outside the any of the column's bounds.

Returns:
the index of the column or -1 if no column is found
 o getTotalColumnWidth
 public int getTotalColumnWidth()
 o setSelectionModel
 public void setSelectionModel(ListSelectionModel newModel)
Sets the selection model for this TableColumnModel to newModel and registers with for listner notifications from the new selection model. If newModel is null, it means columns are not selectable.

Parameters:
newModel - the new selection model
See Also:
getSelectionModel
 o getSelectionModel
 public ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that is used to maintain column selection state.

Returns:
the object that provides column selection state. Or null if row selection is not allowed.
See Also:
setSelectionModel
 o setMultipleSelectionAllowed
 public void setMultipleSelectionAllowed(boolean flag)
 o getMultipleSelectionAllowed
 public boolean getMultipleSelectionAllowed()
 o setEmptySelectionAllowed
 public void setEmptySelectionAllowed(boolean flag)
 o getEmptySelectionAllowed
 public boolean getEmptySelectionAllowed()
 o setColumnSelectionAllowed
 public void setColumnSelectionAllowed(boolean flag)
 o getColumnSelectionAllowed
 public boolean getColumnSelectionAllowed()
 o selectAll
 public void selectAll()
 o clearSelection
 public void clearSelection()
 o makeSelectionEmpty
 public void makeSelectionEmpty()
 o setColumnSelectionInterval
 public void setColumnSelectionInterval(int index0,
                                        int index1)
 o addColumnSelectionInterval
 public void addColumnSelectionInterval(int index0,
                                        int index1)
 o removeColumnSelectionInterval
 public void removeColumnSelectionInterval(int index0,
                                           int index1)
 o getSelectedColumn
 public int getSelectedColumn()
 o getSelectedColumns
 public int[] getSelectedColumns()
 o getSelectedColumnCount
 public int getSelectedColumnCount()
 o isColumnSelected
 public boolean isColumnSelected(int columnIndex)
 o isColumnSelected
 public boolean isColumnSelected(Object identifier)
 o addColumnModelListener
 public void addColumnModelListener(TableColumnModelListener x)
 o removeColumnModelListener
 public void removeColumnModelListener(TableColumnModelListener x)
 o fireColumnAdded
 protected void fireColumnAdded(TableColumnModelEvent e)
 o fireColumnRemoved
 protected void fireColumnRemoved(TableColumnModelEvent e)
 o fireColumnMoved
 protected void fireColumnMoved(TableColumnModelEvent e)
 o fireColumnSelectionChanged
 protected void fireColumnSelectionChanged(ListSelectionEvent e)
 o fireColumnMarginChanged
 protected void fireColumnMarginChanged()
 o propertyChange
 public void propertyChange(PropertyChangeEvent evt)
 o valueChanged
 public void valueChanged(ListSelectionEvent e)
 o createSelectionModel
 protected ListSelectionModel createSelectionModel()
 o recalcWidthCache
 protected void recalcWidthCache()

All Packages  Class Hierarchy  This Package  Previous  Next  Index