KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > form > layoutdesign > ALT_BorderPositions01Test


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.form.layoutdesign;
21
22 import java.awt.Dimension JavaDoc;
23 import java.awt.Point JavaDoc;
24 import java.awt.Rectangle JavaDoc;
25 import java.io.File JavaDoc;
26 import java.io.IOException JavaDoc;
27 import java.util.*;
28 import org.openide.filesystems.FileUtil;
29
30 // Manipulating component at the border - without a gap.
31
public class ALT_BorderPositions01Test extends LayoutTestCase {
32
33     public ALT_BorderPositions01Test(String JavaDoc name) {
34         super(name);
35         try {
36         className = this.getClass().getName();
37         className = className.substring(className.lastIndexOf('.') + 1, className.length());
38             startingFormFile = FileUtil.toFileObject(new File JavaDoc(url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile());
39         } catch (IOException JavaDoc ioe) {
40             fail(ioe.toString());
41         }
42     }
43
44     // Position panel in the top left corner (no gap).
45
public void doChanges0() {
46         ld.externalSizeChangeHappened();
47         // > UPDATE CURRENT STATE
48
contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
49         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
50         ld.updateCurrentState();
51         // < UPDATE CURRENT STATE
52
lc = new LayoutComponent("jPanel1", true, 100, 100);
53         // > START ADDING
54
baselinePosition.put("jPanel1-100-100", new Integer JavaDoc(0));
55         {
56             LayoutComponent[] comps = new LayoutComponent[] { lc };
57             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
58                 new Rectangle JavaDoc(0, 0, 100, 100)
59                 };
60             String JavaDoc defaultContId = null;
61             Point JavaDoc hotspot = new Point JavaDoc(46,50);
62             ld.startAdding(comps, bounds, hotspot, defaultContId);
63         }
64         // < START ADDING
65
prefPaddingInParent.put("Form-jPanel1-1-0", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
66
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
67
prefPaddingInParent.put("Form-jPanel1-0-0", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
68
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
69
// > MOVE
70
{
71             Point JavaDoc p = new Point JavaDoc(45,51);
72             String JavaDoc containerId= "Form";
73             boolean autoPositioning = true;
74             boolean lockDimension = false;
75             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
76                 new Rectangle JavaDoc(0, 0, 100, 100)
77                 };
78             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
79         }
80         // < MOVE
81
prefPaddingInParent.put("Form-jPanel1-1-0", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
82
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
83
prefPaddingInParent.put("Form-jPanel1-0-0", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
84
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
85
// > MOVE
86
{
87             Point JavaDoc p = new Point JavaDoc(44,51);
88             String JavaDoc containerId= "Form";
89             boolean autoPositioning = true;
90             boolean lockDimension = false;
91             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
92                 new Rectangle JavaDoc(0, 0, 100, 100)
93                 };
94             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
95         }
96         // < MOVE
97
// > END MOVING
98
compPrefSize.put("jPanel1", new Dimension JavaDoc(100, 100));
99         compPrefSize.put("jPanel1", new Dimension JavaDoc(100, 100));
100         prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
101
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
102
ld.endMoving(true);
103         // < END MOVING
104
ld.externalSizeChangeHappened();
105         // > UPDATE CURRENT STATE
106
contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 100, 100));
107         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 100, 100));
108         baselinePosition.put("jPanel1-100-100", new Integer JavaDoc(0));
109         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
110         compPrefSize.put("jPanel1", new Dimension JavaDoc(100, 100));
111         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
112         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
113         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
114         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 100, 100));
115         baselinePosition.put("jPanel1-100-100", new Integer JavaDoc(0));
116         contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 100, 100));
117         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
118         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 100, 100));
119         baselinePosition.put("jPanel1-100-100", new Integer JavaDoc(0));
120         ld.updateCurrentState();
121         // < UPDATE CURRENT STATE
122
}
123
124     // Resize panel slightly to the right, then down.
125
public void doChanges1() {
126         // > START RESIZING
127
baselinePosition.put("jPanel1-100-100", new Integer JavaDoc(0));
128         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
129         {
130             String JavaDoc[] compIds = new String JavaDoc[] {
131                 "jPanel1"
132                 };
133             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
134                 new Rectangle JavaDoc(0, 0, 100, 100)
135                 };
136             Point JavaDoc hotspot = new Point JavaDoc(100,50);
137             int[] resizeEdges = new int[] {
138                 1,
139                     -1
140                 };
141             boolean inLayout = true;
142             ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout);
143         }
144         // < START RESIZING
145
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
146
// > MOVE
147
{
148             Point JavaDoc p = new Point JavaDoc(115,52);
149             String JavaDoc containerId= "Form";
150             boolean autoPositioning = true;
151             boolean lockDimension = false;
152             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
153                 new Rectangle JavaDoc(0, 0, 115, 100)
154                 };
155             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
156         }
157         // < MOVE
158
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
159
// > MOVE
160
{
161             Point JavaDoc p = new Point JavaDoc(116,52);
162             String JavaDoc containerId= "Form";
163             boolean autoPositioning = true;
164             boolean lockDimension = false;
165             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
166                 new Rectangle JavaDoc(0, 0, 116, 100)
167                 };
168             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
169         }
170         // < MOVE
171
// > END MOVING
172
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
173
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
174
contInterior.put("jPanel1", new Rectangle JavaDoc(-32768, -32768, 116, 100));
175         compBounds.put("jPanel1", new Rectangle JavaDoc(-32768, -32768, 116, 100));
176         baselinePosition.put("jPanel1-116-100", new Integer JavaDoc(0));
177         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
178         compPrefSize.put("jPanel1", new Dimension JavaDoc(100, 100));
179         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
180         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
181         ld.endMoving(true);
182         // < END MOVING
183
ld.externalSizeChangeHappened();
184         // > UPDATE CURRENT STATE
185
contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 100));
186         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 100));
187         baselinePosition.put("jPanel1-116-100", new Integer JavaDoc(0));
188         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
189         compPrefSize.put("jPanel1", new Dimension JavaDoc(116, 100));
190         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
191         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
192         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
193         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 100));
194         baselinePosition.put("jPanel1-116-100", new Integer JavaDoc(0));
195         contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 100));
196         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
197         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 100));
198         baselinePosition.put("jPanel1-116-100", new Integer JavaDoc(0));
199         ld.updateCurrentState();
200         // < UPDATE CURRENT STATE
201
// > START RESIZING
202
baselinePosition.put("jPanel1-116-100", new Integer JavaDoc(0));
203         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
204         {
205             String JavaDoc[] compIds = new String JavaDoc[] {
206                 "jPanel1"
207                 };
208             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
209                 new Rectangle JavaDoc(0, 0, 116, 100)
210                 };
211             Point JavaDoc hotspot = new Point JavaDoc(54,103);
212             int[] resizeEdges = new int[] {
213                 -1,
214                     1
215                 };
216             boolean inLayout = true;
217             ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout);
218         }
219         // < START RESIZING
220
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
221
// > MOVE
222
{
223             Point JavaDoc p = new Point JavaDoc(54,123);
224             String JavaDoc containerId= "Form";
225             boolean autoPositioning = true;
226             boolean lockDimension = false;
227             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
228                 new Rectangle JavaDoc(0, 0, 116, 120)
229                 };
230             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
231         }
232         // < MOVE
233
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
234
// > MOVE
235
{
236             Point JavaDoc p = new Point JavaDoc(54,124);
237             String JavaDoc containerId= "Form";
238             boolean autoPositioning = true;
239             boolean lockDimension = false;
240             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
241                 new Rectangle JavaDoc(0, 0, 116, 121)
242                 };
243             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
244         }
245         // < MOVE
246
// > END MOVING
247
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
248
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
249
contInterior.put("jPanel1", new Rectangle JavaDoc(-32768, -32768, 116, 121));
250         compBounds.put("jPanel1", new Rectangle JavaDoc(-32768, -32768, 116, 121));
251         baselinePosition.put("jPanel1-116-121", new Integer JavaDoc(0));
252         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
253         compPrefSize.put("jPanel1", new Dimension JavaDoc(116, 100));
254         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
255         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
256         ld.endMoving(true);
257         // < END MOVING
258
ld.externalSizeChangeHappened();
259         // > UPDATE CURRENT STATE
260
contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 121));
261         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 121));
262         baselinePosition.put("jPanel1-116-121", new Integer JavaDoc(0));
263         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
264         compPrefSize.put("jPanel1", new Dimension JavaDoc(116, 121));
265         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
266         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
267         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
268         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 121));
269         baselinePosition.put("jPanel1-116-121", new Integer JavaDoc(0));
270         contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 121));
271         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
272         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 116, 121));
273         baselinePosition.put("jPanel1-116-121", new Integer JavaDoc(0));
274         ld.updateCurrentState();
275         // < UPDATE CURRENT STATE
276
}
277
278     // Resize panel down-right to fill whole frame (no gaps).
279
public void doChanges2() {
280         // > START RESIZING
281
baselinePosition.put("jPanel1-116-121", new Integer JavaDoc(0));
282         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
283         {
284             String JavaDoc[] compIds = new String JavaDoc[] {
285                 "jPanel1"
286                 };
287             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
288                 new Rectangle JavaDoc(0, 0, 116, 121)
289                 };
290             Point JavaDoc hotspot = new Point JavaDoc(115,120);
291             int[] resizeEdges = new int[] {
292                 1,
293                     1
294                 };
295             boolean inLayout = true;
296             ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout);
297         }
298         // < START RESIZING
299
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
300
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
301
// > MOVE
302
{
303             Point JavaDoc p = new Point JavaDoc(394,296);
304             String JavaDoc containerId= "Form";
305             boolean autoPositioning = true;
306             boolean lockDimension = false;
307             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
308                 new Rectangle JavaDoc(0, 0, 400, 300)
309                 };
310             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
311         }
312         // < MOVE
313
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
314
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
315
// > MOVE
316
{
317             Point JavaDoc p = new Point JavaDoc(395,296);
318             String JavaDoc containerId= "Form";
319             boolean autoPositioning = true;
320             boolean lockDimension = false;
321             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
322                 new Rectangle JavaDoc(0, 0, 400, 300)
323                 };
324             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
325         }
326         // < MOVE
327
// > END MOVING
328
contInterior.put("jPanel1", new Rectangle JavaDoc(-32768, -32768, 400, 300));
329         compBounds.put("jPanel1", new Rectangle JavaDoc(-32768, -32768, 400, 300));
330         baselinePosition.put("jPanel1-400-300", new Integer JavaDoc(0));
331         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
332         compPrefSize.put("jPanel1", new Dimension JavaDoc(116, 121));
333         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
334         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
335         ld.endMoving(true);
336         // < END MOVING
337
ld.externalSizeChangeHappened();
338         // > UPDATE CURRENT STATE
339
contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 400, 300));
340         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 400, 300));
341         baselinePosition.put("jPanel1-400-300", new Integer JavaDoc(0));
342         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
343         compPrefSize.put("jPanel1", new Dimension JavaDoc(400, 300));
344         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
345         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
346         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
347         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 400, 300));
348         baselinePosition.put("jPanel1-400-300", new Integer JavaDoc(0));
349         contInterior.put("jPanel1", new Rectangle JavaDoc(0, 0, 400, 300));
350         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
351         compBounds.put("jPanel1", new Rectangle JavaDoc(0, 0, 400, 300));
352         baselinePosition.put("jPanel1-400-300", new Integer JavaDoc(0));
353         ld.updateCurrentState();
354         // < UPDATE CURRENT STATE
355
}
356
357     // Resize (shrink) panel from top-left corner.
358
public void doChanges3() {
359         // > START RESIZING
360
baselinePosition.put("jPanel1-400-300", new Integer JavaDoc(0));
361         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
362         {
363             String JavaDoc[] compIds = new String JavaDoc[] {
364                 "jPanel1"
365                 };
366             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
367                 new Rectangle JavaDoc(0, 0, 400, 300)
368                 };
369             Point JavaDoc hotspot = new Point JavaDoc(-3,-2);
370             int[] resizeEdges = new int[] {
371                 0,
372                     0
373                 };
374             boolean inLayout = true;
375             ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout);
376         }
377         // < START RESIZING
378
prefPaddingInParent.put("Form-jPanel1-1-0", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
379
prefPaddingInParent.put("Form-jPanel1-0-0", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
380
// > MOVE
381
{
382             Point JavaDoc p = new Point JavaDoc(279,206);
383             String JavaDoc containerId= "Form";
384             boolean autoPositioning = true;
385             boolean lockDimension = false;
386             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
387                 new Rectangle JavaDoc(282, 208, 118, 92)
388                 };
389             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
390         }
391         // < MOVE
392
prefPaddingInParent.put("Form-jPanel1-1-0", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
393
prefPaddingInParent.put("Form-jPanel1-0-0", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
394
// > MOVE
395
{
396             Point JavaDoc p = new Point JavaDoc(280,206);
397             String JavaDoc containerId= "Form";
398             boolean autoPositioning = true;
399             boolean lockDimension = false;
400             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
401                 new Rectangle JavaDoc(283, 208, 117, 92)
402                 };
403             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
404         }
405         // < MOVE
406
// > END MOVING
407
prefPaddingInParent.put("Form-jPanel1-0-0", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
408
prefPaddingInParent.put("Form-jPanel1-1-0", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
409
contInterior.put("jPanel1", new Rectangle JavaDoc(-32485, -32560, 117, 92));
410         compBounds.put("jPanel1", new Rectangle JavaDoc(-32485, -32560, 117, 92));
411         baselinePosition.put("jPanel1-117-92", new Integer JavaDoc(0));
412         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
413         compPrefSize.put("jPanel1", new Dimension JavaDoc(400, 300));
414         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
415         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
416         ld.endMoving(true);
417         // < END MOVING
418
ld.externalSizeChangeHappened();
419         // > UPDATE CURRENT STATE
420
contInterior.put("jPanel1", new Rectangle JavaDoc(283, 208, 117, 92));
421         compBounds.put("jPanel1", new Rectangle JavaDoc(283, 208, 117, 92));
422         baselinePosition.put("jPanel1-117-92", new Integer JavaDoc(0));
423         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
424         compPrefSize.put("jPanel1", new Dimension JavaDoc(117, 92));
425         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
426         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
427         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
428         compBounds.put("jPanel1", new Rectangle JavaDoc(283, 208, 117, 92));
429         baselinePosition.put("jPanel1-117-92", new Integer JavaDoc(0));
430         contInterior.put("jPanel1", new Rectangle JavaDoc(283, 208, 117, 92));
431         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
432         compBounds.put("jPanel1", new Rectangle JavaDoc(283, 208, 117, 92));
433         baselinePosition.put("jPanel1-117-92", new Integer JavaDoc(0));
434         ld.updateCurrentState();
435         // < UPDATE CURRENT STATE
436
}
437
438     // Resize bottom-right corner to have preferred gaps.
439
public void doChanges4() {
440         // > START RESIZING
441
baselinePosition.put("jPanel1-117-92", new Integer JavaDoc(0));
442         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
443         {
444             String JavaDoc[] compIds = new String JavaDoc[] {
445                 "jPanel1"
446                 };
447             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
448                 new Rectangle JavaDoc(283, 208, 117, 92)
449                 };
450             Point JavaDoc hotspot = new Point JavaDoc(401,302);
451             int[] resizeEdges = new int[] {
452                 1,
453                     1
454                 };
455             boolean inLayout = true;
456             ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout);
457         }
458         // < START RESIZING
459
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
460
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
461
// > MOVE
462
{
463             Point JavaDoc p = new Point JavaDoc(392,291);
464             String JavaDoc containerId= "Form";
465             boolean autoPositioning = true;
466             boolean lockDimension = false;
467             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
468                 new Rectangle JavaDoc(283, 208, 107, 81)
469                 };
470             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
471         }
472         // < MOVE
473
prefPaddingInParent.put("Form-jPanel1-1-1", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
474
prefPaddingInParent.put("Form-jPanel1-0-1", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
475
// > MOVE
476
{
477             Point JavaDoc p = new Point JavaDoc(391,291);
478             String JavaDoc containerId= "Form";
479             boolean autoPositioning = true;
480             boolean lockDimension = false;
481             Rectangle JavaDoc[] bounds = new Rectangle JavaDoc[] {
482                 new Rectangle JavaDoc(283, 208, 107, 81)
483                 };
484             ld.move(p, containerId, autoPositioning, lockDimension, bounds);
485         }
486         // < MOVE
487
// > END MOVING
488
prefPaddingInParent.put("Form-jPanel1-0-0", new Integer JavaDoc(10)); // parentId-compId-dimension-compAlignment
489
prefPaddingInParent.put("Form-jPanel1-1-0", new Integer JavaDoc(11)); // parentId-compId-dimension-compAlignment
490
contInterior.put("jPanel1", new Rectangle JavaDoc(-32485, -32560, 107, 81));
491         compBounds.put("jPanel1", new Rectangle JavaDoc(-32485, -32560, 107, 81));
492         baselinePosition.put("jPanel1-107-81", new Integer JavaDoc(0));
493         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
494         compPrefSize.put("jPanel1", new Dimension JavaDoc(117, 92));
495         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
496         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
497         ld.endMoving(true);
498         // < END MOVING
499
ld.externalSizeChangeHappened();
500         // > UPDATE CURRENT STATE
501
contInterior.put("jPanel1", new Rectangle JavaDoc(283, 208, 107, 81));
502         compBounds.put("jPanel1", new Rectangle JavaDoc(283, 208, 107, 81));
503         baselinePosition.put("jPanel1-107-81", new Integer JavaDoc(0));
504         compMinSize.put("jPanel1", new Dimension JavaDoc(0, 0));
505         compPrefSize.put("jPanel1", new Dimension JavaDoc(107, 81));
506         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
507         hasExplicitPrefSize.put("jPanel1", new Boolean JavaDoc(false));
508         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
509         compBounds.put("jPanel1", new Rectangle JavaDoc(283, 208, 107, 81));
510         baselinePosition.put("jPanel1-107-81", new Integer JavaDoc(0));
511         contInterior.put("jPanel1", new Rectangle JavaDoc(283, 208, 107, 81));
512         contInterior.put("Form", new Rectangle JavaDoc(0, 0, 400, 300));
513         compBounds.put("jPanel1", new Rectangle JavaDoc(283, 208, 107, 81));
514         baselinePosition.put("jPanel1-107-81", new Integer JavaDoc(0));
515         ld.updateCurrentState();
516         // < UPDATE CURRENT STATE
517
}
518     
519 }
520
Popular Tags