public class EventTableColumnModel<T extends javax.swing.table.TableColumn> extends java.lang.Object implements javax.swing.table.TableColumnModel, java.beans.PropertyChangeListener, javax.swing.event.ListSelectionListener, ListEventListener<T>
TableColumnModel
that holds an EventList
. Each element of
the list corresponds to a TableColumn
in the model.
The EventTableColumnModel class is not thread-safe.
Unless otherwise noted, all methods are only safe to be called from the
event dispatch thread. To do this programmatically, use
SwingUtilities.invokeAndWait(Runnable)
.
Modifier and Type | Field and Description |
---|---|
protected TransformedList<T,T> |
swingThreadSource
the proxy moves events to the Swing Event Dispatch thread
|
Constructor and Description |
---|
EventTableColumnModel(EventList<T> source)
Creates a new model that contains the
TableColumn objects from
the given source . |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(javax.swing.table.TableColumn column) |
void |
addColumnModelListener(javax.swing.event.TableColumnModelListener listener) |
protected javax.swing.ListSelectionModel |
createSelectionModel()
Creates a new default list selection model.
|
void |
dispose()
Releases the resources consumed by this
EventTableColumnModel so that it
may eventually be garbage collected. |
protected void |
fireColumnAdded(javax.swing.event.TableColumnModelEvent e) |
protected void |
fireColumnMarginChanged() |
protected void |
fireColumnMoved(javax.swing.event.TableColumnModelEvent e) |
protected void |
fireColumnRemoved(javax.swing.event.TableColumnModelEvent e) |
protected void |
fireColumnSelectionChanged(javax.swing.event.ListSelectionEvent e) |
javax.swing.table.TableColumn |
getColumn(int columnIndex) |
int |
getColumnCount() |
int |
getColumnIndex(java.lang.Object identifier) |
int |
getColumnIndexAtX(int x) |
int |
getColumnMargin() |
java.util.Enumeration<javax.swing.table.TableColumn> |
getColumns() |
boolean |
getColumnSelectionAllowed() |
int |
getSelectedColumnCount() |
int[] |
getSelectedColumns() |
javax.swing.ListSelectionModel |
getSelectionModel() |
int |
getTotalColumnWidth() |
void |
listChanged(ListEvent<T> listChanges)
When the underlying list changes, this notification allows the
object to repaint itself or update itself as necessary.
|
void |
moveColumn(int columnIndex,
int newIndex) |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Watch for changes to the column width or preferred column width and
trigger a relayout of the table header when they change.
|
void |
removeColumn(javax.swing.table.TableColumn column) |
void |
removeColumnModelListener(javax.swing.event.TableColumnModelListener listener) |
void |
setColumnMargin(int newMargin) |
void |
setColumnSelectionAllowed(boolean flag) |
void |
setSelectionModel(javax.swing.ListSelectionModel newModel) |
void |
valueChanged(javax.swing.event.ListSelectionEvent e) |
protected TransformedList<T extends javax.swing.table.TableColumn,T extends javax.swing.table.TableColumn> swingThreadSource
public void addColumn(javax.swing.table.TableColumn column)
addColumn
in interface javax.swing.table.TableColumnModel
public void removeColumn(javax.swing.table.TableColumn column)
removeColumn
in interface javax.swing.table.TableColumnModel
public void moveColumn(int columnIndex, int newIndex)
moveColumn
in interface javax.swing.table.TableColumnModel
public void setColumnMargin(int newMargin)
setColumnMargin
in interface javax.swing.table.TableColumnModel
public int getColumnMargin()
getColumnMargin
in interface javax.swing.table.TableColumnModel
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableColumnModel
public java.util.Enumeration<javax.swing.table.TableColumn> getColumns()
getColumns
in interface javax.swing.table.TableColumnModel
public int getColumnIndex(java.lang.Object identifier)
getColumnIndex
in interface javax.swing.table.TableColumnModel
public javax.swing.table.TableColumn getColumn(int columnIndex)
getColumn
in interface javax.swing.table.TableColumnModel
public int getColumnIndexAtX(int x)
getColumnIndexAtX
in interface javax.swing.table.TableColumnModel
public int getTotalColumnWidth()
getTotalColumnWidth
in interface javax.swing.table.TableColumnModel
public void setColumnSelectionAllowed(boolean flag)
setColumnSelectionAllowed
in interface javax.swing.table.TableColumnModel
public boolean getColumnSelectionAllowed()
getColumnSelectionAllowed
in interface javax.swing.table.TableColumnModel
public int[] getSelectedColumns()
getSelectedColumns
in interface javax.swing.table.TableColumnModel
public int getSelectedColumnCount()
getSelectedColumnCount
in interface javax.swing.table.TableColumnModel
public void setSelectionModel(javax.swing.ListSelectionModel newModel)
setSelectionModel
in interface javax.swing.table.TableColumnModel
public javax.swing.ListSelectionModel getSelectionModel()
getSelectionModel
in interface javax.swing.table.TableColumnModel
public void addColumnModelListener(javax.swing.event.TableColumnModelListener listener)
addColumnModelListener
in interface javax.swing.table.TableColumnModel
public void removeColumnModelListener(javax.swing.event.TableColumnModelListener listener)
removeColumnModelListener
in interface javax.swing.table.TableColumnModel
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
public void listChanged(ListEvent<T> listChanges)
ListEventListener
It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event.
listChanged
in interface ListEventListener<T extends javax.swing.table.TableColumn>
listChanges
- a ListEvent
describing the changes to the listpublic void dispose()
EventTableColumnModel
so that it
may eventually be garbage collected.
An EventTableColumnModel
will be garbage collected without a
call to dispose()
, but not before its source EventList
is garbage collected. By calling dispose()
, you allow the
EventTableColumnModel
to be garbage collected before its source
EventList
. This is necessary for situations where an
EventTableColumnModel
is short-lived but its source
EventList
is long-lived.
Warning: It is an error
to call any method on an EventTableColumnModel
after it has been
disposed.
protected javax.swing.ListSelectionModel createSelectionModel()
protected void fireColumnAdded(javax.swing.event.TableColumnModelEvent e)
protected void fireColumnRemoved(javax.swing.event.TableColumnModelEvent e)
protected void fireColumnMoved(javax.swing.event.TableColumnModelEvent e)
protected void fireColumnSelectionChanged(javax.swing.event.ListSelectionEvent e)
protected void fireColumnMarginChanged()
Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by buildd at 2016-02-14 5:12