com.softsynth.jmsl.score
Class ScoreCommandCenter

java.lang.Object
  extended by com.softsynth.jmsl.score.ScoreCommandCenter

public class ScoreCommandCenter
extends java.lang.Object

Static repository of ScoreCommand classes
Provides clones of ScoreCommands that were added
Maintains hashtable with KeyCode ints hashed to Score Command Classes

Author:
Nick Didkovsky, (c) 2004 All rights reserved, Email: didkovn@mail.rockefeller.edu

Constructor Summary
ScoreCommandCenter()
           
 
Method Summary
static void addScoreCommand(ScoreCommand cmd)
          Add a ScoreCommand with no hot key.
static void addScoreCommand(ScoreCommand cmd, int keyCode)
          Add a ScoreCommand and associate it with a keyCode hotkey.
static void addScoreCommandAddedListener(ScoreCommandAddedListener listener)
           
static java.util.Enumeration getCommandNames()
           
static ScoreCommand getScoreCommand(Score score, int keyCode)
           
static ScoreCommand getScoreCommand(Score score, java.lang.String commandName)
           
static void removeScoreCommandAddedListener(ScoreCommandAddedListener listener)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScoreCommandCenter

public ScoreCommandCenter()
Method Detail

addScoreCommandAddedListener

public static void addScoreCommandAddedListener(ScoreCommandAddedListener listener)

removeScoreCommandAddedListener

public static void removeScoreCommandAddedListener(ScoreCommandAddedListener listener)

addScoreCommand

public static void addScoreCommand(ScoreCommand cmd,
                                   int keyCode)
Add a ScoreCommand and associate it with a keyCode hotkey. Prints a warning if a ScoreCommand is added which has a duplicate name to one already registered with the ScoreCommandCenter


addScoreCommand

public static void addScoreCommand(ScoreCommand cmd)
Add a ScoreCommand with no hot key.
Same as addScoreCommand(klass, -1)


getScoreCommand

public static ScoreCommand getScoreCommand(Score score,
                                           int keyCode)
                                    throws java.lang.CloneNotSupportedException
Returns:
a clone of the command that hashes to the keyCode. null if no match
Throws:
java.lang.CloneNotSupportedException

getScoreCommand

public static ScoreCommand getScoreCommand(Score score,
                                           java.lang.String commandName)
                                    throws java.lang.CloneNotSupportedException
Returns:
a clone of the command with matching name. null if no match
Throws:
java.lang.CloneNotSupportedException

getCommandNames

public static java.util.Enumeration getCommandNames()
Returns:
Enumeration of command names