ca.odell.glazedlists.swing

Class EventTableColumnModel<T,extends,TableColumn>

Implemented Interfaces:
EventListener, ListSelectionListener, PropertyChangeListener, TableColumnModel, ListEventListener<E>

public class EventTableColumnModel<T,extends,TableColumn>
extends java.lang.Object
implements TableColumnModel, PropertyChangeListener, ListSelectionListener, ListEventListener<E>

A 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).

Author:
James Lemieux

Field Summary

protected TransformedList
T>swingThreadSource
the proxy moves events to the Swing Event Dispatch thread

Constructor Summary

EventTableColumnModel(EventList source)
Creates a new model that contains the TableColumn objects from the given source.

Method Summary

void
addColumn(TableColumn column)
void
addColumnModelListener(TableColumnModelListener listener)
protected 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(TableColumnModelEvent e)
protected void
fireColumnMarginChanged()
protected void
fireColumnMoved(TableColumnModelEvent e)
protected void
fireColumnRemoved(TableColumnModelEvent e)
protected void
fireColumnSelectionChanged(ListSelectionEvent e)
TableColumn
getColumn(int columnIndex)
int
getColumnCount()
int
getColumnIndex(Object identifier)
int
getColumnIndexAtX(int x)
int
getColumnMargin()
boolean
getColumnSelectionAllowed()
Enumeration
getColumns()
int
getSelectedColumnCount()
int[]
getSelectedColumns()
ListSelectionModel
getSelectionModel()
int
getTotalColumnWidth()
void
listChanged(ListEvent listChanges)
void
moveColumn(int columnIndex, int newIndex)
void
propertyChange(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(TableColumn column)
void
removeColumnModelListener(TableColumnModelListener listener)
void
setColumnMargin(int newMargin)
void
setColumnSelectionAllowed(boolean flag)
void
setSelectionModel(ListSelectionModel newModel)
void
valueChanged(ListSelectionEvent e)

Field Details

T>swingThreadSource

protected TransformedListswingThreadSource
the proxy moves events to the Swing Event Dispatch thread

Constructor Details

EventTableColumnModel

public EventTableColumnModel(EventList source)
Creates a new model that contains the TableColumn objects from the given source. Changes to the source are reflected in this model.

Method Details

addColumn

public void addColumn(TableColumn column)

addColumnModelListener

public void addColumnModelListener(TableColumnModelListener listener)

createSelectionModel

protected ListSelectionModel createSelectionModel()
Creates a new default list selection model.

dispose

public void dispose()
Releases the resources consumed by this 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.


fireColumnAdded

protected void fireColumnAdded(TableColumnModelEvent e)

fireColumnMarginChanged

protected void fireColumnMarginChanged()

fireColumnMoved

protected void fireColumnMoved(TableColumnModelEvent e)

fireColumnRemoved

protected void fireColumnRemoved(TableColumnModelEvent e)

fireColumnSelectionChanged

protected void fireColumnSelectionChanged(ListSelectionEvent e)

getColumn

public TableColumn getColumn(int columnIndex)

getColumnCount

public int getColumnCount()

getColumnIndex

public int getColumnIndex(Object identifier)

getColumnIndexAtX

public int getColumnIndexAtX(int x)

getColumnMargin

public int getColumnMargin()

getColumnSelectionAllowed

public boolean getColumnSelectionAllowed()

getColumns

public Enumeration getColumns()

getSelectedColumnCount

public int getSelectedColumnCount()

getSelectedColumns

public int[] getSelectedColumns()

getSelectionModel

public ListSelectionModel getSelectionModel()

getTotalColumnWidth

public int getTotalColumnWidth()

listChanged

public void listChanged(ListEvent listChanges)

moveColumn

public void moveColumn(int columnIndex,
                       int newIndex)

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Watch for changes to the column width or preferred column width and trigger a relayout of the table header when they change.

removeColumn

public void removeColumn(TableColumn column)

removeColumnModelListener

public void removeColumnModelListener(TableColumnModelListener listener)

setColumnMargin

public void setColumnMargin(int newMargin)

setColumnSelectionAllowed

public void setColumnSelectionAllowed(boolean flag)

setSelectionModel

public void setSelectionModel(ListSelectionModel newModel)

valueChanged

public void valueChanged(ListSelectionEvent e)

Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by pbuilder at 2009-07-14 22:05