Package Summary  Overview Summary

class:DefaultTableColumnModel [NONE]

field:tableColumns [NONE]

  • tableColumns

    protected Vector<TableColumn> tableColumns
    Array of TableColumn objects in this model

field:selectionModel [NONE]

  • selectionModel

    protected ListSelectionModel selectionModel
    Model for keeping track of column selections

field:columnMargin [NONE]

  • columnMargin

    protected int columnMargin
    Width margin between each column

field:listenerList [NONE]

  • listenerList

    protected EventListenerList listenerList
    List of TableColumnModelListener

field:changeEvent [NONE]

  • changeEvent

    protected transient ChangeEvent changeEvent
    Change event (only one needed)

field:columnSelectionAllowed [NONE]

  • columnSelectionAllowed

    protected boolean columnSelectionAllowed
    Column selection allowed in this column model

field:totalColumnWidth [NONE]

  • totalColumnWidth

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

constructor:<init>() [NONE]

  • DefaultTableColumnModel

    public DefaultTableColumnModel()
    Creates a default table column model.

method:addColumn(javax.swing.table.TableColumn) [NONE]

method:removeColumn(javax.swing.table.TableColumn) [NONE]

  • removeColumn

    public void removeColumn​(TableColumn column)
    Deletes the column from the tableColumns 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 a columnRemoved event to its listeners.
    Specified by:
    removeColumn in interface TableColumnModel
    Parameters:
    column - the TableColumn to be removed
    See Also:
    addColumn(javax.swing.table.TableColumn)

method:moveColumn(int,int) [NONE]

  • 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 a columnMoved event to its listeners.
    Specified by:
    moveColumn in interface TableColumnModel
    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

method:setColumnMargin(int) [NONE]

method:getColumnCount() [NONE]

  • getColumnCount

    public int getColumnCount()
    Returns the number of columns in the tableColumns array.
    Specified by:
    getColumnCount in interface TableColumnModel
    Returns:
    the number of columns in the tableColumns array
    See Also:
    getColumns()

method:getColumns() [NONE]

method:getColumnIndex(java.lang.Object) [NONE]

  • getColumnIndex

    public int getColumnIndex​(Object identifier)
    Returns the index of the first column in the tableColumns array whose identifier is equal to identifier, when compared using equals.
    Specified by:
    getColumnIndex in interface TableColumnModel
    Parameters:
    identifier - the identifier object
    Returns:
    the index of the first column in the tableColumns array whose identifier is equal to identifier
    Throws:
    IllegalArgumentException - if identifier is null, or if no TableColumn has this identifier
    See Also:
    getColumn(int)

method:getColumn(int) [NONE]

  • getColumn

    public TableColumn getColumn​(int columnIndex)
    Returns the TableColumn object for the column at columnIndex.
    Specified by:
    getColumn in interface TableColumnModel
    Parameters:
    columnIndex - the index of the column desired
    Returns:
    the TableColumn object for the column at columnIndex

method:getColumnMargin() [NONE]

  • getColumnMargin

    public int getColumnMargin()
    Returns the width margin for TableColumn. The default columnMargin is 1.
    Specified by:
    getColumnMargin in interface TableColumnModel
    Returns:
    the maximum width for the TableColumn
    See Also:
    setColumnMargin(int)

method:getColumnIndexAtX(int) [NONE]

  • getColumnIndexAtX

    public int getColumnIndexAtX​(int x)
    Returns the index of the column that lies at position x, or -1 if no column covers this point. In keeping with Swing's separable model architecture, a TableColumnModel does not know how the table columns actually appear on screen. The visual presentation of the columns is the responsibility of the view/controller object using this model (typically JTable). The view/controller need not display the columns sequentially from left to right. For example, columns could be displayed from right to left to accommodate a locale preference or some columns might be hidden at the request of the user. Because the model does not know how the columns are laid out on screen, the given xPosition should not be considered to be a coordinate in 2D graphics space. Instead, it should be considered to be a width from the start of the first column in the model. If the column index for a given X coordinate in 2D space is required, JTable.columnAtPoint can be used instead.
    Specified by:
    getColumnIndexAtX in interface TableColumnModel
    Parameters:
    x - the horizontal location of interest
    Returns:
    the index of the column or -1 if no column is found
    See Also:
    JTable.columnAtPoint(java.awt.Point)

