net.sf.jeppers.grid
Class AbstractSelectionModel

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

public abstract class AbstractSelectionModel
extends Object
implements SelectionModel

A base for SelectionModel that provides handling of listeners.

Author:
Cameron Zemek

Field Summary
protected  boolean isAdjusting
           
protected  EventListenerList listenerList
          List of event listeners
 
Constructor Summary
AbstractSelectionModel()
           
 
Method Summary
 void addSelectionModelListener(SelectionModelListener listener)
          Add listener to model
 void fireSelectionChanged()
          Notifies all SelectionModelListeners that registered themselves as listeners for this SelectionModel that the selection has changed
 void fireSelectionChanged(SelectionModelEvent e)
          Forwards the given notification event to all SelectionModelListeners that registered themselves as listeners for this SelectionModel.
 EventListener[] getListeners(Class listenerType)
          Returns an array of all the listeners of the given type that were added to this model.
 boolean getValueIsAdjusting()
          Returns true if the value is undergoing a series of changes.
 void removeSelectionModelListener(SelectionModelListener listener)
          Remove listener from model
 void setValueIsAdjusting(boolean isAdjusting)
          This property is true if upcoming changes to the value of the model should be considered a single event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jeppers.grid.SelectionModel
clearSelection, getAnchorColumn, getAnchorRow, getFirstSelectedColumn, getFirstSelectedRow, getLastSelectedColumn, getLastSelectedRow, getLeadColumn, getLeadRow, isSelected, setAnchor, setLead, setSelectionRange
 

Field Detail

listenerList

protected EventListenerList listenerList
List of event listeners


isAdjusting

protected boolean isAdjusting
Constructor Detail

AbstractSelectionModel

public AbstractSelectionModel()
Method Detail

addSelectionModelListener

public void addSelectionModelListener(SelectionModelListener listener)
Description copied from interface: SelectionModel
Add listener to model

Specified by:
addSelectionModelListener in interface SelectionModel

removeSelectionModelListener

public void removeSelectionModelListener(SelectionModelListener listener)
Description copied from interface: SelectionModel
Remove listener from model

Specified by:
removeSelectionModelListener in interface SelectionModel

getListeners

public EventListener[] getListeners(Class listenerType)
Returns an array of all the listeners of the given type that were added to this model.

Returns:
all of the objects receiving listenerType notifications from this model

getValueIsAdjusting

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

Specified by:
getValueIsAdjusting in interface SelectionModel

setValueIsAdjusting

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

Specified by:
setValueIsAdjusting in interface SelectionModel

fireSelectionChanged

public void fireSelectionChanged(SelectionModelEvent e)
Forwards the given notification event to all SelectionModelListeners that registered themselves as listeners for this SelectionModel.

Parameters:
e - the event to be forwarded
See Also:
addSelectionModelListener(net.sf.jeppers.grid.SelectionModelListener), SelectionModelEvent, EventListenerList

fireSelectionChanged

public void fireSelectionChanged()
Notifies all SelectionModelListeners that registered themselves as listeners for this SelectionModel that the selection has changed