Support | Links

Customizing the GUI

Adding menus & toolbar buttons

A plugin can easily add menu and toolbar entries by overloading the setMenu and setToolBarItem methods.

In each case, the adequate object is passed as argument. Do not forget to register a Java listener on the MenuItem or Button you add, or it will be pretty useless.

Also, you can add a menu item in an already existing JSynoptic menu by browsing through the java object hierarchy. For example, you could add an entry in the Tools menu, by doing like the Look& Feel plugin: First loop through the getComponents() array of the JMenuBar, and then add the item in the menu with the correct resource ID (see the Look&Feel plugin for a practical example).

Index of contents

Acting on the desktop and source panels.

The JSynoptic application has two main part : the source panel, on the left, and the editor, on the right. See the User Manual for more information. A plugin can add tabs to those areas, simply by using the newDesktopComponent(...) and newSourceComponent(...) methods.

These methods are called only once, at application startup. To do an action each time a component is created (ex: the user clicks on File->New), use the newComponent() method instead. Warning: usage of this last method is not recommended, and this method may be removed in the future. Actually, the builtin plugin uses it to create a new standard plot shape each time the user creates a new component, and this is not a very satisfying colution. Rather, it should offer templates to choose from, or at least a preference dialog to select which and how much components to create. Feel free to improve JSynoptic in this way, instead of using newComponent()...

Index of contents