Kepler Developer Manual
There is a need for a developer manual that gets into more nitty gritty details about the "proper" way to do certain tasks. However, we do not have a single developer who is best positioned to answer all such questions. It is my hope to start a collective effort to create such a module here, starting with a FAQ and growing into a more comprehensive document over time. The difference between this FAQ and the "FAQ for Developers" will be that this FAQ focuses on more nitty gritty questions rather than the more general questions addressed by the other FAQ.
FAQ:
How do you add menu items?
Documentation for how to perform this task may be found here.
How do you add items onto the icons to the toolbar?
/** Compares this object with the specified object for order. */ public int compareTo(KeplerGraphFrameUpdater o) { // always return less than return -1; }
/** Perform any module-specific initializations. */ public void initializeModule() { Tagging.registerAtomicallyTaggableClass(WorkflowRun.class); // add ourself as an updater so we can add a button KeplerGraphFrame.addUpdater(this); }
Next, you need to override the updateFrameComponents method in the manner show below. But before doing so, you need to create a new FigureAction which will be triggered when your toolbar button is pushed. This will often be a separate class so that it can also be triggered elsewhere (such as by a menu item, but the example below uses an anonymous inner class...
/** Update the components. */ public void updateFrameComponents(KeplerGraphFrame.Components components) { MyAction action = new FigureAction() { public void actionPerformed(ActionEvent event) { super.actionPerformed(event); } } JToolBar toolbar = components.getToolBar(); JButton button = diva.gui.GUIUtilities.addToolBarButton(toolbar, action); button.setToolTipText("Provenance recorder"); // tell the action about its button so it can change the icon action.setButton(button); }
How do I add actors to the library?
See Developing a Hello World Actor using the Kepler Build System and Eclipse.