JFugue Music Application Platform
By Geertjan on May 11, 2008
I've always wanted a metronome in the JFugue Music NotePad... and now I do:
I simply copied the metronome parts of JFrets into a separate NetBeans module (which makes sense since both the original application and the destination application use Swing) and then slightly reorganized the ui so that it would fit snugly into the explorer view. When you click Start, the JFugue API is used under the hood to start the audible tick-tocking of the metronome, using the settings you set for the tempo, until you press Stop (which is what the Start button turns into once started). This means that I am now treating the JFugue Music NotePad as an application platform. Simply download the binary and then register it as a NetBeans Platform (under the Tools menu in the IDE). All the modules in the JFugue Music NotePad are then available to your own modules. One of these modules is the module that wraps the JFugue API JAR. So in your own module, such as the one which provides the JFrets metronome, you'd simply declare a dependency on JFugue, which the application made available. Then you can deploy the modules you create in the IDE to the JFugue Music NotePad, from within the IDE, via a menu item that would then start up the JFugue Music NotePad and install your module into it.
Now that the JFrets metronome is a module, I can do the same with all the other JFrets tools, as well as the main window itself. Then I could set up an update center that contains these additional modules. The update center would be automatically registered in the JFugue Music NotePad. All its users would then be able to install additional features, such as a metronome and scale selector, which originally all came from the same JFrets application. Of course, anyone else would also be able to install these tools into their own NetBeans Platform applications, such as the IDE. Not necessarily useful to have a metronome in the IDE, but it is at least possible.