Statistics
| Revision:

root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / ApplicationManager.java @ 38781

History | View | Annotate | Download (9.28 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
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 2
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
*/
22

    
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 IVER T.I   {{Task}}
26
*/
27

    
28
package org.gvsig.app;
29

    
30
import java.awt.Component;
31
import java.util.List;
32

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

    
63

    
64
public interface ApplicationManager extends ThreadSafeDialogs {
65

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

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

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

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

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

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

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

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

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

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

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

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

    
266
        List<WizardPanel> getWizardPanels() throws Exception;
267

    
268

    
269

    
270
        void registerPrepareOpenDataStore(PrepareDataStore action);
271
        void registerPrepareOpenDataStoreParameters(        PrepareDataStoreParameters action);
272
        void registerPrepareOpenLayer(PrepareLayer action);
273

    
274
        DataStore pepareOpenDataSource(DataStore store,
275
                        PrepareContext context)
276
                        throws Exception;
277

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

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

    
295
        public String getLocaleLanguage();
296

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