Revision 2360

View differences:

branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/BandSetupPanel.java
27 27
import java.awt.Dimension;
28 28
import java.awt.event.ActionEvent;
29 29
import java.awt.event.ActionListener;
30
import java.awt.event.KeyEvent;
31
import java.awt.event.KeyListener;
32
import java.awt.event.MouseEvent;
33
import java.awt.event.MouseListener;
30 34
import java.awt.image.DataBuffer;
31 35
import java.io.File;
32 36
import java.util.Vector;
33 37

  
34 38
import javax.swing.AbstractCellEditor;
35
import javax.swing.JList;
36 39
import javax.swing.JPanel;
37 40
import javax.swing.JRadioButton;
38 41
import javax.swing.JScrollPane;
......
52 55
 * Selecciona las bandas visibles en un raster
53 56
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
54 57
 */
55
public class BandSetupPanel extends JPanel implements TableModelListener {
58
public class BandSetupPanel extends JPanel implements TableModelListener, KeyListener, ActionListener {
59

  
60

  
56 61
	/**
57 62
	 * Nombre del panel
58 63
	 */
......
74 79
	private JScrollPane rgbBandAssignPane = null;
75 80
	RGBBandAsignTableModel tableModel = null;
76 81
	private int sizeX = 445, sizeY = 174;
82
	private byte mode = 3;
77 83
	
78 84
	/**
79 85
	 * This method initializes 
......
96 102
        this.setSize(445, 239);
97 103
        this.add(getFileList(), null);
98 104
        this.add(getRGBBandAssignPane(), null);
105
        getFileList().getJComboBox().addKeyListener(this);
106
        getFileList().getJComboBox().addActionListener(this);
99 107
	}
100 108
	
101 109
	/**
......
342 350
		rgbBandAssignPane.revalidate();
343 351
		revalidate();
344 352
	}
353
	
354
	/* (non-Javadoc)
355
	 * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
356
	 */
357
	public void keyPressed(KeyEvent arg0) {
358
		// TODO Auto-generated method stub
359
	}
360
	/* (non-Javadoc)
361
	 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
362
	 */
363
	public void keyReleased(KeyEvent arg0) {
364
		// TODO Auto-generated method stub
365
	}
366
	/* (non-Javadoc)
367
	 * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
368
	 */
369
	public void keyTyped(KeyEvent arg0) {
370
		// TODO Auto-generated method stub
371
	}
372
	
373
	/* (non-Javadoc)
374
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
375
	 */
376
	public void actionPerformed(ActionEvent arg0) {
377
		String vBands = (String)getFileList().getJComboBox().getSelectedItem();
378
		if(vBands.compareTo("BANDAS") == 0 || vBands.compareTo("3") == 0){
379
			mode = 3;
380
		}
381
		if(vBands.compareTo("2") == 0){
382
			mode = 2;
383
			((DefaultTableModel) rgbTable.getModel()).setValueAt(new Boolean(true), 0, 2);
384
			((DefaultTableModel) rgbTable.getModel()).setValueAt(new Boolean(true), 1, 1);
385
			((DefaultTableModel) rgbTable.getModel()).setValueAt(new Boolean(true), 2, 0);
386
		}
387
		if(vBands.compareTo("1") == 0){
388
			mode = 1;
389
		}
390
	}
345 391
 }  //  @jve:decl-index=0:visual-constraint="10,10"
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/FileList.java
32 32
import javax.swing.JPanel;
33 33
import javax.swing.JScrollPane;
34 34

  
35
import javax.swing.JComboBox;
35 36
public class FileList extends JPanel {
36 37

  
37 38
	private JScrollPane jScrollPane = null;
......
42 43
	private Vector fileNames = null;
43 44
	private JList jList = null;
44 45
	private JPanel jPanel1 = null;
46
	private JComboBox jComboBox = null;
45 47
	/**
46 48
	 * This method initializes jScrollPane	
47 49
	 * 	
......
134 136
			jPanel1.setPreferredSize(new java.awt.Dimension(86,180));
135 137
			jPanel1.add(getJButton2(), null);
136 138
			jPanel1.add(getJButton3(), null);
139
			jPanel1.add(getJComboBox(), null);
137 140
		}
138 141
		return jPanel1;
139 142
	}
......
171 174
	public int getNFiles(){
172 175
		return fileNames.size();
173 176
	}
174
}  //  @jve:decl-index=0:visual-constraint="10,10"
177
	/**
178
	 * This method initializes jComboBox	
179
	 * 	
180
	 * @return javax.swing.JComboBox	
181
	 */    
182
	public JComboBox getJComboBox() {
183
		if (jComboBox == null) {
184
			String[] list={"BANDAS", "1", "2", "3"};
185
			jComboBox = new JComboBox(list);
186
		}
187
		return jComboBox;
188
	}
189
 }  //  @jve:decl-index=0:visual-constraint="10,10"

Also available in: Unified diff