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 @ 41264

History | View | Annotate | Download (9.98 KB)

1
/**
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
package org.gvsig.app;
25

    
26
import java.awt.Component;
27
import java.util.List;
28
import javax.swing.JComponent;
29

    
30
import org.cresques.cts.IProjection;
31
import org.gvsig.about.AboutManager;
32
import org.gvsig.andami.actioninfo.ActionInfo;
33
import org.gvsig.andami.ui.mdiFrame.MainFrame;
34
import org.gvsig.andami.ui.mdiFrame.ThreadSafeDialogs;
35
import org.gvsig.andami.ui.mdiManager.IWindow;
36
import org.gvsig.andami.ui.mdiManager.MDIManager;
37
import org.gvsig.app.extension.Version;
38
import org.gvsig.app.gui.WizardPanel;
39
import org.gvsig.app.prepareAction.PrepareContext;
40
import org.gvsig.app.prepareAction.PrepareContextView;
41
import org.gvsig.app.prepareAction.PrepareDataStore;
42
import org.gvsig.app.prepareAction.PrepareDataStoreParameters;
43
import org.gvsig.app.prepareAction.PrepareLayer;
44
import org.gvsig.app.project.Project;
45
import org.gvsig.app.project.ProjectManager;
46
import org.gvsig.app.project.documents.Document;
47
import org.gvsig.app.project.documents.gui.IDocumentWindow;
48
import org.gvsig.fmap.dal.DataManager;
49
import org.gvsig.fmap.dal.DataStore;
50
import org.gvsig.fmap.dal.DataStoreParameters;
51
import org.gvsig.fmap.geom.GeometryManager;
52
import org.gvsig.fmap.mapcontext.MapContextManager;
53
import org.gvsig.fmap.mapcontext.layers.FLayer;
54
import org.gvsig.gui.ColorTablesFactory;
55
import org.gvsig.tools.dataTypes.DataTypesManager;
56
import org.gvsig.tools.dispose.DisposableManager;
57
import org.gvsig.tools.dynobject.DynObjectManager;
58
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
59
import org.gvsig.tools.persistence.PersistenceManager;
60
import org.gvsig.tools.swing.icontheme.IconThemeManager;
61

    
62

    
63
public interface ApplicationManager extends ThreadSafeDialogs {
64

    
65
    /**
66
     * Return the version of the application.
67
     * 
68
     * @return the version
69
     */
70
        public Version getVersion() ;
71

    
72
    /**
73
     * Return the active window, IWindow, in the application.
74
     * 
75
     * @return the active window
76
     */
77
        public IWindow getActiveWindow();
78

    
79
        /**
80
         * Return the project that is loaded and in use in the application.
81
         * 
82
         * @return the project 
83
         */
84
    public Project getCurrentProject();
85

    
86
    /**
87
     * Returns the active document of the application or null 
88
     * if there is no active document.
89
     * 
90
     * @return the active document
91
     */
92
    public Document getActiveDocument();
93

    
94
    /**
95
     * Returns the active document of the application that is of the 
96
     * requested type or null if there is no active document or the
97
     * active document is not of the requested type.
98
     * 
99
     * @param documentTypeName, type name of the document requested.
100
     * @return the active document
101
     */
102
    public Document getActiveDocument(String documentTypeName);
103

    
104
    /**
105
     * Returns the active document of the application that is of the 
106
     * requested type or null if there is no active document or the
107
     * active document is not of the requested type.
108
     * 
109
     * @param documentClass, class of the document requested.
110
     * @return the active document
111
     */
112
    public Document getActiveDocument(Class<? extends Document> documentClass);
113
    
114
    /**
115
     * Returns the JComponent associated to the active document for the
116
     * specified type of document.
117
     * If not is active the specified type of document return null.
118
     * 
119
     * @param documentClass
120
     * @return the component associated to the active document of type documentClass
121
     */
122
    public JComponent getActiveComponent(Class<? extends Document> documentClass);
123
    
124
    /**
125
     * Returns the window associated with the document passed as 
126
     * parameter or null if there is no window associated with 
127
     * the document.
128
     * 
129
     * @param document to search the window
130
     * @return window associated to the document
131
     */
132
    public IDocumentWindow getDocumentWindow(Document document);
133
    
134
    
135
    /**
136
     * Return the root of the nodes of preferences in the application.
137
     * 
138
     * @return the root of preferences.
139
     */
140
    PreferencesNode getPreferences();
141
        
142
    /**
143
     * Search and return the node of preferences required as nodeName.
144
     *  
145
     * @param nodeName, name of the node to return
146
     * @return the preferences node requested
147
     */
148
        PreferencesNode getPreferences(String nodeName);
149
        
150
        /**
151
         * Return the arguments passed to the application in the command line
152
         *  
153
         * @return arguments as a string array
154
         */
155
        public String[] getArguments();
156
        
157
        /**
158
         * Return the value of the argument passed in the command line by
159
         * the name indicated as the parameter. This is passed as:
160
         * <code>
161
         * application --name=value
162
         * </code>
163
         * @param name of the requested argument
164
         * @return value of the requested argument
165
         */
