Steps to create a plugin
- Implement
shiva.interfaces.ShivaPlugin.
- Have
public final static String PLUGIN_DESCRIPTION = "Some Description";
in the class.
- Define entry functions
public final static start (String config)
or
public final static start ()
in the class.
- Specify the plugin class to be loaded in
shiva/resources/start.xml. For example,
<load plugin="shiva.plugins.ColorMapLoader" config="shiva/resources/colormap.xml"/>
or
<load plugin="shiva.plugins.About"/>
The two styles correspond to two different entry functions defined above. The order
of loading the plugins may be important since some plugins depend on other plugins to
work.
For example:
package foo;
import shiva.interfaces.ShivaPlugin;
public class DemoPlugin implements ShivaPlugin
{
public final static String PLUGIN_DESCRIPTION = "A Plugin Demo";
public static void start ()
{
System.out.println ("==== Hello World! ====");
}
}
Then in shiva/resources/start.xml, add the following line
<load plugin="foo.DemoPlugin"/>
At this point, the plugin can be loaded by SHIVA.
For specific types of plugins, check the following links:
- AddCommand
Add actions to menu and toolbars.
- ReaderWriter
Add new file filters.