Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / main / java / org / gvsig / gui / beans / swing / jComboBoxWithImageIconItems / ComboBoxImageIconModel.java @ 40561

History | View | Annotate | Download (3.68 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.gui.beans.swing.jComboBoxWithImageIconItems;
25

    
26
import java.io.Serializable;
27
import java.util.Vector;
28

    
29
import javax.swing.DefaultComboBoxModel;
30

    
31
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
32
 *
33
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
34
 *
35
 * This program is free software; you can redistribute it and/or
36
 * modify it under the terms of the GNU General Public License
37
 * as published by the Free Software Foundation; either version 2
38
 * of the License, or (at your option) any later version.
39
 *
40
 * This program is distributed in the hope that it will be useful,
41
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43
 * GNU General Public License for more details.
44
 *
45
 * You should have received a copy of the GNU General Public License
46
 * along with this program; if not, write to the Free Software
47
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
48
 *
49
 * For more information, contact:
50
 *
51
 *  Generalitat Valenciana
52
 *   Conselleria d'Infraestructures i Transport
53
 *   Av. Blasco Ib??ez, 50
54
 *   46010 VALENCIA
55
 *   SPAIN
56
 *
57
 *      +34 963862235
58
 *   gvsig@gva.es
59
 *      www.gvsig.gva.es
60
 *
61
 *    or
62
 *
63
 *   IVER T.I. S.A
64
 *   Salamanca 50
65
 *   46005 Valencia
66
 *   Spain
67
 *
68
 *   +34 963163400
69
 *   dac@iver.es
70
 */
71

    
72

    
73
/**
74
 * Model for 'JPanelWithJComboBoxImageIconItems', stores the attribute 'showImageIconAndText'
75
 * 
76
 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
77
 */
78
public class ComboBoxImageIconModel extends DefaultComboBoxModel implements Serializable {
79
        private static final long serialVersionUID = -775510419199115805L;
80

    
81
        public static final boolean DEFAULT_SHOW_IMAGE_ICON_AND_TEXT_PROPERTY = false;
82
        
83
        private boolean showImageIconAndText;
84

    
85
        /**
86
         * @see DefaultComboBoxModel#DefaultComboBoxModel()
87
         */
88
        public ComboBoxImageIconModel() {
89
                super();
90
                initialize();
91
        }
92

    
93
        /**
94
         * @see DefaultComboBoxModel#DefaultComboBoxModel(Object[])
95
         */
96
        public ComboBoxImageIconModel(Object[] items) {
97
                super(items);
98
                initialize();
99
        }
100

    
101
        /**
102
         * @see DefaultComboBoxModel#DefaultComboBoxModel(Vector)
103
         */
104
        public ComboBoxImageIconModel(Vector v) {
105
                super(v);
106
                initialize();
107
        }
108

    
109
        /**
110
         * Initializes the new attribute of this model
111
         */
112
        private void initialize() {
113
                showImageIconAndText = DEFAULT_SHOW_IMAGE_ICON_AND_TEXT_PROPERTY;
114
        }
115

    
116
        /**
117
         * Sets the value of the inner attribute 'imageIconAndText'
118
         * 
119
         * @param b A boolean value
120
         */
121
        public void setShowImageIconAndTextProperty(boolean b) {
122
                showImageIconAndText = b;
123
        }
124

    
125
        /**
126
         * Returns the value of the inner attribute 'imageIconAndText'
127
         * 
128
         * @return A boolean value
129
         */
130
        public boolean getShowImageIconAndTextProperty() {
131
                return showImageIconAndText;
132
        }
133
}