1 /*******************************************************************************
2  * Copyright (c) 2000, 2016 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.tests.junit;
15 
16 import static org.junit.Assert.assertEquals;
17 import static org.junit.Assert.assertTrue;
18 
19 import org.eclipse.swt.SWT;
20 import org.eclipse.swt.events.SelectionEvent;
21 import org.eclipse.swt.events.SelectionListener;
22 import org.eclipse.swt.widgets.Canvas;
23 import org.eclipse.swt.widgets.ScrollBar;
24 import org.junit.Before;
25 import org.junit.Test;
26 
27 /**
28  * Automated Test Suite for class org.eclipse.swt.widgets.ScrollBar
29  *
30  * @see org.eclipse.swt.widgets.ScrollBar
31  */
32 public class Test_org_eclipse_swt_widgets_ScrollBar extends Test_org_eclipse_swt_widgets_Widget {
33 
34 @Override
35 @Before
setUp()36 public void setUp() {
37 	super.setUp();
38 	canvas = new Canvas(shell, SWT.H_SCROLL);
39 	scrollBar = canvas.getHorizontalBar();
40 	canvas.setSize(100,100);
41 	setWidget(scrollBar);
42 	shell.pack();
43 	shell.open();
44 }
45 
valueString(int[] intArray)46 protected String valueString(int[] intArray) {
47 	return " ("+intArray[1]+","+intArray[2]+","+intArray[3]+","+intArray[4]+")";
48 }
49 @Test
test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()50 public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener() {
51 	listenerCalled = false;
52 	boolean exceptionThrown = false;
53 	SelectionListener listener = new SelectionListener() {
54 		@Override
55 		public void widgetSelected(SelectionEvent event) {
56 			listenerCalled = true;
57 		}
58 		@Override
59 		public void widgetDefaultSelected(SelectionEvent event) {
60 		}
61 	};
62 	try {
63 		scrollBar.addSelectionListener(null);
64 	}
65 	catch (IllegalArgumentException e) {
66 		exceptionThrown = true;
67 	}
68 	assertTrue("Expected exception not thrown", exceptionThrown);
69 	exceptionThrown = false;
70 	scrollBar.addSelectionListener(listener);
71 	scrollBar.setSelection(100);
72 	assertTrue(":a:", listenerCalled == false);
73 	scrollBar.removeSelectionListener(listener);
74 	try {
75 		scrollBar.removeSelectionListener(null);
76 	}
77 	catch (IllegalArgumentException e) {
78 		exceptionThrown = true;
79 	}
80 	assertTrue("Expected exception not thrown", exceptionThrown);
81 }
82 
83 @Test
test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_events_SelectionListener()84 public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_events_SelectionListener() {
85 	listenerCalled = false;
86 	SelectionListener listener = SelectionListener.widgetSelectedAdapter(e -> listenerCalled = true);
87 
88 	scrollBar.addSelectionListener(listener);
89 	scrollBar.setSelection(100);
90 	assertTrue(":a:", listenerCalled == false);
91 	scrollBar.removeSelectionListener(listener);
92 }
93 
94 @Test
test_getParent()95 public void test_getParent() {
96 	assertEquals(canvas, scrollBar.getParent());
97 }
98 
99 @Test
test_getSize()100 public void test_getSize() {
101 	assertTrue(scrollBar.getSize().x > 0);
102 	assertTrue(scrollBar.getSize().y > 0);
103 }
104 
105 @Test
test_isEnabled()106 public void test_isEnabled() {
107 	scrollBar.setEnabled(true);
108 	assertTrue(scrollBar.isEnabled());
109 
110 	scrollBar.setEnabled(false);
111 	assertTrue(!scrollBar.isEnabled());
112 }
113 
114 @Test
test_isVisible()115 public void test_isVisible() {
116 	scrollBar.setVisible(true);
117 	assertTrue(scrollBar.isVisible());
118 	scrollBar.setVisible(false);
119 	assertTrue(!scrollBar.isVisible());
120 }
121 
122 @Test
test_setEnabledZ()123 public void test_setEnabledZ() {
124 	scrollBar.setEnabled(true);
125 	assertTrue(scrollBar.getEnabled());
126 
127 	scrollBar.setEnabled(false);
128 	assertTrue(!scrollBar.getEnabled());
129 }
130 
131 @Test
test_setIncrementI()132 public void test_setIncrementI() {
133 	int[] cases = {1, 10, 10000};
134 	for (int value : cases) {
135 		scrollBar.setIncrement(value);
136 		assertEquals(value, scrollBar.getIncrement());
137 	}
138 
139 	scrollBar.setIncrement(25);
140 	scrollBar.setIncrement(0); // setting to 0 fails silently
141 	assertEquals(25, scrollBar.getIncrement());
142 }
143 
144 @Test
test_setMaximumI()145 public void test_setMaximumI(){
146 	int [][] testValues = getSetMaximumValues();
147 
148 	for (int[] intArray : testValues) {
149 		setDefaults();
150 		scrollBar.setMaximum(intArray[0]);
151 		String valueString = valueString(intArray);
152 		report("setMax "+intArray[0]+ valueString, intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
153 	}
154 }
155 
156 @Test
test_setMinimumI()157 public void test_setMinimumI(){
158 	int [][] testValues = getSetMinimumValues();
159 
160 	for (int[] intArray : testValues) {
161 		setDefaults();
162 		scrollBar.setMinimum(intArray[0]);
163 		String valueString = valueString(intArray);
164 		report("setMin "+intArray[0]+valueString, intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
165 	}
166 }
167 
168 @Test
test_setPageIncrementI()169 public void test_setPageIncrementI(){
170 	int[] cases = {1, 10, 10000};
171 	for (int value : cases) {
172 		scrollBar.setPageIncrement(value);
173 		assertEquals(scrollBar.getPageIncrement(), value);
174 	}
175 
176 	scrollBar.setPageIncrement(25);
177 	scrollBar.setPageIncrement(0); // setting to 0 fails silently
178 	assertEquals(25, scrollBar.getPageIncrement());
179 }
180 
181 @Test
test_setSelectionI()182 public void test_setSelectionI(){
183 	int [][] testValues = getSetSelectionValues();
184 	for (int[] intArray : testValues) {
185 		setDefaults();
186 		scrollBar.setSelection(intArray[0]);
187 		String valueString = valueString(intArray);
188 		report("setSel "+intArray[0]+valueString,intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
189 	}
190 }
191 
192 @Test
test_setThumbI()193 public void test_setThumbI(){
194 	int [][] testValues = getSetThumbValues();
195 	for (int[] intArray : testValues) {
196 		setDefaults();
197 		scrollBar.setThumb(intArray[0]);
198 		String valueString = valueString(intArray);
199 		report("setThmb "+intArray[0]+valueString,intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
200 	}
201 }
202 
203 @Test
test_setValuesIIIIII()204 public void test_setValuesIIIIII() {
205 	scrollBar.setValues(10, 10, 50, 2, 5, 10);
206 	assertTrue(":a:", scrollBar.getSelection() == 10);
207 	assertTrue(":b:", scrollBar.getMinimum() == 10);
208 	assertTrue(":c:", scrollBar.getMaximum() == 50);
209 	assertTrue(":d:", scrollBar.getThumb() == 2);
210 	assertTrue(":e:", scrollBar.getIncrement() == 5);
211 	assertTrue(":f:", scrollBar.getPageIncrement() == 10);
212 }
213 
214 @Test
test_setVisibleZ()215 public void test_setVisibleZ() {
216 	scrollBar.setVisible(true);
217 	assertTrue(scrollBar.getVisible());
218 
219 	scrollBar.setVisible(false);
220 	assertTrue(!scrollBar.getVisible());
221 }
222 
223 /* custom */
224 ScrollBar scrollBar;
225 Canvas canvas;
226 
227 // this method must be private or protected so the auto-gen tool keeps it
report(String call, int set, int minExpected, int maxExpected, int selectionExpected, int thumbExpected)228 private void report(String call, int set, int minExpected, int maxExpected, int selectionExpected, int thumbExpected) {
229 	// Uncomment these lines and comment out call to check() if you want the test to report all errors without
230 	// stopping.
231 //	if (scrollBar.getMinimum() != minExpected) {
232 //		System.out.println(call + " : Minimum Expected: " + minExpected + "  Actual: " + scrollBar.getMinimum());
233 //	}
234 //	if (scrollBar.getMaximum() != maxExpected){
235 //		System.out.println(call + " : Maximum Expected: " + maxExpected + "  Actual: " + scrollBar.getMaximum());
236 //	}
237 //	if (scrollBar.getSelection() != selectionExpected) {
238 //		System.out.println(call + " : Selection Expected: " + selectionExpected + "  Actual: " + scrollBar.getSelection());
239 //	}
240 //	if (scrollBar.getThumb() != thumbExpected) {
241 //		System.out.println(call + " : Thumb Expected: " + thumbExpected + "  Actual: " + scrollBar.getThumb());
242 //	}
243 	check(call, minExpected, maxExpected, selectionExpected, thumbExpected);
244 }
245 // this method must be private or protected so the auto-gen tool keeps it
check(String call, int minExpected, int maxExpected, int selectionExpected, int thumbExpected)246 private void check(String call, int minExpected, int maxExpected, int selectionExpected, int thumbExpected) {
247 	assertEquals(call+" max ", maxExpected, scrollBar.getMaximum());
248 	assertEquals(call+" min ", minExpected, scrollBar.getMinimum());
249 	assertEquals(call+" sel ", selectionExpected, scrollBar.getSelection());
250 	assertEquals(call+" thmb ", thumbExpected, scrollBar.getThumb());
251 }
252 // this method must be private or protected so the auto-gen tool keeps it
getSetThumbValues()253 private int[][] getSetThumbValues() {
254 return new int[][] {
255 {-15, 10, 100, 50, 10},
256 {-14, 10, 100, 50, 10},
257 {-13, 10, 100, 50, 10},
258 {-12, 10, 100, 50, 10},
259 {-11, 10, 100, 50, 10},
260 {-10, 10, 100, 50, 10},
261 {-9, 10, 100, 50, 10},
262 {-8, 10, 100, 50, 10},
263 {-7, 10, 100, 50, 10},
264 {-6, 10, 100, 50, 10},
265 {-5, 10, 100, 50, 10},
266 {-4, 10, 100, 50, 10},
267 {-3, 10, 100, 50, 10},
268 {-2, 10, 100, 50, 10},
269 {-1, 10, 100, 50, 10},
270 {0, 10, 100, 50, 10},
271 {1, 10, 100, 50, 1},
272 {2, 10, 100, 50, 2},
273 {3, 10, 100, 50, 3},
274 {4, 10, 100, 50, 4},
275 {5, 10, 100, 50, 5},
276 {6, 10, 100, 50, 6},
277 {7, 10, 100, 50, 7},
278 {8, 10, 100, 50, 8},
279 {9, 10, 100, 50, 9},
280 {10, 10, 100, 50, 10},
281 {11, 10, 100, 50, 11},
282 {12, 10, 100, 50, 12},
283 {13, 10, 100, 50, 13},
284 {14, 10, 100, 50, 14},
285 {15, 10, 100, 50, 15},
286 {16, 10, 100, 50, 16},
287 {17, 10, 100, 50, 17},
288 {18, 10, 100, 50, 18},
289 {19, 10, 100, 50, 19},
290 {20, 10, 100, 50, 20},
291 {21, 10, 100, 50, 21},
292 {22, 10, 100, 50, 22},
293 {23, 10, 100, 50, 23},
294 {24, 10, 100, 50, 24},
295 {25, 10, 100, 50, 25},
296 {26, 10, 100, 50, 26},
297 {27, 10, 100, 50, 27},
298 {28, 10, 100, 50, 28},
299 {29, 10, 100, 50, 29},
300 {30, 10, 100, 50, 30},
301 {31, 10, 100, 50, 31},
302 {32, 10, 100, 50, 32},
303 {33, 10, 100, 50, 33},
304 {34, 10, 100, 50, 34},
305 {35, 10, 100, 50, 35},
306 {36, 10, 100, 50, 36},
307 {37, 10, 100, 50, 37},
308 {38, 10, 100, 50, 38},
309 {39, 10, 100, 50, 39},
310 {40, 10, 100, 50, 40},
311 {41, 10, 100, 50, 41},
312 {42, 10, 100, 50, 42},
313 {43, 10, 100, 50, 43},
314 {44, 10, 100, 50, 44},
315 {45, 10, 100, 50, 45},
316 {46, 10, 100, 50, 46},
317 {47, 10, 100, 50, 47},
318 {48, 10, 100, 50, 48},
319 {49, 10, 100, 50, 49},
320 {50, 10, 100, 50, 50},
321 {51, 10, 100, 49, 51},
322 {52, 10, 100, 48, 52},
323 {53, 10, 100, 47, 53},
324 {54, 10, 100, 46, 54},
325 {55, 10, 100, 45, 55},
326 {56, 10, 100, 44, 56},
327 {57, 10, 100, 43, 57},
328 {58, 10, 100, 42, 58},
329 {59, 10, 100, 41, 59},
330 {60, 10, 100, 40, 60},
331 {61, 10, 100, 39, 61},
332 {62, 10, 100, 38, 62},
333 {63, 10, 100, 37, 63},
334 {64, 10, 100, 36, 64},
335 {65, 10, 100, 35, 65},
336 {66, 10, 100, 34, 66},
337 {67, 10, 100, 33, 67},
338 {68, 10, 100, 32, 68},
339 {69, 10, 100, 31, 69},
340 {70, 10, 100, 30, 70},
341 {71, 10, 100, 29, 71},
342 {72, 10, 100, 28, 72},
343 {73, 10, 100, 27, 73},
344 {74, 10, 100, 26, 74},
345 {75, 10, 100, 25, 75},
346 {76, 10, 100, 24, 76},
347 {77, 10, 100, 23, 77},
348 {78, 10, 100, 22, 78},
349 {79, 10, 100, 21, 79},
350 {80, 10, 100, 20, 80},
351 {81, 10, 100, 19, 81},
352 {82, 10, 100, 18, 82},
353 {83, 10, 100, 17, 83},
354 {84, 10, 100, 16, 84},
355 {85, 10, 100, 15, 85},
356 {86, 10, 100, 14, 86},
357 {87, 10, 100, 13, 87},
358 {88, 10, 100, 12, 88},
359 {89, 10, 100, 11, 89},
360 {90, 10, 100, 10, 90},
361 {91, 10, 100, 10, 90},
362 {92, 10, 100, 10, 90},
363 {93, 10, 100, 10, 90},
364 {94, 10, 100, 10, 90},
365 {95, 10, 100, 10, 90},
366 {96, 10, 100, 10, 90},
367 {97, 10, 100, 10, 90},
368 {98, 10, 100, 10, 90},
369 {99, 10, 100, 10, 90},
370 {100, 10, 100, 10, 90},
371 {101, 10, 100, 10, 90},
372 {102, 10, 100, 10, 90},
373 {103, 10, 100, 10, 90},
374 {104, 10, 100, 10, 90},
375 {105, 10, 100, 10, 90},
376 {106, 10, 100, 10, 90},
377 {107, 10, 100, 10, 90},
378 {108, 10, 100, 10, 90},
379 {109, 10, 100, 10, 90},
380 {110, 10, 100, 10, 90},
381 {111, 10, 100, 10, 90},
382 {112, 10, 100, 10, 90},
383 {113, 10, 100, 10, 90},
384 {114, 10, 100, 10, 90},
385 {115, 10, 100, 10, 90},
386 {116, 10, 100, 10, 90},
387 {117, 10, 100, 10, 90},
388 {118, 10, 100, 10, 90},
389 {119, 10, 100, 10, 90},
390 {120, 10, 100, 10, 90},
391 {121, 10, 100, 10, 90},
392 {122, 10, 100, 10, 90},
393 {123, 10, 100, 10, 90},
394 {124, 10, 100, 10, 90},
395 };
396 }
397 // this method must be private or protected so the auto-gen tool keeps it
getSetMinimumValues()398 private int[][] getSetMinimumValues() {
399 return new int[][] {
400 {-15, 10, 100, 50, 10},
401 {-14, 10, 100, 50, 10},
402 {-13, 10, 100, 50, 10},
403 {-12, 10, 100, 50, 10},
404 {-11, 10, 100, 50, 10},
405 {-10, 10, 100, 50, 10},
406 {-9, 10, 100, 50, 10},
407 {-8, 10, 100, 50, 10},
408 {-7, 10, 100, 50, 10},
409 {-6, 10, 100, 50, 10},
410 {-5, 10, 100, 50, 10},
411 {-4, 10, 100, 50, 10},
412 {-3, 10, 100, 50, 10},
413 {-2, 10, 100, 50, 10},
414 {-1, 10, 100, 50, 10},
415 {0, 0, 100, 50, 10},
416 {1, 1, 100, 50, 10},
417 {2, 2, 100, 50, 10},
418 {3, 3, 100, 50, 10},
419 {4, 4, 100, 50, 10},
420 {5, 5, 100, 50, 10},
421 {6, 6, 100, 50, 10},
422 {7, 7, 100, 50, 10},
423 {8, 8, 100, 50, 10},
424 {9, 9, 100, 50, 10},
425 {10, 10, 100, 50, 10},
426 {11, 11, 100, 50, 10},
427 {12, 12, 100, 50, 10},
428 {13, 13, 100, 50, 10},
429 {14, 14, 100, 50, 10},
430 {15, 15, 100, 50, 10},
431 {16, 16, 100, 50, 10},
432 {17, 17, 100, 50, 10},
433 {18, 18, 100, 50, 10},
434 {19, 19, 100, 50, 10},
435 {20, 20, 100, 50, 10},
436 {21, 21, 100, 50, 10},
437 {22, 22, 100, 50, 10},
438 {23, 23, 100, 50, 10},
439 {24, 24, 100, 50, 10},
440 {25, 25, 100, 50, 10},
441 {26, 26, 100, 50, 10},
442 {27, 27, 100, 50, 10},
443 {28, 28, 100, 50, 10},
444 {29, 29, 100, 50, 10},
445 {30, 30, 100, 50, 10},
446 {31, 31, 100, 50, 10},
447 {32, 32, 100, 50, 10},
448 {33, 33, 100, 50, 10},
449 {34, 34, 100, 50, 10},
450 {35, 35, 100, 50, 10},
451 {36, 36, 100, 50, 10},
452 {37, 37, 100, 50, 10},
453 {38, 38, 100, 50, 10},
454 {39, 39, 100, 50, 10},
455 {40, 40, 100, 50, 10},
456 {41, 41, 100, 50, 10},
457 {42, 42, 100, 50, 10},
458 {43, 43, 100, 50, 10},
459 {44, 44, 100, 50, 10},
460 {45, 45, 100, 50, 10},
461 {46, 46, 100, 50, 10},
462 {47, 47, 100, 50, 10},
463 {48, 48, 100, 50, 10},
464 {49, 49, 100, 50, 10},
465 {50, 50, 100, 50, 10},
466 {51, 51, 100, 51, 10},
467 {52, 52, 100, 52, 10},
468 {53, 53, 100, 53, 10},
469 {54, 54, 100, 54, 10},
470 {55, 55, 100, 55, 10},
471 {56, 56, 100, 56, 10},
472 {57, 57, 100, 57, 10},
473 {58, 58, 100, 58, 10},
474 {59, 59, 100, 59, 10},
475 {60, 60, 100, 60, 10},
476 {61, 61, 100, 61, 10},
477 {62, 62, 100, 62, 10},
478 {63, 63, 100, 63, 10},
479 {64, 64, 100, 64, 10},
480 {65, 65, 100, 65, 10},
481 {66, 66, 100, 66, 10},
482 {67, 67, 100, 67, 10},
483 {68, 68, 100, 68, 10},
484 {69, 69, 100, 69, 10},
485 {70, 70, 100, 70, 10},
486 {71, 71, 100, 71, 10},
487 {72, 72, 100, 72, 10},
488 {73, 73, 100, 73, 10},
489 {74, 74, 100, 74, 10},
490 {75, 75, 100, 75, 10},
491 {76, 76, 100, 76, 10},
492 {77, 77, 100, 77, 10},
493 {78, 78, 100, 78, 10},
494 {79, 79, 100, 79, 10},
495 {80, 80, 100, 80, 10},
496 {81, 81, 100, 81, 10},
497 {82, 82, 100, 82, 10},
498 {83, 83, 100, 83, 10},
499 {84, 84, 100, 84, 10},
500 {85, 85, 100, 85, 10},
501 {86, 86, 100, 86, 10},
502 {87, 87, 100, 87, 10},
503 {88, 88, 100, 88, 10},
504 {89, 89, 100, 89, 10},
505 {90, 90, 100, 90, 10},
506 {91, 91, 100, 91, 9},
507 {92, 92, 100, 92, 8},
508 {93, 93, 100, 93, 7},
509 {94, 94, 100, 94, 6},
510 {95, 95, 100, 95, 5},
511 {96, 96, 100, 96, 4},
512 {97, 97, 100, 97, 3},
513 {98, 98, 100, 98, 2},
514 {99, 99, 100, 99, 1},
515 {100, 10, 100, 50, 10},
516 {101, 10, 100, 50, 10},
517 {102, 10, 100, 50, 10},
518 {103, 10, 100, 50, 10},
519 {104, 10, 100, 50, 10},
520 {105, 10, 100, 50, 10},
521 {106, 10, 100, 50, 10},
522 {107, 10, 100, 50, 10},
523 {108, 10, 100, 50, 10},
524 {109, 10, 100, 50, 10},
525 {110, 10, 100, 50, 10},
526 {111, 10, 100, 50, 10},
527 {112, 10, 100, 50, 10},
528 {113, 10, 100, 50, 10},
529 {114, 10, 100, 50, 10},
530 {115, 10, 100, 50, 10},
531 {116, 10, 100, 50, 10},
532 {117, 10, 100, 50, 10},
533 {118, 10, 100, 50, 10},
534 {119, 10, 100, 50, 10},
535 {120, 10, 100, 50, 10},
536 {121, 10, 100, 50, 10},
537 {122, 10, 100, 50, 10},
538 {123, 10, 100, 50, 10},
539 {124, 10, 100, 50, 10},
540 };
541 }
542 // this method must be private or protected so the auto-gen tool keeps it
getSetMaximumValues()543 private int[][] getSetMaximumValues() {
544 return new int[][] {
545 {-15, 10, 100, 50, 10},
546 {-14, 10, 100, 50, 10},
547 {-13, 10, 100, 50, 10},
548 {-12, 10, 100, 50, 10},
549 {-11, 10, 100, 50, 10},
550 {-10, 10, 100, 50, 10},
551 {-9, 10, 100, 50, 10},
552 {-8, 10, 100, 50, 10},
553 {-7, 10, 100, 50, 10},
554 {-6, 10, 100, 50, 10},
555 {-5, 10, 100, 50, 10},
556 {-4, 10, 100, 50, 10},
557 {-3, 10, 100, 50, 10},
558 {-2, 10, 100, 50, 10},
559 {-1, 10, 100, 50, 10},
560 {0, 10, 100, 50, 10},
561 {1, 10, 100, 50, 10},
562 {2, 10, 100, 50, 10},
563 {3, 10, 100, 50, 10},
564 {4, 10, 100, 50, 10},
565 {5, 10, 100, 50, 10},
566 {6, 10, 100, 50, 10},
567 {7, 10, 100, 50, 10},
568 {8, 10, 100, 50, 10},
569 {9, 10, 100, 50, 10},
570 {10, 10, 100, 50, 10},
571 {11, 10, 11, 10, 1},
572 {12, 10, 12, 10, 2},
573 {13, 10, 13, 10, 3},
574 {14, 10, 14, 10, 4},
575 {15, 10, 15, 10, 5},
576 {16, 10, 16, 10, 6},
577 {17, 10, 17, 10, 7},
578 {18, 10, 18, 10, 8},
579 {19, 10, 19, 10, 9},
580 {20, 10, 20, 10, 10},
581 {21, 10, 21, 11, 10},
582 {22, 10, 22, 12, 10},
583 {23, 10, 23, 13, 10},
584 {24, 10, 24, 14, 10},
585 {25, 10, 25, 15, 10},
586 {26, 10, 26, 16, 10},
587 {27, 10, 27, 17, 10},
588 {28, 10, 28, 18, 10},
589 {29, 10, 29, 19, 10},
590 {30, 10, 30, 20, 10},
591 {31, 10, 31, 21, 10},
592 {32, 10, 32, 22, 10},
593 {33, 10, 33, 23, 10},
594 {34, 10, 34, 24, 10},
595 {35, 10, 35, 25, 10},
596 {36, 10, 36, 26, 10},
597 {37, 10, 37, 27, 10},
598 {38, 10, 38, 28, 10},
599 {39, 10, 39, 29, 10},
600 {40, 10, 40, 30, 10},
601 {41, 10, 41, 31, 10},
602 {42, 10, 42, 32, 10},
603 {43, 10, 43, 33, 10},
604 {44, 10, 44, 34, 10},
605 {45, 10, 45, 35, 10},
606 {46, 10, 46, 36, 10},
607 {47, 10, 47, 37, 10},
608 {48, 10, 48, 38, 10},
609 {49, 10, 49, 39, 10},
610 {50, 10, 50, 40, 10},
611 {51, 10, 51, 41, 10},
612 {52, 10, 52, 42, 10},
613 {53, 10, 53, 43, 10},
614 {54, 10, 54, 44, 10},
615 {55, 10, 55, 45, 10},
616 {56, 10, 56, 46, 10},
617 {57, 10, 57, 47, 10},
618 {58, 10, 58, 48, 10},
619 {59, 10, 59, 49, 10},
620 {60, 10, 60, 50, 10},
621 {61, 10, 61, 50, 10},
622 {62, 10, 62, 50, 10},
623 {63, 10, 63, 50, 10},
624 {64, 10, 64, 50, 10},
625 {65, 10, 65, 50, 10},
626 {66, 10, 66, 50, 10},
627 {67, 10, 67, 50, 10},
628 {68, 10, 68, 50, 10},
629 {69, 10, 69, 50, 10},
630 {70, 10, 70, 50, 10},
631 {71, 10, 71, 50, 10},
632 {72, 10, 72, 50, 10},
633 {73, 10, 73, 50, 10},
634 {74, 10, 74, 50, 10},
635 {75, 10, 75, 50, 10},
636 {76, 10, 76, 50, 10},
637 {77, 10, 77, 50, 10},
638 {78, 10, 78, 50, 10},
639 {79, 10, 79, 50, 10},
640 {80, 10, 80, 50, 10},
641 {81, 10, 81, 50, 10},
642 {82, 10, 82, 50, 10},
643 {83, 10, 83, 50, 10},
644 {84, 10, 84, 50, 10},
645 {85, 10, 85, 50, 10},
646 {86, 10, 86, 50, 10},
647 {87, 10, 87, 50, 10},
648 {88, 10, 88, 50, 10},
649 {89, 10, 89, 50, 10},
650 {90, 10, 90, 50, 10},
651 {91, 10, 91, 50, 10},
652 {92, 10, 92, 50, 10},
653 {93, 10, 93, 50, 10},
654 {94, 10, 94, 50, 10},
655 {95, 10, 95, 50, 10},
656 {96, 10, 96, 50, 10},
657 {97, 10, 97, 50, 10},
658 {98, 10, 98, 50, 10},
659 {99, 10, 99, 50, 10},
660 {100, 10, 100, 50, 10},
661 {101, 10, 101, 50, 10},
662 {102, 10, 102, 50, 10},
663 {103, 10, 103, 50, 10},
664 {104, 10, 104, 50, 10},
665 {105, 10, 105, 50, 10},
666 {106, 10, 106, 50, 10},
667 {107, 10, 107, 50, 10},
668 {108, 10, 108, 50, 10},
669 {109, 10, 109, 50, 10},
670 {110, 10, 110, 50, 10},
671 {111, 10, 111, 50, 10},
672 {112, 10, 112, 50, 10},
673 {113, 10, 113, 50, 10},
674 {114, 10, 114, 50, 10},
675 {115, 10, 115, 50, 10},
676 {116, 10, 116, 50, 10},
677 {117, 10, 117, 50, 10},
678 {118, 10, 118, 50, 10},
679 {119, 10, 119, 50, 10},
680 {120, 10, 120, 50, 10},
681 {121, 10, 121, 50, 10},
682 {122, 10, 122, 50, 10},
683 {123, 10, 123, 50, 10},
684 {124, 10, 124, 50, 10},
685 };
686 }
687 // this method must be private or protected so the auto-gen tool keeps it
setDefaults()688 private void setDefaults() {
689 	scrollBar.setMaximum(100);
690 	scrollBar.setMinimum(10);
691 	scrollBar.setThumb(10);
692 	scrollBar.setSelection(50);
693 }
694 // this method must be private or protected so the auto-gen tool keeps it
getSetSelectionValues()695 private int[][] getSetSelectionValues() {
696 return new int[][] {
697 {-15, 10, 100, 10, 10},
698 {-14, 10, 100, 10, 10},
699 {-13, 10, 100, 10, 10},
700 {-12, 10, 100, 10, 10},
701 {-11, 10, 100, 10, 10},
702 {-10, 10, 100, 10, 10},
703 {-9, 10, 100, 10, 10},
704 {-8, 10, 100, 10, 10},
705 {-7, 10, 100, 10, 10},
706 {-6, 10, 100, 10, 10},
707 {-5, 10, 100, 10, 10},
708 {-4, 10, 100, 10, 10},
709 {-3, 10, 100, 10, 10},
710 {-2, 10, 100, 10, 10},
711 {-1, 10, 100, 10, 10},
712 {0, 10, 100, 10, 10},
713 {1, 10, 100, 10, 10},
714 {2, 10, 100, 10, 10},
715 {3, 10, 100, 10, 10},
716 {4, 10, 100, 10, 10},
717 {5, 10, 100, 10, 10},
718 {6, 10, 100, 10, 10},
719 {7, 10, 100, 10, 10},
720 {8, 10, 100, 10, 10},
721 {9, 10, 100, 10, 10},
722 {10, 10, 100, 10, 10},
723 {11, 10, 100, 11, 10},
724 {12, 10, 100, 12, 10},
725 {13, 10, 100, 13, 10},
726 {14, 10, 100, 14, 10},
727 {15, 10, 100, 15, 10},
728 {16, 10, 100, 16, 10},
729 {17, 10, 100, 17, 10},
730 {18, 10, 100, 18, 10},
731 {19, 10, 100, 19, 10},
732 {20, 10, 100, 20, 10},
733 {21, 10, 100, 21, 10},
734 {22, 10, 100, 22, 10},
735 {23, 10, 100, 23, 10},
736 {24, 10, 100, 24, 10},
737 {25, 10, 100, 25, 10},
738 {26, 10, 100, 26, 10},
739 {27, 10, 100, 27, 10},
740 {28, 10, 100, 28, 10},
741 {29, 10, 100, 29, 10},
742 {30, 10, 100, 30, 10},
743 {31, 10, 100, 31, 10},
744 {32, 10, 100, 32, 10},
745 {33, 10, 100, 33, 10},
746 {34, 10, 100, 34, 10},
747 {35, 10, 100, 35, 10},
748 {36, 10, 100, 36, 10},
749 {37, 10, 100, 37, 10},
750 {38, 10, 100, 38, 10},
751 {39, 10, 100, 39, 10},
752 {40, 10, 100, 40, 10},
753 {41, 10, 100, 41, 10},
754 {42, 10, 100, 42, 10},
755 {43, 10, 100, 43, 10},
756 {44, 10, 100, 44, 10},
757 {45, 10, 100, 45, 10},
758 {46, 10, 100, 46, 10},
759 {47, 10, 100, 47, 10},
760 {48, 10, 100, 48, 10},
761 {49, 10, 100, 49, 10},
762 {50, 10, 100, 50, 10},
763 {51, 10, 100, 51, 10},
764 {52, 10, 100, 52, 10},
765 {53, 10, 100, 53, 10},
766 {54, 10, 100, 54, 10},
767 {55, 10, 100, 55, 10},
768 {56, 10, 100, 56, 10},
769 {57, 10, 100, 57, 10},
770 {58, 10, 100, 58, 10},
771 {59, 10, 100, 59, 10},
772 {60, 10, 100, 60, 10},
773 {61, 10, 100, 61, 10},
774 {62, 10, 100, 62, 10},
775 {63, 10, 100, 63, 10},
776 {64, 10, 100, 64, 10},
777 {65, 10, 100, 65, 10},
778 {66, 10, 100, 66, 10},
779 {67, 10, 100, 67, 10},
780 {68, 10, 100, 68, 10},
781 {69, 10, 100, 69, 10},
782 {70, 10, 100, 70, 10},
783 {71, 10, 100, 71, 10},
784 {72, 10, 100, 72, 10},
785 {73, 10, 100, 73, 10},
786 {74, 10, 100, 74, 10},
787 {75, 10, 100, 75, 10},
788 {76, 10, 100, 76, 10},
789 {77, 10, 100, 77, 10},
790 {78, 10, 100, 78, 10},
791 {79, 10, 100, 79, 10},
792 {80, 10, 100, 80, 10},
793 {81, 10, 100, 81, 10},
794 {82, 10, 100, 82, 10},
795 {83, 10, 100, 83, 10},
796 {84, 10, 100, 84, 10},
797 {85, 10, 100, 85, 10},
798 {86, 10, 100, 86, 10},
799 {87, 10, 100, 87, 10},
800 {88, 10, 100, 88, 10},
801 {89, 10, 100, 89, 10},
802 {90, 10, 100, 90, 10},
803 {91, 10, 100, 90, 10},
804 {92, 10, 100, 90, 10},
805 {93, 10, 100, 90, 10},
806 {94, 10, 100, 90, 10},
807 {95, 10, 100, 90, 10},
808 {96, 10, 100, 90, 10},
809 {97, 10, 100, 90, 10},
810 {98, 10, 100, 90, 10},
811 {99, 10, 100, 90, 10},
812 {100, 10, 100, 90, 10},
813 {101, 10, 100, 90, 10},
814 {102, 10, 100, 90, 10},
815 {103, 10, 100, 90, 10},
816 {104, 10, 100, 90, 10},
817 {105, 10, 100, 90, 10},
818 {106, 10, 100, 90, 10},
819 {107, 10, 100, 90, 10},
820 {108, 10, 100, 90, 10},
821 {109, 10, 100, 90, 10},
822 {110, 10, 100, 90, 10},
823 {111, 10, 100, 90, 10},
824 {112, 10, 100, 90, 10},
825 {113, 10, 100, 90, 10},
826 {114, 10, 100, 90, 10},
827 {115, 10, 100, 90, 10},
828 {116, 10, 100, 90, 10},
829 {117, 10, 100, 90, 10},
830 {118, 10, 100, 90, 10},
831 {119, 10, 100, 90, 10},
832 {120, 10, 100, 90, 10},
833 {121, 10, 100, 90, 10},
834 {122, 10, 100, 90, 10},
835 {123, 10, 100, 90, 10},
836 {124, 10, 100, 90, 10},
837 };
838 }
839 }
840