JComponentPack 1.5.0

com.zfqjava.swing
Class AbstractCellSelectionModel

java.lang.Object
  extended by com.zfqjava.swing.AbstractCellSelectionModel
All Implemented Interfaces:
CellSelectionModel
Direct Known Subclasses:
DefaultCellSelectionModel

public abstract class AbstractCellSelectionModel
extends Object
implements CellSelectionModel


Field Summary
protected  SwingPropertyChangeSupport changeSupport
          Used to messaged registered listeners.
protected  EventListenerList listenerList
          List of listeners
 
Fields inherited from interface com.zfqjava.swing.CellSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
AbstractCellSelectionModel()
           
 
Method Summary
 void addCellSelectionListener(CellSelectionListener l)
          Adds listener to the list of listeners that are notified each time the set of selected cells changes.
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds a PropertyChangeListener to the listener list.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Supports reporting bound property changes.
protected  void fireValueChanged(CellSelectionEvent e)
          Forwards the given notification event to all CellSelectionListeners that registered themselves as listeners for this table model.
 CellSelectionListener[] getCellSelectionListeners()
          Returns an array of all the table model listeners registered on this model.
 EventListener[] getListeners(Class listenerType)
          Returns an array of all the objects currently registered as FooListeners upon this AbstractTableModel.
 void removeCellSelectionListener(CellSelectionListener l)
          Removes listener from the list of listeners that are notified each time the set of selected cells changes.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes a PropertyChangeListener from the listener list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.zfqjava.swing.CellSelectionModel
addSelectionCell, addSelectionCells, clearSelection, getAnchorSelectionColumn, getAnchorSelectionRow, getLeadSelectionColumn, getLeadSelectionRow, getMaxSelectionColumn, getMaxSelectionRow, getMinSelectionColumn, getMinSelectionRow, getSelectedCell, getSelectedCells, getSelectionCount, getSelectionList, getSelectionMode, getValueIsAdjusting, insertColumnInterval, insertRowInterval, isCellSelected, isCellSelected, isColumnSelected, isRowSelected, isSelectionEmpty, removeColumnInterval, removeRowInterval, removeSelectionCell, removeSelectionCells, setAnchorSelectionCell, setLeadSelectionCell, setSelectionCell, setSelectionCells, setSelectionMode, setValueIsAdjusting
 

Field Detail

listenerList

protected EventListenerList listenerList
List of listeners


changeSupport

protected SwingPropertyChangeSupport changeSupport
Used to messaged registered listeners.

Constructor Detail

AbstractCellSelectionModel

public AbstractCellSelectionModel()
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Description copied from interface: CellSelectionModel
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.

A PropertyChangeEvent will get fired when the selection mode changes.

Specified by:
addPropertyChangeListener in interface CellSelectionModel
Parameters:
l - the PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Description copied from interface: CellSelectionModel
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Specified by:
removePropertyChangeListener in interface CellSelectionModel
Parameters:
l - the PropertyChangeListener to be removed

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Supports reporting bound property changes. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.


addCellSelectionListener

public void addCellSelectionListener(CellSelectionListener l)
Description copied from interface: CellSelectionModel
Adds listener to the list of listeners that are notified each time the set of selected cells changes.

Specified by:
addCellSelectionListener in interface CellSelectionModel
Parameters:
l - the new listener to be added

removeCellSelectionListener

public void removeCellSelectionListener(CellSelectionListener l)
Description copied from interface: CellSelectionModel
Removes listener from the list of listeners that are notified each time the set of selected cells changes.

Specified by:
removeCellSelectionListener in interface CellSelectionModel
Parameters:
l - the listener to remove

getCellSelectionListeners

public CellSelectionListener[] getCellSelectionListeners()
Returns an array of all the table model listeners registered on this model.

Returns:
all of this model's CellSelectionListeners or an empty array if no table model listeners are currently registered
See Also:
addCellSelectionListener(com.zfqjava.swing.event.CellSelectionListener), removeCellSelectionListener(com.zfqjava.swing.event.CellSelectionListener)

fireValueChanged

protected void fireValueChanged(CellSelectionEvent e)
Forwards the given notification event to all CellSelectionListeners that registered themselves as listeners for this table model.

Parameters:
e - the event to be forwarded
See Also:
addCellSelectionListener(com.zfqjava.swing.event.CellSelectionListener), TableModelEvent, EventListenerList

getListeners

public EventListener[] getListeners(Class listenerType)
Returns an array of all the objects currently registered as FooListeners upon this AbstractTableModel. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a model m for its table model listeners with the following code:

CellSelectionListener[] tmls = (CellSelectionListener[])(m.getListeners(CellSelectionListener.class));
If no such listeners exist, this method returns an empty array.

Parameters:
listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
Returns:
an array of all objects registered as FooListeners on this component, or an empty array if no such listeners have been added
Throws:
ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
See Also:
getCellSelectionListeners()

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.