net.sf.jeppers.grid
Class DefaultSelectionModel

java.lang.Object
  extended bynet.sf.jeppers.grid.AbstractSelectionModel
      extended bynet.sf.jeppers.grid.DefaultSelectionModel
All Implemented Interfaces:
SelectionModel, java.io.Serializable

public class DefaultSelectionModel
extends AbstractSelectionModel
implements java.io.Serializable

Default implementation of SelectionModel.

Author:
Cameron Zemek
See Also:
Serialized Form

Constructor Summary
DefaultSelectionModel()
           
 
Method Summary
 void clearSelection()
          Clear selection
 int getAnchorColumn()
          Returns the leftmost coordinate of the anchor
 int getAnchorRow()
          Returns the top coordinate of the anchor
 int getFirstSelectedColumn()
          Retrieves the index of the first column where at least one cell is selected
 int getFirstSelectedRow()
          Retrieves the index of the first row where at least one cell is selected
 int getLastSelectedColumn()
          Retrieves the index of the last column where at least one cell is selected
 int getLastSelectedRow()
          Retrieves the index of the last row where at least one cell is selected
 int getLeadColumn()
          Returns the rightmost coordinate of the lead
 int getLeadRow()
          Returns the bottom coordinate of the lead
 boolean isSelected(int row, int column)
          Returns true if the specified cell is selected
 void setAnchor(int row, int column)
          Set the selection anchor
 void setLead(int row, int column)
          Set the selection lead
 void setSelectionRange(int topRow, int leftColumn, int bottomRow, int rightColumn)
          Set the selection to the specified range
 
Methods inherited from class net.sf.jeppers.grid.AbstractSelectionModel
addSelectionModelListener, fireSelectionChanged, fireSelectionChanged, getListeners, getValueIsAdjusting, removeSelectionModelListener, setValueIsAdjusting
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSelectionModel

public DefaultSelectionModel()
Method Detail

isSelected

public boolean isSelected(int row,
                          int column)
Description copied from interface: SelectionModel
Returns true if the specified cell is selected

Specified by:
isSelected in interface SelectionModel

setAnchor

public void setAnchor(int row,
                      int column)
Description copied from interface: SelectionModel
Set the selection anchor

Specified by:
setAnchor in interface SelectionModel

setLead

public void setLead(int row,
                    int column)
Description copied from interface: SelectionModel
Set the selection lead

Specified by:
setLead in interface SelectionModel

clearSelection

public void clearSelection()
Description copied from interface: SelectionModel
Clear selection

Specified by:
clearSelection in interface SelectionModel

getAnchorRow

public int getAnchorRow()
Description copied from interface: SelectionModel
Returns the top coordinate of the anchor

Specified by:
getAnchorRow in interface SelectionModel

getAnchorColumn

public int getAnchorColumn()
Description copied from interface: SelectionModel
Returns the leftmost coordinate of the anchor

Specified by:
getAnchorColumn in interface SelectionModel

getLeadRow

public int getLeadRow()
Description copied from interface: SelectionModel
Returns the bottom coordinate of the lead

Specified by:
getLeadRow in interface SelectionModel

getLeadColumn

public int getLeadColumn()
Description copied from interface: SelectionModel
Returns the rightmost coordinate of the lead

Specified by:
getLeadColumn in interface SelectionModel

getFirstSelectedColumn

public int getFirstSelectedColumn()
Description copied from interface: SelectionModel
Retrieves the index of the first column where at least one cell is selected

Specified by:
getFirstSelectedColumn in interface SelectionModel

getLastSelectedColumn

public int getLastSelectedColumn()
Description copied from interface: SelectionModel
Retrieves the index of the last column where at least one cell is selected

Specified by:
getLastSelectedColumn in interface SelectionModel

getFirstSelectedRow

public int getFirstSelectedRow()
Description copied from interface: SelectionModel
Retrieves the index of the first row where at least one cell is selected

Specified by:
getFirstSelectedRow in interface SelectionModel

getLastSelectedRow

public int getLastSelectedRow()
Description copied from interface: SelectionModel
Retrieves the index of the last row where at least one cell is selected

Specified by:
getLastSelectedRow in interface SelectionModel

setSelectionRange

public void setSelectionRange(int topRow,
                              int leftColumn,
                              int bottomRow,
                              int rightColumn)
Description copied from interface: SelectionModel
Set the selection to the specified range

Specified by:
setSelectionRange in interface SelectionModel