JComponentPack 1.3.0

com.zfqjava.swing
Class DefaultCellSelectionModel

java.lang.Object
  extended by com.zfqjava.swing.AbstractCellSelectionModel
      extended by com.zfqjava.swing.DefaultCellSelectionModel
All Implemented Interfaces:
CellSelectionModel

public class DefaultCellSelectionModel
extends AbstractCellSelectionModel


Field Summary
 
Fields inherited from class com.zfqjava.swing.AbstractCellSelectionModel
changeSupport, listenerList
 
Fields inherited from interface com.zfqjava.swing.CellSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
DefaultCellSelectionModel()
           
 
Method Summary
 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 removeColumnInterval(int column0, int column1)
          Remove the indices in the interval column0,column1 (inclusive) from the selection model.
 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.
 
Methods inherited from class com.zfqjava.swing.AbstractCellSelectionModel
addCellSelectionListener, addPropertyChangeListener, firePropertyChange, fireValueChanged, getCellSelectionListeners, getListeners, removeCellSelectionListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCellSelectionModel

public DefaultCellSelectionModel()
Method Detail

setSelectionMode

public void setSelectionMode(int mode)
Description copied from interface: CellSelectionModel
Sets the selection mode.

Parameters:
mode - the selection mode

getSelectionMode

public int getSelectionMode()
Description copied from interface: CellSelectionModel
Returns the selection mode.

Returns:
the selection mode

setSelectionCell

public void setSelectionCell(Cell cell)
Description copied from interface: CellSelectionModel
Changes the selection to select the specified cell.

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

setSelectionCells

public void setSelectionCells(Cell[] cells)
Description copied from interface: CellSelectionModel
Changes the selection to select the specified cells.

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

addSelectionCell

public void addSelectionCell(Cell cell)
Description copied from interface: CellSelectionModel
Adds the specified cell to the selection.

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

addSelectionCells

public void addSelectionCells(Cell[] cells)
Description copied from interface: CellSelectionModel
Adds the specified cells to the selection.

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

removeSelectionCell

public void removeSelectionCell(Cell cell)
Description copied from interface: CellSelectionModel
Removes the specified cell from the selection.

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

removeSelectionCells

public void removeSelectionCells(Cell[] cells)
Description copied from interface: CellSelectionModel
Adds the specified cells to the selection.

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

getSelectionList

public List getSelectionList()
Description copied from interface: CellSelectionModel
Returns the read-only selection list.

Returns:
the read-only selection list

getSelectedCell

public Cell getSelectedCell()
Description copied from interface: CellSelectionModel
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

public Cell[] getSelectedCells()
Description copied from interface: CellSelectionModel
Returns all selected cells in the selection.

Returns:
the selected cell as Cell object

setAnchorSelectionCell

public void setAnchorSelectionCell(int row,
                                   int column)
Description copied from interface: CellSelectionModel
Sets the anchor selection cell.

See Also:
CellSelectionModel.getAnchorSelectionRow(), CellSelectionModel.getAnchorSelectionColumn()

getAnchorSelectionRow

public int getAnchorSelectionRow()
Description copied from interface: CellSelectionModel
Returns the anchor selection row index.

See Also:
CellSelectionModel.setAnchorSelectionCell(int, int)

getAnchorSelectionColumn

public int getAnchorSelectionColumn()
Description copied from interface: CellSelectionModel
Returns the anchor selection column index.

See Also:
CellSelectionModel.setAnchorSelectionCell(int, int)

setLeadSelectionCell

public void setLeadSelectionCell(int row,
                                 int column)
Description copied from interface: CellSelectionModel
Sets the lead selection cell.

See Also:
CellSelectionModel.getLeadSelectionRow(), CellSelectionModel.getLeadSelectionColumn()

getLeadSelectionRow

public int getLeadSelectionRow()
Description copied from interface: CellSelectionModel
Returns the lead selection row index.

See Also:
CellSelectionModel.setLeadSelectionCell(int, int)

getLeadSelectionColumn

public int getLeadSelectionColumn()
Description copied from interface: CellSelectionModel
Returns the lead selection column index.

See Also:
CellSelectionModel.setLeadSelectionCell(int, int)

getMinSelectionRow

public int getMinSelectionRow()
Description copied from interface: CellSelectionModel
Returns the first selected row or -1 if the selection is empty.


getMaxSelectionRow

public int getMaxSelectionRow()
Description copied from interface: CellSelectionModel
Returns the last selected row or -1 if the selection is empty.


getMinSelectionColumn

public int getMinSelectionColumn()
Description copied from interface: CellSelectionModel
Returns the first selected column or -1 if the selection is empty.


getMaxSelectionColumn

public int getMaxSelectionColumn()
Description copied from interface: CellSelectionModel
Returns the last selected column or -1 if the selection is empty.


getSelectionCount

public int getSelectionCount()
Description copied from interface: CellSelectionModel
Returns the number of cells that are selected.


isRowSelected

public boolean isRowSelected(int row)
Description copied from interface: CellSelectionModel
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

isColumnSelected

public boolean isColumnSelected(int column)
Description copied from interface: CellSelectionModel
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

isCellSelected

public boolean isCellSelected(int row,
                              int column)
Description copied from interface: CellSelectionModel
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

isCellSelected

public boolean isCellSelected(Cell c)
Description copied from interface: CellSelectionModel
Returns whether the cell is selected.

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

isSelectionEmpty

public boolean isSelectionEmpty()
Description copied from interface: CellSelectionModel
Returns true if no cells are selected.


clearSelection

public void clearSelection()
Description copied from interface: CellSelectionModel
Change the selection to the empty set. If this represents a change to the current selection then notify each CellSelectionListener.

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

setValueIsAdjusting

public void setValueIsAdjusting(boolean valueIsAdjusting)
Description copied from interface: CellSelectionModel
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:
CellSelectionModel.getValueIsAdjusting()

getValueIsAdjusting

public boolean getValueIsAdjusting()
Description copied from interface: CellSelectionModel
Returns true if the value is undergoing a series of changes.

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

insertRowInterval

public void insertRowInterval(int row,
                              int length,
                              boolean before)
Description copied from interface: CellSelectionModel
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

public void removeRowInterval(int row0,
                              int row1)
Description copied from interface: CellSelectionModel
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

public void insertColumnInterval(int column,
                                 int length,
                                 boolean before)
Description copied from interface: CellSelectionModel
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

public void removeColumnInterval(int column0,
                                 int column1)
Description copied from interface: CellSelectionModel
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.


JComponentPack 1.3.0

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