Statistics
| Revision:

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

History | View | Annotate | Download (9.03 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.util.List;
31

    
32
import org.cresques.cts.IProjection;
33

    
34
import org.gvsig.about.AboutManager;
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 {
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 window associated with the document passed as 
116
     * parameter or null if there is no window associated with 
117
     * the document.
118
     * 
119
     * @param document to search the window
120
     * @return window associated to the document
121
     */
122
    public IDocumentWindow getDocumentWindow(Document document);
123
    
124
    
125
    /**
126
     * Return the root of the nodes of preferences in the application.
127
     * 
128
     * @return the root of preferences.
129
     */
130
    PreferencesNode getPreferences();
131
        
132
    /**
133
     * Search and return the node of preferences required as nodeName.
134
     *  
135
     * @param nodeName, name of the node to return
136
     * @return the preferences node requested
137
     */
138
        PreferencesNode getPreferences(String nodeName);
139
        
140
        /**
141
         * Return the arguments passed to the application in the command line
142
         *  
143
         * @return arguments as a string array
144
         */
145
        public String[] getArguments();
146
        
147
        /**
148
         * Return the value of the argument passed in the command line by
149
         * the name indicated as the parameter. This is passed as:
150
         * <code>
151
         * application --name=value
152
         * </code>
153
         * @param name of the requested argument
154
         * @return value of the requested argument
155
         */
156
        public String getArgument(String name);
157
        
158
        /**
159
         * Get the value of the system clipboard as a string.
160
         * 
161
         * @return the clipboard value
162
         */
163
        public String getFromClipboard();
164
        
165
        /**
166
         * Put the string value passed as parameter in the clipboard of
167
         * the system.
168
         * 
169
         * @param data to put in the clipboard.
170
         */
171
        public void putInClipboard(String data) ;
172

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

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

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

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

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

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

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

    
267

    
268

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

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

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

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

    
294
        public String getLocaleLanguage();
295

    
296
    /**
297
     * Adds message to status bar
298
     * @param message
299
     * @param message_type One of: JOptionPane.ERROR_MESSAGE),
300
     * JOptionPane.WARNING_MESSAGE, JOptionPane.INFORMATION_MESSAGE 
301
     */
302
    public void message(String message, int message_type);
303
        
304

    
305
}