Package com.tagtraum.beatunes.songinfo
Class Rating.DefaultRatingModel
- java.lang.Object
-
- com.tagtraum.beatunes.songinfo.Rating.DefaultRatingModel
-
- All Implemented Interfaces:
Rating.RatingModel
- Enclosing class:
- Rating
public static class Rating.DefaultRatingModel extends Object implements Rating.RatingModel
-
-
Field Summary
Fields Modifier and Type Field Description protected EventListenerList
listenerList
The list of ChangeListeners for this model.
-
Constructor Summary
Constructors Constructor Description DefaultRatingModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActionListener(ActionListener l)
void
addChangeListener(ChangeListener l)
Adds a ChangeListener to the model's listener list.protected void
fireActionPerformed(ActionEvent e)
Notifies all listeners that have registered interest for notification on this event type.protected void
fireStateChanged()
Run each ChangeListeners stateChanged() method.ActionListener[]
getActionListeners()
Returns an array of all the action listeners registered on thisDefaultButtonModel
.ChangeListener[]
getChangeListeners()
Returns an array of all theChangeListener
s added to this AbstractSpinnerModel with addChangeListener().<T extends EventListener>
T[]getListeners(Class<T> listenerType)
Return an array of all the listeners of the given type that were added to this model.int
getValue()
boolean
isAdjusting()
void
removeActionListener(ActionListener l)
void
removeChangeListener(ChangeListener l)
Removes a ChangeListener from the model's listener list.void
setAdjusting(boolean adjusting)
void
setValue(int v)
-
-
-
Field Detail
-
listenerList
protected EventListenerList listenerList
The list of ChangeListeners for this model. Subclasses may store their own listeners here.
-
-
Method Detail
-
isAdjusting
public boolean isAdjusting()
- Specified by:
isAdjusting
in interfaceRating.RatingModel
-
setAdjusting
public void setAdjusting(boolean adjusting)
- Specified by:
setAdjusting
in interfaceRating.RatingModel
-
getValue
public int getValue()
- Specified by:
getValue
in interfaceRating.RatingModel
-
setValue
public void setValue(int v)
- Specified by:
setValue
in interfaceRating.RatingModel
-
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.- Specified by:
addChangeListener
in interfaceRating.RatingModel
- Parameters:
l
- the ChangeListener to add- See Also:
removeChangeListener(javax.swing.event.ChangeListener)
,SpinnerModel.addChangeListener(javax.swing.event.ChangeListener)
-
removeChangeListener
public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from the model's listener list.- Specified by:
removeChangeListener
in interfaceRating.RatingModel
- Parameters:
l
- the ChangeListener to remove- See Also:
addChangeListener(javax.swing.event.ChangeListener)
,SpinnerModel.removeChangeListener(javax.swing.event.ChangeListener)
-
getChangeListeners
public ChangeListener[] getChangeListeners()
Returns an array of all theChangeListener
s added to this AbstractSpinnerModel with addChangeListener().- Returns:
- all of the
ChangeListener
s added or an empty array if no listeners have been added - Since:
- 1.4
-
fireStateChanged
protected void fireStateChanged()
Run each ChangeListeners stateChanged() method.- See Also:
setValue(int)
,EventListenerList
-
getListeners
public <T extends EventListener> T[] getListeners(Class<T> 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
-
addActionListener
public void addActionListener(ActionListener l)
- Specified by:
addActionListener
in interfaceRating.RatingModel
-
removeActionListener
public void removeActionListener(ActionListener l)
- Specified by:
removeActionListener
in interfaceRating.RatingModel
-
getActionListeners
public ActionListener[] getActionListeners()
Returns an array of all the action listeners registered on thisDefaultButtonModel
.- Returns:
- all of this model's
ActionListener
s or an empty array if no action listeners are currently registered - Since:
- 1.4
- See Also:
addActionListener(java.awt.event.ActionListener)
,removeActionListener(java.awt.event.ActionListener)
-
fireActionPerformed
protected void fireActionPerformed(ActionEvent e)
Notifies all listeners that have registered interest for notification on this event type.- Parameters:
e
- theActionEvent
to deliver to listeners- See Also:
EventListenerList
-
-