net.sf.jeppers.grid
Class DefaultSelectionModel

java.lang.Object
  |
  +--net.sf.jeppers.grid.AbstractSelectionModel
        |
        +--net.sf.jeppers.grid.DefaultSelectionModel
All Implemented Interfaces:
SelectionModel

public class DefaultSelectionModel
extends AbstractSelectionModel

Default implementation of SelectionModel.

Author:
Cameron Zemek

Field Summary
 
Fields inherited from class net.sf.jeppers.grid.AbstractSelectionModel
isAdjusting, listenerList
 
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
clone, equals, finalize, 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


setAnchor

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


setLead

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


clearSelection

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


getAnchorRow

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


getAnchorColumn

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


getLeadRow

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


getLeadColumn

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


getFirstSelectedColumn

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


getLastSelectedColumn

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


getFirstSelectedRow

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


getLastSelectedRow

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


setSelectionRange

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