Revision 4161 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;
59 60
import org.cresques.io.raster.RasterFilterStackManager;
60 61
import org.cresques.ui.raster.BandSetupPanel;
61 62
import org.cresques.ui.raster.EnhancedPanel;
62 63
import org.cresques.ui.raster.FilterRasterDialogPanel;
63 64
import org.cresques.ui.raster.RasterTransparencyPanel;
65
import org.cresques.ui.raster.SharpeningPanel;
64 66

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

  
334 335
	
336
	
335 337
	public void initialize(FPopupMenu m) {
336 338
		super.initialize(m);
337 339
		
......
409 411
				pEnhan.setSelectedFilter(0);
410 412
						
411 413
			GeoRasterFile[] files = ((FLyrRaster)lyr).getSource().getFiles();
412
			bandSetup.addFiles(files);
414
			propsDialog.addFiles(files);
413 415
			for(int i=0; i< files.length;i++)
414 416
				propsDialog.addNumBands(files[i].getBandCount());
415 417
			
......
459 461
			
460 462
			propsDialog.readStat();
461 463
			
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
			
462 491
       		PluginServices.getMDIManager().addView(propsDialog);
463 492
        }
464 493
	}

Also available in: Unified diff