[jmsl] NotePropertiesTransformCommand / NotePropertiesTransform
jmsl at music.columbia.edu
jmsl at music.columbia.edu
Wed Dec 19 01:58:13 EST 2007
Hi Peter
I can see there are very good reasons to get an Enumeration for the
ScoreCommands I will add it in the next release.
1) Meanwhile, you can do something like this:
foreach name in ScoreCommandCenter.getCommandNames() {
ScoreCommand cmd = ScoreCommandCenter.getScoreCommand(Score score,
String commandName)
}
...you can pass any old score into getScoreCommand(). It returns a clone
of the command with the score set. This is inefficient but a good
workaround for now.
2) Or maybe it would be cleaner and better if you created a
ScoreCommandListener and added it to ScoreCommandCenter first thing in
your application with
ScoreCommandCenter.addScoreCommandAddedListener(myListener)
Your listener will get a callback for every ScoreCommand added to
ScoreCommandCenter with...
notifyScoreCommandAdded(ScoreCommand scoreCommand, int keyCode); //
keycode == -1 if none assigned
...you can add these ScoreCommands to a Vector of your own and Enumerate
through them whenever you like.
Will one of these approaches work for you?
Thanks,
Nick Didkovsky
jmsl at music.columbia.edu wrote:
> Hi Nick,
>
> I was assuming that getCommandName() does getName() on the various
> transforms, which returns the user specified string for the name of a
> transform. For instance, when I do getCommandName() for the
> DeleteCommand(), I get
>
> "Delete"
>
> as output, rather than the class. I'd like to get the class, so that
> I can see if the class has an undo method defined. (which none of the
> JMSL classes will, but for some of my classes that generate material,
> I'd like to be able to create custom undo behaviors)
>
> I may be going about this the wrong way?
>
> thanks,
> Peter McCulloch
>
>
>
> _______________________________________________
> jmsl mailing list
> jmsl at music.columbia.edu
> http://music.columbia.edu/mailman/listinfo/jmsl
More information about the jmsl
mailing list