JComponentPack 1.5.0

com.zfqjava.swing
Interface CellSelectionModel

All Known Implementing Classes:
AbstractCellSelectionModel, DefaultCellSelectionModel

public interface CellSelectionModel


Field Summary
static int MULTIPLE_INTERVAL_SELECTION
          A value for the selectionMode property: select one or more contiguous ranges of cell at a time.
static int SINGLE_INTERVAL_SELECTION
          A value for the selectionMode property: select one contiguous range of cell at a time.
static int SINGLE_SELECTION
          A value for the selectionMode property: select one cell at a time.
 
Method Summary
 void addCellSelectionListener(CellSelectionListener l)
          Adds listener to the list of listeners that are notified each time the set of selected cells changes.
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds a PropertyChangeListener to the listener list.
 void addSelectionCell(Cell cell)
          Adds the specified cell to the selection.
 void addSelectionCells(Cell[] cells)
          Adds the specified cells to the selection.
 void clearSelection()
          Change the selection to the empty set.
 int getAnchorSelectionColumn()
          Returns the anchor selection column index.
 int getAnchorSelectionRow()
          Returns the anchor selection row index.
 int getLeadSelectionColumn()
          Returns the lead selection column index.
 int getLeadSelectionRow()
          Returns the lead selection row index.
 int getMaxSelectionColumn()
          Returns the last selected column or -1 if the selection is empty.
 int getMaxSelectionRow()
          Returns the last selected row or -1 if the selection is empty.
 int getMinSelectionColumn()
          Returns the first selected column or -1 if the selection is empty.
 int getMinSelectionRow()
          Returns the first selected row or -1 if the selection is empty.
 Cell getSelectedCell()
          Returns the selected cell as Cell object.
 Cell[] getSelectedCells()
          Returns all selected cells in the selection.
 int getSelectionCount()
          Returns the number of cells that are selected.
 List getSelectionList()
          Returns the read-only selection list.
 int getSelectionMode()
          Returns the selection mode.
 boolean getValueIsAdjusting()
          Returns true if the value is undergoing a series of changes.
 void insertColumnInterval(int column, int length, boolean before)
          Insert length indices beginning before/after column.
 void insertRowInterval(int row, int length, boolean before)
          Insert length indices beginning before/after row.
 boolean isCellSelected(Cell c)
          Returns whether the cell is selected.
 boolean isCellSelected(int row, int column)
          Returns true if the cell at the specified position is selected.
 boolean isColumnSelected(int column)
          Returns true if the column at the specified index is selected.
 boolean isRowSelected(int row)
          Returns true if the row at the specified index is selected.
 boolean isSelectionEmpty()
          Returns true if no cells are selected.
 void removeCellSelectionListener(CellSelectionListener l)
          Removes listener from the list of listeners that are notified each time the set of selected cells changes.
 void removeColumnInterval(int column0, int column1)
          Remove the indices in the interval column0,column1 (inclusive) from the selection model.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes a PropertyChangeListener from the listener list.
 void removeRowInterval(int row0, int row1)
          Remove the indices in the interval row0,row1 (inclusive) from the selection model.
 void removeSelectionCell(Cell cell)
          Removes the specified cell from the selection.
 void removeSelectionCells(Cell[] cells)
          Adds the specified cells to the selection.
 void setAnchorSelectionCell(int row, int column)
          Sets the anchor selection cell.
 void setLeadSelectionCell(int row, int column)
          Sets the lead selection cell.
 void setSelectionCell(Cell cell)
          Changes the selection to select the specified cell.
 void setSelectionCells(Cell[] cells)
          Changes the selection to select the specified cells.
 void setSelectionMode(int mode)
          Sets the selection mode.
 void setValueIsAdjusting(boolean valueIsAdjusting)
          This property is true if upcoming changes to the value of the model should be considered a single event.
 

Field Detail

SINGLE_SELECTION

static final int SINGLE_SELECTION
A value for the selectionMode property: select one cell at a time.

See Also:
setSelectionMode(int), Constant Field Values

SINGLE_INTERVAL_SELECTION

static final int SINGLE_INTERVAL_SELECTION
A value for the selectionMode property: select one contiguous range of cell at a time.

See Also:
setSelectionMode(int), Constant Field Values

MULTIPLE_INTERVAL_SELECTION

static final int MULTIPLE_INTERVAL_SELECTION
A value for the selectionMode property: select one or more contiguous ranges of cell at a time.

See Also:
setSelectionMode(int), Constant Field Values
Method Detail

setSelectionMode

void setSelectionMode(int mode)
Sets the selection mode.

Parameters:
mode - the selection mode

getSelectionMode

int getSelectionMode()
Returns the selection mode.

Returns:
the selection mode

setSelectionCell

void setSelectionCell(Cell cell)
Changes the selection to select the specified cell.

Parameters:
cell - the cell to be selected
See Also:
addSelectionCell(com.zfqjava.swing.cell.Cell)

setSelectionCells

void setSelectionCells(Cell[] cells)
Changes the selection to select the specified cells.

Parameters:
cells - the cells to be selected
See Also:
addSelectionCells(com.zfqjava.swing.cell.Cell[])

addSelectionCell

void addSelectionCell(Cell cell)
Adds the specified cell to the selection.

Parameters:
cell - the cell to be selected
See Also:
setSelectionCell(com.zfqjava.swing.cell.Cell)

addSelectionCells

void addSelectionCells(Cell[] cells)
Adds the specified cells to the selection.

Parameters:
cells - the cells to be selected
See Also:
setSelectionCells(com.zfqjava.swing.cell.Cell[])

removeSelectionCell

void removeSelectionCell(Cell cell)
Removes the specified cell from the selection.

