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 @ 40596
History | View | Annotate | Download (9.33 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.ui.mdiFrame.ThreadSafeDialogs; |
32 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
33 |
import org.gvsig.andami.ui.mdiManager.MDIManager; |
34 |
import org.gvsig.app.extension.Version; |
35 |
import org.gvsig.app.gui.WizardPanel; |
36 |
import org.gvsig.app.prepareAction.PrepareContext; |
37 |
import org.gvsig.app.prepareAction.PrepareContextView; |
38 |
import org.gvsig.app.prepareAction.PrepareDataStore; |
39 |
import org.gvsig.app.prepareAction.PrepareDataStoreParameters; |
40 |
import org.gvsig.app.prepareAction.PrepareLayer; |
41 |
import org.gvsig.app.project.Project; |
42 |
import org.gvsig.app.project.ProjectManager; |
43 |
import org.gvsig.app.project.documents.Document; |
44 |
import org.gvsig.app.project.documents.gui.IDocumentWindow; |
45 |
import org.gvsig.fmap.dal.DataManager; |
46 |
import org.gvsig.fmap.dal.DataStore; |
47 |
import org.gvsig.fmap.dal.DataStoreParameters; |
48 |
import org.gvsig.fmap.geom.GeometryManager; |
49 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
50 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
51 |
import org.gvsig.gui.ColorTablesFactory; |
52 |
import org.gvsig.tools.dataTypes.DataTypesManager; |
53 |
import org.gvsig.tools.dispose.DisposableManager; |
54 |
import org.gvsig.tools.dynobject.DynObjectManager; |
55 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
56 |
import org.gvsig.tools.persistence.PersistenceManager; |
57 |
import org.gvsig.tools.swing.icontheme.IconThemeManager; |
58 |
|
59 |
|
60 |
public interface ApplicationManager extends ThreadSafeDialogs { |
61 |
|
62 |
/**
|
63 |
* Return the version of the application.
|
64 |
*
|
65 |
* @return the version
|
66 |
*/
|
67 |
public Version getVersion() ;
|
68 |
|
69 |
/**
|
70 |
* Return the active window, IWindow, in the application.
|
71 |
*
|
72 |
* @return the active window
|
73 |
*/
|
74 |
public IWindow getActiveWindow();
|
75 |
|
76 |
/**
|
77 |
* Return the project that is loaded and in use in the application.
|
78 |
*
|
79 |
* @return the project
|
80 |
*/
|
81 |
public Project getCurrentProject();
|
82 |
|
83 |
/**
|
84 |
* Returns the active document of the application or null
|
85 |
* if there is no active document.
|
86 |
*
|
87 |
* @return the active document
|
88 |
*/
|
89 |
public Document getActiveDocument(); |
90 |
|
91 |
/**
|
92 |
* Returns the active document of the application that is of the
|
93 |
* requested type or null if there is no active document or the
|
94 |
* active document is not of the requested type.
|
95 |
*
|
96 |
* @param documentTypeName, type name of the document requested.
|
97 |
* @return the active document
|
98 |
*/
|
99 |
public Document getActiveDocument(String documentTypeName); |
100 |
|
101 |
/**
|
102 |
* Returns the active document of the application that is of the
|
103 |
* requested type or null if there is no active document or the
|
104 |
* active document is not of the requested type.
|
105 |
*
|
106 |
* @param documentClass, class of the document requested.
|
107 |
* @return the active document
|
108 |
*/
|
109 |
public Document getActiveDocument(Class<? extends Document> documentClass); |
110 |
|
111 |
/**
|
112 |
* Returns the window associated with the document passed as
|
113 |
* parameter or null if there is no window associated with
|
114 |
* the document.
|
115 |
*
|
116 |
* @param document to search the window
|
117 |
* @return window associated to the document
|
118 |
*/
|
119 |
public IDocumentWindow getDocumentWindow(Document document); |
120 |
|
121 |
|
122 |
/**
|
123 |
* Return the root of the nodes of preferences in the application.
|
124 |
*
|
125 |
* @return the root of preferences.
|
126 |
*/
|
127 |
PreferencesNode getPreferences(); |
128 |
|
129 |
/**
|
130 |
* Search and return the node of preferences required as nodeName.
|
131 |
*
|
132 |
* @param nodeName, name of the node to return
|
133 |
* @return the preferences node requested
|
134 |
*/
|
135 |
PreferencesNode getPreferences(String nodeName);
|
136 |
|
137 |
/**
|
138 |
* Return the arguments passed to the application in the command line
|
139 |
*
|
140 |
* @return arguments as a string array
|
141 |
*/
|
142 |
public String[] getArguments(); |
143 |
|
144 |
/**
|
145 |
* Return the value of the argument passed in the command line by
|
146 |
* the name indicated as the parameter. This is passed as:
|
147 |
* <code>
|
148 |
* application --name=value
|
149 |
* </code>
|
150 |
* @param name of the requested argument
|
151 |
* @return value of the requested argument
|
152 |
*/
|
153 |
public String getArgument(String name); |
154 |
|
155 |
/**
|
156 |
* Get the value of the system clipboard as a string.
|
157 |
*
|
158 |
* @return the clipboard value
|
159 |
*/
|
160 |
public String getFromClipboard(); |
161 |
|
162 |
/**
|
163 |
* Put the string value passed as parameter in the clipboard of
|
164 |
* the system.
|
165 |
*
|
166 |
* @param data to put in the clipboard.
|
167 |
*/
|
168 |
public void putInClipboard(String data) ; |
169 |
|
170 |
/**
|
171 |
* Obtain the projection associated by the code of projection
|
172 |
* Passed as parameter. If passed code of projection it not
|
173 |
* a valid projection code null is returned.
|
174 |
*
|
175 |
* @param code of the projection requested
|
176 |
* @return the requested projection or null
|
177 |
*/
|
178 |
public IProjection getCRS(String code); |
179 |
|
180 |
/**
|
181 |
* Utility method to obtain the DataManager used in the application at this moment.
|
182 |
*
|
183 |
* @return the DataManager
|
184 |
*/
|
185 |
public DataManager getDataManager();
|
186 |
|
187 |
/**
|
188 |
* Utility method to obtain the ProjectManager used in the application at this moment.
|
189 |
*
|
190 |
* @return the ProjectManager
|
191 |
*/
|
192 |
public ProjectManager getProjectManager();
|
193 |
|
194 |
/**
|
195 |
* Utility method to obtain the UIManager used in the application at this moment.
|
196 |
*
|
197 |
* @return the UIManager
|
198 |
*/
|
199 |
public MDIManager getUIManager();
|
200 |
|
201 |
/**
|
202 |
* Utility method to obtain the GeometryManager used in the application at this moment.
|
203 |
*
|
204 |
* @return the GeometryManager
|
205 |
*/
|
206 |
public GeometryManager getGeometryManager();
|
207 |
|
208 |
/**
|
209 |
* Utility method to obtain the PersistenceManager used in the application at this moment.
|
210 |
*
|
211 |
* @return the PersistenceManager
|
212 |
*/
|
213 |
public PersistenceManager getPersistenceManager();
|
214 |
|
215 |
/**
|
216 |
* Utility method to obtain the DisposableManager used in the application at this moment.
|
217 |
*
|
218 |
* @return the DisposableManager
|
219 |
*/
|
220 |
public DisposableManager getDisposableManager() ;
|
221 |
|
222 |
/**
|
223 |
* Utility method to obtain the DynObjectManager used in the application at this moment.
|
224 |
*
|
225 |
* @return the DynObjectManager
|
226 |
*/
|
227 |
public DynObjectManager getDynObjectManager() ;
|
228 |
|
229 |
/**
|
230 |
* Utility method to obtain the ExtensionPointManager used in the application at this moment.
|
231 |
*
|
232 |
* @return the ExtensionPointManager
|
233 |
*/
|
234 |
public ExtensionPointManager getExtensionPointManager();
|
235 |
|
236 |
/**
|
237 |
* Utility method to obtain the MapContextManager used in the application at this moment.
|
238 |
*
|
239 |
* @return the MapContextManager
|
240 |
*/
|
241 |
public MapContextManager getMapContextManager();
|
242 |
|
243 |
/**
|
244 |
* Utility method to obtain the AboutManager used in the application at this moment.
|
245 |
*
|
246 |
* @return the AboutManager
|
247 |
*/
|
248 |
public AboutManager getAbout();
|
249 |
|
250 |
public DataTypesManager getDataTypesManager();
|
251 |
|
252 |
/**
|
253 |
* Utility method to obtain the IconThemeManager used in the application at this moment.
|
254 |
*
|
255 |
* @return the IconThemeManager
|
256 |
*/
|
257 |
IconThemeManager getIconThemeManager(); |
258 |
|
259 |
void registerAddTableWizard(String name, String description, |
260 |
Class<? extends WizardPanel> wpClass); |
261 |
|
262 |
List<WizardPanel> getWizardPanels() throws Exception; |
263 |
|
264 |
|
265 |
|
266 |
void registerPrepareOpenDataStore(PrepareDataStore action);
|
267 |
void registerPrepareOpenDataStoreParameters( PrepareDataStoreParameters action);
|
268 |
void registerPrepareOpenLayer(PrepareLayer action);
|
269 |
|
270 |
DataStore pepareOpenDataSource(DataStore store, |
271 |
PrepareContext context) |
272 |
throws Exception; |
273 |
|
274 |
DataStoreParameters prepareOpenDataStoreParameters( |
275 |
DataStoreParameters storeParameters, PrepareContext context) |
276 |
throws Exception; |
277 |
|
278 |
List<DataStoreParameters> prepareOpenDataStoreParameters(
|
279 |
List<DataStoreParameters> storeParameters, PrepareContext context)
|
280 |
throws Exception; |
281 |
|
282 |
FLayer prepareOpenLayer(FLayer layer, |
283 |
PrepareContextView context) |
284 |
throws Exception; |
285 |
|
286 |
|
287 |
public ColorTablesFactory getColorTablesFactory();
|
288 |
|
289 |
public void registerColorTablesFactory(ColorTablesFactory factory); |
290 |
|
291 |
public String getLocaleLanguage(); |
292 |
|
293 |
/**
|
294 |
* sets message in status bar
|
295 |
*
|
296 |
* This method is thread safe.
|
297 |
*
|
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 |
public String translate(String message, String... args) ; |
305 |
|
306 |
public Component getRootComponent(); |
307 |
|
308 |
public void refreshMenusAndToolBars(); |
309 |
|
310 |
} |