1 package com.explosion.expf;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import java.util.Properties;
24 import java.util.Vector;
25
26 import javax.swing.JPanel;
27
28 import com.explosion.utilities.preferences.Preference;
29
30 /***
31 * Each module which plugs into this application should have an implementation
32 * of this interface. Classes of this type will be instantiated using the
33 * Class.forName() method. The purpose of this class willbe to initialise any
34 * menus, toolbar buttons etc used by this module.
35 *
36 * The application will only ever instantiate one instance of this class. It is the
37 * mananger for any and all instances of the module it represents. Its job is to provide
38 * a place where all pre-initialisation required by the tools based on this module is
39 * performed.
40 *
41 * It also provides a common place for instances of tools created by this module to come
42 * and get shared information.
43 *
44 * @author Stephen Cowx
45 */
46
47 public interface ExpModuleManager
48 {
49
50 /***
51 * Returns a string containing the version of this module. The string should
52 * be the version number only and should not contain the word "version". Eg.
53 * "1.0" and NOT "Version 1.0"
54 *
55 * @return String
56 */
57 public String getVersion();
58
59 /***
60 * This method returns the name of the module as it will be seen by the
61 * user.
62 *
63 * @return
64 */
65 public String getName();
66
67 /***
68 * This method returns a String which describes the funtion of the module.
69 *
70 * @return
71 */
72 public String getDescription();
73
74 /***
75 * Module initialisation is split into two phases. Phase one is the
76 * initialisation of core components (such as loading preferences etc) which
77 * are required for the module to run. The second phase is the initialising
78 * of the Graphical User Interface related components. The reason for the
79 * separation is to allow for interfacing with the module when there is no
80 * user interface. The aim is to be able to call module functionality from a
81 * programmatic API rather than just through a user interface.
82 *
83 * Although this is currently not implemented, it is a wise idea to keep the
84 * separation in mind.
85 *
86 * The module properties are the attributes for this module written into the
87 * expf.properties property file
88 *
89 * initialiseCore() is called during module initialisation and it is called
90 * before initialiseGui()
91 *
92 * @param properties TODO
93 * @param moduleAttributes
94 */
95 public void initialiseCore(Properties properties);
96
97 /***
98 * initialiseGui() is called during module initialisation and it is called
99 * after initialiseCore()
100 *
101 * @see initialiseCore(Attributes moduleAttributes)
102 */
103 public void initialiseGui() throws Exception;
104
105 /***
106 * Returns a Vector which contains all of the preferences for this module
107 * @return
108 */
109 public Vector getPreferences();
110
111 /***
112 * Returns the Preference for this name or null if it does not exist.
113 * @param preferenceName
114 * @return
115 */
116 public Preference getPreference(String preferenceName);
117
118 /***
119 * Returns a JPanel contaning all of the neccessary elements required by a user to be able to
120 * edit the preferences for this module. If this is null then the default preferences
121 * editor for the application will be used.
122 * @return
123 */
124 public JPanel getPreferencesEditor();
125
126 /***
127 * Each Module Manager may have a Global Listener. The application will ask the
128 * Module Manager for it's global listener at module iitialisation time. This
129 * method is called after the initialiseCore() and initilaiseGui() methods have been called.
130 * @return
131 */
132 public ExpActionListener getGlobalListener();
133
134 }