|
JIDE 2.9.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jidesoft.grid.DefaultTableSelectionModel
public class DefaultTableSelectionModel
TableSelectionModel is a table selection model that can support non-contiguous selection. It is used by
JideTable when JideTable.setNonContiguousCellSelection(boolean) is set to true.
| Field Summary | |
|---|---|
protected int |
_anchorColumnIndex
|
protected int |
_anchorRowIndex
|
protected boolean |
_isValueAdjusting
|
protected int |
_leadColumnIndex
|
protected int |
_leadRowIndex
|
protected Vector<ListSelectionModel> |
_listSelectionModels
contains a ListSelectionModel for each column |
protected int |
_maxColumnIndex
|
protected int |
_maxRowIndex
|
protected int |
_minColumnIndex
|
protected int |
_minRowIndex
|
protected boolean |
_withinOneSelection
|
protected EventListenerList |
listenerList
List of Listeners which will be notified when the selection value changes |
| Constructor Summary | |
|---|---|
DefaultTableSelectionModel()
|
|
| Method Summary | |
|---|---|
protected void |
addColumn()
Adds a column to the end of the model. |
void |
addSelection(int row,
int column)
Adds the cell specified by row and column to the selection. |
void |
addTableSelectionListener(TableSelectionListener l)
Add a listener to the list that's notified each time a change to the selection occurs. |
void |
clearSelection()
Clears all the selections. |
void |
columnAdded(int columnIndex)
Notifies the selection model that a column is added to TableColumnModel. |
void |
columnMoved(int fromColumnIndex,
int toColumnIndex)
Notifies the selection model that a column is added to TableColumnModel. |
void |
columnRemoved(int columnIndex)
Notifies the selection model that a column is removed from TableColumnModel. |
protected void |
fireValueChanged()
|
protected void |
fireValueChanged(boolean isAdjusting)
Notifies listeners that we have ended a series of adjustments. |
protected void |
fireValueChanged(Object source,
int firstIndex,
int lastIndex,
int columnIndex,
boolean isAdjusting)
Notify listeners that we have ended a series of adjustments. |
protected void |
fireValueChanged(Object source,
int firstIndex,
int lastIndex,
int firstColumnIndex,
int lastColumnIndex,
boolean isAdjusting)
Notify listeners that we have ended a series of adjustments. |
int |
getAnchorColumnIndex()
Gets the anchor column index. |
int |
getAnchorRowIndex()
Gets the anchor row index. |
int |
getLeadColumnIndex()
Gets the lead column index. |
int |
getLeadRowIndex()
Gets the lead row index. |
ListSelectionModel |
getListSelectionModelAt(int columnIndex)
Returns the ListSelectionModel at the specified column. |
int |
getMaxSelectedColumnIndex()
Returns the last selected column index or -1 if the selection is empty. |
int |
getMaxSelectedRowIndex()
Returns the last selected row index or -1 if the selection is empty. |
int |
getMinSelectedColumnIndex()
Returns the first selected column index or -1 if the selection is empty. |
int |
getMinSelectedRowIndex()
Returns the first selected row index or -1 if the selection is empty. |
int |
getSelectedColumnCount()
Returns the number of selected columns. |
int[] |
getSelectedColumns()
Returns an array of indices of all selected columns. |
int |
getSelectedRowCount()
Returns the number of selected rows. |
int[] |
getSelectedRows()
Returns an array of indices of all selected rows. |
protected void |
insertColumn(int index)
Inserts a column at the specified index of the model. |
boolean |
isColumnSelected(int columnIndex)
Checks if the column at column index has any selected cells. |
boolean |
isRowSelected(int rowIndex)
Checks if the row at row index has any selected cells. |
boolean |
isSelected(int row,
int column)
Checks if the specified cell is selected. |
boolean |
isSelectionEmpty()
Checks if there is any selection in the selection model. |
boolean |
isValueAdjusting()
Checks if the value is adjusting. |
void |
markAsDirty(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
|
void |
moveLeadSelection(int row,
int column)
Moves the lead selection at the cell specified by row and column and leaving all selection values unchanged. |
void |
propertyChange(PropertyChangeEvent evt)
When the TableModel changes, the TableSelectionModel has to adapt to the new Model. |
protected void |
removeColumn()
Removes last column from model. |
void |
removeSelection(int row,
int column)
Removes the cell specified by row and column from the selection. |
void |
removeTableSelectionListener(TableSelectionListener l)
Remove a listener from the list that's notified each time a change to the selection occurs. |
void |
selectAll(int rowCount,
int columnCount)
Selects all the cells. |
void |
setAnchorSelection(int row,
int column)
Sets the anchor selection at the cell specified by row and column. |
void |
setColumns(int count)
Set the number of columns. |
void |
setLeadSelection(int row,
int column)
Sets the lead selection at the cell specified by row and column. |
void |
setSelection(int row,
int column)
Adds the cell specified by row and column to the selection. |
void |
setSelectionInterval(int row1,
int row2,
int column)
Adds the cells of the specified column between row1 and row2 to the selection. |
void |
setValueAdjusting(boolean valueAdjusting)
Sets the value adjusting flag. |
void |
tableChanged(TableModelEvent e)
Is called when the TableModel changes. |
String |
toString()
|
void |
valueChanged(ListSelectionEvent e)
Is called when the selection of a ListSelectionModel of a column has changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected EventListenerList listenerList
protected Vector<ListSelectionModel> _listSelectionModels
protected boolean _withinOneSelection
protected int _anchorRowIndex
protected int _anchorColumnIndex
protected int _leadRowIndex
protected int _leadColumnIndex
protected int _minRowIndex
protected int _minColumnIndex
protected int _maxRowIndex
protected int _maxColumnIndex
protected boolean _isValueAdjusting
| Constructor Detail |
|---|
public DefaultTableSelectionModel()
| Method Detail |
|---|
public boolean isValueAdjusting()
TableSelectionModel
isValueAdjusting in interface TableSelectionModelpublic void setValueAdjusting(boolean valueAdjusting)
TableSelectionModel
setValueAdjusting in interface TableSelectionModelvalueAdjusting - true or false.
public void markAsDirty(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
public void addSelection(int row,
int column)
addSelection in interface TableSelectionModel
public void removeSelection(int row,
int column)
removeSelection in interface TableSelectionModel
public void setSelection(int row,
int column)
setSelection in interface TableSelectionModel
public void setSelectionInterval(int row1,
int row2,
int column)
setSelectionInterval in interface TableSelectionModel
public void setAnchorSelection(int row,
int column)
setAnchorSelection in interface TableSelectionModel
public void setLeadSelection(int row,
int column)
setLeadSelection in interface TableSelectionModelrow - the new lead selection row indexcolumn - the new lead selection column index
public void moveLeadSelection(int row,
int column)
moveLeadSelection in interface TableSelectionModelrow - the new lead selection row indexcolumn - the new lead selection column indexpublic void clearSelection()
clearSelection in interface TableSelectionModel
public void selectAll(int rowCount,
int columnCount)
selectAll in interface TableSelectionModel
public boolean isSelected(int row,
int column)
isSelected in interface TableSelectionModelpublic ListSelectionModel getListSelectionModelAt(int columnIndex)
columnIndex - the column
public void setColumns(int count)
setColumns in interface TableSelectionModelcount - the number of columnsprotected void addColumn()
protected void insertColumn(int index)
index - the column index.protected void removeColumn()
public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic void addTableSelectionListener(TableSelectionListener l)
addTableSelectionListener in interface TableSelectionModelpublic void removeTableSelectionListener(TableSelectionListener l)
removeTableSelectionListener in interface TableSelectionModelpublic void tableChanged(TableModelEvent e)
tableChanged in interface TableModelListenerpublic void valueChanged(ListSelectionEvent e)
valueChanged in interface ListSelectionListenerprotected void fireValueChanged(boolean isAdjusting)
isAdjusting - true or false.
protected void fireValueChanged(Object source,
int firstIndex,
int lastIndex,
int columnIndex,
boolean isAdjusting)
source - firstIndex - lastIndex - columnIndex - isAdjusting - protected void fireValueChanged()
protected void fireValueChanged(Object source,
int firstIndex,
int lastIndex,
int firstColumnIndex,
int lastColumnIndex,
boolean isAdjusting)
source - firstIndex - lastIndex - firstColumnIndex - lastColumnIndex - isAdjusting - public String toString()
toString in class Objectpublic int getAnchorRowIndex()
getAnchorRowIndex in interface TableSelectionModelpublic int getAnchorColumnIndex()
getAnchorColumnIndex in interface TableSelectionModelpublic int getLeadRowIndex()
getLeadRowIndex in interface TableSelectionModelpublic int getLeadColumnIndex()
getLeadColumnIndex in interface TableSelectionModelpublic boolean isSelectionEmpty()
isSelectionEmpty in interface TableSelectionModelpublic int[] getSelectedColumns()
TableSelectionModel
getSelectedColumns in interface TableSelectionModelpublic int getSelectedColumnCount()
TableSelectionModel
getSelectedColumnCount in interface TableSelectionModelpublic int[] getSelectedRows()
TableSelectionModel
getSelectedRows in interface TableSelectionModelpublic int getSelectedRowCount()
TableSelectionModel
getSelectedRowCount in interface TableSelectionModelpublic boolean isRowSelected(int rowIndex)
TableSelectionModel
isRowSelected in interface TableSelectionModelpublic boolean isColumnSelected(int columnIndex)
TableSelectionModel
isColumnSelected in interface TableSelectionModelpublic int getMinSelectedRowIndex()
TableSelectionModel
getMinSelectedRowIndex in interface TableSelectionModelpublic int getMaxSelectedRowIndex()
TableSelectionModel
getMaxSelectedRowIndex in interface TableSelectionModelpublic int getMinSelectedColumnIndex()
TableSelectionModel
getMinSelectedColumnIndex in interface TableSelectionModelpublic int getMaxSelectedColumnIndex()
TableSelectionModel
getMaxSelectedColumnIndex in interface TableSelectionModelpublic void columnAdded(int columnIndex)
TableSelectionModel
columnAdded in interface TableSelectionModelcolumnIndex - the added column index.public void columnRemoved(int columnIndex)
TableSelectionModel
columnRemoved in interface TableSelectionModelcolumnIndex - the removed column index.
public void columnMoved(int fromColumnIndex,
int toColumnIndex)
TableSelectionModel
columnMoved in interface TableSelectionModelfromColumnIndex - the column index which is moved.toColumnIndex - the column index where the column is moved.
|
JIDE 2.9.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||