Parameters:
cell - the cell to be selected
See Also:
setSelectionCell(com.zfqjava.swing.cell.Cell)

removeSelectionCells

void removeSelectionCells(Cell[] cells)
Adds the specified cells to the selection.

Parameters:
cells - the cells to be selected
See Also:
setSelectionCells(com.zfqjava.swing.cell.Cell[])

getSelectionList

List getSelectionList()
Returns the read-only selection list.

Returns:
the read-only selection list

getSelectedCell

Cell getSelectedCell()
Returns the selected cell as Cell object. Returns null if have not such selected cell or the selected cell is not contiguous.

Returns:
the selected cell as Cell object

getSelectedCells

Cell[] getSelectedCells()
Returns all selected cells in the selection.

Returns:
the selected cell as Cell object

setAnchorSelectionCell

void setAnchorSelectionCell(int row,
                            int column)
Sets the anchor selection cell.

See Also:
getAnchorSelectionRow(), getAnchorSelectionColumn()

getAnchorSelectionRow

int getAnchorSelectionRow()
Returns the anchor selection row index.

See Also:
setAnchorSelectionCell(int, int)

getAnchorSelectionColumn

int getAnchorSelectionColumn()
Returns the anchor selection column index.

See Also:
setAnchorSelectionCell(int, int)

setLeadSelectionCell

void setLeadSelectionCell(int row,
                          int column)
Sets the lead selection cell.

See Also:
getLeadSelectionRow(), getLeadSelectionColumn()

getLeadSelectionRow

int getLeadSelectionRow()
Returns the lead selection row index.

See Also:
setLeadSelectionCell(int, int)

getLeadSelectionColumn

int getLeadSelectionColumn()
Returns the lead selection column index.

See Also:
setLeadSelectionCell(int, int)

getMinSelectionRow

int getMinSelectionRow()
Returns the first selected row or -1 if the selection is empty.


getMaxSelectionRow

int getMaxSelectionRow()
Returns the last selected row or -1 if the selection is empty.


getMinSelectionColumn

int getMinSelectionColumn()
Returns the first selected column or -1 if the selection is empty.


getMaxSelectionColumn

int getMaxSelectionColumn()
Returns the last selected column or -1 if the selection is empty.


getSelectionCount

int getSelectionCount()
Returns the number of cells that are selected.


isRowSelected

boolean isRowSelected(int row)
Returns true if the row at the specified index is selected.

Returns:
true if the row at index row is selected, where 0 is the first row
Throws:
IllegalArgumentException - if row is not in the valid range

isColumnSelected

boolean isColumnSelected(int column)
Returns true if the column at the specified index is selected.

Parameters:
column - the column in the column model
Returns:
true if the column at index column is selected, where 0 is the first column
Throws:
IllegalArgumentException - if column is not in the valid range

isCellSelected

boolean isCellSelected(int row,
                       int column)
Returns true if the cell at the specified position is selected.

Parameters:
row - the row being queried
column - the column being queried
Returns:
true if the cell at index (row, column) is selected, where the first row and first column are at index 0
Throws:
IllegalArgumentException - if row or column are not in the valid range

isCellSelected

boolean isCellSelected(Cell c)
Returns whether the cell is selected.

Parameters:
c - the cell
Returns:
true if the cell is selected, otherwise return false

isSelectionEmpty

boolean isSelectionEmpty()
Returns true if no cells are selected.


clearSelection

void clearSelection()
Change the selection to the empty set. If this represents a change to the current selection then notify each CellSelectionListener.

See Also:
addCellSelectionListener(com.zfqjava.swing.event.CellSelectionListener)

setValueIsAdjusting

void setValueIsAdjusting(boolean valueIsAdjusting)
This property is true if upcoming changes to the value of the model should be considered a single event. For example if the model is being updated in response to a user drag, the value of the valueIsAdjusting property will be set to true when the drag is initiated and be set to false when the drag is finished. This property allows listeners to to update only when a change has been finalized, rather than always handling all of the intermediate values.

Parameters:
valueIsAdjusting - The new value of the property.
See Also:
getValueIsAdjusting()

getValueIsAdjusting

boolean getValueIsAdjusting()
Returns true if the value is undergoing a series of changes.

Returns:
true if the value is currently adjusting
See Also:
setValueIsAdjusting(boolean)

insertRowInterval

void insertRowInterval(int row,
                       int length,
                       boolean before)
Insert length indices beginning before/after row. This is typically called to sync the selection model with a corresponding change in the data model.


removeRowInterval

void removeRowInterval(int row0,
                       int row1)
Remove the indices in the interval row0,row1 (inclusive) from the selection model. This is typically called to sync the selection model width a corresponding change in the data model.


insertColumnInterval

void insertColumnInterval(int column,
                          int length,
                          boolean before)
Insert length indices beginning before/after column. This is typically called to sync the selection model with a corresponding change in the data model.


removeColumnInterval

void removeColumnInterval(int column0,
                          int column1)
Remove the indices in the interval column0,column1 (inclusive) from the selection model. This is typically called to sync the selection model width a corresponding change in the data model.


addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.

A PropertyChangeEvent will get fired when the selection mode changes.

Parameters:
l - the PropertyChangeListener to be added

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
l - the PropertyChangeListener to be removed

addCellSelectionListener

void addCellSelectionListener(CellSelectionListener l)
Adds listener to the list of listeners that are notified each time the set of selected cells changes.

Parameters:
l - the new listener to be added

removeCellSelectionListener

void removeCellSelectionListener(CellSelectionListener l)
Removes listener from the list of listeners that are notified each time the set of selected cells changes.

Parameters:
l - the listener to remove

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.