Package com.softsynth.jmsl.score
Class ScoreCommandCenter
java.lang.Object
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
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: nick@didkovsky.com
-
Field Summary
Fields Modifier and Type Field Description static boolean
VERBOSE
-
Constructor Summary
Constructors Constructor Description ScoreCommandCenter()
-
Method Summary
Modifier and Type Method Description 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 int
getHotkey(ScoreCommand cmd)
static ScoreCommand
getScoreCommand(Score score, int keyCode)
static ScoreCommand
getScoreCommand(Score score, java.lang.String commandName)
static java.util.Enumeration
getScoreCommands()
static void
removeScoreCommandAddedListener(ScoreCommandAddedListener listener)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
VERBOSE
public static boolean VERBOSE
-
-
Constructor Details
-
ScoreCommandCenter
public ScoreCommandCenter()
-
-
Method Details
-
addScoreCommandAddedListener
-
removeScoreCommandAddedListener
-
addScoreCommand
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. Only prints if ScoreCommandCenter.VERBOSE = true; -
addScoreCommand
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
-
getScoreCommands
public static java.util.Enumeration getScoreCommands()- Returns:
- Enumeration of ScoreCommands
-
getHotkey
- Returns:
- hotkey assigned to this ScoreCommand, else -1 if ScoreCommand found but unassigned to a hotkey, else -2 if command not found
-
getCommandNames
public static java.util.Enumeration getCommandNames()- Returns:
- Enumeration of command names
-