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