Revision 31496 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/extension/MeasureExtension.java
MeasureExtension.java | ||
---|---|---|
44 | 44 |
|
45 | 45 |
import org.gvsig.andami.PluginServices; |
46 | 46 |
import org.gvsig.andami.plugins.Extension; |
47 |
import org.gvsig.app.project.documents.view.IProjectView;
|
|
48 |
import org.gvsig.app.project.documents.view.gui.View;
|
|
47 |
import org.gvsig.app.project.documents.view.ViewDocument;
|
|
48 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel;
|
|
49 | 49 |
import org.gvsig.fmap.mapcontext.MapContext; |
50 | 50 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
51 | 51 |
import org.gvsig.fmap.mapcontrol.MapControl; |
... | ... | |
95 | 95 |
org.gvsig.andami.ui.mdiManager.IWindow view = PluginServices.getMDIManager() |
96 | 96 |
.getActiveWindow(); |
97 | 97 |
|
98 |
if (!(view instanceof View)) {
|
|
98 |
if (!(view instanceof DefaultViewPanel)) {
|
|
99 | 99 |
return; |
100 | 100 |
} |
101 | 101 |
|
102 |
View vista = (View) view;
|
|
102 |
DefaultViewPanel vista = (DefaultViewPanel) view;
|
|
103 | 103 |
MapControl mapCtrl = vista.getMapControl(); |
104 | 104 |
|
105 | 105 |
if (s.equals("MEDICION")) { |
... | ... | |
120 | 120 |
return false; |
121 | 121 |
} |
122 | 122 |
|
123 |
if (f instanceof View) {
|
|
124 |
View vista = (View) f;
|
|
125 |
IProjectView model = vista.getModel();
|
|
123 |
if (f instanceof DefaultViewPanel) {
|
|
124 |
DefaultViewPanel vista = (DefaultViewPanel) f;
|
|
125 |
ViewDocument model = vista.getModel();
|
|
126 | 126 |
MapContext mapa = model.getMapContext(); |
127 | 127 |
|
128 | 128 |
FLayers layers = mapa.getLayers(); |
... | ... | |
148 | 148 |
return false; |
149 | 149 |
} |
150 | 150 |
|
151 |
if (f instanceof View) {
|
|
152 |
View vista = (View) f;
|
|
153 |
IProjectView model = vista.getModel();
|
|
151 |
if (f instanceof DefaultViewPanel) {
|
|
152 |
DefaultViewPanel vista = (DefaultViewPanel) f;
|
|
153 |
ViewDocument model = vista.getModel();
|
|
154 | 154 |
MapContext mapa = model.getMapContext(); |
155 | 155 |
|
156 | 156 |
return mapa.getLayers().getLayersCount() > 0; |
Also available in: Unified diff