166
        public String getArgument(String name);
167
        
168
        /**
169
         * Get the value of the system clipboard as a string.
170
         * 
171
         * @return the clipboard value
172
         */
173
        public String getFromClipboard();
174
        
175
        /**
176
         * Put the string value passed as parameter in the clipboard of
177
         * the system.
178
         * 
179
         * @param data to put in the clipboard.
180
         */
181
        public void putInClipboard(String data) ;
182

    
183
        /**
184
         * Obtain the projection associated by the code of projection
185
         * Passed as parameter. If passed code of projection it not
186
         * a valid projection code null is returned.
187
         * 
188
         * @param code of the projection requested
189
         * @return the requested projection or null
190
         */
191
    public IProjection getCRS(String code);
192
    
193
        /**
194
     * Utility method to obtain the DataManager used in the application at this moment.
195
     * 
196
     * @return the DataManager
197
         */
198
        public DataManager getDataManager();
199
    
200
    /**
201
     * Utility method to obtain the ProjectManager used in the application at this moment.
202
     * 
203
     * @return the ProjectManager
204
     */
205
    public ProjectManager getProjectManager();
206

    
207
    /**
208
     * Utility method to obtain the UIManager used in the application at this moment.
209
     * 
210
     * @return the UIManager
211
     */
212
    public MDIManager getUIManager();
213
    
214
    /**
215
     * Utility method to obtain the GeometryManager used in the application at this moment.
216
     * 
217
     * @return the GeometryManager
218
     */
219
    public GeometryManager getGeometryManager();
220
    
221
    /**
222
     * Utility method to obtain the PersistenceManager used in the application at this moment.
223
     * 
224
     * @return the PersistenceManager
225
     */
226
    public PersistenceManager getPersistenceManager();
227
    
228
    /**
229
     * Utility method to obtain the DisposableManager used in the application at this moment.
230
     * 
231
     * @return the DisposableManager
232
     */
233
    public DisposableManager getDisposableManager() ;
234

    
235
    /**
236
     * Utility method to obtain the DynObjectManager used in the application at this moment.
237
     * 
238
     * @return the DynObjectManager
239
     */
240
    public DynObjectManager getDynObjectManager() ;
241

    
242
    /**
243
     * Utility method to obtain the ExtensionPointManager used in the application at this moment.
244
     * 
245
     * @return the ExtensionPointManager
246
     */
247
    public ExtensionPointManager getExtensionPointManager();
248

    
249
    /**
250
     * Utility method to obtain the MapContextManager used in the application at this moment.
251
     * 
252
     * @return the MapContextManager
253
     */
254
    public MapContextManager getMapContextManager();
255
    
256
    /**
257
     * Utility method to obtain the AboutManager used in the application at this moment.
258
     * 
259
     * @return the AboutManager
260
     */
261
    public AboutManager getAbout();
262

    
263
    public DataTypesManager getDataTypesManager();
264
    
265
    /**
266
     * Utility method to obtain the IconThemeManager used in the application at this moment.
267
     * 
268
     * @return the IconThemeManager
269
     */
270
    IconThemeManager getIconThemeManager();
271
    
272
        void registerAddTableWizard(String name, String description,
273
                        Class<? extends WizardPanel> wpClass);
274

    
275
        List<WizardPanel> getWizardPanels() throws Exception;
276

    
277

    
278

    
279
        void registerPrepareOpenDataStore(PrepareDataStore action);
280
        void registerPrepareOpenDataStoreParameters(        PrepareDataStoreParameters action);
281
        void registerPrepareOpenLayer(PrepareLayer action);
282

    
283
        DataStore pepareOpenDataSource(DataStore store,
284
                        PrepareContext context)
285
                        throws Exception;
286

    
287
        DataStoreParameters prepareOpenDataStoreParameters(
288
                        DataStoreParameters storeParameters, PrepareContext context)
289
                        throws Exception;
290
        
291
        List<DataStoreParameters> prepareOpenDataStoreParameters(
292
                        List<DataStoreParameters> storeParameters, PrepareContext context)
293
                        throws Exception;
294

    
295
        FLayer prepareOpenLayer(FLayer layer,
296
                        PrepareContextView context)
297
                        throws Exception;
298
        
299
        
300
        public ColorTablesFactory getColorTablesFactory();
301
        
302
        public void registerColorTablesFactory(ColorTablesFactory factory);
303

    
304
        public String getLocaleLanguage();
305

    
306
    /**
307
     * sets message in status bar
308
     * 
309
     * This method is thread safe.
310
     * 
311
     * @param message
312
     * @param message_type One of: JOptionPane.ERROR_MESSAGE,
313
     * JOptionPane.WARNING_MESSAGE, JOptionPane.INFORMATION_MESSAGE 
314
     */
315
    public void message(String message, int message_type);
316
    
317
        public String translate(String message, String... args) ;
318
        
319
        public Component getRootComponent();
320
        
321
        public void refreshMenusAndToolBars();
322

    
323
        public MainFrame getMainFrame();
324
        
325
        public void addMenu(ActionInfo action, String text);
326
        public void addTool(ActionInfo action, String toolBarName);
327
}