com.realtime.crossfire.jxclient.spells
Class CurrentSpellManager

java.lang.Object
  extended by com.realtime.crossfire.jxclient.spells.CurrentSpellManager

public class CurrentSpellManager
extends java.lang.Object

Manages the currently selected spell.


Field Summary
private  Spell currentSpell
          The currently selected spell, or null.
private  java.util.Collection<CurrentSpellManagerListener> listeners
          The listeners to notify object changed spell objects.
 
Constructor Summary
CurrentSpellManager()
           
 
Method Summary
 void addSpellListener(CurrentSpellManagerListener listener)
          Add a spell listener to be notified if the current spell object has changed.
 Spell getCurrentSpell()
          Return the currently selected spell object.
 void removeSpellListener(CurrentSpellManagerListener listener)
          Remove a spell listener.
 void setCurrentSpell(Spell spell)
          Set the currently selected spell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentSpell

@Nullable
private Spell currentSpell
The currently selected spell, or null.


listeners

@NotNull
private final java.util.Collection<CurrentSpellManagerListener> listeners
The listeners to notify object changed spell objects.

Constructor Detail

CurrentSpellManager

public CurrentSpellManager()
Method Detail

addSpellListener

public void addSpellListener(@NotNull
                             CurrentSpellManagerListener listener)
Add a spell listener to be notified if the current spell object has changed.

Parameters:
listener - The listener to add.

getCurrentSpell

@Nullable
public Spell getCurrentSpell()
Return the currently selected spell object.

Returns:
The spell object, or null if no spell is selected.

removeSpellListener

public void removeSpellListener(@NotNull
                                CurrentSpellManagerListener listener)
Remove a spell listener.

Parameters:
listener - The listener to remove.

setCurrentSpell

public void setCurrentSpell(@Nullable
                            Spell spell)
Set the currently selected spell.

Parameters:
spell - The spell to selected.