Revision 3102 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/TablePointsPanel.java
TablePointsPanel.java | ||
---|---|---|
172 | 172 |
//Buscamos una capa FlyrPoint en la vista y si no la hay la creamos |
173 | 173 |
|
174 | 174 |
if(lyrPoints == null){ |
175 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
|
175 |
View theView = null; |
|
176 |
try{ |
|
177 |
theView = (View)PluginServices.getMDIManager().getActiveView(); |
|
178 |
}catch(ClassCastException exc){ |
|
179 |
return; |
|
180 |
} |
|
176 | 181 |
for(int i=0;i<theView.getMapControl().getMapContext().getLayers().getLayersCount();i++){ |
177 | 182 |
FLayer lyr = theView.getMapControl().getMapContext().getLayers().getLayer(i); |
178 | 183 |
if( lyr instanceof FLyrGeoRaster && |
179 | 184 |
lyr.getName().startsWith("*") && |
180 | 185 |
lyr.isActive()) |
181 |
lyrPoints = ((FLyrGeoRaster)lyr).getFLyrPoints(); |
|
186 |
try{ |
|
187 |
lyrPoints = ((FLyrGeoRaster)lyr).getFLyrPoints(); |
|
188 |
}catch(ClassCastException exc){ |
|
189 |
throw new InstantiationException("No se ha podido obtener una capa de puntos"); |
|
190 |
} |
|
182 | 191 |
} |
183 | 192 |
} |
184 |
|
|
185 |
if(lyrPoints == null) |
|
186 |
throw new InstantiationException("No se ha podido obtener una capa de puntos"); |
|
187 | 193 |
|
188 | 194 |
} |
189 | 195 |
|
Also available in: Unified diff