Revision 2669 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/LoadableComboBox.java

View differences:

LoadableComboBox.java
1 1
/*
2 2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 * 
4
 * Copyright (C) 2004-5. 
5 3
 *
4
 * Copyright (C) 2004-5.
5
 *
6 6
 * This program is free software; you can redistribute it and/or
7 7
 * modify it under the terms of the GNU General Public License
8 8
 * as published by the Free Software Foundation; either version 2
......
18 18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19 19
 *
20 20
 * For more information, contact:
21
 * 
21
 *
22 22
 * cresques@gmail.com
23 23
 */
24 24
package org.cresques.ui;
25 25

  
26 26
import javax.swing.JComboBox;
27 27

  
28

  
28 29
/**
29 30
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
30 31
 */
31 32
public class LoadableComboBox extends JComboBox {
32
	final private static long serialVersionUID = -3370601314380922368L;
33
	public LoadableComboBox() {
34
		super();
35
		initialize();
36
//		addItemListener(this);
37
//		setSize(new java.awt.Dimension(185, 23));
38
	}
39
	
40
	/**
41
	 * This method initializes this
42
	 * 
43
	 * @return void
44
	 */
45
	private void initialize() {
46
        this.setPreferredSize(new java.awt.Dimension(185,23));
47
			
48
	}
49
	public void loadData(String data[]) {
50
		if (data == null) return;
51
		for (int i=0; i<data.length; i++)
52
			addItem(data[i]);
53
	}
33
    final private static long serialVersionUID = -3370601314380922368L;
54 34

  
55
/*	public void itemStateChanged(ItemEvent e) {
56
	    if (e.getStateChange() == ItemEvent.SELECTED) {
57
	        //label.setVisible(true);
58
	    } else {
59
	        //label.setVisible(false);
60
	    }
61
	}*/
35
    public LoadableComboBox() {
36
        super();
37
        initialize();
38

  
39
        //		addItemListener(this);
40
        //		setSize(new java.awt.Dimension(185, 23));
41
    }
42

  
43
    /**
44
     * This method initializes this
45
     *
46
     * @return void
47
     */
48
    private void initialize() {
49
        this.setPreferredSize(new java.awt.Dimension(185, 23));
50
    }
51

  
52
    public void loadData(String[] data) {
53
        if (data == null) {
54
            return;
55
        }
56

  
57
        for (int i = 0; i < data.length; i++)
58
            addItem(data[i]);
59
    }
60

  
61
    /*        public void itemStateChanged(ItemEvent e) {
62
                if (e.getStateChange() == ItemEvent.SELECTED) {
63
                    //label.setVisible(true);
64
                } else {
65
                    //label.setVisible(false);
66
                }
67
            }*/
62 68
}
63

  

Also available in: Unified diff