Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / ApplicationManager.java @ 44644

History | View | Annotate | Download (10.8 KB)

1 40558 jjdelcerro
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24 40435 jjdelcerro
package org.gvsig.app;
25
26
import java.awt.Component;
27
import java.util.List;
28 41264 jjdelcerro
import javax.swing.JComponent;
29 41442 jjdelcerro
import javax.swing.event.HyperlinkListener;
30 42651 jjdelcerro
import javax.swing.tree.TreeModel;
31 40435 jjdelcerro
32
import org.cresques.cts.IProjection;
33
import org.gvsig.about.AboutManager;
34 41080 jjdelcerro
import org.gvsig.andami.actioninfo.ActionInfo;
35
import org.gvsig.andami.ui.mdiFrame.MainFrame;
36 40435 jjdelcerro
import org.gvsig.andami.ui.mdiFrame.ThreadSafeDialogs;
37
import org.gvsig.andami.ui.mdiManager.IWindow;
38
import org.gvsig.andami.ui.mdiManager.MDIManager;
39
import org.gvsig.app.extension.Version;
40
import org.gvsig.app.gui.WizardPanel;
41
import org.gvsig.app.prepareAction.PrepareContext;
42
import org.gvsig.app.prepareAction.PrepareContextView;
43
import org.gvsig.app.prepareAction.PrepareDataStore;
44
import org.gvsig.app.prepareAction.PrepareDataStoreParameters;
45
import org.gvsig.app.prepareAction.PrepareLayer;
46
import org.gvsig.app.project.Project;
47
import org.gvsig.app.project.ProjectManager;
48
import org.gvsig.app.project.documents.Document;
49
import org.gvsig.app.project.documents.gui.IDocumentWindow;
50
import org.gvsig.fmap.dal.DataManager;
51
import org.gvsig.fmap.dal.DataStore;
52
import org.gvsig.fmap.dal.DataStoreParameters;
53
import org.gvsig.fmap.geom.GeometryManager;
54
import org.gvsig.fmap.mapcontext.MapContextManager;
55
import org.gvsig.fmap.mapcontext.layers.FLayer;
56
import org.gvsig.gui.ColorTablesFactory;
57
import org.gvsig.tools.dataTypes.DataTypesManager;
58
import org.gvsig.tools.dispose.DisposableManager;
59
import org.gvsig.tools.dynobject.DynObjectManager;
60
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
61 44330 jjdelcerro
import org.gvsig.tools.observer.ObservableHelper;
62
import org.gvsig.tools.observer.Observer;
63 40435 jjdelcerro
import org.gvsig.tools.persistence.PersistenceManager;
64 41441 jjdelcerro
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
65 40435 jjdelcerro
import org.gvsig.tools.swing.icontheme.IconThemeManager;
66 44317 jjdelcerro
import org.gvsig.tools.util.PropertiesSupport;
67 40435 jjdelcerro
68
69 44317 jjdelcerro
public interface ApplicationManager
70
        extends ThreadSafeDialogs, PropertiesSupport
