Revision 1860 org.gvsig.raster.tools/trunk/templates/examples/org.gvsig.raster.roimask/org.gvsig.raster.roimask.app/org.gvsig.raster.roimask.app.client/src/main/java/org/gvsig/raster/roimask/app/ROIMaskExtension.java
ROIMaskExtension.java | ||
---|---|---|
20 | 20 |
import org.gvsig.fmap.dal.coverage.RasterLibrary; |
21 | 21 |
import org.gvsig.fmap.dal.coverage.RasterLocator; |
22 | 22 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
23 |
import org.gvsig.fmap.dal.coverage.exception.ROIException; |
|
23 | 24 |
import org.gvsig.fmap.dal.coverage.grid.ROI; |
24 | 25 |
import org.gvsig.fmap.dal.coverage.util.FileUtils; |
25 | 26 |
import org.gvsig.fmap.dal.exception.ReadException; |
... | ... | |
101 | 102 |
initializeMainPanel(); |
102 | 103 |
} catch (ReadException e) { |
103 | 104 |
logger.error("Error initializing the main panel", e); |
104 |
} |
|
105 |
} catch (ROIException e) { |
|
106 |
logger.error("Error getting ROI", e); |
|
107 |
} |
|
105 | 108 |
} |
106 | 109 |
} |
107 | 110 |
|
108 | 111 |
/** |
109 | 112 |
* Creates and initializes the main panel |
110 | 113 |
* @throws ReadException |
114 |
* @throws ROIException |
|
111 | 115 |
*/ |
112 |
private void initializeMainPanel() throws ReadException { |
|
116 |
private void initializeMainPanel() throws ReadException, ROIException {
|
|
113 | 117 |
try { |
114 | 118 |
loadROIMaskPanel(); |
115 | 119 |
} catch (NotInitializeException e) { |
... | ... | |
137 | 141 |
/** |
138 | 142 |
* Loads the main panel with the data |
139 | 143 |
* @throws NotInitializeException |
144 |
* @throws ROIException |
|
140 | 145 |
*/ |
141 |
private void loadROIMaskPanel() throws NotInitializeException { |
|
146 |
private void loadROIMaskPanel() throws NotInitializeException, ROIException {
|
|
142 | 147 |
FLyrRaster lyr = getSelectedLayer(); |
143 | 148 |
LayerElement element = new LayerElement(lyr); |
144 | 149 |
getROIMaskPanel().getDataModel().setInputLayer(element); |
... | ... | |
294 | 299 |
messageBoxError("error_processing_layer", null, e1); |
295 | 300 |
} |
296 | 301 |
task.setActions(this); |
297 |
getDataSourcePreview().addParams(task, |
|
298 |
getNewLayerPanel().getDirectorySelected(), |
|
299 |
getNewLayerPanel().getFileSelected()); |
|
302 |
try { |
|
303 |
getDataSourcePreview().addParams(task, |
|
304 |
getNewLayerPanel().getDirectorySelected(), |
|
305 |
getNewLayerPanel().getFileSelected()); |
|
306 |
} catch (ROIException e1) { |
|
307 |
messageBoxError("error_processing_layer", null, e1); |
|
308 |
} |
|
300 | 309 |
task.start(); |
301 | 310 |
return; |
302 | 311 |
} |
Also available in: Unified diff