Revision 26497 tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/wps/WPSCallejeroClientExtension.java
WPSCallejeroClientExtension.java | ||
---|---|---|
1 | 1 |
package es.logex.gvsig.wps; |
2 | 2 |
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.List; |
|
5 |
|
|
3 | 6 |
import org.apache.log4j.Logger; |
4 | 7 |
|
5 | 8 |
import com.iver.andami.PluginServices; |
6 | 9 |
import com.iver.andami.plugins.Extension; |
10 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
11 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
7 | 12 |
import com.iver.cit.gvsig.AddLayer; |
8 | 13 |
import com.iver.cit.gvsig.fmap.MapControl; |
9 | 14 |
import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior; |
15 |
import com.iver.cit.gvsig.project.documents.view.gui.BaseView; |
|
10 | 16 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
11 | 17 |
import com.iver.cit.gvsig.project.documents.view.toc.gui.FPopupMenu; |
12 | 18 |
import com.iver.cit.gvsig.project.documents.view.toolListeners.ZoomOutListener; |
... | ... | |
14 | 20 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
15 | 21 |
|
16 | 22 |
import es.logex.gvsig.fmap.layers.FLyrWPS; |
17 |
import es.logex.gvsig.gui.dialogs.WPSPropsTocMenuEntry; |
|
18 |
import es.logex.gvsig.gui.wizards.StreetsMapWizard; |
|
19 | 23 |
|
24 |
import es.logex.gvsig.gui.dialogs.StreetsMapDialog; |
|
25 |
import es.logex.gvsig.streetsmap.core.*; |
|
20 | 26 |
public class WPSCallejeroClientExtension extends Extension { |
21 | 27 |
|
22 |
private static Logger logger = Logger.getLogger(WPSCallejeroClientExtension_Old.class.getName()); |
|
23 |
|
|
24 |
|
|
28 |
private List<StreetsMapExtensionManager> listManagers = new ArrayList<StreetsMapExtensionManager>(); |
|
29 |
|
|
30 |
private static Logger logger = Logger |
|
31 |
.getLogger(WPSCallejeroClientExtension.class.getName()); |
|
32 |
|
|
25 | 33 |
public void initialize() { |
26 |
logger.info("Añado Wizard StreetsMap."); |
|
27 |
|
|
28 |
FPopupMenu.addEntry(new WPSPropsTocMenuEntry()); |
|
29 |
//FPopupMenu.addEntry(new WPSVectorialPropsTocMenuEntry()); |
|
30 |
|
|
31 |
// Adds a new tab to the "add layer" wizard for WFS layer creation |
|
32 |
AddLayer.addWizard(StreetsMapWizard.class); |
|
33 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
|
34 |
extensionPoints.add("CatalogLayers","OGC:WPS",FLyrWPS.class); |
|
35 |
|
|
34 |
/* |
|
35 |
* logger.info("Añado Wizard StreetsMap."); |
|
36 |
* |
|
37 |
* FPopupMenu.addEntry(new WPSPropsTocMenuEntry()); |
|
38 |
* //FPopupMenu.addEntry(new WPSVectorialPropsTocMenuEntry()); // Adds a |
|
39 |
* new tab to the "add layer" wizard for WFS layer creation |
|
40 |
* AddLayer.addWizard(StreetsMapWizard.class); ExtensionPoints |
|
41 |
* extensionPoints = ExtensionPointsSingleton.getInstance(); |
|
42 |
* extensionPoints.add("CatalogLayers","OGC:WPS",FLyrWPS.class); |
|
43 |
*/ |
|
44 |
|
|
36 | 45 |
} |
37 | 46 |
|
38 | 47 |
public void execute(String actionCommand) { |
48 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices |
|
49 |
.getMDIManager().getActiveWindow(); |
|
50 |
|
|
51 |
boolean found = false; |
|
39 | 52 |
|
53 |
for (StreetsMapExtensionManager em : listManagers) { |
|
54 |
if (em.getBaseView() == f) { |
|
55 |
found = true; |
|
56 |
PluginServices.getMDIManager().addWindow(em.getStreetsMapDialog()); |
|
57 |
break; |
|
58 |
} |
|
59 |
} |
|
60 |
if (!found) { |
|
61 |
StreetsMapExtensionManager em = new StreetsMapExtensionManager((BaseView)f); |
|
62 |
listManagers.add(em); |
|
63 |
PluginServices.getMDIManager().addWindow(em.getStreetsMapDialog()); |
|
64 |
} |
|
40 | 65 |
} |
41 | 66 |
|
42 | 67 |
public void terminate() { |
43 |
//TODO: dessubscribirse del redraw del viewport. |
|
44 |
|
|
68 |
// TODO: dessubscribirse del redraw del viewport.
|
|
69 |
|
|
45 | 70 |
} |
46 |
|
|
71 |
|
|
47 | 72 |
public boolean isEnabled() { |
48 |
// TODO Auto-generated method stub |
|
49 |
return false; |
|
73 |
return true; |
|
50 | 74 |
} |
51 | 75 |
|
52 | 76 |
public boolean isVisible() { |
53 |
// TODO Auto-generated method stub |
|
54 |
return false; |
|
77 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices |
|
78 |
.getMDIManager().getActiveWindow(); |
|
79 |
|
|
80 |
if (f == null) { |
|
81 |
return false; |
|
82 |
} |
|
83 |
|
|
84 |
return (f instanceof BaseView); |
|
55 | 85 |
} |
56 | 86 |
} |
87 |
|
|
88 |
final class StreetsMapView extends BaseView { |
|
89 |
public StreetsMapView() { |
|
90 |
super(); |
|
91 |
} |
|
92 |
|
|
93 |
public void windowClosed() { |
|
94 |
|
|
95 |
} |
|
96 |
} |
Also available in: Unified diff