001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.form.layoutdesign;
043:
044: import java.awt.Dimension;
045: import java.awt.Point;
046: import java.awt.Rectangle;
047: import java.io.File;
048: import java.io.IOException;
049: import java.util.*;
050: import org.openide.filesystems.FileUtil;
051:
052: // Testing parallel group creation with suppressed resizing. Unlike in test 19
053: // here the resizing components span only fixed area.
054: public class ALT_ParallelPosition20Test extends LayoutTestCase {
055:
056: public ALT_ParallelPosition20Test(String name) {
057: super (name);
058: try {
059: className = this .getClass().getName();
060: className = className.substring(
061: className.lastIndexOf('.') + 1, className.length());
062: startingFormFile = FileUtil.toFileObject(new File(url
063: .getFile()
064: + goldenFilesPath
065: + className
066: + "-StartingForm.form").getCanonicalFile());
067: } catch (IOException ioe) {
068: fail(ioe.toString());
069: }
070: }
071:
072: // Create starting situation - three textfields in the middle (anchored to
073: // the right), one list at the right border.
074: public void doChanges0() {
075: ld.externalSizeChangeHappened();
076: // > UPDATE CURRENT STATE
077: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
078: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
079: ld.updateCurrentState();
080: // < UPDATE CURRENT STATE
081: lc = new LayoutComponent("jTextField1", false);
082: // > START ADDING
083: baselinePosition.put("jTextField1-59-20", new Integer(14));
084: {
085: LayoutComponent[] comps = new LayoutComponent[] { lc };
086: Rectangle[] bounds = new Rectangle[] { new Rectangle(0, 0,
087: 59, 20) };
088: String defaultContId = null;
089: Point hotspot = new Point(25, 10);
090: ld.startAdding(comps, bounds, hotspot, defaultContId);
091: }
092: // < START ADDING
093: prefPaddingInParent
094: .put("Form-jTextField1-1-0", new Integer(11)); // parentId-compId-dimension-compAlignment
095: prefPaddingInParent
096: .put("Form-jTextField1-1-1", new Integer(11)); // parentId-compId-dimension-compAlignment
097: prefPaddingInParent
098: .put("Form-jTextField1-0-0", new Integer(10)); // parentId-compId-dimension-compAlignment
099: prefPaddingInParent
100: .put("Form-jTextField1-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
101: // > MOVE
102: {
103: Point p = new Point(213, 27);
104: String containerId = "Form";
105: boolean autoPositioning = true;
106: boolean lockDimension = false;
107: Rectangle[] bounds = new Rectangle[] { new Rectangle(188,
108: 11, 59, 20) };
109: ld.move(p, containerId, autoPositioning, lockDimension,
110: bounds);
111: }
112: // < MOVE
113: prefPaddingInParent
114: .put("Form-jTextField1-1-0", new Integer(11)); // parentId-compId-dimension-compAlignment
115: prefPaddingInParent
116: .put("Form-jTextField1-1-1", new Integer(11)); // parentId-compId-dimension-compAlignment
117: prefPaddingInParent
118: .put("Form-jTextField1-0-0", new Integer(10)); // parentId-compId-dimension-compAlignment
119: prefPaddingInParent
120: .put("Form-jTextField1-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
121: // > MOVE
122: {
123: Point p = new Point(212, 27);
124: String containerId = "Form";
125: boolean autoPositioning = true;
126: boolean lockDimension = false;
127: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
128: 11, 59, 20) };
129: ld.move(p, containerId, autoPositioning, lockDimension,
130: bounds);
131: }
132: // < MOVE
133: // > END MOVING
134: compPrefSize.put("jTextField1", new Dimension(59, 20));
135: compPrefSize.put("jTextField1", new Dimension(59, 20));
136: prefPaddingInParent
137: .put("Form-jTextField1-0-0", new Integer(10)); // parentId-compId-dimension-compAlignment
138: prefPaddingInParent
139: .put("Form-jTextField1-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
140: prefPaddingInParent
141: .put("Form-jTextField1-1-1", new Integer(10)); // parentId-compId-dimension-compAlignment
142: ld.endMoving(true);
143: // < END MOVING
144: ld.externalSizeChangeHappened();
145: // > UPDATE CURRENT STATE
146: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
147: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
148: baselinePosition.put("jTextField1-59-20", new Integer(14));
149: compPrefSize.put("jTextField1", new Dimension(59, 20));
150: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
151: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
152: baselinePosition.put("jTextField1-59-20", new Integer(14));
153: ld.updateCurrentState();
154: // < UPDATE CURRENT STATE
155: lc = new LayoutComponent("jTextField2", false);
156: // > START ADDING
157: baselinePosition.put("jTextField2-59-20", new Integer(14));
158: {
159: LayoutComponent[] comps = new LayoutComponent[] { lc };
160: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
161: 11, 59, 20) };
162: String defaultContId = "Form";
163: Point hotspot = new Point(212, 21);
164: ld.startAdding(comps, bounds, hotspot, defaultContId);
165: }
166: // < START ADDING
167: prefPaddingInParent
168: .put("Form-jTextField2-1-0", new Integer(11)); // parentId-compId-dimension-compAlignment
169: prefPaddingInParent
170: .put("Form-jTextField2-1-1", new Integer(11)); // parentId-compId-dimension-compAlignment
171: prefPadding
172: .put("jTextField1-jTextField2-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
173: prefPadding
174: .put("jTextField2-jTextField1-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
175: prefPaddingInParent
176: .put("Form-jTextField2-0-0", new Integer(10)); // parentId-compId-dimension-compAlignment
177: prefPaddingInParent
178: .put("Form-jTextField2-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
179: prefPadding.put("jTextField1-jTextField2-0-0-2",
180: new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
181: // > MOVE
182: {
183: Point p = new Point(210, 47);
184: String containerId = "Form";
185: boolean autoPositioning = true;
186: boolean lockDimension = false;
187: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
188: 37, 59, 20) };
189: ld.move(p, containerId, autoPositioning, lockDimension,
190: bounds);
191: }
192: // < MOVE
193: prefPaddingInParent
194: .put("Form-jTextField2-1-0", new Integer(11)); // parentId-compId-dimension-compAlignment
195: prefPaddingInParent
196: .put("Form-jTextField2-1-1", new Integer(11)); // parentId-compId-dimension-compAlignment
197: prefPadding
198: .put("jTextField1-jTextField2-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
199: prefPadding
200: .put("jTextField2-jTextField1-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
201: prefPaddingInParent
202: .put("Form-jTextField2-0-0", new Integer(10)); // parentId-compId-dimension-compAlignment
203: prefPaddingInParent
204: .put("Form-jTextField2-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
205: prefPadding.put("jTextField1-jTextField2-0-0-2",
206: new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
207: // > MOVE
208: {
209: Point p = new Point(210, 48);
210: String containerId = "Form";
211: boolean autoPositioning = true;
212: boolean lockDimension = false;
213: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
214: 37, 59, 20) };
215: ld.move(p, containerId, autoPositioning, lockDimension,
216: bounds);
217: }
218: // < MOVE
219: // > END MOVING
220: compPrefSize.put("jTextField2", new Dimension(59, 20));
221: compPrefSize.put("jTextField2", new Dimension(59, 20));
222: prefPaddingInParent
223: .put("Form-jTextField2-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
224: prefPaddingInParent
225: .put("Form-jTextField2-1-1", new Integer(10)); // parentId-compId-dimension-compAlignment
226: ld.endMoving(true);
227: // < END MOVING
228: ld.externalSizeChangeHappened();
229: // > UPDATE CURRENT STATE
230: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
231: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
232: baselinePosition.put("jTextField1-59-20", new Integer(14));
233: compPrefSize.put("jTextField1", new Dimension(59, 20));
234: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
235: baselinePosition.put("jTextField2-59-20", new Integer(14));
236: compPrefSize.put("jTextField2", new Dimension(59, 20));
237: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
238: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
239: baselinePosition.put("jTextField1-59-20", new Integer(14));
240: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
241: baselinePosition.put("jTextField2-59-20", new Integer(14));
242: ld.updateCurrentState();
243: // < UPDATE CURRENT STATE
244: lc = new LayoutComponent("jTextField3", false);
245: // > START ADDING
246: baselinePosition.put("jTextField3-59-20", new Integer(14));
247: {
248: LayoutComponent[] comps = new LayoutComponent[] { lc };
249: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
250: 37, 59, 20) };
251: String defaultContId = "Form";
252: Point hotspot = new Point(212, 47);
253: ld.startAdding(comps, bounds, hotspot, defaultContId);
254: }
255: // < START ADDING
256: prefPaddingInParent
257: .put("Form-jTextField3-1-0", new Integer(11)); // parentId-compId-dimension-compAlignment
258: prefPaddingInParent
259: .put("Form-jTextField3-1-1", new Integer(11)); // parentId-compId-dimension-compAlignment
260: prefPadding
261: .put("jTextField1-jTextField3-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
262: prefPadding
263: .put("jTextField3-jTextField1-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
264: prefPadding
265: .put("jTextField2-jTextField3-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
266: prefPadding
267: .put("jTextField3-jTextField2-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
268: prefPaddingInParent
269: .put("Form-jTextField3-0-0", new Integer(10)); // parentId-compId-dimension-compAlignment
270: prefPaddingInParent
271: .put("Form-jTextField3-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
272: prefPadding.put("jTextField2-jTextField3-0-0-2",
273: new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
274: // > MOVE
275: {
276: Point p = new Point(212, 69);
277: String containerId = "Form";
278: boolean autoPositioning = true;
279: boolean lockDimension = false;
280: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
281: 63, 59, 20) };
282: ld.move(p, containerId, autoPositioning, lockDimension,
283: bounds);
284: }
285: // < MOVE
286: prefPaddingInParent
287: .put("Form-jTextField3-1-0", new Integer(11)); // parentId-compId-dimension-compAlignment
288: prefPaddingInParent
289: .put("Form-jTextField3-1-1", new Integer(11)); // parentId-compId-dimension-compAlignment
290: prefPadding
291: .put("jTextField1-jTextField3-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
292: prefPadding
293: .put("jTextField3-jTextField1-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
294: prefPadding
295: .put("jTextField2-jTextField3-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
296: prefPadding
297: .put("jTextField3-jTextField2-1-0-0", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
298: prefPaddingInParent
299: .put("Form-jTextField3-0-0", new Integer(10)); // parentId-compId-dimension-compAlignment
300: prefPaddingInParent
301: .put("Form-jTextField3-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
302: prefPadding.put("jTextField2-jTextField3-0-0-2",
303: new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
304: // > MOVE
305: {
306: Point p = new Point(213, 69);
307: String containerId = "Form";
308: boolean autoPositioning = true;
309: boolean lockDimension = false;
310: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
311: 63, 59, 20) };
312: ld.move(p, containerId, autoPositioning, lockDimension,
313: bounds);
314: }
315: // < MOVE
316: // > END MOVING
317: compPrefSize.put("jTextField3", new Dimension(59, 20));
318: compPrefSize.put("jTextField3", new Dimension(59, 20));
319: prefPaddingInParent
320: .put("Form-jTextField3-0-1", new Integer(10)); // parentId-compId-dimension-compAlignment
321: prefPaddingInParent
322: .put("Form-jTextField3-1-1", new Integer(10)); // parentId-compId-dimension-compAlignment
323: ld.endMoving(true);
324: // < END MOVING
325: ld.externalSizeChangeHappened();
326: // > UPDATE CURRENT STATE
327: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
328: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
329: baselinePosition.put("jTextField1-59-20", new Integer(14));
330: compPrefSize.put("jTextField1", new Dimension(59, 20));
331: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
332: baselinePosition.put("jTextField2-59-20", new Integer(14));
333: compPrefSize.put("jTextField2", new Dimension(59, 20));
334: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
335: baselinePosition.put("jTextField3-59-20", new Integer(14));
336: compPrefSize.put("jTextField3", new Dimension(59, 20));
337: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
338: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
339: baselinePosition.put("jTextField1-59-20", new Integer(14));
340: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
341: baselinePosition.put("jTextField2-59-20", new Integer(14));
342: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
343: baselinePosition.put("jTextField3-59-20", new Integer(14));
344: ld.updateCurrentState();
345: // < UPDATE CURRENT STATE
346: lc = new LayoutComponent("jScrollPane1", false);
347: // > START ADDING
348: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
349: {
350: LayoutComponent[] comps = new LayoutComponent[] { lc };
351: Rectangle[] bounds = new Rectangle[] { new Rectangle(0, 0,
352: 37, 132) };
353: String defaultContId = null;
354: Point hotspot = new Point(14, 66);
355: ld.startAdding(comps, bounds, hotspot, defaultContId);
356: }
357: // < START ADDING
358: prefPaddingInParent.put("Form-jScrollPane1-1-0",
359: new Integer(11)); // parentId-compId-dimension-compAlignment
360: prefPaddingInParent.put("Form-jScrollPane1-1-1",
361: new Integer(11)); // parentId-compId-dimension-compAlignment
362: prefPaddingInParent.put("Form-jScrollPane1-0-0",
363: new Integer(10)); // parentId-compId-dimension-compAlignment
364: prefPaddingInParent.put("Form-jScrollPane1-0-1",
365: new Integer(10)); // parentId-compId-dimension-compAlignment
366: prefPadding.put("jTextField3-jScrollPane1-0-0-0",
367: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
368: prefPadding.put("jTextField2-jScrollPane1-0-0-0",
369: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
370: prefPadding.put("jTextField1-jScrollPane1-0-0-0",
371: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
372: // > MOVE
373: {
374: Point p = new Point(361, 77);
375: String containerId = "Form";
376: boolean autoPositioning = true;
377: boolean lockDimension = false;
378: Rectangle[] bounds = new Rectangle[] { new Rectangle(353,
379: 11, 37, 132) };
380: ld.move(p, containerId, autoPositioning, lockDimension,
381: bounds);
382: }
383: // < MOVE
384: prefPaddingInParent.put("Form-jScrollPane1-1-0",
385: new Integer(11)); // parentId-compId-dimension-compAlignment
386: prefPaddingInParent.put("Form-jScrollPane1-1-1",
387: new Integer(11)); // parentId-compId-dimension-compAlignment
388: prefPaddingInParent.put("Form-jScrollPane1-0-0",
389: new Integer(10)); // parentId-compId-dimension-compAlignment
390: prefPaddingInParent.put("Form-jScrollPane1-0-1",
391: new Integer(10)); // parentId-compId-dimension-compAlignment
392: prefPadding.put("jTextField3-jScrollPane1-0-0-0",
393: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
394: prefPadding.put("jTextField2-jScrollPane1-0-0-0",
395: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
396: prefPadding.put("jTextField1-jScrollPane1-0-0-0",
397: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
398: // > MOVE
399: {
400: Point p = new Point(362, 77);
401: String containerId = "Form";
402: boolean autoPositioning = true;
403: boolean lockDimension = false;
404: Rectangle[] bounds = new Rectangle[] { new Rectangle(353,
405: 11, 37, 132) };
406: ld.move(p, containerId, autoPositioning, lockDimension,
407: bounds);
408: }
409: // < MOVE
410: // > END MOVING
411: compPrefSize.put("jScrollPane1", new Dimension(37, 132));
412: compPrefSize.put("jScrollPane1", new Dimension(37, 132));
413: prefPadding.put("jTextField3-jScrollPane1-0-0-0", new Integer(
414: 10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
415: prefPadding.put("jTextField2-jScrollPane1-0-0-0", new Integer(
416: 10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
417: prefPadding.put("jTextField1-jScrollPane1-0-0-0", new Integer(
418: 10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
419: prefPaddingInParent.put("Form-jScrollPane1-1-1",
420: new Integer(10)); // parentId-compId-dimension-compAlignment
421: ld.endMoving(true);
422: // < END MOVING
423: ld.externalSizeChangeHappened();
424: // > UPDATE CURRENT STATE
425: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
426: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
427: baselinePosition.put("jTextField1-59-20", new Integer(14));
428: compPrefSize.put("jTextField1", new Dimension(59, 20));
429: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
430: baselinePosition.put("jTextField2-59-20", new Integer(14));
431: compPrefSize.put("jTextField2", new Dimension(59, 20));
432: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
433: baselinePosition.put("jTextField3-59-20", new Integer(14));
434: compPrefSize.put("jTextField3", new Dimension(59, 20));
435: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
436: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
437: compPrefSize.put("jScrollPane1", new Dimension(37, 132));
438: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
439: compBounds.put("jTextField1", new Rectangle(187, 11, 59, 20));
440: baselinePosition.put("jTextField1-59-20", new Integer(14));
441: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
442: baselinePosition.put("jTextField2-59-20", new Integer(14));
443: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
444: baselinePosition.put("jTextField3-59-20", new Integer(14));
445: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
446: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
447: ld.updateCurrentState();
448: // < UPDATE CURRENT STATE
449: }
450:
451: // One by one, resize the textfields to the right to snap next to the list.
452: public void doChanges1() {
453: // > START RESIZING
454: baselinePosition.put("jTextField1-59-20", new Integer(14));
455: compPrefSize.put("jTextField1", new Dimension(59, 20));
456: {
457: String[] compIds = new String[] { "jTextField1" };
458: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
459: 11, 59, 20) };
460: Point hotspot = new Point(246, 23);
461: int[] resizeEdges = new int[] { 1, -1 };
462: boolean inLayout = true;
463: ld.startResizing(compIds, bounds, hotspot, resizeEdges,
464: inLayout);
465: }
466: // < START RESIZING
467: prefPadding.put("jTextField1-jScrollPane1-0-0-0",
468: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
469: // > MOVE
470: {
471: Point p = new Point(339, 23);
472: String containerId = "Form";
473: boolean autoPositioning = true;
474: boolean lockDimension = false;
475: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
476: 11, 152, 20) };
477: ld.move(p, containerId, autoPositioning, lockDimension,
478: bounds);
479: }
480: // < MOVE
481: prefPadding.put("jTextField1-jScrollPane1-0-0-0",
482: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
483: // > MOVE
484: {
485: Point p = new Point(340, 23);
486: String containerId = "Form";
487: boolean autoPositioning = true;
488: boolean lockDimension = false;
489: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
490: 11, 160, 20) };
491: ld.move(p, containerId, autoPositioning, lockDimension,
492: bounds);
493: }
494: // < MOVE
495: // > END MOVING
496: prefPadding.put("jTextField3-jScrollPane1-0-0-0",
497: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
498: prefPadding.put("jTextField2-jScrollPane1-0-0-0",
499: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
500: ld.endMoving(true);
501: // < END MOVING
502: ld.externalSizeChangeHappened();
503: // > UPDATE CURRENT STATE
504: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
505: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
506: baselinePosition.put("jTextField2-59-20", new Integer(14));
507: compPrefSize.put("jTextField2", new Dimension(59, 20));
508: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
509: baselinePosition.put("jTextField3-59-20", new Integer(14));
510: compPrefSize.put("jTextField3", new Dimension(59, 20));
511: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
512: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
513: compPrefSize.put("jScrollPane1", new Dimension(37, 132));
514: compBounds.put("jTextField1", new Rectangle(187, 11, 160, 20));
515: baselinePosition.put("jTextField1-160-20", new Integer(14));
516: compPrefSize.put("jTextField1", new Dimension(59, 20));
517: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
518: compBounds.put("jTextField2", new Rectangle(187, 37, 59, 20));
519: baselinePosition.put("jTextField2-59-20", new Integer(14));
520: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
521: baselinePosition.put("jTextField3-59-20", new Integer(14));
522: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
523: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
524: compBounds.put("jTextField1", new Rectangle(187, 11, 160, 20));
525: baselinePosition.put("jTextField1-160-20", new Integer(14));
526: ld.updateCurrentState();
527: // < UPDATE CURRENT STATE
528: // > START RESIZING
529: baselinePosition.put("jTextField2-59-20", new Integer(14));
530: compPrefSize.put("jTextField2", new Dimension(59, 20));
531: {
532: String[] compIds = new String[] { "jTextField2" };
533: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
534: 37, 59, 20) };
535: Point hotspot = new Point(244, 47);
536: int[] resizeEdges = new int[] { 1, -1 };
537: boolean inLayout = true;
538: ld.startResizing(compIds, bounds, hotspot, resizeEdges,
539: inLayout);
540: }
541: // < START RESIZING
542: prefPadding.put("jTextField2-jScrollPane1-0-0-0",
543: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
544: // > MOVE
545: {
546: Point p = new Point(337, 46);
547: String containerId = "Form";
548: boolean autoPositioning = true;
549: boolean lockDimension = false;
550: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
551: 37, 152, 20) };
552: ld.move(p, containerId, autoPositioning, lockDimension,
553: bounds);
554: }
555: // < MOVE
556: prefPadding.put("jTextField2-jScrollPane1-0-0-0",
557: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
558: // > MOVE
559: {
560: Point p = new Point(338, 46);
561: String containerId = "Form";
562: boolean autoPositioning = true;
563: boolean lockDimension = false;
564: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
565: 37, 160, 20) };
566: ld.move(p, containerId, autoPositioning, lockDimension,
567: bounds);
568: }
569: // < MOVE
570: // > END MOVING
571: compPrefSize.put("jTextField2", new Dimension(59, 20));
572: ld.endMoving(true);
573: // < END MOVING
574: ld.externalSizeChangeHappened();
575: // > UPDATE CURRENT STATE
576: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
577: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
578: baselinePosition.put("jTextField3-59-20", new Integer(14));
579: compPrefSize.put("jTextField3", new Dimension(59, 20));
580: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
581: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
582: compPrefSize.put("jScrollPane1", new Dimension(37, 132));
583: compBounds.put("jTextField1", new Rectangle(187, 11, 160, 20));
584: baselinePosition.put("jTextField1-160-20", new Integer(14));
585: compPrefSize.put("jTextField1", new Dimension(59, 20));
586: compBounds.put("jTextField2", new Rectangle(187, 37, 160, 20));
587: baselinePosition.put("jTextField2-160-20", new Integer(14));
588: compPrefSize.put("jTextField2", new Dimension(59, 20));
589: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
590: compBounds.put("jTextField3", new Rectangle(187, 63, 59, 20));
591: baselinePosition.put("jTextField3-59-20", new Integer(14));
592: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
593: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
594: compBounds.put("jTextField1", new Rectangle(187, 11, 160, 20));
595: baselinePosition.put("jTextField1-160-20", new Integer(14));
596: compBounds.put("jTextField2", new Rectangle(187, 37, 160, 20));
597: baselinePosition.put("jTextField2-160-20", new Integer(14));
598: ld.updateCurrentState();
599: // < UPDATE CURRENT STATE
600: // > START RESIZING
601: baselinePosition.put("jTextField3-59-20", new Integer(14));
602: compPrefSize.put("jTextField3", new Dimension(59, 20));
603: {
604: String[] compIds = new String[] { "jTextField3" };
605: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
606: 63, 59, 20) };
607: Point hotspot = new Point(247, 75);
608: int[] resizeEdges = new int[] { 1, -1 };
609: boolean inLayout = true;
610: ld.startResizing(compIds, bounds, hotspot, resizeEdges,
611: inLayout);
612: }
613: // < START RESIZING
614: prefPadding.put("jTextField3-jScrollPane1-0-0-0",
615: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
616: // > MOVE
617: {
618: Point p = new Point(341, 70);
619: String containerId = "Form";
620: boolean autoPositioning = true;
621: boolean lockDimension = false;
622: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
623: 63, 160, 20) };
624: ld.move(p, containerId, autoPositioning, lockDimension,
625: bounds);
626: }
627: // < MOVE
628: prefPadding.put("jTextField3-jScrollPane1-0-0-0",
629: new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType
630: // > MOVE
631: {
632: Point p = new Point(342, 70);
633: String containerId = "Form";
634: boolean autoPositioning = true;
635: boolean lockDimension = false;
636: Rectangle[] bounds = new Rectangle[] { new Rectangle(187,
637: 63, 160, 20) };
638: ld.move(p, containerId, autoPositioning, lockDimension,
639: bounds);
640: }
641: // < MOVE
642: // > END MOVING
643: compPrefSize.put("jTextField3", new Dimension(59, 20));
644: ld.endMoving(true);
645: // < END MOVING
646: ld.externalSizeChangeHappened();
647: // > UPDATE CURRENT STATE
648: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
649: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
650: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
651: compPrefSize.put("jScrollPane1", new Dimension(37, 132));
652: compBounds.put("jTextField1", new Rectangle(187, 11, 160, 20));
653: baselinePosition.put("jTextField1-160-20", new Integer(14));
654: compPrefSize.put("jTextField1", new Dimension(59, 20));
655: compBounds.put("jTextField2", new Rectangle(187, 37, 160, 20));
656: baselinePosition.put("jTextField2-160-20", new Integer(14));
657: compPrefSize.put("jTextField2", new Dimension(59, 20));
658: compBounds.put("jTextField3", new Rectangle(187, 63, 160, 20));
659: baselinePosition.put("jTextField3-160-20", new Integer(14));
660: compPrefSize.put("jTextField3", new Dimension(59, 20));
661: contInterior.put("Form", new Rectangle(0, 0, 400, 300));
662: compBounds.put("jScrollPane1", new Rectangle(353, 11, 37, 132));
663: baselinePosition.put("jScrollPane1-37-132", new Integer(0));
664: compBounds.put("jTextField1", new Rectangle(187, 11, 160, 20));
665: baselinePosition.put("jTextField1-160-20", new Integer(14));
666: compBounds.put("jTextField2", new Rectangle(187, 37, 160, 20));
667: baselinePosition.put("jTextField2-160-20", new Integer(14));
668: compBounds.put("jTextField3", new Rectangle(187, 63, 160, 20));
669: baselinePosition.put("jTextField3-160-20", new Integer(14));
670: ld.updateCurrentState();
671: // < UPDATE CURRENT STATE
672: }
673:
674: }
|