svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / main / java / org / gvsig / gui / beans / swing / jComboBoxWithImageIconItems / ImageIconItemInfo.java @ 40561
History | View | Annotate | Download (4.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 |
|
28 |
import javax.swing.ImageIcon; |
29 |
|
30 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
31 |
*
|
32 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
33 |
*
|
34 |
* This program is free software; you can redistribute it and/or
|
35 |
* modify it under the terms of the GNU General Public License
|
36 |
* as published by the Free Software Foundation; either version 2
|
37 |
* of the License, or (at your option) any later version.
|
38 |
*
|
39 |
* This program is distributed in the hope that it will be useful,
|
40 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
41 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
42 |
* GNU General Public License for more details.
|
43 |
*
|
44 |
* You should have received a copy of the GNU General Public License
|
45 |
* along with this program; if not, write to the Free Software
|
46 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
47 |
*
|
48 |
* For more information, contact:
|
49 |
*
|
50 |
* Generalitat Valenciana
|
51 |
* Conselleria d'Infraestructures i Transport
|
52 |
* Av. Blasco Ib??ez, 50
|
53 |
* 46010 VALENCIA
|
54 |
* SPAIN
|
55 |
*
|
56 |
* +34 963862235
|
57 |
* gvsig@gva.es
|
58 |
* www.gvsig.gva.es
|
59 |
*
|
60 |
* or
|
61 |
*
|
62 |
* IVER T.I. S.A
|
63 |
* Salamanca 50
|
64 |
* 46005 Valencia
|
65 |
* Spain
|
66 |
*
|
67 |
* +34 963163400
|
68 |
* dac@iver.es
|
69 |
*/
|
70 |
|
71 |
|
72 |
|
73 |
/**
|
74 |
* This class represents the necessary information about each image icon item of 'JPanelWithJComboBoxImageIconItems'
|
75 |
*
|
76 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
|
77 |
*/
|
78 |
public class ImageIconItemInfo implements Serializable { |
79 |
private static final long serialVersionUID = -7087121873703006781L; |
80 |
|
81 |
private ImageIcon imageIcon; |
82 |
private String toolTipText; |
83 |
private Object itemValue; // An object value of the item like a item value of a JComboBox |
84 |
|
85 |
/* This other attribute it's necessary because it's possible that the image icon couldn't be
|
86 |
loaded and then in this case could be impossible to know the path after */
|
87 |
private String path; |
88 |
|
89 |
/**
|
90 |
* Default constructor without parameters
|
91 |
*/
|
92 |
public ImageIconItemInfo() {
|
93 |
path = null;
|
94 |
imageIcon = null;
|
95 |
toolTipText = null;
|
96 |
itemValue = null;
|
97 |
} |
98 |
|
99 |
/**
|
100 |
* Default constructor with two parameters
|
101 |
*
|
102 |
* @param path Path to the image icon
|
103 |
* @param image_Icon The image icon
|
104 |
* @param text The tool tip text
|
105 |
* @param item_Value A value associated to this item
|
106 |
*/
|
107 |
public ImageIconItemInfo(String image_Icon_Path, ImageIcon image_Icon, String text, Object item_Value) { |
108 |
path = image_Icon_Path; |
109 |
imageIcon = image_Icon; |
110 |
toolTipText = text; |
111 |
itemValue = item_Value; |
112 |
} |
113 |
|
114 |
/**
|
115 |
* Gets the image icon object reference
|
116 |
*
|
117 |
* @return the imageIcon
|
118 |
*/
|
119 |
public ImageIcon getImageIcon() { |
120 |
return imageIcon;
|
121 |
} |
122 |
|
123 |
/**
|
124 |
* Sets the image icon object reference
|
125 |
*
|
126 |
* @param imageIcon the imageIcon to set
|
127 |
*/
|
128 |
public void setImageIcon(ImageIcon imageIcon) { |
129 |
this.imageIcon = imageIcon;
|
130 |
} |
131 |
|
132 |
/**
|
133 |
* Gets the path
|
134 |
*
|
135 |
* @return the path
|
136 |
*/
|
137 |
public String getPath() { |
138 |
return path;
|
139 |
} |
140 |
|
141 |
/**
|
142 |
* Sets the path
|
143 |
*
|
144 |
* @param path the path to set
|
145 |
*/
|
146 |
public void setPath(String path) { |
147 |
this.path = path;
|
148 |
} |
149 |
|
150 |
/**
|
151 |
* Gets the tool tip text
|
152 |
*
|
153 |
* @return text the tool tip text to this icon image
|
154 |
*/
|
155 |
public String getToolTipText() { |
156 |
return this.toolTipText; |
157 |
} |
158 |
|
159 |
/**
|
160 |
* Sets the tool tip text
|
161 |
*
|
162 |
* @param text the tool tip text to this icon image
|
163 |
*/
|
164 |
public void setToolTipText(String text) { |
165 |
this.toolTipText = text;
|
166 |
} |
167 |
|
168 |
/**
|
169 |
* Gets the associated item value
|
170 |
*
|
171 |
* @return a value associated to this item
|
172 |
*/
|
173 |
public Object getItemValue() { |
174 |
return this.itemValue; |
175 |
} |
176 |
|
177 |
/**
|
178 |
* Sets the associated item value
|
179 |
*
|
180 |
* @param item_Value a value associated to this item
|
181 |
*/
|
182 |
public void setItemValue(Object item_Value) { |
183 |
this.itemValue = item_Value;
|
184 |
} |
185 |
} |