public class ColumnList
extends java.lang.Object
implements javax.swing.event.TableColumnModelListener
TableColumn
objects
in a TableColumnModel
.
Unlike a TableColumnModel, this never throws away
any columns, it just maintains an array of flags to indicate which
columns are currently in the model and which are not.
On construction it registers itself as a listener on its ColumnModel
so that it automatically keeps up to date with its state.Constructor and Description |
---|
ColumnList(javax.swing.table.TableColumnModel columnModel)
Constructs a new ColumnList, which will track a given column model.
|
Modifier and Type | Method and Description |
---|---|
void |
columnAdded(javax.swing.event.TableColumnModelEvent evt) |
void |
columnMarginChanged(javax.swing.event.ChangeEvent evt) |
void |
columnMoved(javax.swing.event.TableColumnModelEvent evt) |
void |
columnRemoved(javax.swing.event.TableColumnModelEvent evt) |
void |
columnSelectionChanged(javax.swing.event.ListSelectionEvent evt) |
javax.swing.table.TableColumn |
getColumn(int jcol)
Returns one of the columns in this list.
|
int |
getModelIndex(int jcol)
Returns the index in the table column model of a column at a given
index in this list.
|
int |
indexOf(javax.swing.table.TableColumn tcol)
Returns the position in this list at which the given table column
can be found.
|
boolean |
isActive(int jcol)
Indicates whether the column at a given index is currently active
(present in the table column model).
|
void |
setActive(int jcol,
boolean actv)
Marks a given column as active.
|
int |
size()
Returns the number of columns in this list.
|
public ColumnList(javax.swing.table.TableColumnModel columnModel)
columnModel
- table column model to trackpublic javax.swing.table.TableColumn getColumn(int jcol)
jcol
- list index of the columnpublic boolean isActive(int jcol)
jcol
- list index of the columnpublic void setActive(int jcol, boolean actv)
jcol
- list index of the columnactv
- whether the column at jcol should be present
in the table column modelpublic int size()
public int indexOf(javax.swing.table.TableColumn tcol)
tcol
- sought columnpublic int getModelIndex(int jcol)
jcol
- list indexpublic void columnAdded(javax.swing.event.TableColumnModelEvent evt)
columnAdded
in interface javax.swing.event.TableColumnModelListener
public void columnMoved(javax.swing.event.TableColumnModelEvent evt)
columnMoved
in interface javax.swing.event.TableColumnModelListener
public void columnRemoved(javax.swing.event.TableColumnModelEvent evt)
columnRemoved
in interface javax.swing.event.TableColumnModelListener
public void columnMarginChanged(javax.swing.event.ChangeEvent evt)
columnMarginChanged
in interface javax.swing.event.TableColumnModelListener
public void columnSelectionChanged(javax.swing.event.ListSelectionEvent evt)
columnSelectionChanged
in interface javax.swing.event.TableColumnModelListener
Copyright ? 2003-2017 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.