Create a plugin
What a plugin can bring to JSynoptic?
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...)
- Shapes
- Mathematical functions
- GUI (menus, more tabs...)
- Templates
Bring shapes
It is possible to bring some new shapes by overwriting following methods:
-
getShapes
-
createShape
Bring data
It is possible to bring some new sources by overwriting following methods:
-
getSources
-
createSource
A plugin may bring some new Data SOurce or Collection icons which are displayed in the source panel. Overwirte
getDataSourceIcons
to specify those icons.
Bring templates
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.
Customize JSynoptic interface
It is possible to add menus or menu items, some new icons in the tool box: you have to overwrite following Plugins methods: setMenu
, setToolBarItem
, newDesktopComponent
.
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.
Process a kind of file
A plugin can process several kinds of files.
The processing of file is related to four kinds of actions:
- OPEN
- SAVB
- IMPORT
- EXPORT
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:- Overwrite
getFileFilters
method to notify JSynoptic that your plugin can process this kind of file
- Overwrite
processFile
method to make the job when a such file is opened, saved, exported. Take care about the kind of file processing.
Process a synoptic
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
Process a data source collection
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
Do something at JSynoptic closing
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.
Add your help articles in JSynoptic user manual
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
How plugins are loaded?
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 package
Index of contents