Revision 8783 branches/v10+Piloto/libraries/libCq_CMS_praster/src/org/cresques/ui/raster/BandSetupPanel.java

View differences:

BandSetupPanel.java
62 62
public class BandSetupPanel extends JPanel implements TableModelListener,
63 63
                                                      KeyListener,
64 64
                                                      ActionListener,
65
                                                      ComponentListener {
65
                                                      ComponentListener,
66
                                                      IResize{
66 67
    final private static long serialVersionUID = -3370601314380922368L;
67 68

  
68 69
    /**
70
     * Variables para la asignaci?n de tama?o de los componentes del panel.
71
     */
72
    private int						wComp = 445, hComp = 239;
73
    private int						wFileList = wComp, hFileList = (int)Math.round(hComp * 0.46);	
74
    private int						wBand = wFileList, hBand = hComp - hFileList - 20;
75
    
76
    /**
69 77
     * Asigna la banda del rojo
70 78
     */
71 79
    public static final int RED_BAND = GeoRasterFile.RED_BAND;
......
109 117
     * @return void
110 118
     */
111 119
    void initialize() {
112
        this.setPreferredSize(new Dimension(sizeX, sizeY));
120
        //this.setPreferredSize(new Dimension(wComp, hComp));
113 121
        this.setLayout(null);
114 122
        this.setLocation(0, 0);
115
        this.setSize(445, 239);
116 123
        this.add(getFileList(), null);
117 124
        this.add(getRGBBandAssignPane(), null);
118 125
        getFileList().getJComboBox().addKeyListener(this);
119 126
        getFileList().getJComboBox().addActionListener(this);
120 127
        this.addComponentListener(this);
128
        this.setComponentSize(wComp, hComp);
121 129
    }
122 130

  
123 131
    /**
......
318 326
    public FileList getFileList() {
319 327
        if (fileList == null) {
320 328
            fileList = new FileList();
321
            fileList.setBounds(9, 9, 428, 110);
329
            //fileList.setBounds(9, 9, wFileList, hFileList);
322 330
        }
323 331

  
324 332
        return fileList;
......
332 340
    private JScrollPane getRGBBandAssignPane() {
333 341
        if (rgbBandAssignPane == null) {
334 342
            rgbBandAssignPane = new JScrollPane(getRGBTable());
335
            rgbBandAssignPane.setBounds(10, 123, 427, 104);
343
            //rgbBandAssignPane.setBounds(10, 123, wBand, hBand);
336 344

  
337 345
            TableColumn column = null;
338 346

  
......
622 630
              
623 631
    }
624 632

  
633
    
634
    public void setComponentSize(int w, int h){
635
    	wComp = w; hComp = h;
636
        wFileList = wComp - 18; hFileList = (int)Math.round(hComp * 0.46);	
637
        wBand = wFileList; hBand = hComp - hFileList - 20;
638
        
639
        this.setPreferredSize(new Dimension(wComp, hComp));
640
        this.setSize(wComp, hComp);
641
        rgbBandAssignPane.setBounds(10, hFileList + 12, wBand, hBand);
642
        fileList.setBounds(9, 9, wFileList, hFileList);
643
        
644
    }
645
    
646
    
647
    
625 648
	public void componentHidden(ComponentEvent e) {
626 649
		// TODO Auto-generated method stub
627 650
		
......
635 658
	 * Redimensiona el panel cuando se redimensiona el contenedor de ?ste
636 659
	 */
637 660
	public void componentResized(ComponentEvent e) {
638
		if(e.getSource() == this){
661
		/*if(e.getSource() == this){
639 662
			int nWidth = this.getSize().width;
640 663
			int nHeight = this.getSize().height;
641 664
			int difWidth = nWidth - 445;
......
643 666
			this.fileList.setResize(difWidth, difHeight);
644 667
			this.rgbBandAssignPane.setBounds(10, 123 + difHeight/2, 427 + difWidth, 104 + difHeight/2);
645 668
			
646
		}
669
		}*/
647 670
		
648 671
	}
649 672

  

Also available in: Unified diff