71
    {
72 40435 jjdelcerro
73
    /**
74
     * Return the version of the application.
75
     *
76
     * @return the version
77
     */
78
        public Version getVersion() ;
79
80
    /**
81
     * Return the active window, IWindow, in the application.
82
     *
83
     * @return the active window
84
     */
85
        public IWindow getActiveWindow();
86
87
        /**
88
         * Return the project that is loaded and in use in the application.
89
         *
90
         * @return the project
91
         */
92
    public Project getCurrentProject();
93
94
    /**
95
     * Returns the active document of the application or null
96
     * if there is no active document.
97
     *
98
     * @return the active document
99
     */
100
    public Document getActiveDocument();
101
102
    /**
103
     * Returns the active document of the application that is of the
104
     * requested type or null if there is no active document or the
105
     * active document is not of the requested type.
106
     *
107
     * @param documentTypeName, type name of the document requested.
108
     * @return the active document
109
     */
110
    public Document getActiveDocument(String documentTypeName);
111
112
    /**
113
     * Returns the active document of the application that is of the
114
     * requested type or null if there is no active document or the
115
     * active document is not of the requested type.
116
     *
117
     * @param documentClass, class of the document requested.
118
     * @return the active document
119
     */
120
    public Document getActiveDocument(Class<? extends Document> documentClass);
121
122
    /**
123 41264 jjdelcerro
     * Returns the JComponent associated to the active document for the
124
     * specified type of document.
125
     * If not is active the specified type of document return null.
126
     *
127
     * @param documentClass
128
     * @return the component associated to the active document of type documentClass
129
     */
130
    public JComponent getActiveComponent(Class<? extends Document> documentClass);
131
132
    /**
133 40435 jjdelcerro
     * Returns the window associated with the document passed as
134
     * parameter or null if there is no window associated with
135
     * the document.
136
     *
137
     * @param document to search the window
138
     * @return window associated to the document
139
     */
140
    public IDocumentWindow getDocumentWindow(Document document);
141
142
143
    /**
144
     * Return the root of the nodes of preferences in the application.
145
     *
146
     * @return the root of preferences.
147
     */
148
    PreferencesNode getPreferences();
149
150
    /**
151
     * Search and return the node of preferences required as nodeName.
152
     *
153
     * @param nodeName, name of the node to return
154
     * @return the preferences node requested
155
     */
156
        PreferencesNode getPreferences(String nodeName);
157
158
        /**
159
         * Return the arguments passed to the application in the command line
160
         *
161
         * @return arguments as a string array
162
         */
163
        public String[] getArguments();
164
165
        /**
166
         * Return the value of the argument passed in the command line by
167
         * the name indicated as the parameter. This is passed as:
168
         * <code>
169
         * application --name=value
170
         * </code>
171
         * @param name of the requested argument
172
         * @return value of the requested argument
173
         */
174
        public String getArgument(String name);
175
176
        /**
177
         * Get the value of the system clipboard as a string.
178
         *
179
         * @return the clipboard value
180
         */
181
        public String getFromClipboard();
182
183
        /**
184
         * Put the string value passed as parameter in the clipboard of
185
         * the system.
186
         *
187
         * @param data to put in the clipboard.
188
         */
189
        public void putInClipboard(String data) ;
190
191
        /**
192
         * Obtain the projection associated by the code of projection
193
         * Passed as parameter. If passed code of projection it not
194
         * a valid projection code null is returned.
195
         *
196
         * @param code of the projection requested
197
         * @return the requested projection or null
198
         */
199
    public IProjection getCRS(String code);
200
201
        /**
202
     * Utility method to obtain the DataManager used in the application at this moment.
203
     *
204
     * @return the DataManager
205
         */
206
        public DataManager getDataManager();
207
208
    /**
209
     * Utility method to obtain the ProjectManager used in the application at this moment.
210
     *
211
     * @return the ProjectManager
212
     */
213
    public ProjectManager getProjectManager();
214
215
    /**
216
     * Utility method to obtain the UIManager used in the application at this moment.
217
     *
218
     * @return the UIManager
219
     */
220
    public MDIManager getUIManager();
221
222
    /**
223
     * Utility method to obtain the GeometryManager used in the application at this moment.
224
     *
225
     * @return the GeometryManager
226
     */
227
    public GeometryManager getGeometryManager();
228
229
    /**
230
     * Utility method to obtain the PersistenceManager used in the application at this moment.
231
     *
232
     * @return the PersistenceManager
233
     */
234
    public PersistenceManager getPersistenceManager();
235
236
    /**
237
     * Utility method to obtain the DisposableManager used in the application at this moment.
238
     *
239
     * @return the DisposableManager
240
     */
241
    public DisposableManager getDisposableManager() ;
242
243
    /**
244
     * Utility method to obtain the DynObjectManager used in the application at this moment.
245
     *
246
     * @return the DynObjectManager
247
     */
248
    public DynObjectManager getDynObjectManager() ;
249
250
    /**
251
     * Utility method to obtain the ExtensionPointManager used in the application at this moment.
252
     *
253
     * @return the ExtensionPointManager
254
     */
255
    public ExtensionPointManager getExtensionPointManager();
256
257
    /**
258
     * Utility method to obtain the MapContextManager used in the application at this moment.
259
     *
260
     * @return the MapContextManager
261
     */
262
    public MapContextManager getMapContextManager();
263
264
    /**
265
     * Utility method to obtain the AboutManager used in the application at this moment.
266
     *
267
     * @return the AboutManager
268
     */
269
    public AboutManager getAbout();
270
271
    public DataTypesManager getDataTypesManager();
272
273
    /**
274
     * Utility method to obtain the IconThemeManager used in the application at this moment.
275
     *
276
     * @return the IconThemeManager
277
     */
278
    IconThemeManager getIconThemeManager();
279
280
        void registerAddTableWizard(String name, String description,
281
                        Class<? extends WizardPanel> wpClass);
282
283
        List<WizardPanel> getWizardPanels() throws Exception;
284
285
286
287
        void registerPrepareOpenDataStore(PrepareDataStore action);
288
        void registerPrepareOpenDataStoreParameters(        PrepareDataStoreParameters action);
289
        void registerPrepareOpenLayer(PrepareLayer action);
290
291
        DataStore pepareOpenDataSource(DataStore store,
292
                        PrepareContext context)
293
                        throws Exception;
294
295
        DataStoreParameters prepareOpenDataStoreParameters(
296
                        DataStoreParameters storeParameters, PrepareContext context)
297
                        throws Exception;
298
299
        List<DataStoreParameters> prepareOpenDataStoreParameters(
300
                        List<DataStoreParameters> storeParameters, PrepareContext context)
301
                        throws Exception;
302
303
        FLayer prepareOpenLayer(FLayer layer,
304
                        PrepareContextView context)
305
                        throws Exception;
306
307
308
        public ColorTablesFactory getColorTablesFactory();
309
310
        public void registerColorTablesFactory(ColorTablesFactory factory);
311
312
        public String getLocaleLanguage();
313
314 43913 jjdelcerro
//    /**
315
//     * sets message in status bar
316
//     *
317
//     * This method is thread safe.
318
//     *
319
//     * @param message
320
//     * @param message_type One of: JOptionPane.ERROR_MESSAGE,
321
//     * JOptionPane.WARNING_MESSAGE, JOptionPane.INFORMATION_MESSAGE
322
//     */
323
//    public void message(String message, int message_type);
324
//
325 41441 jjdelcerro
    public String translate(String message, String... args) ;
326 41080 jjdelcerro
327 41441 jjdelcerro
    public Component getRootComponent();
328
329
    public void refreshMenusAndToolBars();
330
331
    public MainFrame getMainFrame();
332
333
    public void addMenu(ActionInfo action, String text);
334
    public void addTool(ActionInfo action, String toolBarName);
335 42924 jjdelcerro
    public void addSelectableTool(ActionInfo action, String toolBarName);
336 41441 jjdelcerro
337
    public void showTextDialog(final WindowManager.MODE mode, final String title, final String htmlText);
338 41442 jjdelcerro
    public void showTextDialog(final WindowManager.MODE mode, final String title, final String htmlText, HyperlinkListener hyperlinkListener);
339 41441 jjdelcerro
340 42651 jjdelcerro
    public TreeModel createProjectLayersTreeModel();
341 44330 jjdelcerro
342
    public void addPropertiesObserver(Observer o);
343
344
    public void deletePropertiesObserver(Observer o);
345
346
    public void deletePropertiesObservers();
347
348 40435 jjdelcerro
}