This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing
class AbstractSpinnerModel

java.lang.Object extended by javax.swing.AbstractSpinnerModel
All Implemented Interfaces:
SpinnerModel
Direct Known Subclasses:
SpinnerDateModel, SpinnerListModel, SpinnerNumberModel

public abstract class AbstractSpinnerModel
extends Object
implements SpinnerModel

This class provides the ChangeListener part of the SpinnerModel interface that should be suitable for most concrete SpinnerModel implementations. Subclasses must provide an implementation of the setValue, getValue, getNextValue and getPreviousValue methods.


Field Summary
protected EventListenerList listenerList
          The list of ChangeListeners for this model.
 
Constructor Summary

          
 
Method Summary
 void

          Adds a ChangeListener to the model's listener list.
protected void

          Run each ChangeListeners stateChanged() method.
 ChangeListener[]

          Returns an array of all the ChangeListeners added to this AbstractSpinnerModel with addChangeListener().
 EventListener[]
getListeners(Class listenerType)

          Return an array of all the listeners of the given type that were added to this model.
 void

          Removes a ChangeListener from the model's listener list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList
The list of ChangeListeners for this model. Subclasses may store their own listeners here.
Constructor Detail

AbstractSpinnerModel

public AbstractSpinnerModel()
Method Detail

addChangeListener

public void addChangeListener(ChangeListener l)
Adds a ChangeListener to the model's listener list. The ChangeListeners must be notified when the models value changes.

Parameters:
l - the ChangeListener to add

fireStateChanged

protected void fireStateChanged()
Run each ChangeListeners stateChanged() method.


getChangeListeners

public ChangeListener[] getChangeListeners()
Returns an array of all the ChangeListeners added to this AbstractSpinnerModel with addChangeListener().

Returns:
all of the ChangeListeners added or an empty array if no listeners have been added

getListeners

public EventListener[] getListeners(Class listenerType)
Return an array of all the listeners of the given type that were added to this model. For example to find all of the ChangeListeners added to this model:
 myAbstractSpinnerModel.getListeners(ChangeListener.class);
 

Parameters:
listenerType - the type of listeners to return, e.g. ChangeListener.class
Returns:
all of the objects receiving listenerType notifications from this model

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from the model's listener list.

Parameters:
l - the ChangeListener to remove


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.