com.realtime.crossfire.jxclient.shortcuts
Class Shortcut

java.lang.Object
  extended by com.realtime.crossfire.jxclient.shortcuts.Shortcut
Direct Known Subclasses:
ShortcutCommand, ShortcutSpell

public abstract class Shortcut
extends java.lang.Object

Abstract base class for shortcut commands.


Field Summary
private  javax.swing.event.EventListenerList listeners
          The listeners to be notified.
 
Constructor Summary
Shortcut()
           
 
Method Summary
 void addShortcutListener(ShortcutListener listener)
          Register a shortcut listener.
abstract  boolean displaysFace(Face face)
          Returns whether this shortcut displays the given face.
abstract  void dispose()
          Releases all allocated resources.
abstract  void execute()
          Execute the shortcut.
protected  void fireModifiedEvent()
          Notify all listeners about a modification.
abstract  java.lang.String getTooltipText()
          Returns the current tooltip text.
 void removeShortcutListener(ShortcutListener listener)
          Unregister a shortcut listener.
abstract  void visit(ShortcutVisitor visitor)
          Calls a ShortcutVisitor's visit() function for this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

@NotNull
private final javax.swing.event.EventListenerList listeners
The listeners to be notified.

Constructor Detail

Shortcut

public Shortcut()
Method Detail

addShortcutListener

public void addShortcutListener(@NotNull
                                ShortcutListener listener)
Register a shortcut listener.

Parameters:
listener - The listener to register.

displaysFace

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

Parameters:
face - the face to check for
Returns:
whether the face is displayed

dispose

public abstract void dispose()
Releases all allocated resources.


execute

public abstract void execute()
Execute the shortcut.


fireModifiedEvent

protected void fireModifiedEvent()
Notify all listeners about a modification.


getTooltipText

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

Returns:
the tooltip text

removeShortcutListener

public void removeShortcutListener(@NotNull
                                   ShortcutListener listener)
Unregister a shortcut listener.

Parameters:
listener - The listener to unregister.

visit

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

Parameters:
visitor - the visitor to call