Revision 4166 branches/v051/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java

View differences:

FPopupMenu.java
56 56
import javax.swing.tree.DefaultMutableTreeNode;
57 57

  
58 58
import org.cresques.io.GeoRasterFile;
59
import org.cresques.io.raster.RasterFilter;
60 59
import org.cresques.io.raster.RasterFilterStackManager;
61 60
import org.cresques.ui.raster.BandSetupPanel;
62 61
import org.cresques.ui.raster.EnhancedPanel;
63 62
import org.cresques.ui.raster.FilterRasterDialogPanel;
64 63
import org.cresques.ui.raster.RasterTransparencyPanel;
65
import org.cresques.ui.raster.SharpeningPanel;
66 64

  
67 65
import com.iver.andami.PluginServices;
68 66
import com.iver.cit.gvsig.ProjectExtension;
......
332 330
	FLayer 							lyr = null;
333 331
	private PropertiesRasterDialog	propsDialog = null;
334 332
	private BandSetupPanel 			bandSetup = null;
333

  
335 334
	
336
	
337 335
	public void initialize(FPopupMenu m) {
338 336
		super.initialize(m);
339 337
		
......
411 409
				pEnhan.setSelectedFilter(0);
412 410
						
413 411
			GeoRasterFile[] files = ((FLyrRaster)lyr).getSource().getFiles();
414
			propsDialog.addFiles(files);
412
			bandSetup.addFiles(files);
415 413
			for(int i=0; i< files.length;i++)
416 414
				propsDialog.addNumBands(files[i].getBandCount());
417 415
			
......
461 459
			
462 460
			propsDialog.readStat();
463 461
			
464
			//Modificaci?n del estado de los controles del pansharpening
465
			if(stackManager.isActive(stackManager.getTypeFilter("sharpening"))){
466
				SharpeningPanel pSharp =  ((FilterRasterDialogPanel)propsDialog.getContentPane()).getSharpeningPanel();
467
				pSharp.getCbActiveSharpening().setSelected(true);
468
				pSharp.setTableEnabled(true);
469
				
470
				RasterFilter sharp = stackManager.getFilter("sharpening");
471
				String pancrName = (String)sharp.getParam("pancrName");
472
				for(int i=0;i<pSharp.getNBands();i++){
473
					if(pSharp.getBandName(i).endsWith(pancrName))
474
						pSharp.selectRow(i);
475
				}
476
				if(((String)sharp.getParam("method")).equals("hsl")){
477
					pSharp.getRbHSL().setSelected(true);
478
					Double coef = ((Double)sharp.getParam("coef"));
479
					pSharp.getJTextField().setText(coef.toString());
480
					pSharp.getJSlider().setValue((int)((coef.doubleValue() * 100)/0.5));
481
				}
482
				
483
				if(((String)sharp.getParam("method")).equals("brovey")){
484
					pSharp.getRbBrovey().setSelected(true);
485
					Integer coefBrovey = ((Integer)sharp.getParam("coefBrovey"));
486
					pSharp.getJTextField1().setText(coefBrovey.toString());
487
					pSharp.getJSlider1().setValue((int)((coefBrovey.intValue() * 100)/50));
488
				}
489
			}
490
			
491 462
       		PluginServices.getMDIManager().addView(propsDialog);
492 463
        }
493 464
	}

Also available in: Unified diff