svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / ViewManager.java @ 46089
History | View | Annotate | Download (20.7 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.project.documents.view; |
25 |
|
26 |
import java.util.HashMap; |
27 |
import java.util.Iterator; |
28 |
import java.util.List; |
29 |
import java.util.Map; |
30 |
import java.util.function.Predicate; |
31 |
|
32 |
import javax.swing.ImageIcon; |
33 |
import org.apache.commons.lang3.StringUtils; |
34 |
|
35 |
import org.gvsig.andami.IconThemeHelper; |
36 |
import org.gvsig.andami.PluginServices; |
37 |
import org.gvsig.andami.PluginsLocator; |
38 |
import org.gvsig.andami.actioninfo.ActionInfo; |
39 |
import org.gvsig.andami.actioninfo.ActionInfoManager; |
40 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
41 |
import org.gvsig.app.project.Project; |
42 |
import org.gvsig.app.project.ProjectManager; |
43 |
import org.gvsig.app.project.documents.AbstractDocument; |
44 |
import org.gvsig.app.project.documents.AbstractDocumentManager; |
45 |
import org.gvsig.app.project.documents.Document; |
46 |
import org.gvsig.app.project.documents.actions.CopyDocumentAction; |
47 |
import org.gvsig.app.project.documents.actions.CutDocumentAction; |
48 |
import org.gvsig.app.project.documents.actions.PasteDocumentAction; |
49 |
import org.gvsig.app.project.documents.gui.IDocumentWindow; |
50 |
import org.gvsig.app.project.documents.gui.WindowLayout; |
51 |
import org.gvsig.app.project.documents.view.dalactions.AddFilterToLayerAction.AddFilterToLayerActionFactory; |
52 |
import org.gvsig.app.project.documents.view.dalactions.CreateTemporalLayerAction; |
53 |
import org.gvsig.app.project.documents.view.dalactions.ViewZoomAction.ViewZoomActionFactory; |
54 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
55 |
import org.gvsig.app.project.documents.view.gui.ViewProperties; |
56 |
import org.gvsig.app.project.documents.view.toc.AbstractActionInfoAdapterToTocContextMenuAction; |
57 |
import org.gvsig.fmap.dal.AbstractStoresRepository; |
58 |
import org.gvsig.fmap.dal.DALLocator; |
59 |
import org.gvsig.fmap.dal.DataManager; |
60 |
import org.gvsig.fmap.dal.DataStore; |
61 |
import org.gvsig.fmap.dal.DataStoreParameters; |
62 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
63 |
import org.gvsig.fmap.mapcontext.MapContext; |
64 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
65 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
66 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesHelper; |
67 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
68 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
69 |
import org.gvsig.tools.ToolsLocator; |
70 |
import org.gvsig.tools.dynobject.DynStruct; |
71 |
import org.gvsig.tools.extensionpoint.ExtensionBuilder; |
72 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
73 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
74 |
import org.gvsig.tools.persistence.PersistenceManager; |
75 |
import org.gvsig.tools.util.UnmodifiableBasicSet; |
76 |
import org.gvsig.tools.util.UnmodifiableBasicSetAdapter; |
77 |
import org.slf4j.Logger; |
78 |
import org.slf4j.LoggerFactory; |
79 |
|
80 |
/**
|
81 |
* Factory of View.
|
82 |
*
|
83 |
* @author gvSIG Team
|
84 |
*
|
85 |
*/
|
86 |
public class ViewManager extends AbstractDocumentManager { |
87 |
|
88 |
private static final Logger LOGGER = LoggerFactory.getLogger(ViewManager.class); |
89 |
|
90 |
private static class ViewDocumentStoresRepository extends AbstractStoresRepository { |
91 |
|
92 |
public ViewDocumentStoresRepository(String name) { |
93 |
super(name);
|
94 |
} |
95 |
|
96 |
private Map<String, DataStoreParameters> getAll(Predicate<DataStore> filter, int limit) { |
97 |
Map<String, DataStoreParameters> all = new HashMap<>(); |
98 |
Project project = ProjectManager.getInstance().getCurrentProject(); |
99 |
List<Document> views = project.getDocuments(TYPENAME); |
100 |
for (Document view : views) { |
101 |
for (FLayer layer : ((ViewDocument) view).layers()) {
|
102 |
if (layer instanceof FLyrVect) { |
103 |
FeatureStore store = ((FLyrVect) layer).getFeatureStore(); |
104 |
if (store!=null && (filter == null || filter.test(store))) { |
105 |
all.put(store.getName(), store.getParameters()); |
106 |
} |
107 |
// UnmodifiableBasicMap<String, DataStore> children = store.getChildren();
|
108 |
// if (children != null) {
|
109 |
// for (DataStore dataStore : children) {
|
110 |
// if (filter == null || filter.test(dataStore)) {
|
111 |
// all.put(dataStore.getName(), dataStore.getParameters());
|
112 |
// }
|
113 |
// }
|
114 |
// }
|
115 |
} |
116 |
if (limit > 0 && all.size() >= limit) { |
117 |
break;
|
118 |
} |
119 |
} |
120 |
} |
121 |
if (all.isEmpty()) {
|
122 |
return null; |
123 |
} |
124 |
return all;
|
125 |
} |
126 |
|
127 |
@Override
|
128 |
protected DataStoreParameters getMyParameters(final String name) { |
129 |
Map<String, DataStoreParameters> all = this.getAll((DataStore t) -> { |
130 |
String x = t==null? null:t.getName(); |
131 |
return StringUtils.equalsIgnoreCase(name, x);
|
132 |
}, 1);
|
133 |
if (all == null) { |
134 |
return null; |
135 |
} |
136 |
return all.get(name);
|
137 |
} |
138 |
|
139 |
@Override
|
140 |
public boolean containsKey(final String key) { |
141 |
Map<String, DataStoreParameters> all = this.getAll((DataStore t) -> { |
142 |
String x = t==null? null:t.getName(); |
143 |
return StringUtils.equalsIgnoreCase(key, x);
|
144 |
}, 1);
|
145 |
if (all == null) { |
146 |
return false; |
147 |
} |
148 |
return all.containsKey(key);
|
149 |
} |
150 |
|
151 |
@Override
|
152 |
protected UnmodifiableBasicSet<String> getMyKeySet() { |
153 |
Map<String, DataStoreParameters> all = this.getAll(null, 0); |
154 |
if (all == null) { |
155 |
return null; |
156 |
} |
157 |
return new UnmodifiableBasicSetAdapter<>(all.keySet()); |
158 |
} |
159 |
|
160 |
@Override
|
161 |
protected boolean isEmptyMyRepository() { |
162 |
Map<String, DataStoreParameters> all = this.getAll(null, 1); |
163 |
return all.isEmpty();
|
164 |
} |
165 |
|
166 |
@Override
|
167 |
protected int getMySize() { |
168 |
Map<String, DataStoreParameters> all = this.getAll(null, 0); |
169 |
return all.size();
|
170 |
} |
171 |
|
172 |
@Override
|
173 |
public Iterator<DataStoreParameters> iterator() { |
174 |
Map<String, DataStoreParameters> all = this.getAll(null, 0); |
175 |
return all.values().iterator();
|
176 |
} |
177 |
|
178 |
public static void selfRegister() { |
179 |
DataManager dataManager = DALLocator.getDataManager(); |
180 |
dataManager.getStoresRepository().addRepository(new ViewDocumentStoresRepository("Project layers")); |
181 |
} |
182 |
} |
183 |
private static final String PERSISTENCE_VIEW_DOCUMENT_DEFINITION_NAME |
184 |
= "DefaultViewDocument";
|
185 |
public static String TYPENAME = "project.document.view2d"; |
186 |
private DynStruct persistenceDefinition;
|
187 |
|
188 |
public ViewManager() {
|
189 |
// Do nothing
|
190 |
} |
191 |
|
192 |
@Override
|
193 |
public int getPriority() { |
194 |
return 0; |
195 |
} |
196 |
|
197 |
@Override
|
198 |
public ImageIcon getIcon() { |
199 |
return PluginServices.getIconTheme().get("document-view-icon"); |
200 |
} |
201 |
|
202 |
@Override
|
203 |
public ImageIcon getIconSelected() { |
204 |
return PluginServices.getIconTheme().get("document-view-icon-sel"); |
205 |
} |
206 |
|
207 |
@Override
|
208 |
public String getTitle() { |
209 |
return PluginServices.getText(this, "Vista"); |
210 |
} |
211 |
|
212 |
@Override
|
213 |
public String getTypeName() { |
214 |
return TYPENAME;
|
215 |
} |
216 |
|
217 |
@Override
|
218 |
public Class getMainWindowClass() { |
219 |
return DefaultViewPanel.class;
|
220 |
} |
221 |
|
222 |
@Override
|
223 |
public AbstractDocument createDocument() { |
224 |
AbstractDocument doc = new DefaultViewDocument(this); |
225 |
if (this.notifyObservers(NOTIFY_AFTER_CREATEDOCUMENT, doc).isCanceled()) { |
226 |
return null; |
227 |
} |
228 |
return doc;
|
229 |
|
230 |
} |
231 |
|
232 |
@Override
|
233 |
public IWindow getMainWindow(Document doc, WindowLayout layout) { |
234 |
IDocumentWindow win = (IDocumentWindow) super.getMainWindow(doc, layout);
|
235 |
if (win == null) { |
236 |
win = this.createDocumentWindow(doc);
|
237 |
if (layout != null && win != null) { |
238 |
win.setWindowLayout(layout); |
239 |
} |
240 |
if (this.notifyObservers(NOTIFY_AFTER_CREATEMAINWINDOW, win).isCanceled()) { |
241 |
return null; |
242 |
} |
243 |
} |
244 |
if (this.notifyObservers(NOTIFY_AFTER_GETMAINWINDOW, win).isCanceled()) { |
245 |
return null; |
246 |
} |
247 |
((AbstractDocument) doc).raiseEventCreateWindow(win);
|
248 |
return win;
|
249 |
} |
250 |
|
251 |
@Override
|
252 |
public IWindow getPropertiesWindow(Document doc) { |
253 |
IWindow win = super.getPropertiesWindow(doc);
|
254 |
if (win == null) { |
255 |
win = new ViewProperties((DefaultViewDocument) doc);
|
256 |
if (this.notifyObservers(NOTIFY_AFTER_CREATEPROPERTIESWINDOW, win).isCanceled()) { |
257 |
return null; |
258 |
} |
259 |
} |
260 |
if (this.notifyObservers(NOTIFY_AFTER_GETPROPERTIESWINDOW, win).isCanceled()) { |
261 |
return null; |
262 |
} |
263 |
return win;
|
264 |
} |
265 |
|
266 |
public void addTOCContextAction(String theAction) { |
267 |
ActionInfoManager actionManager = PluginsLocator.getActionInfoManager(); |
268 |
ActionInfo action = actionManager.getAction(theAction); |
269 |
if (action == null) { |
270 |
String errmsg = "Action '" + theAction + "' not found"; |
271 |
LOGGER.info(errmsg); |
272 |
throw new RuntimeException(errmsg); |
273 |
} |
274 |
this.addTOCContextAction(action);
|
275 |
} |
276 |
|
277 |
public void addTOCContextAction(String theAction, String group, int groupOrder, int order) { |
278 |
ActionInfoManager actionManager = PluginsLocator.getActionInfoManager(); |
279 |
ActionInfo action = actionManager.getAction(theAction); |
280 |
if (action == null) { |
281 |
String errmsg = "Action '" + theAction + "' not found"; |
282 |
LOGGER.info(errmsg); |
283 |
throw new RuntimeException(errmsg); |
284 |
} |
285 |
this.addTOCContextAction(
|
286 |
action.getName(), |
287 |
new ActionInfoAdapterToContextMenuAction(action, group, groupOrder, order)
|
288 |
); |
289 |
} |
290 |
|
291 |
public void addTOCContextAction(ActionInfo action) { |
292 |
this.addTOCContextAction(action.getName(), new ActionInfoAdapterToContextMenuAction(action, "default", 9000)); |
293 |
} |
294 |
|
295 |
public void addTOCContextAction(ActionInfo action, String group, int groupOrder) { |
296 |
this.addTOCContextAction(action.getName(), new ActionInfoAdapterToContextMenuAction(action, group, groupOrder)); |
297 |
} |
298 |
|
299 |
public void addTOCSeparator(String group, int groupOrder, int order) { |
300 |
this.addTOCContextAction(
|
301 |
group + "/-",
|
302 |
new IContextMenuAction() {
|
303 |
@Override
|
304 |
public boolean isVisible(Object item, Object[] selectedItems) { |
305 |
return true; |
306 |
} |
307 |
|
308 |
@Override
|
309 |
public boolean isEnabled(Object item, Object[] selectedItems) { |
310 |
return true; |
311 |
} |
312 |
|
313 |
@Override
|
314 |
public void execute(Object item, Object[] selectedItems) { |
315 |
} |
316 |
|
317 |
@Override
|
318 |
public String getGroup() { |
319 |
return group + "/-"; |
320 |
} |
321 |
|
322 |
@Override
|
323 |
public int getGroupOrder() { |
324 |
return groupOrder;
|
325 |
} |
326 |
|
327 |
@Override
|
328 |
public int getOrder() { |
329 |
return order;
|
330 |
} |
331 |
|
332 |
@Override
|
333 |
public String getText() { |
334 |
return "-"; |
335 |
} |
336 |
|
337 |
@Override
|
338 |
public String getDescription() { |
339 |
return ""; |
340 |
} |
341 |
} |
342 |
); |
343 |
} |
344 |
|
345 |
class ActionInfoAdapterToContextMenuAction extends AbstractActionInfoAdapterToTocContextMenuAction { |
346 |
|
347 |
ActionInfoAdapterToContextMenuAction(ActionInfo action, String group, int groupOrder) { |
348 |
super(action, group, groupOrder);
|
349 |
} |
350 |
|
351 |
ActionInfoAdapterToContextMenuAction(ActionInfo action, String group, int groupOrder, int order) { |
352 |
super(action, group, groupOrder, order);
|
353 |
} |
354 |
} |
355 |
|
356 |
/**
|
357 |
* @deprecated use addTOCContextAction(ActionInfo action, String group, int
|
358 |
* groupOrder)
|
359 |
* @param id
|
360 |
* @param action
|
361 |
*/
|
362 |
public void addTOCContextAction(String id, IContextMenuAction action) { |
363 |
initializeRegisterTOCActions(); |
364 |
ExtensionPoint exPoint = ToolsLocator.getExtensionPointManager().add( |
365 |
"View_TocActions", ""); |
366 |
if (action instanceof ExtensionBuilder) { |
367 |
exPoint.append(id, "", (ExtensionBuilder) action);
|
368 |
return;
|
369 |
} |
370 |
exPoint.append(id, "", new ContextMenuActionAdapterToExtensionBuilder(action)); |
371 |
} |
372 |
|
373 |
class ContextMenuActionAdapterToExtensionBuilder implements ExtensionBuilder { |
374 |
|
375 |
IContextMenuAction menuAction = null;
|
376 |
|
377 |
ContextMenuActionAdapterToExtensionBuilder(IContextMenuAction menuAction) { |
378 |
this.menuAction = menuAction;
|
379 |
} |
380 |
|
381 |
@Override
|
382 |
public Object create() { |
383 |
return this.menuAction; |
384 |
} |
385 |
|
386 |
@Override
|
387 |
public Object create(Object[] args) { |
388 |
return this.menuAction; |
389 |
} |
390 |
|
391 |
@Override
|
392 |
public Object create(Map args) { |
393 |
return this.menuAction; |
394 |
} |
395 |
} |
396 |
|
397 |
private static void initializeRegisterTOCActions() { |
398 |
ExtensionPointManager epManager = ToolsLocator.getExtensionPointManager(); |
399 |
|
400 |
if (!epManager.has("View_TocActions")) { |
401 |
epManager.add( |
402 |
"View_TocActions",
|
403 |
"Context menu options of the TOC "
|
404 |
+ " in the view window "
|
405 |
+ "(register instances of "
|
406 |
+ "org.gvsig.app.gui.toc.AbstractTocContextMenuAction)"
|
407 |
); |
408 |
} |
409 |
} |
410 |
|
411 |
/**
|
412 |
* Registers in the points of extension the Factory with alias.
|
413 |
*
|
414 |
*/
|
415 |
public static void register() { |
416 |
ViewManager factory = new ViewManager();
|
417 |
ProjectManager.getInstance().registerDocumentFactory(factory); |
418 |
|
419 |
PersistenceManager manager = ToolsLocator.getPersistenceManager(); |
420 |
manager.registerFactory(factory); |
421 |
|
422 |
initializeRegisterTOCActions(); |
423 |
|
424 |
ProjectManager.getInstance().registerDocumentAction(TYPENAME, new CopyDocumentAction());
|
425 |
ProjectManager.getInstance().registerDocumentAction(TYPENAME, new CutDocumentAction());
|
426 |
ProjectManager.getInstance().registerDocumentAction(TYPENAME, new PasteDocumentAction());
|
427 |
|
428 |
IconThemeHelper.registerIcon("document", "document-view-icon", ViewManager.class); |
429 |
IconThemeHelper.registerIcon("document", "document-view-icon-sel", ViewManager.class); |
430 |
|
431 |
IconThemeHelper.registerIcon("cursor", "cursor-crux", ViewManager.class); |
432 |
IconThemeHelper.registerIcon("cursor", "cursor-info-by-point", ViewManager.class); |
433 |
IconThemeHelper.registerIcon("cursor", "cursor-pan", ViewManager.class); |
434 |
IconThemeHelper.registerIcon("cursor", "cursor-query-area", ViewManager.class); |
435 |
IconThemeHelper.registerIcon("cursor", "cursor-select-by-point", ViewManager.class); |
436 |
IconThemeHelper.registerIcon("cursor", "cursor-select-by-polygon", ViewManager.class); |
437 |
IconThemeHelper.registerIcon("cursor", "cursor-select-by-rectangle", ViewManager.class); |
438 |
IconThemeHelper.registerIcon("cursor", "cursor-zoom-in", ViewManager.class); |
439 |
IconThemeHelper.registerIcon("cursor", "cursor-zoom-out", ViewManager.class); |
440 |
|
441 |
IconThemeHelper.registerIcon("layer", "layer-icon", ViewManager.class); |
442 |
IconThemeHelper.registerIcon("layer", "layer-icon-group", ViewManager.class); |
443 |
IconThemeHelper.registerIcon("layer", "layer-icon-vectorial", ViewManager.class); |
444 |
IconThemeHelper.registerIcon("layer", "layer-icon-csv", ViewManager.class); |
445 |
IconThemeHelper.registerIcon("layer", "layer-icon-dgn", ViewManager.class); |
446 |
IconThemeHelper.registerIcon("layer", "layer-icon-dxf", ViewManager.class); |
447 |
IconThemeHelper.registerIcon("layer", "layer-icon-postgresql", ViewManager.class); |
448 |
IconThemeHelper.registerIcon("layer", "layer-icon-mysql", ViewManager.class); |
449 |
IconThemeHelper.registerIcon("layer", "layer-icon-jdbc", ViewManager.class); |
450 |
//IconThemeHelper.registerIcon("layer", "layer-icon-unavailable", ViewManager.class);
|
451 |
IconThemeHelper.registerIcon("layer", "layer-chk-unavailable", ViewManager.class); |
452 |
IconThemeHelper.registerIcon("layer", "layer-chk-temporary", ViewManager.class); |
453 |
IconThemeHelper.registerIcon("layer", "active-layer-bring-front", ViewManager.class); |
454 |
IconThemeHelper.registerIcon("layer", "active-layer-move-ahead", ViewManager.class); |
455 |
IconThemeHelper.registerIcon("layer", "active-layer-move-behind", ViewManager.class); |
456 |
IconThemeHelper.registerIcon("layer", "active-layer-send-back", ViewManager.class); |
457 |
IconThemeHelper.registerIcon("layer", "active-layer-set-hide", ViewManager.class); |
458 |
IconThemeHelper.registerIcon("layer", "active-layer-set-visible", ViewManager.class); |
459 |
IconThemeHelper.registerIcon("layer", "layer-set-visible", ViewManager.class); |
460 |
IconThemeHelper.registerIcon("layer", "layer-set-hide", ViewManager.class); |
461 |
IconThemeHelper.registerIcon("layer", "layer-set-inactive", ViewManager.class); |
462 |
IconThemeHelper.registerIcon("layer", "layer-set-active", ViewManager.class); |
463 |
|
464 |
IconThemeHelper.registerIcon("legend", "legend-overview-single-symbol", ViewManager.class); |
465 |
IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-interval", ViewManager.class); |
466 |
IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-unique-value", ViewManager.class); |
467 |
|
468 |
MapContextManager mapContextMgr = MapContextLocator.getMapContextManager(); |
469 |
mapContextMgr.registerIconLayer("CSV", "layer-icon-csv"); |
470 |
mapContextMgr.registerIconLayer("DGN", "layer-icon-dgn"); |
471 |
mapContextMgr.registerIconLayer("DXF", "layer-icon-dxf"); |
472 |
mapContextMgr.registerIconLayer("jdbc", "layer-icon-jdbc"); |
473 |
mapContextMgr.registerIconLayer("PostgreSQL", "layer-icon-postgresql"); |
474 |
mapContextMgr.registerIconLayer("MySQL", "layer-icon-mysql"); |
475 |
|
476 |
if (factory.persistenceDefinition == null) { |
477 |
factory.persistenceDefinition = manager.addDefinition( |
478 |
ViewDocument.class, |
479 |
PERSISTENCE_VIEW_DOCUMENT_DEFINITION_NAME, |
480 |
"Default view document persistence definition",
|
481 |
null,
|
482 |
null
|
483 |
); |
484 |
factory.persistenceDefinition.extend(manager.getDefinition(AbstractDocument.PERSISTENCE_DEFINITION_NAME));
|
485 |
|
486 |
factory.persistenceDefinition.addDynFieldBoolean("useMapOverview").setMandatory(true); |
487 |
factory.persistenceDefinition.addDynFieldObject("mainMapContext").setClassOfValue(MapContext.class).setMandatory(true); |
488 |
factory.persistenceDefinition.addDynFieldObject("overviewMapContext").setClassOfValue(MapContext.class).setMandatory(false); |
489 |
factory.persistenceDefinition.addDynFieldObject("propertiesHelper").setClassOfValue(ExtendedPropertiesHelper.class)
|
490 |
.setMandatory(false);
|
491 |
|
492 |
} |
493 |
ViewDocumentStoresRepository.selfRegister(); |
494 |
ViewZoomActionFactory.selfRegister(); |
495 |
AddFilterToLayerActionFactory.selfRegister(); |
496 |
CreateTemporalLayerAction.CreateTemporalLayerActionFactory.selfRegister(); |
497 |
} |
498 |
|
499 |
@SuppressWarnings("rawtypes") |
500 |
@Override
|
501 |
public DynStruct getDefinition(String className) { |
502 |
|
503 |
if (this.persistenceDefinition.getName().equalsIgnoreCase(className)) { |
504 |
return this.persistenceDefinition; |
505 |
} |
506 |
if (this.persistenceDefinition.getFullName().equalsIgnoreCase(className)) { |
507 |
return this.persistenceDefinition; |
508 |
} |
509 |
if (this.getDocumentClass().getName().equals(className)) { |
510 |
return this.persistenceDefinition; |
511 |
} |
512 |
|
513 |
return null; |
514 |
} |
515 |
|
516 |
@SuppressWarnings("rawtypes") |
517 |
@Override
|
518 |
protected Class getDocumentClass() { |
519 |
return DefaultViewDocument.class;
|
520 |
} |
521 |
|
522 |
@Override
|
523 |
public boolean manages(Object object) { |
524 |
return object instanceof ViewDocument; |
525 |
} |
526 |
} |