net.sf.jeppers.grid
Class AbstractSpanModel

java.lang.Object
  |
  +--net.sf.jeppers.grid.AbstractSpanModel
All Implemented Interfaces:
SpanModel
Direct Known Subclasses:
DefaultSpanModel

public abstract class AbstractSpanModel
extends Object
implements SpanModel

A base for SpanModel that provides handling of listeners.

Author:
Cameron Zemek

Field Summary
protected  EventListenerList listenerList
          List of event listeners
 
Constructor Summary
AbstractSpanModel()
           
 
Method Summary
 void addSpanModelListener(SpanModelListener listener)
          Add listener to model
 void fireCellSpanAdded(CellSpan newSpan)
          Notifies all SpanModelListeners that registered themselves as listeners for this SpanModel that a span was added
 void fireCellSpanRemoved(CellSpan removedSpan)
          Notifies all SpanModelListeners that registered themselves as listeners for this SpanModel that a span was removed
 void fireCellSpanUpdated(int anchorRow, int anchorColumn, int oldRowCount, int oldColumnCount, int newRowCount, int newColumnCount)
          Notifies all SpanModelListeners that registered themselves as listeners for this SpanModel that a span was updated
 void fireSpanChanged(SpanModelEvent e)
          Forwards the given notification event to all SpanModelListeners that registered themselves as listeners for this SpanModel.
 EventListener[] getListeners(Class listenerType)
          Returns an array of all the listeners of the given type that were added to this model.
 void removeSpanModelListener(SpanModelListener listener)
          Remove listener from model
 
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.SpanModel
getSpanIterator, getSpanOver, isCellSpan
 

Field Detail

listenerList

protected EventListenerList listenerList
List of event listeners

Constructor Detail

AbstractSpanModel

public AbstractSpanModel()
Method Detail

addSpanModelListener

public void addSpanModelListener(SpanModelListener listener)
Add listener to model

Specified by:
addSpanModelListener in interface SpanModel

removeSpanModelListener

public void removeSpanModelListener(SpanModelListener listener)
Remove listener from model

Specified by:
removeSpanModelListener in interface SpanModel

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

fireSpanChanged

public void fireSpanChanged(SpanModelEvent e)
Forwards the given notification event to all SpanModelListeners that registered themselves as listeners for this SpanModel.

Parameters:
e - the event to be forwarded
See Also:
addSpanModelListener(net.sf.jeppers.grid.SpanModelListener), SpanModelEvent, EventListenerList

fireCellSpanAdded

public void fireCellSpanAdded(CellSpan newSpan)
Notifies all SpanModelListeners that registered themselves as listeners for this SpanModel that a span was added


fireCellSpanRemoved

public void fireCellSpanRemoved(CellSpan removedSpan)
Notifies all SpanModelListeners that registered themselves as listeners for this SpanModel that a span was removed


fireCellSpanUpdated

public void fireCellSpanUpdated(int anchorRow,
                                int anchorColumn,
                                int oldRowCount,
                                int oldColumnCount,
                                int newRowCount,
                                int newColumnCount)
Notifies all SpanModelListeners that registered themselves as listeners for this SpanModel that a span was updated