Revision 2300 org.gvsig.raster.mosaic/trunk/org.gvsig.raster.mosaic/org.gvsig.raster.mosaic.app/src/main/java/org/gvsig/raster/mosaic/app/MainDialogActions.java
MainDialogActions.java | ||
---|---|---|
44 | 44 |
this.addFilesPanel = panel; |
45 | 45 |
} |
46 | 46 |
|
47 |
public void loadLayer() { |
|
48 |
RasterDataStore mainRasterStore = (RasterDataStore)addFilesPanel.getResult(); |
|
49 |
if(mainRasterStore == null) { |
|
50 |
return; |
|
51 |
} |
|
47 |
public void saveLayer() { |
|
48 |
RasterDataStore mainRasterStore = addFilesPanel.getResult(false); |
|
52 | 49 |
|
53 | 50 |
try { |
54 | 51 |
saveMosaicFileLayer(mainRasterStore); |
55 | 52 |
} catch (IOException e) { |
56 | 53 |
RasterSwingLibrary.messageBoxError(Messages.getText("error_saving_mosaic"), addFilesPanel, e); |
57 | 54 |
} |
58 |
|
|
59 |
try { |
|
60 |
loadLayerInView(mainRasterStore); |
|
61 |
} catch (LoadLayerException e) { |
|
62 |
RasterSwingLibrary.messageBoxError(Messages.getText("error_loading_layer"), addFilesPanel, e); |
|
63 |
} |
|
64 | 55 |
} |
65 | 56 |
|
66 | 57 |
/** |
... | ... | |
95 | 86 |
return null; |
96 | 87 |
} |
97 | 88 |
|
89 |
public void loadLayer() { |
|
90 |
RasterDataStore mainRasterStore = addFilesPanel.getResult(true); |
|
91 |
if(mainRasterStore == null) { |
|
92 |
return; |
|
93 |
} |
|
94 |
|
|
95 |
try { |
|
96 |
loadLayerInView(mainRasterStore); |
|
97 |
} catch (LoadLayerException e) { |
|
98 |
RasterSwingLibrary.messageBoxError(Messages.getText("error_loading_layer"), addFilesPanel, e); |
|
99 |
} |
|
100 |
} |
|
101 |
|
|
98 | 102 |
private void loadLayerInView(RasterDataStore mainRasterStore) throws LoadLayerException { |
99 | 103 |
MapContextManager mcm = MapContextLocator.getMapContextManager(); |
100 | 104 |
FLyrRaster lyr = (FLyrRaster) mcm.createLayer(file, mainRasterStore); |
... | ... | |
129 | 133 |
store.getBandCount(), |
130 | 134 |
store.getDataType()[0], |
131 | 135 |
store.getCellSize(), |
132 |
store.getNoDataValue().getValue().doubleValue());
|
|
136 |
store.getNoDataValue()); |
|
133 | 137 |
} catch (RasterDriverException e1) { |
134 | 138 |
log.debug("Error loading a RasterDataStore from the list", e1); |
135 | 139 |
} catch (InitializeException e1) { |
... | ... | |
156 | 160 |
store.getBandCount(), |
157 | 161 |
store.getDataType()[0], |
158 | 162 |
store.getCellSize(), |
159 |
store.getNoDataValue().getValue().doubleValue());
|
|
163 |
store.getNoDataValue()); |
|
160 | 164 |
} catch (RasterDriverException e1) { |
161 | 165 |
log.debug("Error loading a RasterDataStore from the list", e1); |
162 | 166 |
} catch (InitializeException e1) { |
Also available in: Unified diff