Revision 408
org.gvsig.geoprocess/branches/gvSIG-geoprocess/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.tool/src/main/java/org/gvsig/geoprocess/app/tool/AbstractToolboxAction.java | ||
---|---|---|
27 | 27 |
import org.gvsig.andami.PluginServices; |
28 | 28 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
29 | 29 |
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel; |
30 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
30 | 31 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
31 | 32 |
import org.gvsig.geoprocess.lib.sextante.dataObjects.FLyrRasterIRasterLayer; |
32 | 33 |
import org.gvsig.i18n.Messages; |
... | ... | |
71 | 72 |
* @return |
72 | 73 |
*/ |
73 | 74 |
public boolean loadLayer() { |
74 |
if(!isActive()) |
|
75 |
if(!isActive()) { |
|
76 |
RasterToolsUtil.messageBoxError(Messages.getText("layer_not_valid"), null); |
|
75 | 77 |
return false; |
78 |
} |
|
76 | 79 |
|
77 | 80 |
boolean existsRasterButNotActive = false; |
78 | 81 |
lyr = null; |
82 |
IWindow[] windows = PluginServices.getMDIManager().getAllWindows(); |
|
83 |
MapContext mapCtx = null; |
|
84 |
for (int i = 0; i < windows.length; i++) { |
|
85 |
if(windows[i] instanceof AbstractViewPanel) { |
|
86 |
mapCtx = ((AbstractViewPanel)windows[i]).getMapControl().getMapContext(); |
|
87 |
break; |
|
88 |
} |
|
89 |
} |
|
90 |
|
|
79 | 91 |
IRasterLayer[] layers = SextanteGUI.getInputFactory().getRasterLayers(); |
80 | 92 |
for (int i = 0; i < layers.length; i++) { |
81 | 93 |
FLyrRaster l = (FLyrRaster)((FLyrRasterIRasterLayer)layers[i]).getBaseDataObject(); |
82 | 94 |
existsRasterButNotActive = true; |
83 |
if(l.isActive()) { |
|
95 |
if(l.isActive() && mapCtx == l.getMapContext()) {
|
|
84 | 96 |
existsRasterButNotActive = false; |
85 | 97 |
lyr = l; |
86 | 98 |
break; |
org.gvsig.geoprocess/branches/gvSIG-geoprocess/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.tool/src/main/resources/text.properties | ||
---|---|---|
7 | 7 |
clip_raster=Recortar |
8 | 8 |
save_as=Exportar |
9 | 9 |
overviews=Overviews |
10 |
layer_datatype=Cambiar tipo de dato |
|
10 |
layer_datatype=Cambiar tipo de dato |
|
11 |
layer_not_valid=No hay capas v?lidas en la vista activa |
org.gvsig.geoprocess/branches/gvSIG-geoprocess/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.tool/src/main/resources/text_en.properties | ||
---|---|---|
7 | 7 |
clip_raster=Clip |
8 | 8 |
save_as=Export |
9 | 9 |
overviews=Overviews |
10 |
layer_datatype=Change data type |
|
10 |
layer_datatype=Change data type |
|
11 |
layer_not_valid=There is not valid layers in the active view |
Also available in: Unified diff