Revision 3102 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/georeferencing/GeoreferencingToolsModule.java
GeoreferencingToolsModule.java | ||
---|---|---|
79 | 79 |
* El control es visible siempre que haya una vista abierta |
80 | 80 |
*/ |
81 | 81 |
public boolean isVisible() { |
82 |
com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager() |
|
83 |
.getActiveView(); |
|
82 |
com.iver.andami.ui.mdiManager.View f = null; |
|
83 |
try{ |
|
84 |
f = PluginServices.getMDIManager().getActiveView(); |
|
85 |
}catch(ClassCastException exc){ |
|
86 |
return false; |
|
87 |
} |
|
84 | 88 |
|
85 | 89 |
if (f == null) { |
86 | 90 |
return false; |
87 | 91 |
} |
88 | 92 |
|
89 | 93 |
try{ |
90 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
|
91 |
for(int i=0;i<theView.getMapControl().getMapContext().getLayers().getLayersCount();i++){ |
|
92 |
FLayer lyr = theView.getMapControl().getMapContext().getLayers().getLayer(i); |
|
94 |
for(int i=0;i<((View)f).getMapControl().getMapContext().getLayers().getLayersCount();i++){ |
|
95 |
FLayer lyr = ((View)f).getMapControl().getMapContext().getLayers().getLayer(i); |
|
93 | 96 |
if( lyr instanceof FLyrGeoRaster && |
94 | 97 |
lyr.isActive() && |
95 | 98 |
lyr.getName().startsWith("*")) |
... | ... | |
107 | 110 |
* la que ha sido activada. |
108 | 111 |
*/ |
109 | 112 |
public void execute(String s) { |
110 |
View vista = (View) PluginServices.getMDIManager().getActiveView(); |
|
111 |
MapControl mapCtrl = vista.getMapControl(); |
|
113 |
View theView = null; |
|
114 |
try{ |
|
115 |
theView = (View) PluginServices.getMDIManager().getActiveView(); |
|
116 |
}catch(ClassCastException exc){ |
|
117 |
return; |
|
118 |
} |
|
119 |
MapControl mapCtrl = theView.getMapControl(); |
|
112 | 120 |
|
113 | 121 |
if (s.compareTo("GEO_PAN") == 0) { |
114 | 122 |
mapCtrl.setTool("geoPan"); |
... | ... | |
119 | 127 |
FLyrGeoRaster lyrGeoRaster = null; |
120 | 128 |
|
121 | 129 |
//Obtenemos la capa |
122 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
|
123 | 130 |
for(int i=0;i<theView.getMapControl().getMapContext().getLayers().getLayersCount();i++){ |
124 | 131 |
FLayer lyr = theView.getMapControl().getMapContext().getLayers().getLayer(i); |
125 | 132 |
if(lyr instanceof FLyrGeoRaster && lyr.getName().startsWith("*")) |
... | ... | |
129 | 136 |
//Asignamos el ?ltimo extent |
130 | 137 |
if(lyrGeoRaster != null){ |
131 | 138 |
lyrGeoRaster.setLastExtent(); |
132 |
vista.getMapControl().getMapContext().invalidate();
|
|
139 |
mapCtrl.getMapContext().invalidate();
|
|
133 | 140 |
} |
134 | 141 |
} else if (s.compareTo("GEO_MOVE_POINT") == 0) |
135 | 142 |
mapCtrl.setTool("geoMovePoint"); |
Also available in: Unified diff