method:getTotalColumnWidth() [NONE]

  • getTotalColumnWidth

    public int getTotalColumnWidth()
    Returns the total combined width of all columns.
    Specified by:
    getTotalColumnWidth in interface TableColumnModel
    Returns:
    the totalColumnWidth property

method:setSelectionModel(javax.swing.ListSelectionModel) [NONE]

method:getSelectionModel() [NONE]

method:setColumnSelectionAllowed(boolean) [NONE]

method:getColumnSelectionAllowed() [NONE]

method:getSelectedColumns() [NONE]

  • getSelectedColumns

    public int[] getSelectedColumns()
    Returns an array of selected columns. If selectionModel is null, returns an empty array.
    Specified by:
    getSelectedColumns in interface TableColumnModel
    Returns:
    an array of selected columns or an empty array if nothing is selected or the selectionModel is null

method:getSelectedColumnCount() [NONE]

  • getSelectedColumnCount

    public int getSelectedColumnCount()
    Returns the number of columns selected.
    Specified by:
    getSelectedColumnCount in interface TableColumnModel
    Returns:
    the number of columns selected

method:addColumnModelListener(javax.swing.event.TableColumnModelListener) [NONE]

method:removeColumnModelListener(javax.swing.event.TableColumnModelListener) [NONE]

method:getColumnModelListeners() [NONE]

method:fireColumnAdded(javax.swing.event.TableColumnModelEvent) [NONE]

  • fireColumnAdded

    protected void fireColumnAdded​(TableColumnModelEvent e)
    Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
    Parameters:
    e - the event received
    See Also:
    EventListenerList

method:fireColumnRemoved(javax.swing.event.TableColumnModelEvent) [NONE]

  • fireColumnRemoved

    protected void fireColumnRemoved​(TableColumnModelEvent e)
    Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
    Parameters:
    e - the event received
    See Also:
    EventListenerList

method:fireColumnMoved(javax.swing.event.TableColumnModelEvent) [NONE]

  • fireColumnMoved

    protected void fireColumnMoved​(TableColumnModelEvent e)
    Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
    Parameters:
    e - the event received
    See Also:
    EventListenerList

method:fireColumnSelectionChanged(javax.swing.event.ListSelectionEvent) [NONE]

  • fireColumnSelectionChanged

    protected void fireColumnSelectionChanged​(ListSelectionEvent e)
    Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
    Parameters:
    e - the event received
    See Also:
    EventListenerList

method:fireColumnMarginChanged() [NONE]

  • fireColumnMarginChanged

    protected void fireColumnMarginChanged()
    Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
    See Also:
    EventListenerList

method:getListeners(java.lang.Class) [NONE]

  • getListeners

    public <T extends EventListener> T[] getListeners​(Class<T> listenerType)
    Returns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

    You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a DefaultTableColumnModelm for its column model listeners with the following code:

    ColumnModelListener[] cmls = (ColumnModelListener[])(m.getListeners(ColumnModelListener.class));
    If no such listeners exist, this method returns an empty array.

    Type Parameters:
    T - the listener type
    Parameters:
    listenerType - the type of listeners requested
    Returns:
    an array of all objects registered as FooListeners on this model, or an empty array if no such listeners have been added
    Throws:
    ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
    Since:
    1.3
    See Also:
    getColumnModelListeners()

method:propertyChange(java.beans.PropertyChangeEvent) [NONE]

  • propertyChange

    public void propertyChange​(PropertyChangeEvent evt)
    Property Change Listener change method. Used to track changes to the column width or preferred column width.
    Specified by:
    propertyChange in interface PropertyChangeListener
    Parameters:
    evt - PropertyChangeEvent

method:valueChanged(javax.swing.event.ListSelectionEvent) [NONE]

  • valueChanged

    public void valueChanged​(ListSelectionEvent e)
    A ListSelectionListener that forwards ListSelectionEvents when there is a column selection change.
    Specified by:
    valueChanged in interface ListSelectionListener
    Parameters:
    e - the change event

method:createSelectionModel() [NONE]

  • createSelectionModel

    protected ListSelectionModel createSelectionModel()
    Creates a new default list selection model.
    Returns:
    a newly created default list selection model.

method:recalcWidthCache() [NONE]

  • recalcWidthCache

    protected void recalcWidthCache()
    Recalculates the total combined width of all columns. Updates the totalColumnWidth property.

© 2019 Oracle Corporation and/or its affiliates