Revision 1817 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app/org.gvsig.raster.tools.app.multifile/src/main/java/org/gvsig/raster/tools/app/multifile/panel/BandSelectorListener.java

View differences:

BandSelectorListener.java
28 28
import java.io.File;
29 29
import java.io.IOException;
30 30
import java.util.ArrayList;
31
import java.util.List;
31 32

  
32 33
import javax.swing.JOptionPane;
33 34

  
......
57 58
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
58 59
import org.gvsig.gui.beans.swing.JFileChooser;
59 60
import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
61
import org.gvsig.i18n.Messages;
60 62
import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
61 63
import org.gvsig.raster.fmap.layers.FLyrRaster;
62 64
import org.gvsig.raster.tools.app.basic.RasterExtension;
......
66 68
import org.gvsig.raster.tools.multifile.io.MultiFileFormat;
67 69
import org.gvsig.raster.tools.multifile.io.MultiFileProvider;
68 70
import org.gvsig.tools.locator.LocatorException;
71
import org.slf4j.Logger;
72
import org.slf4j.LoggerFactory;
69 73

  
70 74
/**
71 75
 * Clase que maneja los eventos del panel BandSetupPanel. Gestiona el a?adir o
......
75 79
 * @author Nacho Brodin (brodin_ign@gva.es)
76 80
 */
77 81
public class BandSelectorListener implements ActionListener, ButtonsPanelListener {
82
	private Logger                log            = LoggerFactory.getLogger(BandSelectorListener.class);
78 83
	private BandSelectorPanel     bandSetupPanel = null;
79 84
	private JFileChooser          fileChooser    = null;
80 85
	private FLyrRaster            fLayer         = null;
81 86
	private boolean               enabled        = true;
82
	private ArrayList<File>       fileList       = null;
87
	private List<File>            fileList       = null;
83 88

  
84 89
	/**
85 90
	 * Constructor
......
165 170
			int aBand = bandSetupPanel.getAssignedBand(RasterDataStore.ALPHA_BAND);
166 171

  
167 172
			if (!isCorrectAssignedBand(rBand, gBand, bBand, aBand)) {
168
				RasterToolsUtil.messageBoxError("combinacion_no_asignable", bandSetupPanel);
173
				RasterToolsUtil.messageBoxError(Messages.getText("combinacion_no_asignable"), bandSetupPanel);
169 174
				return;
170 175
			}
171 176

  
172
			RasterToolsUtil.messageBoxYesOrNot("color_interpretation_continue", this);
177
			RasterToolsUtil.messageBoxYesOrNot(Messages.getText("color_interpretation_continue"), this);
173 178
			RasterDataStore dataSource = fLayer.getDataStore();
174 179
			if(dataSource == null) {
175
				RasterToolsUtil.messageBoxError("error_carga_capa", bandSetupPanel);
180
				RasterToolsUtil.messageBoxError(Messages.getText("error_carga_capa"), bandSetupPanel);
176 181
				return;
177 182
			}
178 183

  
......
193 198
				String fileName = fLayer.getDataStore().getName();
194 199
				RasterLocator.getManager().getProviderServices().saveObjectToRmfFile(fileName, ci);
195 200
			} catch (RmfSerializerException exc) {
196
				RasterToolsUtil.messageBoxError("error_salvando_rmf", bandSetupPanel, exc);
201
				RasterToolsUtil.messageBoxError(Messages.getText("error_salvando_rmf"), bandSetupPanel, exc);
197 202
			} catch (NotInitializeException exc) {
198
				RasterToolsUtil.messageBoxError("table_not_initialize", bandSetupPanel, exc);
203
				RasterToolsUtil.messageBoxError(Messages.getText("table_not_initialize"), bandSetupPanel, exc);
199 204
			}
200 205
		}
201 206

  
......
277 282
				boolean exists = false;
278 283
				for (int j = 0; j < uris.length; j++) {
279 284
					if (uris[j].endsWith(files[i].getName())) {
280
						RasterToolsUtil.messageBoxError( PluginServices.getText( this, "fichero_existe") + ": " + files[i].getAbsolutePath(), bandSetupPanel);
285
						RasterToolsUtil.messageBoxError( Messages.getText("fichero_existe") + ": " + files[i].getAbsolutePath(), bandSetupPanel);
281 286
						exists = true;
282 287
						break;
283 288
					}
......
290 295
				//Checks extents
291 296
				try {
292 297
					if(!checkNewFile(fileList.get(i).getAbsolutePath())) {
293
						JOptionPane.showMessageDialog(null, PluginServices.getText(this, "extents_no_coincidentes") +  " " + files[i].getAbsolutePath(), "", JOptionPane.ERROR_MESSAGE);
298
						JOptionPane.showMessageDialog(null, Messages.getText("extents_no_coincidentes") +  " " + files[i].getAbsolutePath(), "", JOptionPane.ERROR_MESSAGE);
294 299
						fileList.remove(i);
295 300
					}
296 301
				} catch (Exception e) {
297
					e.printStackTrace();
302
					log.debug("Problems check the bounding boxes", e);
298 303
				}
299 304
			}
300

  
305
			
306
			if(dataStore.isTiled()) {
307
				if(!RasterToolsUtil.messageBoxYesOrNot(Messages.getText("store_tiled"), this)) {
308
					return;
309
				}
310
			}
311
			
301 312
			if(dataStore.isMultiFile()) {
302 313
				for (int i = 0; i < fileList.size(); i++) {
303 314
					try {
304 315
						dataStore.addFile(fileList.get(i).getAbsolutePath());
305 316
					} catch (InvalidSourceException e) {
306
						RasterToolsUtil.messageBoxError("addband_error", bandSetupPanel, e);
317
						RasterToolsUtil.messageBoxError(Messages.getText("addband_error"), bandSetupPanel, e);
307 318
					}
308 319
				}
309 320
				
......
374 385
			try {
375 386
				bandSetupPanel.addFiles(dataStore);
376 387
			} catch (NotInitializeException ex) {
377
				RasterToolsUtil.messageBoxError("table_not_initialize", this, ex);
388
				RasterToolsUtil.messageBoxError(Messages.getText("table_not_initialize"), this, ex);
378 389
			}
379 390
			
380 391
			ArrayList<File> uriList = new ArrayList<File>();
......
385 396
			saveMultiFileLayer(layerName, paramFirstFile.getURI(), uriList);
386 397

  
387 398
		} catch (Exception exc) {
388
			RasterToolsUtil.messageBoxError("addband_error", bandSetupPanel, exc);
399
			RasterToolsUtil.messageBoxError(Messages.getText("addband_error"), bandSetupPanel, exc);
389 400
		}
390 401
	}
391 402
	

Also available in: Unified diff