com.realtime.crossfire.jxclient.shortcuts
Class ShortcutSpell

java.lang.Object
  extended by com.realtime.crossfire.jxclient.shortcuts.Shortcut
      extended by com.realtime.crossfire.jxclient.shortcuts.ShortcutSpell

public class ShortcutSpell
extends Shortcut

A Shortcut that casts a spell.


Field Summary
private static java.lang.String CAST
          Command prefix to "cast" a spell.
private  java.lang.String command
          The command for casting the spell.
private  CommandQueue commandQueue
          The command queue for executing commands.
private static java.lang.String INVOKE
          Command prefix to "invoke" a spell.
private  Spell spell
          The spell to cast.
private  SpellListener spellListener
          The SpellListener attached to spell.
 
Constructor Summary
ShortcutSpell(CommandQueue commandQueue, Spell spell)
          Creates a new instance.
 
Method Summary
 boolean displaysFace(Face face)
          Returns whether this shortcut displays the given face.
 void dispose()
          Releases all allocated resources.
 void execute()
          Execute the shortcut.
 Spell getSpell()
          Return the spell to cast.
 java.lang.String getTooltipText()
          Returns the current tooltip text.
 boolean isCast()
          Return whether the spell should be "cast" or "invoked".
 void setCast(boolean cast)
          Set whether the spell should be "cast" or "invoked".
 void visit(ShortcutVisitor visitor)
          Calls a ShortcutVisitor's visit() function for this instance.
 
Methods inherited from class com.realtime.crossfire.jxclient.shortcuts.Shortcut
addShortcutListener, fireModifiedEvent, removeShortcutListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAST

@NotNull
private static final java.lang.String CAST
Command prefix to "cast" a spell.

See Also:
Constant Field Values

command

@NotNull
private java.lang.String command
The command for casting the spell.


commandQueue

@NotNull
private final CommandQueue commandQueue
The command queue for executing commands.


INVOKE

@NotNull
private static final java.lang.String INVOKE
Command prefix to "invoke" a spell.

See Also:
Constant Field Values

spell

@NotNull
private final Spell spell
The spell to cast.


spellListener

@NotNull
private final SpellListener spellListener
The SpellListener attached to spell.

Constructor Detail

ShortcutSpell

public ShortcutSpell(@NotNull
                     CommandQueue commandQueue,
                     @NotNull
                     Spell spell)
Creates a new instance.

Parameters:
commandQueue - the command queue for executing commands
spell - the spell to cast
Method Detail

displaysFace

public boolean displaysFace(Face face)
Returns whether this shortcut displays the given face.

Specified by:
displaysFace in class Shortcut
Parameters:
face - the face to check for
Returns:
whether the face is displayed

dispose

public void dispose()
Releases all allocated resources.

Specified by:
dispose in class Shortcut

execute

public void execute()
Execute the shortcut.

Specified by:
execute in class Shortcut

getSpell

@NotNull
public Spell getSpell()
Return the spell to cast.

Returns:
The spell.

getTooltipText

@NotNull
public java.lang.String getTooltipText()
Returns the current tooltip text.

Specified by:
getTooltipText in class Shortcut
Returns:
the tooltip text

isCast

public boolean isCast()
Return whether the spell should be "cast" or "invoked".

Returns:
true for "cast", or false for "invoke".

setCast

public void setCast(boolean cast)
Set whether the spell should be "cast" or "invoked".

Parameters:
cast - true for "cast", or false for "invoke".

visit

public void visit(@NotNull
                  ShortcutVisitor visitor)
Calls a ShortcutVisitor's visit() function for this instance.

Specified by:
visit in class Shortcut
Parameters:
visitor - the visitor to call