Revision 2174 branches/gvSIG_GisPlanet/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/PropertiesRasterDialog.java

View differences:

PropertiesRasterDialog.java
105 105
	private	long 									filesize = 0;
106 106
	private	int 									width = 0;
107 107
	private	int 									height = 0;
108
	private	int 									nbands = 0;
109 108
	private JFileChooser							fileChooser = null;
110 109
	private String									lastPath = new String("./");
111 110
	private StatusLayerRaster						rasterStatus = null;
......
266 265
			fLayer.setStatus(rasterStatus);
267 266
		}else
268 267
			rasterStatus = (StatusLayerRaster)fLayer.getStatus();
269
		initialize();
268
		initialize();			
270 269
		this.setRanges(rangeR, rangeG, rangeB);
271 270
		setTranslation();
272 271
	}
......
372 371
		
373 372
	}
374 373
	
374
	public void addNumBands(int numBands){
375
		nbands += numBands;
376
	}
377
	
375 378
	/**
376 379
	 * Inicializa el jDialog		
377 380
	 */    
......
391 394
				width = ((Integer)a[1]).intValue();
392 395
			if(a[0].toString().equals("Height"))
393 396
				height = ((Integer)a[1]).intValue();
394
			if(a[0].toString().equals("Bands"))
395
				nbands = ((Integer)a[1]).intValue();
396
			    			
397 397
		}
398 398
   		
399 399
   		this.loadInfoData();
......
622 622
	private void addFileBand(ActionEvent e){
623 623
		String[] driverNames = null;
624 624
		String rasterDriver = null;
625
				
625
						
626 626
		//Creaci?n del dialogo para selecci?n de ficheros
627 627
		
628 628
		fileChooser = new JFileChooser(lastPath);
......
666 666
            		try{
667 667
            			Rectangle2D extentOrigin = fLayer.getFullExtent();
668 668
            			
669
            			Extent extentNewFile = GeoRasterFile.openFile(fLayer.getProjection(), files[i].getAbsolutePath()).getExtent();
669
            			GeoRasterFile geoRasterFile = GeoRasterFile.openFile(fLayer.getProjection(), files[i].getAbsolutePath());
670
            			Extent extentNewFile = geoRasterFile.getExtent();
671
            			nbands += geoRasterFile.getBandCount();
670 672
            			
671 673
						//Comprobamos que el extent y tama?o del fichero a?adido sea igual al 
672 674
						//fichero original. Si no es as? no abrimos la capa y mostramos un aviso
......
700 702
            		fLayer.addFiles(files[i].getAbsolutePath());
701 703
            		//Mantiene la lista de ficheros a?adidos por si se cancela
702 704
            		status.addFile(files[i].getAbsolutePath());
705
            		
706
            	
703 707
            	}else{
704 708
            		JOptionPane.showMessageDialog(null, 
705 709
							PluginServices.getText(this, "fichero_existe")+" "+files[i].getAbsolutePath(), "", JOptionPane.ERROR_MESSAGE);
......
738 742
		if(	bandSetup.getFileList().getJList().getSelectedValue()!=null &&
739 743
			bandSetup.getFileList().getNFiles() > 1){
740 744
			String pathName = bandSetup.getFileList().getJList().getSelectedValue().toString();
745
			GeoRasterFile geoRasterFile = GeoRasterFile.openFile(fLayer.getProjection(), pathName);
746
			nbands -= geoRasterFile.getBandCount();
741 747
			fLayer.delFile(pathName);
742 748
			String file = pathName.substring(pathName.lastIndexOf("/")+1);
743 749
			file = file.substring(file.lastIndexOf("\\")+1);

Also available in: Unified diff