Create a plugin
JSynoptic provides a "plug-in" extension system. They are fully operant parts of JSynoptic : they are Java classes, and can be user-defined or distributed with applications wishing to interact with JSynoptic. They provide abilities concerning:
- File formats
- Sources (source templates, network connections, etc...)
- Mathematical functions
- GUI (menus, more tabs...)
It is possible to bring some new shapes by overwriting following methods:
It is possible to bring some new sources by overwriting following methods:
A plugin may bring some new Data SOurce or Collection icons which are displayed in the source panel. Overwirte
getDataSourceIconsto specify those icons.
A template is a synoptic model which can be used to create new synoptics (ex: a plot grid, an empty sheet).
Plugin may bring their own templates. A template can provide a JPanel dedicated to customize template parameters when the template chooser dialog box is displayed.
It is possible to add menus or menu items, some new icons in the tool box: you have to overwrite following Plugins methods:
If you wish to modify in a deeper way JSynoptic interface (for instance, add/delete panels, hide some components...), you'll have to get and modify JSynoptic GUI elements from JSynopticPanel class. Anyway this work has to be done in a Plugin class.
A plugin can process several kinds of files.
The processing of file is related to four kinds of actions:
Save action implies that the file is a homewowner kind of file whereas Export action allow the writing of files in a format which is not owned by JSynoptic.To process a new kind of file, you should follow those steps:
getFileFiltersmethod to notify JSynoptic that your plugin can process this kind of file
processFilemethod to make the job when a such file is opened, saved, exported. Take care about the kind of file processing.
In batch mode, you can load synoptics and apply some transformations on them.
Thancks to Plugin
processSynoptic you can work on those loaded synoptics in batch mode
In batch mode, you can load collections and apply some transformations on them.
Thancks to Plugin
processDataSourceCollection you can work on those loaded collections in batch mode
When JSynoptic is being closed your plugin may have some work to perform. For instance a socket connection or an external application may have to be closed at this moment.
This article describes how to integrate HTML help documentation about your plugin feature in JSynoptic Help Center. At the moment, JSynoptic help is written exclusively in English.
- Help table of content. Help content is provided by overwritting Plugin
gethelp()method. This method returns a node which is inserted into JSynoptic help tree. You can include a help node into an existing node, even into the help root node.
- Help content. The help documents are written in HTML. In order to homogenize the JSynoptic help, we recommand to duplicate existing help packages and to follow the same HTML structure. You can take inspiration from the standard JSynoptic help (jsynoptic/ui/help package).
Index of contents
To load correctly your new created plugin when launching JSynoptic you have to check that:
- Plugin directory path belongs to JSynoptic list of directorie.
- The user pproperties contains your Plugin name in the jsynoptic.plugin property.
If your plugin is still not loaded, check that no compilation/exception errors are related to your plugin packageIndex of contents