net.sf.jeppers.grid
Interface SelectionModel

All Known Implementing Classes:
AbstractSelectionModel

public interface SelectionModel

SelectionModel stores selection information for a grid of cells.

Author:
Cameron Zemek

Method Summary
 void addSelectionModelListener(SelectionModelListener listener)
          Add listener to model
 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 getValueIsAdjusting()
          Returns true if the value is undergoing a series of changes.
 boolean isSelected(int row, int column)
          Returns true if the specified cell is selected
 void removeSelectionModelListener(SelectionModelListener listener)
          Remove listener from model
 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
 void setValueIsAdjusting(boolean isAdjusting)
          This property is true if upcoming changes to the value of the model should be considered a single event.
 

Method Detail

addSelectionModelListener

public void addSelectionModelListener(SelectionModelListener listener)
Add listener to model


removeSelectionModelListener

public void removeSelectionModelListener(SelectionModelListener listener)
Remove listener from model


isSelected

public boolean isSelected(int row,
                          int column)
Returns true if the specified cell is selected


setAnchor

public void setAnchor(int row,
                      int column)
Set the selection anchor


setLead

public void setLead(int row,
                    int column)
Set the selection lead


clearSelection

public void clearSelection()
Clear selection


getAnchorRow

public int getAnchorRow()
Returns the top coordinate of the anchor


getAnchorColumn

public int getAnchorColumn()
Returns the leftmost coordinate of the anchor


getLeadRow

public int getLeadRow()
Returns the bottom coordinate of the lead


getLeadColumn

public int getLeadColumn()
Returns the rightmost coordinate of the lead


getFirstSelectedColumn

public int getFirstSelectedColumn()
Retrieves the index of the first column where at least one cell is selected


getLastSelectedColumn

public int getLastSelectedColumn()
Retrieves the index of the last column where at least one cell is selected


getFirstSelectedRow

public int getFirstSelectedRow()
Retrieves the index of the first row where at least one cell is selected


getLastSelectedRow

public int getLastSelectedRow()
Retrieves the index of the last row where at least one cell is selected


getValueIsAdjusting

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


setValueIsAdjusting

public void setValueIsAdjusting(boolean isAdjusting)
This property is true if upcoming changes to the value of the model should be considered a single event.


setSelectionRange

public void setSelectionRange(int topRow,
                              int leftColumn,
                              int bottomRow,
                              int rightColumn)
Set the selection to the specified range