public class ColumnList extends Object implements 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(TableColumnModel columnModel)
Constructs a new ColumnList, which will track a given column model.
|
Modifier and Type | Method and Description |
---|---|
void |
columnAdded(TableColumnModelEvent evt) |
void |
columnMarginChanged(ChangeEvent evt) |
void |
columnMoved(TableColumnModelEvent evt) |
void |
columnRemoved(TableColumnModelEvent evt) |
void |
columnSelectionChanged(ListSelectionEvent evt) |
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(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(TableColumnModel columnModel)
columnModel
- table column model to trackpublic TableColumn getColumn(int jcol)
jcol
- list index of the columnjcol
public boolean isActive(int jcol)
jcol
- list index of the columnjcol
is activepublic 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(TableColumn tcol)
tcol
- sought columntcol
in this list, or -1 if it's not therepublic int getModelIndex(int jcol)
jcol
- list indexjcol
int this list, or one bigger than the size of the column model
if it's not in itpublic void columnAdded(TableColumnModelEvent evt)
columnAdded
in interface TableColumnModelListener
public void columnMoved(TableColumnModelEvent evt)
columnMoved
in interface TableColumnModelListener
public void columnRemoved(TableColumnModelEvent evt)
columnRemoved
in interface TableColumnModelListener
public void columnMarginChanged(ChangeEvent evt)
columnMarginChanged
in interface TableColumnModelListener
public void columnSelectionChanged(ListSelectionEvent evt)
columnSelectionChanged
in interface TableColumnModelListener
Copyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.