Revision 10413
trunk/libraries/libUI/src-test/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/Item.java | ||
---|---|---|
1 |
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker; |
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
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 2 |
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
|
|
43 |
/** |
|
44 |
* This class is used for test the JComboBoxItemsSeekerConfigurable. Represents an Object with a string value. |
|
45 |
* |
|
46 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com) |
|
47 |
*/ |
|
48 |
public class Item implements Comparable{ |
|
49 |
String value; |
|
50 |
|
|
51 |
/** |
|
52 |
* Default contructor with 1 parameter |
|
53 |
* |
|
54 |
* @param v Text value |
|
55 |
*/ |
|
56 |
public Item (String v) { |
|
57 |
value = v; |
|
58 |
} |
|
59 |
|
|
60 |
/* |
|
61 |
* (non-Javadoc) |
|
62 |
* @see java.lang.Object#toString() |
|
63 |
*/ |
|
64 |
public String toString() { |
|
65 |
return value; |
|
66 |
} |
|
67 |
|
|
68 |
/* |
|
69 |
* (non-Javadoc) |
|
70 |
* @see java.lang.Comparable#compareTo(java.lang.Object) |
|
71 |
*/ |
|
72 |
public int compareTo(Object o) { |
|
73 |
return this.value.compareTo(o.toString()); |
|
74 |
} |
|
75 |
} |
|
0 | 76 |
trunk/libraries/libUI/src-test/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/programmerTests/TestJComboBoxItemsSeekerConfigurable.java | ||
---|---|---|
1 |
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.programmerTests; |
|
2 |
|
|
3 |
import java.awt.Dimension; |
|
4 |
|
|
5 |
import javax.swing.JFrame; |
|
6 |
import javax.swing.JOptionPane; |
|
7 |
|
|
8 |
import org.gvsig.gui.beans.Messages; |
|
9 |
import org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.Item; |
|
10 |
import org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.JComboBoxItemsSeekerConfigurable; |
|
11 |
|
|
12 |
|
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
|
|
54 |
/** |
|
55 |
* Tests the classes JComboBoxItemsSeekerConfigurable and its models: classes 'AbstractDefaultComboBoxItemsSeekerConfigurableModel', |
|
56 |
* ComboBoxItemsSeekerConfigurableModel, ComboBoxSingularItemsSeekerConfigurableModel |
|
57 |
* |
|
58 |
* Notes: |
|
59 |
* - MORE TESTS COULD BE ADDED!!! |
|
60 |
* - DON'T REMOVE TEST COMMENTED!!! |
|
61 |
* |
|
62 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com) |
|
63 |
*/ |
|
64 |
public class TestJComboBoxItemsSeekerConfigurable extends JFrame{ |
|
65 |
private static final long serialVersionUID = -3945427396385529605L; |
|
66 |
|
|
67 |
/** |
|
68 |
* Test method for the TestJComboBoxItemsSeekerDynamic |
|
69 |
* |
|
70 |
* @param args |
|
71 |
*/ |
|
72 |
public static void main(String[] args) |
|
73 |
{ |
|
74 |
int width = 300; |
|
75 |
int height = 60; |
|
76 |
|
|
77 |
try |
|
78 |
{ |
|
79 |
// Objects creation |
|
80 |
JFrame jF = new JFrame(); |
|
81 |
|
|
82 |
// Create a JComboBoxSearcheable, set behavior configuration and add Items |
|
83 |
|
|
84 |
// --- TESTS FOR THE JCOMBOBOXITEMSSEEKERCONFIGURABLE --- |
|
85 |
// Test the default behavior |
|
86 |
JComboBoxItemsSeekerConfigurable jCBSD = new JComboBoxItemsSeekerConfigurable(); |
|
87 |
|
|
88 |
// Tests adding a model |
|
89 |
// ComboBoxItemsSeekerConfigurableModel model = new ComboBoxItemsSeekerConfigurableModel(); |
|
90 |
// ComboBoxItemsSeekerConfigurableModel model = new ComboBoxItemsSeekerConfigurableModel(new Object[] {new Item("Item1"), new Item("Item2"), new Item("Item3"), new Item("Item4"), new Item("Item5")}); |
|
91 |
// jCBSD.setModel(model); |
|
92 |
|
|
93 |
// Test of the change of the flag onlyOneColor |
|
94 |
// jCBSD.setOnlyOneColorOnText_Flag(true); |
|
95 |
// jCBSD.setOnlyOneColorOnText_Flag(false); |
|
96 |
|
|
97 |
// Test of the change of the flag beepEnabled |
|
98 |
// jCBSD.setBeepEnabled_Flag(true); |
|
99 |
// jCBSD.setBeepEnabled_Flag(false); |
|
100 |
|
|
101 |
// Test of the change of the flag completeMatchedItem |
|
102 |
// jCBSD.setCompleteMatchedItem_Flag(true); |
|
103 |
// jCBSD.setCompleteMatchedItem_Flag(false); |
|
104 |
|
|
105 |
// Test of the change of the flag allowedRepeatedItems |
|
106 |
// jCBSD.setAllowedRepeatedItems_Flag(true); |
|
107 |
// jCBSD.setAllowedRepeatedItems_Flag(false); |
|
108 |
|
|
109 |
// Test of the change of the flag toForceToOnlyCoincidencesInTheSearch_Flag |
|
110 |
// jCBSD.setToForceToOnlyCoincidencesInTheSearch_Flag(true); |
|
111 |
// jCBSD.setToForceToOnlyCoincidencesInTheSearch_Flag(false); |
|
112 |
|
|
113 |
// Test of the change of the flag useHighLight_Flag |
|
114 |
// jCBSD.setUseHighLight_Flag(true); |
|
115 |
// jCBSD.setUseHighLight_Flag(false); |
|
116 |
|
|
117 |
// Test of the change of the flag allowedMouseEditionPopupMenu |
|
118 |
// jCBSD.setAllowedMouseEditionPopupMenu_Flag(false); |
|
119 |
// jCBSD.setAllowedMouseEditionPopupMenu_Flag(true); |
|
120 |
|
|
121 |
// --- TESTS FOR THE AbstractDefaultComboBoxItemsSeekerConfigurableModel IMPLEMENTATIONS --- |
|
122 |
// Test a configuration of behavior of the start of JComboBoxSearcheableDynamic |
|
123 |
// jCBSD.setStartBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.MAINTAIN_ORIGINAL_POSITION_START); |
|
124 |
// jCBSD.setStartBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_START); |
|
125 |
// jCBSD.setStartBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.DISORDERED_START); |
|
126 |
// jCBSD.setStartBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_ALL_ITEMS_SEARCH); // Test error configuration |
|
127 |
|
|
128 |
// Test a configuration of behavior of the search of JComboBoxSearcheableDynamic |
|
129 |
// jCBSD.setSearchBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.MAINTAIN_ORIGINAL_POSITION_ALL_ITEMS_SEARCH); |
|
130 |
// jCBSD.setSearchBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_ALL_ITEMS_SEARCH); |
|
131 |
// jCBSD.setSearchBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.DISORDERED_ALL_ITEMS_SEARCH); |
|
132 |
// jCBSD.setSearchBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.MAINTAIN_ORIGINAL_POSITION_DYNAMIC_SEARCH); |
|
133 |
// jCBSD.setSearchBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_DYNAMIC_SEARCH); |
|
134 |
// jCBSD.setSearchBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.DISORDERED_DYNAMIC_SEARCH); |
|
135 |
// jCBSD.setStartBehavior(AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_START); // Test error configuration |
|
136 |
|
|
137 |
// Test of the change of the flag caseSensitive |
|
138 |
// jCBSD.setCaseSensitive_Flag(true); |
|
139 |
// jCBSD.setCaseSensitive_Flag(false); |
|
140 |
|
|
141 |
// Test of the change of the flag useHighLight_Flag |
|
142 |
// jCBSD.setSelectAnItemWhenLosesFocus_Flag(true); |
|
143 |
// jCBSD.setSelectAnItemWhenLosesFocus_Flag(false); |
|
144 |
|
|
145 |
// --- ADD ITEMS TO THE COMPONENT AND OTHER TESTS --- |
|
146 |
// If the flags configuration is ok -> test the component |
|
147 |
if (jCBSD.testFlagsConfigurationOK()) |
|
148 |
{ |
|
149 |
// Add some items to test if has too much delay with an average number of items |
|
150 |
jCBSD.addItem(new Item("_fwAndami")); |
|
151 |
jCBSD.addItem(new Item("extAddEventTheme")); |
|
152 |
jCBSD.addItem(new Item("extJDBC")); |
|
153 |
jCBSD.addItem(new Item("extCAD")); |
|
154 |
jCBSD.addItem(new Item("libuiDownCase")); |
|
155 |
jCBSD.addItem(new Item("appgvSig")); |
|
156 |
// jCBSD.setSelectedItem(jCBSD.getItemAt(3)); //Test setSelectedItem |
|
157 |
jCBSD.addItem(new Item("extNomenclatorIGN")); |
|
158 |
// jCBSD.setSelectedIndex(1); //Test setSelectedIndex |
|
159 |
jCBSD.addItem(new Item("extWMS")); |
|
160 |
jCBSD.addItem(new Item("LIBUI")); |
|
161 |
//// jCBSD.addItem(new Item("libCorePlugin")); |
|
162 |
//// jCBSD.addItem(new Item("libCq CMS for java")); |
|
163 |
//// jCBSD.addItem(new Item("libDriverManager")); |
|
164 |
//// jCBSD.addItem(new Item("libFMap")); |
|
165 |
//// jCBSD.addItem(new Item("libGDBMS")); |
|
166 |
//// jCBSD.addItem(new Item("libIverUtiles")); |
|
167 |
//// jCBSD.addItem(new Item("libNomenclatorIGN")); |
|
168 |
//// jCBSD.addItem(new Item("libNomenclatorIGN_GUI")); |
|
169 |
//// jCBSD.addItem(new Item("libRemoteServices")); |
|
170 |
////// jCBSD.addItem(new Item("extNomenclatorIGN")); // Duplication test |
|
171 |
//// jCBSD.addItem(new Item("libUI")); |
|
172 |
//// jCBSD.addItem(new Item("a")); |
|
173 |
//// jCBSD.addItem(new Item("aa")); |
|
174 |
//// jCBSD.addItem(new Item("aaa")); |
|
175 |
//// jCBSD.addItem(new Item("aaaa")); |
|
176 |
//// jCBSD.addItem(new Item("aaaaa")); |
|
177 |
//// jCBSD.addItem(new Item("b")); |
|
178 |
//// jCBSD.addItem(new Item("bbb")); |
|
179 |
//// jCBSD.addItem(new Item("bb")); |
|
180 |
//// jCBSD.addItem(new Item("c")); |
|
181 |
//// jCBSD.addItem(new Item(".")); |
|
182 |
//// jCBSD.addItem(new Item("ccc")); |
|
183 |
//// jCBSD.addItem(new Item("cc")); |
|
184 |
//// jCBSD.addItem(new Item("cccc")); |
|
185 |
//// jCBSD.addItem(new Item("ddd")); |
|
186 |
//// jCBSD.addItem(new Item("d")); |
|
187 |
//// jCBSD.addItem(new Item("dd")); |
|
188 |
//// jCBSD.addItem(new Item("dddd")); |
|
189 |
//// jCBSD.addItem(new Item("e")); |
|
190 |
//// jCBSD.addItem(new Item("eee")); |
|
191 |
//// jCBSD.addItem(new Item("ee")); |
|
192 |
//// jCBSD.addItem(new Item("eeee")); |
|
193 |
// jCBSD.addItem(new Item("ff")); |
|
194 |
// jCBSD.addItem(new Item("f")); |
|
195 |
//// jCBSD.addItem(new Item("LIBZZMAYUSCULA1")); |
|
196 |
//// jCBSD.addItem(new Item("ff")); // Duplication test |
|
197 |
//// jCBSD.addItem(new Item("asldf")); |
|
198 |
//// jCBSD.addItem(new Item("wej")); |
|
199 |
//// jCBSD.addItem(new Item("asdf")); |
|
200 |
//// jCBSD.addItem(new Item("LIBMAYUSCULA2")); |
|
201 |
//// jCBSD.addItem(new Item("qera")); |
|
202 |
//// jCBSD.addItem(new Item("zxvcas")); |
|
203 |
//// jCBSD.addItem(new Item("wea")); |
|
204 |
//// jCBSD.addItem(new Item("asr")); |
|
205 |
//// jCBSD.addItem(new Item("asra")); |
|
206 |
//// jCBSD.addItem(new Item("LIBMAYUSCULA1")); |
|
207 |
//// jCBSD.addItem(new Item("rar")); |
|
208 |
//// jCBSD.addItem(new Item("afda")); |
|
209 |
//// jCBSD.addItem(new Item("ljvkgk")); |
|
210 |
//// jCBSD.addItem(new Item("zcv")); |
|
211 |
//// jCBSD.addItem(new Item("gfhdt")); |
|
212 |
//// jCBSD.addItem(new Item("dfhgd")); |
|
213 |
//// jCBSD.addItem(new Item("dfh")); |
|
214 |
//// jCBSD.addItem(new Item("dfhs")); |
|
215 |
//// jCBSD.addItem(new Item("sfszv")); |
|
216 |
//// jCBSD.addItem(new Item("qer")); |
|
217 |
//// jCBSD.addItem(new Item("adfazva")); |
|
218 |
//// jCBSD.addItem(new Item("xnd")); |
|
219 |
//// jCBSD.addItem(new Item("vdkjgd")); |
|
220 |
//// jCBSD.addItem(new Item("ddhd")); |
|
221 |
//// jCBSD.addItem(new Item("dxgx")); |
|
222 |
//// jCBSD.addItem(new Item("cnsf")); |
|
223 |
//// jCBSD.addItem(new Item("ssfgs")); |
|
224 |
//// jCBSD.addItem(new Item("sgfsbx")); |
|
225 |
//// jCBSD.addItem(new Item("sfxb")); |
|
226 |
//// jCBSD.addItem(new Item("chdgk")); |
|
227 |
//// jCBSD.addItem(new Item("jgu")); |
|
228 |
//// jCBSD.addItem(new Item("gkgj")); |
|
229 |
//// jCBSD.addItem(new Item("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeee")); |
|
230 |
//// jCBSD.addItem(new Item("ljko?j.n")); |
|
231 |
//// jCBSD.addItem(new Item("hfjf")); |
|
232 |
//// jCBSD.addItem(new Item("xbxb")); |
|
233 |
//// jCBSD.addItem(new Item(".,lhhi")); |
|
234 |
//// jCBSD.addItem(new Item("hklx")); |
|
235 |
//// jCBSD.addItem(new Item("cvn")); |
|
236 |
//// jCBSD.addItem(new Item("dgh")); |
|
237 |
//// jCBSD.addItem(new Item("cncv")); |
|
238 |
//// jCBSD.addItem(new Item("sg")); |
|
239 |
//// jCBSD.addItem(new Item("b,mjk")); |
|
240 |
//// jCBSD.addItem(new Item("xv")); |
|
241 |
//// jCBSD.addItem(new Item("sgghu")); |
|
242 |
//// jCBSD.addItem(new Item("saxc")); |
|
243 |
//// jCBSD.addItem(new Item("srts")); |
|
244 |
//// jCBSD.addItem(new Item("sduyg")); |
|
245 |
//// jCBSD.addItem(new Item("sxfsrs")); |
|
246 |
//// jCBSD.addItem(new Item("rsdtf")); |
|
247 |
//// jCBSD.addItem(new Item("po`llh")); |
|
248 |
//// jCBSD.addItem(new Item("fghtf54j")); |
|
249 |
//// jCBSD.addItem(new Item("s25ewsd")); |
|
250 |
//// jCBSD.addItem(new Item("uo8khkj")); |
|
251 |
//// jCBSD.addItem(new Item("sfg45")); |
|
252 |
//// jCBSD.addItem(new Item("3gd")); |
|
253 |
//// jCBSD.addItem(new Item("5dhd")); |
|
254 |
//// jCBSD.addItem(new Item("sg4dh6")); |
|
255 |
//// jCBSD.addItem(new Item("dfh5")); |
|
256 |
//// jCBSD.addItem(new Item("s4hfj74")); |
|
257 |
//// jCBSD.addItem(new Item("sdg534")); |
|
258 |
//// jCBSD.addItem(new Item("2452etdfg")); |
|
259 |
//// jCBSD.addItem(new Item("2ui068")); |
|
260 |
//// jCBSD.addItem(new Item("3dsd sgr")); |
|
261 |
//// jCBSD.addItem(new Item("sr sgsr")); |
|
262 |
//// jCBSD.addItem(new Item("sssssssss")); |
|
263 |
//// jCBSD.addItem(new Item("aaaaass")); |
|
264 |
//// jCBSD.addItem(new Item("ss")); |
|
265 |
//// jCBSD.addItem(new Item("sry")); |
|
266 |
//// jCBSD.addItem(new Item("h?hj")); |
|
267 |
//// jCBSD.addItem(new Item("gkgb")); |
|
268 |
//// jCBSD.addItem(new Item("gkgu")); |
|
269 |
//// jCBSD.addItem(new Item("gjugvfc")); |
|
270 |
//// jCBSD.addItem(new Item("dghdd")); |
|
271 |
//// jCBSD.addItem(new Item("dhdt")); |
|
272 |
//// jCBSD.addItem(new Item("dhgd")); |
|
273 |
//// jCBSD.addItem(new Item("ddtughd")); |
|
274 |
//// jCBSD.addItem(new Item("ffuklj?d")); |
|
275 |
//// jCBSD.addItem(new Item("j?olk.j")); |
|
276 |
//// jCBSD.addItem(new Item("las alupoai a?ieurpay")); |
|
277 |
//// jCBSD.addItem(new Item("tytresd")); |
|
278 |
//// jCBSD.addItem(new Item("fgkg")); |
|
279 |
//// jCBSD.addItem(new Item("lhh")); |
|
280 |
//// jCBSD.addItem(new Item("hkhlhip")); |
|
281 |
//// jCBSD.addItem(new Item("k?popi0??=(J")); |
|
282 |
//// jCBSD.addItem(new Item("af??=)(/?/")); |
|
283 |
//// jCBSD.addItem(new Item("-a,malj'=)/")); |
|
284 |
//// jCBSD.addItem(new Item("2gw")); |
|
285 |
//// jCBSD.addItem(new Item("5teu")); |
|
286 |
//// jCBSD.addItem(new Item("4576jfff")); |
|
287 |
//// jCBSD.addItem(new Item("urtyu")); |
|
288 |
//// jCBSD.addItem(new Item("fi7")); |
|
289 |
//// jCBSD.addItem(new Item("git7t4h")); |
|
290 |
//// jCBSD.addItem(new Item("hr6frr")); |
|
291 |
//// jCBSD.addItem(new Item("ehe5et")); |
|
292 |
//// jCBSD.addItem(new Item("eue5klhj")); |
|
293 |
//// jCBSD.addItem(new Item("yoiyoy")); |
|
294 |
//// jCBSD.addItem(new Item("yoyi")); |
|
295 |
//// jCBSD.addItem(new Item("sgcsc")); |
|
296 |
//// jCBSD.addItem(new Item("sgmff74")); |
|
297 |
//// jCBSD.addItem(new Item("dd43d d6dhlhju")); |
|
298 |
//// jCBSD.addItem(new Item("gkjngr")); |
|
299 |
//// jCBSD.addItem(new Item("dbddht")); |
|
300 |
//// jCBSD.addItem(new Item("sbd")); |
|
301 |
//// jCBSD.addItem(new Item("dcbd5opihjj")); |
|
302 |
//// jCBSD.addItem(new Item("pujtth")); |
|
303 |
//// jCBSD.addItem(new Item("ZZZZZ")); |
|
304 |
//// jCBSD.addItem(new Item("ytht")); |
|
305 |
//// jCBSD.addItem(new Item("tjgt")); |
|
306 |
//// jCBSD.addItem(new Item("rrf")); |
|
307 |
//// jCBSD.addItem(new Item("BLIUE? ")); |
|
308 |
//// jCBSD.addItem(new Item("?AND?")); |
|
309 |
//// jCBSD.addItem(new Item("axaaa4iktiu")); |
|
310 |
//// jCBSD.addItem(new Item("tttyir")); |
|
311 |
//// jCBSD.addItem(new Item("ruyrrruu4")); |
|
312 |
//// jCBSD.addItem(new Item("rryewrsw")); |
|
313 |
//// jCBSD.addItem(new Item("wertw")); |
|
314 |
//// jCBSD.addItem(new Item("wer26e")); |
|
315 |
//// jCBSD.addItem(new Item("eceye")); |
|
316 |
//// jCBSD.addItem(new Item("etye7yyy-er")); |
|
317 |
//// jCBSD.addItem(new Item("eyert7e7e7")); |
|
318 |
//// jCBSD.addItem(new Item("_abcdefghijklmn?opqrstuvwxyz")); |
|
319 |
//// jCBSD.addItem(new Item("_0123456789")); |
|
320 |
//// jCBSD.addItem(new Item("sstsnmmsutt")); |
|
321 |
//// jCBSD.addItem(new Item("dcytdtyd")); |
|
322 |
//// jCBSD.addItem(new Item("dcdtdty")); |
|
323 |
//// jCBSD.addItem(new Item("dctycd")); |
|
324 |
//// jCBSD.addItem(new Item("cstyd")); |
|
325 |
//// jCBSD.addItem(new Item("dbddcytdsssc")); |
|
326 |
//// jCBSD.addItem(new Item("cdydt")); |
|
327 |
//// jCBSD.addItem(new Item("scscydu")); |
|
328 |
//// jCBSD.addItem(new Item("axct")); |
|
329 |
//// jCBSD.addItem(new Item("joobfvd")); |
|
330 |
//// jCBSD.addItem(new Item("jomj")); |
|
331 |
//// jCBSD.addItem(new Item("omjo")); |
|
332 |
//// jCBSD.addItem(new Item("mol")); |
|
333 |
//// jCBSD.addItem(new Item("agdhfj")); |
|
334 |
//// jCBSD.addItem(new Item("fjfhjuh,ooom")); |
|
335 |
//// jCBSD.addItem(new Item("affjfa")); |
|
336 |
//// jCBSD.addItem(new Item("afjfjyfga")); |
|
337 |
//// jCBSD.addItem(new Item("NOMENCLATOR")); |
|
338 |
//// jCBSD.addItem(new Item("asg")); |
|
339 |
//// jCBSD.addItem(new Item("afaea")); |
|
340 |
//// jCBSD.addItem(new Item("gvSIG")); |
|
341 |
//// jCBSD.addItem(new Item("yoiey")); |
|
342 |
//// jCBSD.addItem(new Item("35")); |
|
343 |
//// jCBSD.addItem(new Item("ewgw2dh")); |
|
344 |
//// jCBSD.addItem(new Item("titgr")); |
|
345 |
//// jCBSD.addItem(new Item("o9yky")); |
|
346 |
//// jCBSD.addItem(new Item("kyio8gbr")); |
|
347 |
//// jCBSD.addItem(new Item("eve5yed574rir")); |
|
348 |
//// jCBSD.addItem(new Item("578tygmtio")); |
|
349 |
//// jCBSD.addItem(new Item("t43262ryteye")); |
|
350 |
//// jCBSD.addItem(new Item("wvwx")); |
|
351 |
//// jCBSD.addItem(new Item("zssscwwwwww")); |
|
352 |
//// jCBSD.addItem(new Item("sgvr")); |
|
353 |
//// jCBSD.addItem(new Item("...")); |
|
354 |
// jCBSD.addItem(new Item("?LTIMO ITEM EN A?ADIRSE")); |
|
355 |
|
|
356 |
// --- END ADD ITEMS TO THE COMPONENT AND OTHER TESTS --- |
|
357 |
|
|
358 |
// Test of no item default selection |
|
359 |
// jCBSD.setSelectedIndex(-1); |
|
360 |
|
|
361 |
// More tests for the change of the flag allowedRepeatedItems |
|
362 |
// jCBSD.setAllowedRepeatedItems_Flag(true); |
|
363 |
// jCBSD.setAllowedRepeatedItems_Flag(false); |
|
364 |
|
|
365 |
// Test the number of actions that can hold the UndoManager of the JComponent |
|
366 |
// jCBSD.setUndoRedoLimitActions(5); |
|
367 |
|
|
368 |
// Configure the JFrame |
|
369 |
jF.setTitle("Test JComboBoxItemsSeekerConfigurable"); |
|
370 |
jF.setSize(new Dimension(width, height)); |
|
371 |
jF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
372 |
jF.getContentPane().add(jCBSD); |
|
373 |
jF.setVisible(true); |
|
374 |
} |
|
375 |
else |
|
376 |
JOptionPane.showMessageDialog(null, Messages.getText("errorMessageJComboBoxItemsSeekerConfigurable"), Messages.getText("testJComboBoxItemsSeekerErrorTitle"), JOptionPane.ERROR_MESSAGE); |
|
377 |
} |
|
378 |
catch(Exception e) |
|
379 |
{ |
|
380 |
e.printStackTrace(); |
|
381 |
JOptionPane.showMessageDialog(null, Messages.getText("testJComboBoxItemsSeekerErrorMessage"), Messages.getText("testJComboBoxItemsSeekerErrorTitle"), JOptionPane.ERROR_MESSAGE); |
|
382 |
} |
|
383 |
} |
|
384 |
} |
|
0 | 385 |
trunk/libraries/libUI/src-test/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/userTests/TextAreaOutputStream.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
|
|
42 |
/** |
|
43 |
* |
|
44 |
*/ |
|
45 |
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.userTests; |
|
46 |
|
|
47 |
import java.io.IOException; |
|
48 |
import java.io.OutputStream; |
|
49 |
|
|
50 |
import javax.swing.JTextArea; |
|
51 |
|
|
52 |
/** |
|
53 |
* An output stream that writes its output to a javax.swing.JTextArea |
|
54 |
* control. |
|
55 |
* |
|
56 |
* @see javax.swing.JTextArea |
|
57 |
* |
|
58 |
* @author Ranganath Kini |
|
59 |
*/ |
|
60 |
public class TextAreaOutputStream extends OutputStream { |
|
61 |
private JTextArea textControl; |
|
62 |
|
|
63 |
/** |
|
64 |
* Creates a new instance of TextAreaOutputStream which writes |
|
65 |
* to the specified instance of javax.swing.JTextArea control. |
|
66 |
* |
|
67 |
* @param control A reference to the javax.swing.JTextArea |
|
68 |
* control to which the output must be redirected |
|
69 |
* to. |
|
70 |
*/ |
|
71 |
public TextAreaOutputStream( JTextArea control ) { |
|
72 |
textControl = control; |
|
73 |
} |
|
74 |
|
|
75 |
/* |
|
76 |
* Writes the specified byte as a character to the |
|
77 |
* javax.swing.JTextArea. |
|
78 |
* |
|
79 |
* @see java.io.OutputStream#write(int) |
|
80 |
* |
|
81 |
* @param b The byte to be written as character to the |
|
82 |
* JTextArea. |
|
83 |
*/ |
|
84 |
public void write(int arg0) throws IOException { |
|
85 |
// append the data as characters to the JTextArea control |
|
86 |
textControl.append( String.valueOf( ( char )arg0 ) ); |
|
87 |
} |
|
88 |
} |
|
0 | 89 |
trunk/libraries/libUI/src-test/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/userTests/JFrameUserTestOfJComboBoxItemsSeekerConfigurable.java | ||
---|---|---|
1 |
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.userTests; |
|
2 |
|
|
3 |
import java.io.Serializable; |
|
4 |
|
|
5 |
import javax.swing.JFrame; |
|
6 |
|
|
7 |
import org.gvsig.gui.beans.Messages; |
|
8 |
|
|
9 |
|
|
10 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
11 |
* |
|
12 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
13 |
* |
|
14 |
* This program is free software; you can redistribute it and/or |
|
15 |
* modify it under the terms of the GNU General Public License |
|
16 |
* as published by the Free Software Foundation; either version 2 |
|
17 |
* of the License, or (at your option) any later version. |
|
18 |
* |
|
19 |
* This program is distributed in the hope that it will be useful, |
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
22 |
* GNU General Public License for more details. |
|
23 |
* |
|
24 |
* You should have received a copy of the GNU General Public License |
|
25 |
* along with this program; if not, write to the Free Software |
|
26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
27 |
* |
|
28 |
* For more information, contact: |
|
29 |
* |
|
30 |
* Generalitat Valenciana |
|
31 |
* Conselleria d'Infraestructures i Transport |
|
32 |
* Av. Blasco Ib??ez, 50 |
|
33 |
* 46010 VALENCIA |
|
34 |
* SPAIN |
|
35 |
* |
|
36 |
* +34 963862235 |
|
37 |
* gvsig@gva.es |
|
38 |
* www.gvsig.gva.es |
|
39 |
* |
|
40 |
* or |
|
41 |
* |
|
42 |
* IVER T.I. S.A |
|
43 |
* Salamanca 50 |
|
44 |
* 46005 Valencia |
|
45 |
* Spain |
|
46 |
* |
|
47 |
* +34 963163400 |
|
48 |
* dac@iver.es |
|
49 |
*/ |
|
50 |
|
|
51 |
/** |
|
52 |
* This class launches and creates a JComboBoxItemsSeekerConfigurable test application |
|
53 |
* |
|
54 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com) |
|
55 |
*/ |
|
56 |
public class JFrameUserTestOfJComboBoxItemsSeekerConfigurable implements Serializable{ |
|
57 |
private static final long serialVersionUID = 4228969179075895429L; |
|
58 |
private JPanelUserTestOfJComboBoxItemsSeekerConfigurable mainPanel = null; |
|
59 |
private JFrame frame; |
|
60 |
|
|
61 |
/** |
|
62 |
* Default Constructor |
|
63 |
*/ |
|
64 |
public JFrameUserTestOfJComboBoxItemsSeekerConfigurable() { |
|
65 |
createFrame(); |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* Creates the main JFrame for execute the application, and adds to it the JPanel test application |
|
70 |
*/ |
|
71 |
private void createFrame() { |
|
72 |
// Create: Configuration Frame |
|
73 |
frame = new JFrame(); |
|
74 |
frame.setResizable(false); |
|
75 |
frame.setTitle(Messages.getText("jComboBoxItemsSeekerConfigurableTestingByTheUser_frameTitle")); |
|
76 |
frame.getContentPane().add(getJPanelUserTestOfJComboBoxItemsSeekerConfigurable()); |
|
77 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
78 |
frame.pack(); |
|
79 |
|
|
80 |
// Centers the frame in the middle of the screen |
|
81 |
frame.setLocationRelativeTo(null); |
|
82 |
} |
|
83 |
|
|
84 |
private JPanelUserTestOfJComboBoxItemsSeekerConfigurable getJPanelUserTestOfJComboBoxItemsSeekerConfigurable() { |
|
85 |
if (mainPanel == null) { |
|
86 |
mainPanel = new JPanelUserTestOfJComboBoxItemsSeekerConfigurable(); |
|
87 |
} |
|
88 |
|
|
89 |
return mainPanel; |
|
90 |
} |
|
91 |
|
|
92 |
/** |
|
93 |
* Method for launch the application |
|
94 |
* |
|
95 |
* @param args |
|
96 |
*/ |
|
97 |
public static void main(String[] args) { |
|
98 |
JFrameUserTestOfJComboBoxItemsSeekerConfigurable app = new JFrameUserTestOfJComboBoxItemsSeekerConfigurable(); |
|
99 |
app.setVisible(true); |
|
100 |
} |
|
101 |
|
|
102 |
/** |
|
103 |
* Sets visible the frame |
|
104 |
* |
|
105 |
* @param visible True or false |
|
106 |
*/ |
|
107 |
public void setVisible(boolean visible) { |
|
108 |
frame.setVisible(visible); |
|
109 |
} |
|
110 |
} |
|
0 | 111 |
trunk/libraries/libUI/src-test/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/userTests/JPanelUserTestOfJComboBoxItemsSeekerConfigurable.java | ||
---|---|---|
1 |
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.userTests; |
|
2 |
|
|
3 |
import java.awt.Color; |
|
4 |
import java.awt.ComponentOrientation; |
|
5 |
import java.awt.Dimension; |
|
6 |
import java.awt.FlowLayout; |
|
7 |
import java.awt.Font; |
|
8 |
import java.awt.GridLayout; |
|
9 |
import java.awt.event.MouseAdapter; |
|
10 |
import java.awt.event.MouseEvent; |
|
11 |
import java.awt.event.WindowAdapter; |
|
12 |
import java.awt.event.WindowEvent; |
|
13 |
import java.io.BufferedReader; |
|
14 |
import java.io.File; |
|
15 |
import java.io.FileReader; |
|
16 |
import java.io.IOException; |
|
17 |
import java.io.PrintStream; |
|
18 |
import java.io.Serializable; |
|
19 |
import java.lang.reflect.InvocationTargetException; |
|
20 |
import java.lang.reflect.Method; |
|
21 |
import java.util.HashMap; |
|
22 |
import java.util.Map; |
|
23 |
import java.util.StringTokenizer; |
|
24 |
import java.util.Vector; |
|
25 |
|
|
26 |
import javax.swing.BorderFactory; |
|
27 |
import javax.swing.JButton; |
|
28 |
import javax.swing.JCheckBox; |
|
29 |
import javax.swing.JComboBox; |
|
30 |
import javax.swing.JFrame; |
|
31 |
import javax.swing.JLabel; |
|
32 |
import javax.swing.JOptionPane; |
|
33 |
import javax.swing.JPanel; |
|
34 |
import javax.swing.JScrollPane; |
|
35 |
import javax.swing.JTabbedPane; |
|
36 |
import javax.swing.JTextArea; |
|
37 |
import javax.swing.JTextField; |
|
38 |
import javax.swing.SwingConstants; |
|
39 |
import javax.swing.border.TitledBorder; |
|
40 |
import javax.swing.event.PopupMenuEvent; |
|
41 |
import javax.swing.event.PopupMenuListener; |
|
42 |
|
|
43 |
import org.gvsig.gui.beans.Messages; |
|
44 |
import org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.AbstractDefaultComboBoxItemsSeekerConfigurableModel; |
|
45 |
import org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.Item; |
|
46 |
import org.gvsig.gui.beans.swing.jComboBoxItemsSeeker.JComboBoxItemsSeekerConfigurable; |
|
47 |
|
|
48 |
|
|
49 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
50 |
* |
|
51 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
52 |
* |
|
53 |
* This program is free software; you can redistribute it and/or |
|
54 |
* modify it under the terms of the GNU General Public License |
|
55 |
* as published by the Free Software Foundation; either version 2 |
|
56 |
* of the License, or (at your option) any later version. |
|
57 |
* |
|
58 |
* This program is distributed in the hope that it will be useful, |
|
59 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
60 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
61 |
* GNU General Public License for more details. |
|
62 |
* |
|
63 |
* You should have received a copy of the GNU General Public License |
|
64 |
* along with this program; if not, write to the Free Software |
|
65 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
66 |
* |
|
67 |
* For more information, contact: |
|
68 |
* |
|
69 |
* Generalitat Valenciana |
|
70 |
* Conselleria d'Infraestructures i Transport |
|
71 |
* Av. Blasco Ib??ez, 50 |
|
72 |
* 46010 VALENCIA |
|
73 |
* SPAIN |
|
74 |
* |
|
75 |
* +34 963862235 |
|
76 |
* gvsig@gva.es |
|
77 |
* www.gvsig.gva.es |
|
78 |
* |
|
79 |
* or |
|
80 |
* |
|
81 |
* IVER T.I. S.A |
|
82 |
* Salamanca 50 |
|
83 |
* 46005 Valencia |
|
84 |
* Spain |
|
85 |
* |
|
86 |
* +34 963163400 |
|
87 |
* dac@iver.es |
|
88 |
*/ |
|
89 |
|
|
90 |
/** |
|
91 |
* Application for testing JComboBoxItemsSeekerConfigurable objects |
|
92 |
* This class is a JPanel and has other classes nested. |
|
93 |
* |
|
94 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com) |
|
95 |
*/ |
|
96 |
public class JPanelUserTestOfJComboBoxItemsSeekerConfigurable extends JPanel implements Serializable { |
|
97 |
private static final long serialVersionUID = -6215950904003508523L; |
|
98 |
private final int panelWidth = 735; |
|
99 |
private final int panelHeight = 530; |
|
100 |
private final int testWidth = 260; |
|
101 |
private ConfigurationJPanel configurationPanel = null; |
|
102 |
private OtherTestsJPanel otherTestsPanel = null; |
|
103 |
private JavaFileMethodsLoader javaFileMethodsLoader; |
|
104 |
private int testNumber; |
|
105 |
private String path; |
|
106 |
|
|
107 |
/** |
|
108 |
* Default constructor |
|
109 |
*/ |
|
110 |
public JPanelUserTestOfJComboBoxItemsSeekerConfigurable() { |
|
111 |
super(); |
|
112 |
this.initialize(); |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* Initializes the application pane |
|
117 |
*/ |
|
118 |
private void initialize() { |
|
119 |
path = "src/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/JComboBoxItemsSeekerConfigurable.java"; |
|
120 |
this.setPreferredSize(new Dimension(panelWidth, panelHeight)); |
|
121 |
this.setSize(new Dimension(panelWidth, panelHeight)); |
|
122 |
FlowLayout flowLayout = new FlowLayout(); |
|
123 |
flowLayout.setAlignment(FlowLayout.LEFT); |
|
124 |
this.setLayout(flowLayout); |
|
125 |
this.add(this.getConfigurationPanel()); |
|
126 |
this.add(this.getOtherTestsPanel()); |
|
127 |
this.loadPublicMethods(); |
|
128 |
this.redirectDebugAndErrorMessages(); |
|
129 |
testNumber = 1; |
|
130 |
} |
|
131 |
|
|
132 |
/** |
|
133 |
* Loads public methods of the JComboBoxItemsSeekerConfigurable from its file class and adds the constructors to the |
|
134 |
* inner ConfigurationPanel and the other methods to the OtherTestsPanel |
|
135 |
*/ |
|
136 |
private void loadPublicMethods() { |
|
137 |
String methodHead; |
|
138 |
String reservedWord = new String("public "); |
|
139 |
int reservedWordLength = reservedWord.length(); |
|
140 |
|
|
141 |
for (int i = 0; i < javaFileMethodsLoader.size(); i++) |
|
142 |
{ |
|
143 |
methodHead = javaFileMethodsLoader.getMethodHead(i); |
|
144 |
if (methodHead.startsWith(reservedWord)) |
|
145 |
{ |
|
146 |
if (methodHead.startsWith(reservedWord + javaFileMethodsLoader.getClassName())) |
|
147 |
getConfigurationPanel().addConstructorItem(methodHead.substring(reservedWordLength, methodHead.length())); |
|
148 |
else |
|
149 |
getOtherTestsPanel().addMethodItem(methodHead.substring(reservedWordLength, methodHead.length())); |
|
150 |
} |
|
151 |
} |
|
152 |
} |
|
153 |
|
|
154 |
/** |
|
155 |
* Redirects the default output and error stream to the inner log JTextArea |
|
156 |
*/ |
|
157 |
private void redirectDebugAndErrorMessages() { |
|
158 |
// Now create a new TextAreaOutputStream to write to our JTextArea control and wrap a |
|
159 |
// PrintStream around it to support the println/printf methods. |
|
160 |
PrintStream out = new PrintStream( new TextAreaOutputStream( getOtherTestsPanel().getJTextAreaLog() ) ); |
|
161 |
|
|
162 |
// Redirect standard output stream to the TextAreaOutputStream |
|
163 |
System.setOut( out ); |
|
164 |
|
|
165 |
// Redirect standard error stream to the TextAreaOutputStream |
|
166 |
System.setErr( out ); |
|
167 |
} |
|
168 |
|
|
169 |
/** |
|
170 |
* This method initializes configurationPanel |
|
171 |
* |
|
172 |
* @return javax.swing.JComboBoxItemsSeekerConfigurableTestingByTheUserConfigurationPanel |
|
173 |
*/ |
|
174 |
private ConfigurationJPanel getConfigurationPanel() { |
|
175 |
if (configurationPanel == null) { |
|
176 |
configurationPanel = new ConfigurationJPanel(); |
|
177 |
configurationPanel.getJButtonNew().addMouseListener(new MouseAdapter() { |
|
178 |
/* |
|
179 |
* (non-Javadoc) |
|
180 |
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent) |
|
181 |
*/ |
|
182 |
public void mouseClicked(MouseEvent arg0) { |
|
183 |
addNewTestObject(); |
|
184 |
} |
|
185 |
}); |
|
186 |
} |
|
187 |
|
|
188 |
return configurationPanel; |
|
189 |
} |
|
190 |
|
|
191 |
/** |
|
192 |
* This method initializes otherTestsPanel |
|
193 |
* |
|
194 |
* @return javax.swing.JComboBoxItemsSeekerConfigurableTestingByTheUserOtherTestsPanel |
|
195 |
*/ |
|
196 |
private OtherTestsJPanel getOtherTestsPanel() { |
|
197 |
if (this.otherTestsPanel == null) |
|
198 |
this.otherTestsPanel = new OtherTestsJPanel(path); |
|
199 |
|
|
200 |
return this.otherTestsPanel; |
|
201 |
} |
|
202 |
|
|
203 |
/** |
|
204 |
* This method creates a JFrame with a new object for testing. |
|
205 |
* This method also defines the closing methods and the name of the JFrame, and add the JFrame to the OtherTestPanel; that panel |
|
206 |
* will use it for do methods. |
|
207 |
*/ |
|
208 |
private void addNewTestObject() { |
|
209 |
JComboBoxItemsSeekerConfigurable object = this.createComponent(); |
|
210 |
object.setPreferredSize(new Dimension(testWidth, object.getPreferredSize().height)); |
|
211 |
String keyAndTitle = Messages.getText("test") + " " + String.valueOf(testNumber++); |
|
212 |
|
|
213 |
JFrame jFrame = new JFrame(keyAndTitle); |
|
214 |
jFrame.getContentPane().add(object); |
|
215 |
jFrame.pack(); |
|
216 |
jFrame.setVisible(true); |
|
217 |
|
|
218 |
// Centers the JFrame in the middle of the screen |
|
219 |
jFrame.setLocationRelativeTo(null); |
|
220 |
|
|
221 |
// Defines the methods that will have to do the JFrame when it would have to be closed |
|
222 |
jFrame.addWindowListener(new WindowAdapter(){ |
|
223 |
|
|
224 |
/* |
|
225 |
* (non-Javadoc) |
|
226 |
* @see java.awt.event.WindowAdapter#windowClosed(java.awt.event.WindowEvent) |
|
227 |
*/ |
|
228 |
public void windowClosed(WindowEvent e) { |
|
229 |
// It's executen when the application closes the JFrame |
|
230 |
getOtherTestsPanel().removeTestObject(((JFrame)e.getSource()).getTitle()); |
|
231 |
getOtherTestsPanel().getJTextAreaLog().append('(' + ((JFrame)e.getSource()).getTitle() + ", " + Messages.getText("elimination") + ")\n"); |
|
232 |
} |
|
233 |
|
|
234 |
/* |
|
235 |
* (non-Javadoc) |
|
236 |
* @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent) |
|
237 |
*/ |
|
238 |
public void windowClosing(WindowEvent e) { |
|
239 |
// It's executen when the user closes the JFrame |
|
240 |
getOtherTestsPanel().removeTestObject(((JFrame)e.getSource()).getTitle()); |
|
241 |
getOtherTestsPanel().getJTextAreaLog().append('(' + ((JFrame)e.getSource()).getTitle() + ", " + Messages.getText("elimination") + ")\n"); |
|
242 |
} |
|
243 |
}); |
|
244 |
|
|
245 |
this.getOtherTestsPanel().addTestObject(keyAndTitle, jFrame); |
|
246 |
} |
|
247 |
|
|
248 |
|
|
249 |
/** |
|
250 |
* Obteins the configuration value for create the new object and creates it |
|
251 |
* |
|
252 |
* @return JComboBoxItemsSeekerConfigurable The new object created |
|
253 |
*/ |
|
254 |
private JComboBoxItemsSeekerConfigurable createComponent() { |
|
255 |
int startBehavior, searchBehavior; |
|
256 |
|
|
257 |
// Start Behavior |
|
258 |
switch(getConfigurationPanel().getSelectedBehaviorOfJComboBoxStartBehavior()) |
|
259 |
{ |
|
260 |
case 0: |
|
261 |
startBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.MAINTAIN_ORIGINAL_POSITION_START; |
|
262 |
break; |
|
263 |
case 1: |
|
264 |
startBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_START; |
|
265 |
break; |
|
266 |
case 2: |
|
267 |
startBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.DISORDERED_START; |
|
268 |
break; |
|
269 |
default: |
|
270 |
startBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.DEFAULT_START_BEHAVIOR_CONFIGURATION; |
|
271 |
} |
|
272 |
|
|
273 |
// Search Behavior |
|
274 |
switch(getConfigurationPanel().getSelectedBehaviorOfJComboBoxSearchBehavior()) |
|
275 |
{ |
|
276 |
case 0: |
|
277 |
searchBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.MAINTAIN_ORIGINAL_POSITION_ALL_ITEMS_SEARCH; |
|
278 |
break; |
|
279 |
case 1: |
|
280 |
searchBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_ALL_ITEMS_SEARCH; |
|
281 |
break; |
|
282 |
case 2: |
|
283 |
searchBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.DISORDERED_ALL_ITEMS_SEARCH; |
|
284 |
break; |
|
285 |
case 3: |
|
286 |
searchBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.MAINTAIN_ORIGINAL_POSITION_DYNAMIC_SEARCH; |
|
287 |
break; |
|
288 |
case 4: |
|
289 |
searchBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.ORDERED_DYNAMIC_SEARCH; |
|
290 |
break; |
|
291 |
case 5: |
|
292 |
searchBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.DISORDERED_DYNAMIC_SEARCH; |
|
293 |
break; |
|
294 |
default: |
|
295 |
searchBehavior = AbstractDefaultComboBoxItemsSeekerConfigurableModel.DEFAULT_SEARCH_BEHAVIOR_CONFIGURATION; |
|
296 |
} |
|
297 |
|
|
298 |
getOtherTestsPanel().getJTextAreaLog().append('(' + Messages.getText("test") + " " + String.valueOf(testNumber) + ", " + |
|
299 |
Messages.getText("creaction") + ": " + startBehavior + ": " + searchBehavior + ", " + getConfigurationPanel().isSelectedJCheckBoxCaseSensitive() + ", " + |
|
300 |
getConfigurationPanel().isSelectedJCheckBoxOnlyOneColor() + ", " + getConfigurationPanel().isSelectedJCheckBoxCompleteMatchedItem() + ", " + |
|
301 |
getConfigurationPanel().isSelectedJCheckBoxUseBeep() + ", " + getConfigurationPanel().isSelectedJCheckBoxAllowedRepeatedItems() + ", " + |
|
302 |
getConfigurationPanel().isSelectedJCheckBoxAllowedMouseEditionPopupMenu() + ", " + getConfigurationPanel().isSelectedJCheckBoxToForceToOnlyCoincidencesInTheSearch() + ", " + |
|
303 |
getConfigurationPanel().isSelectedJCheckBoxUseHighLight() + ", " + getConfigurationPanel().isSelectedJCheckBoxSelectAnItemWhenLosesFocus() + ")\n"); |
|
304 |
|
|
305 |
return new JComboBoxItemsSeekerConfigurable(startBehavior, searchBehavior, getConfigurationPanel().isSelectedJCheckBoxCaseSensitive(), |
|
306 |
getConfigurationPanel().isSelectedJCheckBoxOnlyOneColor(), getConfigurationPanel().isSelectedJCheckBoxCompleteMatchedItem(), |
|
307 |
getConfigurationPanel().isSelectedJCheckBoxUseBeep(), getConfigurationPanel().isSelectedJCheckBoxAllowedRepeatedItems(), |
|
308 |
getConfigurationPanel().isSelectedJCheckBoxAllowedMouseEditionPopupMenu(), getConfigurationPanel().isSelectedJCheckBoxToForceToOnlyCoincidencesInTheSearch(), |
|
309 |
getConfigurationPanel().isSelectedJCheckBoxUseHighLight(), getConfigurationPanel().isSelectedJCheckBoxSelectAnItemWhenLosesFocus()); |
|
310 |
} |
|
311 |
|
|
312 |
|
|
313 |
/** |
|
314 |
* A JPanel for the configuration and create a new JComboBoxItemsSeekerConfigurable for testing |
|
315 |
* |
|
316 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com) |
|
317 |
*/ |
|
318 |
private class ConfigurationJPanel extends JPanel implements Serializable { |
|
319 |
private static final long serialVersionUID = -1346586262697239304L; |
|
320 |
private final int configurationPanelWidth = 310; |
|
321 |
private final int configurationPanelHeight = 520; |
|
322 |
private final int subPanelWidth = 280; |
|
323 |
private final int subPanelHeight = 28; |
|
324 |
private final int buttonWidth = 90; |
|
325 |
private final int buttonHeight = 20; |
|
326 |
private final int jComboBoxWidth = 200; |
|
327 |
private final int jComboBoxHeight = 20; |
|
328 |
private final int jPaneConfigurationParametersWidth = 296; |
|
329 |
private final int jPaneConfigurationParametersHeight = 390; |
|
330 |
private final int jPaneConstructorsWidth = jPaneConfigurationParametersWidth; |
|
331 |
private final int jPaneConstructorsHeight = 55; |
|
332 |
private final int jComboBoxConstructorsWidth = jPaneConfigurationParametersWidth - 10; |
|
333 |
private final int jComboBoxConstructorsHeight = jComboBoxHeight; |
|
334 |
private JCheckBox jCheckBoxCaseSensitive = null; |
|
335 |
private JCheckBox jCheckBoxOnlyOneColorOnText = null; |
|
336 |
private JCheckBox jCheckBoxCompleteMatchedItem = null; |
|
337 |
private JCheckBox jCheckBoxUseBeep = null; |
|
338 |
private JCheckBox jCheckBoxAllowedRepeatedItems = null; |
|
339 |
private JCheckBox jCheckBoxAllowedMouseEditionPopupMenu = null; |
|
340 |
private JCheckBox jCheckBoxToForceToOnlyCoincidencesInTheSearch = null; |
|
341 |
private JCheckBox jCheckBoxUseHighLight = null; |
|
342 |
private JCheckBox jCheckBoxSelectAnItemWhenLosesFocus = null; |
|
343 |
private JLabel jLabelStartBehavior = null; |
|
344 |
private JLabel jLabelSearchBehavior = null; |
|
345 |
private JLabel jLabelCaseSensitive = null; |
|
346 |
private JLabel jLabelOnlyOneColorOnText = null; |
|
347 |
private JLabel jLabelCompleteMatchedItem = null; |
|
348 |
private JLabel jLabelUseBeep = null; |
|
349 |
private JLabel jLabelAllowedRepeatedItems = null; |
|
350 |
private JLabel jLabelAllowedMouseEditionPopupMenu = null; |
|
351 |
private JLabel jLabelToForceToOnlyCoincidencesInTheSearch = null; |
|
352 |
private JLabel jLabelUseHighLight = null; |
|
353 |
private JLabel jLabelSelectAnItemWhenLosesFocus = null; |
|
354 |
private JButton jButtonReset = null; |
|
355 |
private JPanel jPaneConstructor = null; |
|
356 |
private JPanel jPaneConfigurationParameters = null; |
|
357 |
private JPanel jPaneStartBehavior = null; |
|
358 |
private JPanel jPaneSearchBehavior = null; |
|
359 |
private JPanel jPaneCaseSensitive = null; |
|
360 |
private JPanel jPaneOnlyOneColorOnText = null; |
|
361 |
private JPanel jPaneCompleteMatchedItem = null; |
|
362 |
private JPanel jPaneUseBeep = null; |
|
363 |
private JPanel jPaneCaseAllowedRepeatedItems = null; |
|
364 |
private JPanel jPaneAllowedMouseEditionPopupMenu = null; |
|
365 |
private JPanel jPaneToForceToOnlyCoincidencesInTheSearch = null; |
|
366 |
private JPanel jPaneUseHighLight = null; |
|
367 |
private JPanel jPaneSelectAnItemWhenLosesFocus = null; |
|
368 |
private JPanel jPaneButtons = null; |
|
369 |
private JComboBox jComboBoxConstructors = null; |
|
370 |
private JComboBox jComboBoxStartBehavior = null; |
|
371 |
private JComboBox jComboBoxSearchBehavior = null; |
|
372 |
private JButton jButtonNew = null; |
|
373 |
private Object lastSelectedConstructor = null; |
|
374 |
|
|
375 |
/** |
|
376 |
* Default constructor |
|
377 |
*/ |
|
378 |
public ConfigurationJPanel() { |
|
379 |
super(); |
|
380 |
this.initialize(); |
|
381 |
} |
|
382 |
|
|
383 |
/** |
|
384 |
* Initializes this pane |
|
385 |
*/ |
|
386 |
private void initialize() { |
|
387 |
this.setPreferredSize(new Dimension(configurationPanelWidth, configurationPanelHeight)); |
|
388 |
this.setSize(new Dimension(configurationPanelWidth, configurationPanelHeight)); |
|
389 |
this.setBorder(BorderFactory.createTitledBorder(null, Messages.getText("objectsCreation"), TitledBorder.LEFT, TitledBorder.TOP, new Font("Dialog", Font.BOLD, 12), Color.black)); |
|
390 |
this.add(getJPaneConstructors(), null); |
|
391 |
this.add(getJPaneConfigurationParameters(), null); |
|
392 |
this.add(getJPaneButtons(), null); |
|
393 |
this.resetConfigurationPanel(); |
|
394 |
} |
|
395 |
|
|
396 |
/** |
|
397 |
* This method initializes jCheckBoxCaseSensitive |
|
398 |
* |
|
399 |
* @return javax.swing.JCheckBox |
|
400 |
*/ |
|
401 |
private JCheckBox getJCheckBoxCaseSensitive() { |
|
402 |
if (jCheckBoxCaseSensitive == null) { |
|
403 |
jCheckBoxCaseSensitive = new JCheckBox(); |
|
404 |
} |
|
405 |
return jCheckBoxCaseSensitive; |
|
406 |
} |
|
407 |
|
|
408 |
/** |
|
409 |
* This method initializes jCheckBoxOnlyOneColor |
|
410 |
* |
|
411 |
* @return javax.swing.JCheckBox |
|
412 |
*/ |
|
413 |
private JCheckBox getJCheckBoxOnlyOneColorOnText() { |
|
414 |
if (jCheckBoxOnlyOneColorOnText == null) { |
|
415 |
jCheckBoxOnlyOneColorOnText = new JCheckBox(); |
|
416 |
} |
|
417 |
return jCheckBoxOnlyOneColorOnText; |
|
418 |
} |
|
419 |
|
|
420 |
/** |
|
421 |
* This method initializes jCheckBoxCompleteMatchedItem |
|
422 |
* |
|
423 |
* @return javax.swing.JCheckBox |
|
424 |
*/ |
|
425 |
private JCheckBox getJCheckBoxCompleteMatchedItem() { |
|
426 |
if (jCheckBoxCompleteMatchedItem == null) { |
|
427 |
jCheckBoxCompleteMatchedItem = new JCheckBox(); |
|
428 |
} |
|
429 |
return jCheckBoxCompleteMatchedItem; |
|
430 |
} |
|
431 |
|
|
432 |
/** |
|
433 |
* This method initializes jCheckBoxUseBeep |
|
434 |
* |
|
435 |
* @return javax.swing.JCheckBox |
|
436 |
*/ |
|
437 |
private JCheckBox getJCheckBoxUseBeep() { |
|
438 |
if (jCheckBoxUseBeep == null) { |
|
439 |
jCheckBoxUseBeep = new JCheckBox(); |
|
440 |
} |
|
441 |
return jCheckBoxUseBeep; |
|
442 |
} |
|
443 |
|
|
444 |
/** |
|
445 |
* This method initializes jCheckBoxAllowedRepeatedItems |
|
446 |
* |
|
447 |
* @return javax.swing.JCheckBox |
|
448 |
*/ |
|
449 |
private JCheckBox getJCheckBoxAllowedRepeatedItems() { |
|
450 |
if (jCheckBoxAllowedRepeatedItems == null) { |
|
451 |
jCheckBoxAllowedRepeatedItems = new JCheckBox(); |
|
452 |
} |
|
453 |
return jCheckBoxAllowedRepeatedItems; |
|
454 |
} |
|
455 |
|
|
456 |
/** |
|
457 |
* This method initializes jCheckBoxAllowedMouseEditionPopupMenu |
|
458 |
* |
|
459 |
* @return javax.swing.JCheckBox |
|
460 |
*/ |
|
461 |
private JCheckBox getJCheckBoxAllowedMouseEditionPopupMenu() { |
|
462 |
if (jCheckBoxAllowedMouseEditionPopupMenu == null) { |
|
463 |
jCheckBoxAllowedMouseEditionPopupMenu = new JCheckBox(); |
|
464 |
} |
|
465 |
return jCheckBoxAllowedMouseEditionPopupMenu; |
|
466 |
} |
|
467 |
|
|
468 |
/** |
|
469 |
* This method initializes jCheckBoxToForceToOnlyCoincidencesInTheSearch |
|
470 |
* |
|
471 |
* @return javax.swing.JCheckBox |
|
472 |
*/ |
|
473 |
private JCheckBox getJCheckBoxToForceToOnlyCoincidencesInTheSearch() { |
|
474 |
if (jCheckBoxToForceToOnlyCoincidencesInTheSearch == null) { |
|
475 |
jCheckBoxToForceToOnlyCoincidencesInTheSearch = new JCheckBox(); |
|
476 |
} |
|
477 |
return jCheckBoxToForceToOnlyCoincidencesInTheSearch; |
|
478 |
} |
|
479 |
|
|
480 |
/** |
|
481 |
* This method initializes jCheckBoxUseHighLight |
|
482 |
* |
|
483 |
* @return javax.swing.JCheckBox |
|
484 |
*/ |
|
485 |
private JCheckBox getJCheckBoxUseHighLight() { |
|
486 |
if (jCheckBoxUseHighLight == null) { |
|
487 |
jCheckBoxUseHighLight = new JCheckBox(); |
|
488 |
} |
|
489 |
return jCheckBoxUseHighLight; |
|
490 |
} |
|
491 |
|
|
492 |
/** |
|
493 |
* This method initializes jCheckBoxSelectAnItemWhenLosesFocus |
|
494 |
* |
|
495 |
* @return javax.swing.JCheckBox |
|
496 |
*/ |
|
497 |
private JCheckBox getJCheckBoxSelectAnItemWhenLosesFocus() { |
|
498 |
if (jCheckBoxSelectAnItemWhenLosesFocus == null) { |
|
499 |
jCheckBoxSelectAnItemWhenLosesFocus = new JCheckBox(); |
|
500 |
} |
|
501 |
return jCheckBoxSelectAnItemWhenLosesFocus; |
|
502 |
} |
|
503 |
|
|
504 |
/** |
|
505 |
* @see JCheckBox#setSelected(boolean) |
|
506 |
*/ |
|
507 |
public void setSelectedJCheckBoxCaseSensitive(boolean b) { |
|
508 |
jCheckBoxCaseSensitive.setSelected(b); |
|
509 |
} |
|
510 |
|
|
511 |
/** |
|
512 |
* @see JCheckBox#setSelected(boolean) |
|
513 |
*/ |
|
514 |
public void setSelectedJCheckBoxOnlyOneColor(boolean b) { |
|
515 |
getJCheckBoxOnlyOneColorOnText().setSelected(b); |
|
516 |
} |
|
517 |
|
|
518 |
/** |
|
519 |
* @see JCheckBox#setSelected(boolean) |
|
520 |
*/ |
|
521 |
public void setSelectedJCheckBoxCompleteMatchedItem(boolean b) { |
|
522 |
getJCheckBoxCompleteMatchedItem().setSelected(b); |
|
523 |
} |
|
524 |
|
|
525 |
/** |
|
526 |
* @see JCheckBox#setSelected(boolean) |
|
527 |
*/ |
|
528 |
public void setSelectedJCheckBoxUseBeep(boolean b) { |
|
529 |
getJCheckBoxUseBeep().setSelected(b); |
|
530 |
} |
|
531 |
|
|
532 |
/** |
|
533 |
* @see JCheckBox#setSelected(boolean) |
|
534 |
*/ |
|
535 |
public void setSelectedJCheckBoxAllowedRepeatedItems(boolean b) { |
|
536 |
getJCheckBoxAllowedRepeatedItems().setSelected(b); |
|
537 |
} |
|
538 |
|
|
539 |
/** |
|
540 |
* @see JCheckBox#setSelected(boolean) |
|
541 |
*/ |
|
542 |
public void setSelectedJCheckBoxAllowedMouseEditionPopupMenu(boolean b) { |
|
543 |
getJCheckBoxAllowedMouseEditionPopupMenu().setSelected(b); |
|
544 |
} |
|
545 |
|
|
546 |
/** |
|
547 |
* @see JCheckBox#setSelected(boolean) |
|
548 |
*/ |
|
549 |
public void setSelectedJCheckBoxToForceToOnlyCoincidencesInTheSearch(boolean b) { |
|
550 |
getJCheckBoxToForceToOnlyCoincidencesInTheSearch().setSelected(b); |
|
551 |
} |
|
552 |
|
|
553 |
/** |
|
554 |
* @see JCheckBox#setSelected(boolean) |
|
555 |
*/ |
|
556 |
public void setSelectedJCheckBoxUseHighLight(boolean b) { |
|
557 |
getJCheckBoxUseHighLight().setSelected(b); |
|
558 |
} |
|
559 |
|
|
560 |
/** |
|
561 |
* @see JCheckBox#setSelected(boolean) |
|
562 |
*/ |
|
563 |
public void setSelectedJCheckBoxSelectAnItemWhenLosesFocus(boolean b) { |
|
564 |
getJCheckBoxSelectAnItemWhenLosesFocus().setSelected(b); |
|
565 |
} |
|
566 |
|
|
567 |
/** |
|
568 |
* @see JCheckBox#isSelected() |
|
569 |
*/ |
|
570 |
public boolean isSelectedJCheckBoxCaseSensitive() { |
|
571 |
return jCheckBoxCaseSensitive.isSelected(); |
|
572 |
} |
|
573 |
|
|
574 |
/** |
|
575 |
* @see JCheckBox#isSelected() |
|
576 |
*/ |
|
577 |
public boolean isSelectedJCheckBoxOnlyOneColor() { |
|
578 |
return getJCheckBoxOnlyOneColorOnText().isSelected(); |
|
579 |
} |
|
580 |
|
|
581 |
/** |
|
582 |
* @see JCheckBox#isSelected() |
|
583 |
*/ |
|
584 |
public boolean isSelectedJCheckBoxCompleteMatchedItem() { |
|
585 |
return getJCheckBoxCompleteMatchedItem().isSelected(); |
|
586 |
} |
|
587 |
|
|
588 |
/** |
|
589 |
* @see JCheckBox#isSelected() |
|
590 |
*/ |
|
591 |
public boolean isSelectedJCheckBoxUseBeep() { |
|
592 |
return getJCheckBoxUseBeep().isSelected(); |
|
593 |
} |
|
594 |
|
|
595 |
/** |
|
596 |
* @see JCheckBox#isSelected() |
|
597 |
*/ |
|
598 |
public boolean isSelectedJCheckBoxAllowedRepeatedItems() { |
|
599 |
return getJCheckBoxAllowedRepeatedItems().isSelected(); |
|
600 |
} |
|
601 |
|
|
602 |
/** |
|
603 |
* @see JCheckBox#isSelected() |
|
604 |
*/ |
|
605 |
public boolean isSelectedJCheckBoxAllowedMouseEditionPopupMenu() { |
|
606 |
return getJCheckBoxAllowedMouseEditionPopupMenu().isSelected(); |
|
607 |
} |
|
608 |
|
|
609 |
/** |
|
610 |
* @see JCheckBox#isSelected() |
|
611 |
*/ |
|
612 |
public boolean isSelectedJCheckBoxToForceToOnlyCoincidencesInTheSearch() { |
|
613 |
return getJCheckBoxToForceToOnlyCoincidencesInTheSearch().isSelected(); |
|
614 |
} |
|
615 |
|
|
616 |
/** |
|
617 |
* @see JCheckBox#isSelected(boolean) |
|
618 |
*/ |
|
619 |
public boolean isSelectedJCheckBoxUseHighLight() { |
|
620 |
return getJCheckBoxUseHighLight().isSelected(); |
|
621 |
} |
|
622 |
|
|
623 |
/** |
|
624 |
* @see JCheckBox#isSelected(boolean) |
|
625 |
*/ |
|
626 |
public boolean isSelectedJCheckBoxSelectAnItemWhenLosesFocus() { |
|
627 |
return getJCheckBoxSelectAnItemWhenLosesFocus().isSelected(); |
|
628 |
} |
|
629 |
|
|
630 |
/** |
|
631 |
* This method initializes jButtonReset |
|
632 |
* |
|
633 |
* @return javax.swing.JButton |
|
634 |
*/ |
|
635 |
private JButton getJButtonReset() { |
|
636 |
if (jButtonReset == null) { |
|
637 |
jButtonReset = new JButton(); |
|
638 |
jButtonReset.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); |
|
639 |
jButtonReset.setText(Messages.getText("reset")); |
|
640 |
jButtonReset.addMouseListener(new MouseAdapter() { |
|
641 |
/* |
|
642 |
* (non-Javadoc) |
|
643 |
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent) |
|
644 |
*/ |
|
645 |
public void mouseClicked(MouseEvent arg0) { |
|
646 |
resetConfigurationPanel(); |
|
647 |
} |
|
648 |
}); |
|
649 |
} |
|
650 |
return jButtonReset; |
|
651 |
} |
|
652 |
|
|
653 |
/** |
|
654 |
* This method initializes jPaneConfigurationParameters |
|
655 |
* |
|
656 |
* @return javax.swing.JPanel |
|
657 |
*/ |
|
658 |
private JPanel getJPaneConfigurationParameters() { |
|
659 |
if (jPaneConfigurationParameters == null) { |
|
660 |
jPaneConfigurationParameters = new JPanel(); |
|
661 |
jPaneConfigurationParameters.setPreferredSize(new Dimension(jPaneConfigurationParametersWidth, jPaneConfigurationParametersHeight)); |
|
662 |
jPaneConfigurationParameters.setBorder(BorderFactory.createTitledBorder(null, Messages.getText("configurationParameters"), TitledBorder.LEFT, TitledBorder.TOP, new Font("Dialog", Font.BOLD, 12), Color.black)); |
|
663 |
jPaneConfigurationParameters.add(getJPaneStartBehavior(), null); |
|
664 |
jPaneConfigurationParameters.add(getJPaneSearchBehavior(), null); |
|
665 |
jPaneConfigurationParameters.add(getJPaneCaseSensitive(), null); |
|
666 |
jPaneConfigurationParameters.add(getJPaneOnlyOneColorOnText(), null); |
|
667 |
jPaneConfigurationParameters.add(getJPaneCompleteMatchedItem(), null); |
|
668 |
jPaneConfigurationParameters.add(getJPaneUseBeep(), null); |
|
669 |
jPaneConfigurationParameters.add(getJPaneCaseAllowedRepeatedItems(), null); |
|
670 |
jPaneConfigurationParameters.add(getJPaneAllowedMouseEditionPopupMenu(), null); |
|
671 |
jPaneConfigurationParameters.add(getJPaneToForceToOnlyCoincidencesInTheSearch(), null); |
|
672 |
jPaneConfigurationParameters.add(getJPaneUseHighLight(), null); |
|
673 |
jPaneConfigurationParameters.add(getJPaneSelectAnItemWhenLosesFocus(), null); |
|
674 |
} |
|
675 |
return jPaneConfigurationParameters; |
|
676 |
} |
|
677 |
|
|
678 |
/** |
|
679 |
* This method initializes jPanelStartBehavior |
|
680 |
* |
|
681 |
* @return javax.swing.JPanel |
|
682 |
*/ |
|
683 |
private JPanel getJPaneStartBehavior() { |
|
684 |
if (jPaneStartBehavior == null) { |
|
685 |
|
|
686 |
FlowLayout flowLayout = new FlowLayout(); |
|
687 |
flowLayout.setAlignment(FlowLayout.LEFT); |
|
688 |
jPaneStartBehavior = new JPanel(); |
|
689 |
jPaneStartBehavior.setBorder(BorderFactory.createLineBorder(Color.gray, 1)); |
|
690 |
jPaneStartBehavior.setLayout(flowLayout); |
|
691 |
jPaneStartBehavior.setPreferredSize(new Dimension(subPanelWidth, subPanelHeight)); |
|
692 |
jPaneStartBehavior.add(getJComboBoxStartBehavior(), null); |
|
693 |
jPaneStartBehavior.add(getJLabelStartBehavior(), null); |
|
694 |
} |
|
695 |
return jPaneStartBehavior; |
|
696 |
} |
|
697 |
|
|
698 |
/** |
|
699 |
* This method initializes jLabelStartBehavior1 |
|
700 |
* |
|
701 |
* @return javax.swing.JLabel |
|
702 |
*/ |
|
703 |
private JLabel getJLabelStartBehavior() { |
|
704 |
if (jLabelStartBehavior == null) { |
|
705 |
jLabelStartBehavior = new JLabel(); |
|
706 |
jLabelStartBehavior.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); |
|
707 |
jLabelStartBehavior.setHorizontalAlignment(SwingConstants.RIGHT); |
|
708 |
jLabelStartBehavior.setText(Messages.getText("startConfigurationLabel")); |
|
709 |
} |
|
710 |
return jLabelStartBehavior; |
|
711 |
} |
|
712 |
|
|
713 |
/** |
|
714 |
* This method initializes jLabelSearchBehavior1 |
|
715 |
* |
|
716 |
* @return javax.swing.JLabel |
|
717 |
*/ |
|
718 |
private JLabel getJLabelSearchBehavior() { |
|
719 |
if (jLabelSearchBehavior == null) { |
|
720 |
jLabelSearchBehavior = new JLabel(); |
|
721 |
jLabelSearchBehavior.setText(Messages.getText("searchConfigurationLabel")); |
|
722 |
} |
|
723 |
return jLabelSearchBehavior; |
|
724 |
} |
|
725 |
|
|
726 |
/** |
|
727 |
* This method initializes jLabelCaseSensitive1 |
|
728 |
* |
|
729 |
* @return javax.swing.JLabel |
|
730 |
*/ |
|
731 |
private JLabel getJLabelCaseSensitive() { |
|
732 |
if (jLabelCaseSensitive == null) { |
|
733 |
jLabelCaseSensitive = new JLabel(); |
|
734 |
jLabelCaseSensitive.setText(Messages.getText("caseSensitiveConfigurationLabel")); |
|
735 |
jLabelCaseSensitive.addMouseListener(new MouseAdapter(){ |
|
736 |
/* |
|
737 |
* (non-Javadoc) |
|
738 |
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent) |
|
739 |
*/ |
|
740 |
public void mouseClicked(MouseEvent arg0) { |
|
741 |
getJCheckBoxCaseSensitive().setSelected(!getJCheckBoxCaseSensitive().isSelected()); |
|
742 |
} |
|
743 |
}); |
|
744 |
} |
|
745 |
return jLabelCaseSensitive; |
|
746 |
} |
|
747 |
|
|
748 |
/** |
|
749 |
* This method initializes jLabelOnlyOneColorOnText |
|
750 |
* |
|
751 |
* @return javax.swing.JLabel |
|
752 |
*/ |
|
753 |
private JLabel getJLabelOnlyOneColorOnText() { |
|
754 |
if (jLabelOnlyOneColorOnText == null) { |
|
755 |
jLabelOnlyOneColorOnText = new JLabel(); |
|
756 |
jLabelOnlyOneColorOnText.setText(Messages.getText("onlyOneColorOnTextConfigurationLabel")); |
|
757 |
jLabelOnlyOneColorOnText.addMouseListener(new MouseAdapter(){ |
|
758 |
/* |
|
759 |
* (non-Javadoc) |
|
760 |
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent) |
|
761 |
*/ |
|
762 |
public void mouseClicked(MouseEvent arg0) { |
|
763 |
getJCheckBoxOnlyOneColorOnText().setSelected(!getJCheckBoxOnlyOneColorOnText().isSelected()); |
|
764 |
} |
|
765 |
}); |
|
766 |
} |
|
767 |
return jLabelOnlyOneColorOnText; |
|
768 |
} |
|
769 |
|
|
770 |
/** |
|
771 |
* This method initializes jLabelCompleteMatchedItem1 |
|
772 |
* |
|
773 |
* @return javax.swing.JLabel |
|
774 |
*/ |
|
775 |
private JLabel getJLabelCompleteMatchedItem() { |
|
776 |
if (jLabelCompleteMatchedItem == null) { |
|
777 |
jLabelCompleteMatchedItem = new JLabel(); |
|
778 |
jLabelCompleteMatchedItem.setText(Messages.getText("completeMatchedItemConfigurationLabel")); |
|
779 |
jLabelCompleteMatchedItem.addMouseListener(new MouseAdapter(){ |
|
780 |
/* |
|
781 |
* (non-Javadoc) |
|
782 |
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent) |
|
783 |
*/ |
|
784 |
public void mouseClicked(MouseEvent arg0) { |
|
785 |
getJCheckBoxCompleteMatchedItem().setSelected(!getJCheckBoxCompleteMatchedItem().isSelected()); |
|
786 |
} |
|
787 |
}); |
|
788 |
} |
|
789 |
return jLabelCompleteMatchedItem; |
|
790 |
} |
|
791 |
|
|
792 |
/** |
|
793 |
* This method initializes jLabelUseBeep1 |
|
794 |
* |
|
795 |
* @return javax.swing.JLabel |
Also available in: Unified diff