View Javadoc
1   package com.github.celldynamics.quimp.plugin;
2   
3   /**
4    * General definition of plugin interface for QuimP.
5    * 
6    * <p>Contain also flags understood by plugins
7    * 
8    * @author p.baniukiewicz
9    * @see com.github.celldynamics.quimp.plugin.engine.PluginFactory
10   */
11  public interface IQuimpCorePlugin extends IQuimpPluginExchangeData {
12  
13    // any change here should be reflected in
14    // com.github.celldynamics.quimp.PluginFactory.getPluginType(File, String)
15    /**
16     * Type of plugin not defined.
17     */
18    int GENERAL = 0;
19    /**
20     * Plugin process snakes only.
21     */
22    int DOES_SNAKES = 1;
23    /**
24     * Plugin change size of input data.
25     */
26    int CHANGE_SIZE = 32;
27    /**
28     * Plugin modify input data in place.
29     */
30    int MODIFY_INPUT = 64;
31  
32    /**
33     * Provide basic information to QuimP about plugin.
34     * 
35     * <p>It must return at least type of plugin
36     * 
37     * @return Combination of flags specifying: -# type of plugin (obligatory) -# modification of
38     *         input size (e.g. reduction of polygon points)
39     */
40    int setup();
41  
42    /**
43     * Show or hide plugin UI.
44     * 
45     * <p>UI is not obligatory. This function must be implemented but may do nothing.
46     * 
47     * @param val boolean
48     * @return integer value that in principle can be e.g. information about cancelling window.
49     *         Exemplary return can be: {@code return toggleWindow() ? 1 : 0;}, where toggle window
50     *         returns boolean value.
51     */
52    int showUi(boolean val);
53  
54    /**
55     * Get version of plugin.
56     * 
57     * <p>Versioning may be used for detecting incompatibilities between configurations. Plugin
58     * version
59     * is saved in QuimP config files, and then passed to plugin by setPluginConfig(ParamList) as \a
60     * version key. This key is not available if plugin has not provided its version. The plugin is
61     * responsible for parsing this parameter.
62     * 
63     * @return String with version (any format) or \c null if not supported
64     */
65    String getVersion();
66  
67    /**
68     * Get short info about plugin.
69     * 
70     * <p>One can use white characters in this string to limit line length because there is no
71     * guarantee that displayer will wrap lines.
72     * 
73     * <p>It can shows also simple help for supported macro options.
74     * 
75     * @return String about (any format) or null if not supported
76     */
77    String about();
78  }