public class TableSelectionModel
extends java.lang.Object
implements java.beans.PropertyChangeListener, javax.swing.event.ListSelectionListener, javax.swing.event.TableModelListener
Modifier and Type | Field and Description |
---|---|
protected javax.swing.event.EventListenerList |
listenerList
List of Listeners which will be notified when the selection value changes
|
protected java.util.ArrayList |
listSelectionModels
contains a ListSelectionModel for each column
|
Constructor and Description |
---|
TableSelectionModel() |
Modifier and Type | Method and Description |
---|---|
protected void |
addColumn()
Add a column to the end of the model.
|
void |
addSelection(int row,
int column)
Forwards the request to the ListSelectionModel
at the specified column.
|
void |
addTableSelectionListener(TableSelectionListener l)
Add a listener to the list that's notified each time a
change to the selection occurs.
|
void |
clearSelection()
Calls clearSelection() of all ListSelectionModels.
|
protected void |
fireValueChanged(java.lang.Object source,
int firstIndex,
int lastIndex,
int columnIndex,
boolean isAdjusting)
Notify listeners that we have ended a series of adjustments.
|
javax.swing.ListSelectionModel |
getListSelectionModelAt(int index)
Returns the ListSelectionModel at the specified column
|
boolean |
isSelected(int row,
int column) |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
When the TableModel changes, the TableSelectionModel
has to adapt to the new Model.
|
protected void |
removeColumn()
Remove last column from model.
|
void |
removeSelection(int row,
int column)
Forwards the request to the ListSelectionModel
at the specified column.
|
void |
removeTableSelectionListener(TableSelectionListener l)
Remove a listener from the list that's notified each time a
change to the selection occurs.
|
void |
setColumns(int count)
Set the number of columns.
|
void |
setLeadSelectionIndex(int row,
int column)
Forwards the request to the ListSelectionModel
at the specified column.
|
void |
setSelection(int row,
int column)
Forwards the request to the ListSelectionModel
at the specified column.
|
void |
setSelectionInterval(int row1,
int row2,
int column)
Forwards the request to the ListSelectionModel
at the specified column.
|
void |
tableChanged(javax.swing.event.TableModelEvent e)
Is called when the TableModel changes.
|
java.lang.String |
toString() |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
Is called when the selection of a ListSelectionModel
of a column has changed.
|
protected javax.swing.event.EventListenerList listenerList
protected java.util.ArrayList listSelectionModels
public void addSelection(int row, int column)
public void setSelection(int row, int column)
public void setSelectionInterval(int row1, int row2, int column)
public void setLeadSelectionIndex(int row, int column)
public void removeSelection(int row, int column)
public void clearSelection()
public boolean isSelected(int row, int column)
public javax.swing.ListSelectionModel getListSelectionModelAt(int index)
index
- the columnpublic void setColumns(int count)
count
- the number of columnsprotected void addColumn()
protected void removeColumn()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void addTableSelectionListener(TableSelectionListener l)
public void removeTableSelectionListener(TableSelectionListener l)
public void tableChanged(javax.swing.event.TableModelEvent e)
tableChanged
in interface javax.swing.event.TableModelListener
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
fireValueChanged(Object source, int firstIndex, int lastIndex, int columnIndex, boolean isAdjusting)
protected void fireValueChanged(java.lang.Object source, int firstIndex, int lastIndex, int columnIndex, boolean isAdjusting)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2004-2015 Wandora Team