Statistics
| Revision:

root / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / swing / jComboBoxWithImageIconItems / ImageIconItemInfo.java @ 13136

History | View | Annotate | Download (3.74 KB)

1
package org.gvsig.gui.beans.swing.jComboBoxWithImageIconItems;
2

    
3
import java.io.Serializable;
4

    
5
import javax.swing.ImageIcon;
6

    
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47

    
48

    
49

    
50
/**
51
 * This class represents the necessary information about each image icon item of 'JPanelWithJComboBoxImageIconItems'
52
 * 
53
 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
54
 */
55
public class ImageIconItemInfo implements Serializable {
56
        private static final long serialVersionUID = -7087121873703006781L;
57

    
58
        private ImageIcon imageIcon;
59
        private String toolTipText;
60
        private Object itemValue; // An object value of the item like a item value of a JComboBox
61
        
62
        /* This other attribute it's necessary because it's possible that the image icon couldn't be
63
             loaded and then in this case could be impossible to know the path after */
64
        private String path;
65

    
66
        /**
67
         * Default constructor without parameters
68
         */
69
        public ImageIconItemInfo() {
70
                path = null;
71
                imageIcon = null;
72
                toolTipText = null;
73
                itemValue = null;
74
        }
75
        
76
        /**
77
         * Default constructor with two parameters
78
         * 
79
         * @param path Path to the image icon
80
         * @param image_Icon The image icon
81
         * @param text The tool tip text
82
         * @param item_Value A value associated to this item
83
         */
84
        public ImageIconItemInfo(String image_Icon_Path, ImageIcon image_Icon, String text, Object item_Value) {
85
                path = image_Icon_Path;
86
                imageIcon = image_Icon;
87
                toolTipText = text;
88
                itemValue = item_Value;
89
        }
90

    
91
        /**
92
         * Gets the image icon object reference
93
         * 
94
         * @return the imageIcon
95
         */
96
        public ImageIcon getImageIcon() {
97
                return imageIcon;
98
        }
99

    
100
        /**
101
         * Sets the image icon object reference
102
         * 
103
         * @param imageIcon the imageIcon to set
104
         */
105
        public void setImageIcon(ImageIcon imageIcon) {
106
                this.imageIcon = imageIcon;
107
        }
108

    
109
        /**
110
         * Gets the path
111
         * 
112
         * @return the path
113
         */
114
        public String getPath() {
115
                return path;
116
        }
117

    
118
        /**
119
         * Sets the path
120
         * 
121
         * @param path the path to set
122
         */
123
        public void setPath(String path) {
124
                this.path = path;
125
        }
126
        
127
        /**
128
         * Gets the tool tip text
129
         * 
130
         * @return text the tool tip text to this icon image
131
         */
132
        public String getToolTipText() {
133
                return this.toolTipText;
134
        }
135
        
136
        /**
137
         * Sets the tool tip text
138
         * 
139
         * @param text the tool tip text to this icon image
140
         */
141
        public void setToolTipText(String text) {
142
                this.toolTipText = text;
143
        }
144
        
145
        /**
146
         * Gets the associated item value
147
         * 
148
         * @return a value associated to this item
149
         */
150
        public Object getItemValue() {
151
                return this.itemValue;
152
        }
153
        
154
        /**
155
         * Sets the associated item value
156
         * 
157
         * @param item_Value a value associated to this item
158
         */
159
        public void setItemValue(Object item_Value) {
160
                this.itemValue = item_Value;
161
        }
162
}