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

History | View | Annotate | Download (9.56 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

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

    
61

    
62
public interface ApplicationManager extends ThreadSafeDialogs {
63

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

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

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

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

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

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

    
172
        /**
173
         * Obtain the projection associated by the code of projection
174
         * Passed as parameter. If passed code of projection it not
175
         * a valid projection code null is returned.
176
         * 
177
         * @param code of the projection requested
178
         * @return the requested projection or null
179
         */
180
    public IProjection getCRS(String code);
181
    
182
        /**
183
     * Utility method to obtain the DataManager used in the application at this moment.
184
     * 
185
     * @return the DataManager
186
         */
187
        public DataManager getDataManager();
188
    
189
    /**
190
     * Utility method to obtain the ProjectManager used in the application at this moment.
191
     * 
192
     * @return the ProjectManager
193
     */
194
    public ProjectManager getProjectManager();
195

    
196
    /**
197
     * Utility method to obtain the UIManager used in the application at this moment.
198
     * 
199
     * @return the UIManager
200
     */
201
    public MDIManager getUIManager();
202
    
203
    /**
204
     * Utility method to obtain the GeometryManager used in the application at this moment.
205
     * 
206
     * @return the GeometryManager
207
     */
208
    public GeometryManager getGeometryManager();
209
    
210
    /**
211
     * Utility method to obtain the PersistenceManager used in the application at this moment.
212
     * 
213
     * @return the PersistenceManager
214
     */
215
    public PersistenceManager getPersistenceManager();
216
    
217
    /**
218
     * Utility method to obtain the DisposableManager used in the application at this moment.
219
     * 
220
     * @return the DisposableManager
221
     */
222
    public DisposableManager getDisposableManager() ;
223

    
224
    /**
225
     * Utility method to obtain the DynObjectManager used in the application at this moment.
226
     * 
227
     * @return the DynObjectManager
228
     */
229
    public DynObjectManager getDynObjectManager() ;
230

    
231
    /**
232
     * Utility method to obtain the ExtensionPointManager used in the application at this moment.
233
     * 
234
     * @return the ExtensionPointManager
235
     */
236
    public ExtensionPointManager getExtensionPointManager();
237

    
238
    /**
239
     * Utility method to obtain the MapContextManager used in the application at this moment.
240
     * 
241
     * @return the MapContextManager
242
     */
243
    public MapContextManager getMapContextManager();
244
    
245
    /**
246
     * Utility method to obtain the AboutManager used in the application at this moment.
247
     * 
248
     * @return the AboutManager
249
     */
250
    public AboutManager getAbout();
251

    
252
    public DataTypesManager getDataTypesManager();
253
    
254
    /**
255
     * Utility method to obtain the IconThemeManager used in the application at this moment.
256
     * 
257
     * @return the IconThemeManager
258
     */
259
    IconThemeManager getIconThemeManager();
260
    
261
        void registerAddTableWizard(String name, String description,
262
                        Class<? extends WizardPanel> wpClass);
263

    
264
        List<WizardPanel> getWizardPanels() throws Exception;
265

    
266

    
267

    
268
        void registerPrepareOpenDataStore(PrepareDataStore action);
269
        void registerPrepareOpenDataStoreParameters(        PrepareDataStoreParameters action);
270
        void registerPrepareOpenLayer(PrepareLayer action);
271

    
272
        DataStore pepareOpenDataSource(DataStore store,
273
                        PrepareContext context)
274
                        throws Exception;
275

    
276
        DataStoreParameters prepareOpenDataStoreParameters(
277
                        DataStoreParameters storeParameters, PrepareContext context)
278
                        throws Exception;
279
        
280
        List<DataStoreParameters> prepareOpenDataStoreParameters(
281
                        List<DataStoreParameters> storeParameters, PrepareContext context)
282
                        throws Exception;
283

    
284
        FLayer prepareOpenLayer(FLayer layer,
285
                        PrepareContextView context)
286
                        throws Exception;
287
        
288
        
289
        public ColorTablesFactory getColorTablesFactory();
290
        
291
        public void registerColorTablesFactory(ColorTablesFactory factory);
292

    
293
        public String getLocaleLanguage();
294

    
295
    /**
296
     * sets message in status bar
297
     * 
298
     * This method is thread safe.
299
     * 
300
     * @param message
301
     * @param message_type One of: JOptionPane.ERROR_MESSAGE,
302
     * JOptionPane.WARNING_MESSAGE, JOptionPane.INFORMATION_MESSAGE 
303
     */
304
    public void message(String message, int message_type);
305
    
306
        public String translate(String message, String... args) ;
307
        
308
        public Component getRootComponent();
309
        
310
        public void refreshMenusAndToolBars();
311

    
312
        public MainFrame getMainFrame();
313
        
314
        public void addMenu(ActionInfo action, String text);
315
        public void addTool(ActionInfo action, String toolBarName);
316
}