1 19 20 package org.netbeans.modules.form.layoutdesign; 21 22 import java.awt.Dimension ; 23 import java.awt.Point ; 24 import java.awt.Rectangle ; 25 import java.io.File ; 26 import java.io.IOException ; 27 import java.util.*; 28 import org.openide.filesystems.FileUtil; 29 30 public class ALT_ParallelPosition06Test extends LayoutTestCase { 33 34 public ALT_ParallelPosition06Test(String name) { 35 super(name); 36 try { 37 className = this.getClass().getName(); 38 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 39 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 40 } catch (IOException ioe) { 41 fail(ioe.toString()); 42 } 43 } 44 45 public void doChanges0() { 47 ld.externalSizeChangeHappened(); 48 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 50 compBounds.put("jToggleButton1", new Rectangle (285, 11, 105, 23)); 51 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 52 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 53 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 54 compBounds.put("jToggleButton1", new Rectangle (285, 11, 105, 23)); 55 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 56 ld.updateCurrentState(); 57 lc = new LayoutComponent("jLabel1", false); 59 baselinePosition.put("jLabel1-34-14", new Integer (11)); 61 { 62 LayoutComponent[] comps = new LayoutComponent[] { lc }; 63 Rectangle [] bounds = new Rectangle [] { 64 new Rectangle (0, 0, 34, 14) 65 }; 66 String defaultContId = null; 67 Point hotspot = new Point (13,7); 68 ld.startAdding(comps, bounds, hotspot, defaultContId); 69 } 70 prefPaddingInParent.put("Form-jLabel1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel1-0-1", new Integer (10)); prefPadding.put("jToggleButton1-jLabel1-0-0-2", new Integer (10)); { 80 Point p = new Point (292,49); 81 String containerId= "Form"; 82 boolean autoPositioning = true; 83 boolean lockDimension = false; 84 Rectangle [] bounds = new Rectangle [] { 85 new Rectangle (285, 40, 34, 14) 86 }; 87 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 88 } 89 prefPaddingInParent.put("Form-jLabel1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel1-0-1", new Integer (10)); prefPadding.put("jToggleButton1-jLabel1-0-0-2", new Integer (10)); { 99 Point p = new Point (293,49); 100 String containerId= "Form"; 101 boolean autoPositioning = true; 102 boolean lockDimension = false; 103 Rectangle [] bounds = new Rectangle [] { 104 new Rectangle (285, 40, 34, 14) 105 }; 106 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 107 } 108 compPrefSize.put("jLabel1", new Dimension (34, 14)); 111 compPrefSize.put("jLabel1", new Dimension (34, 14)); 112 prefPaddingInParent.put("Form-jLabel1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jToggleButton1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jLabel1-1-1", new Integer (10)); ld.endMoving(true); 116 ld.externalSizeChangeHappened(); 118 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 120 compBounds.put("jToggleButton1", new Rectangle (285, 11, 105, 23)); 121 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 122 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 123 compBounds.put("jLabel1", new Rectangle (285, 40, 34, 14)); 124 baselinePosition.put("jLabel1-34-14", new Integer (11)); 125 compPrefSize.put("jLabel1", new Dimension (34, 14)); 126 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 127 compBounds.put("jToggleButton1", new Rectangle (285, 11, 105, 23)); 128 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 129 compBounds.put("jLabel1", new Rectangle (285, 40, 34, 14)); 130 baselinePosition.put("jLabel1-34-14", new Integer (11)); 131 ld.updateCurrentState(); 132 lc = new LayoutComponent("jLabel2", false); 134 baselinePosition.put("jLabel2-34-14", new Integer (11)); 136 { 137 LayoutComponent[] comps = new LayoutComponent[] { lc }; 138 Rectangle [] bounds = new Rectangle [] { 139 new Rectangle (285, 40, 34, 14) 140 }; 141 String defaultContId= "Form"; 142 Point hotspot = new Point (298,47); 143 ld.startAdding(comps, bounds, hotspot, defaultContId); 144 } 145 prefPaddingInParent.put("Form-jLabel2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel2-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel2-1-0-0", new Integer (6)); prefPadding.put("jLabel2-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel2-0-1", new Integer (10)); prefPadding.put("jLabel1-jLabel2-0-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jLabel2-0-0-2", new Integer (10)); { 157 Point p = new Point (364,50); 158 String containerId= "Form"; 159 boolean autoPositioning = true; 160 boolean lockDimension = false; 161 Rectangle [] bounds = new Rectangle [] { 162 new Rectangle (356, 40, 34, 14) 163 }; 164 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 165 } 166 prefPaddingInParent.put("Form-jLabel2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel2-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel2-1-0-0", new Integer (6)); prefPadding.put("jLabel2-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel2-0-1", new Integer (10)); prefPadding.put("jLabel1-jLabel2-0-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jLabel2-0-0-2", new Integer (10)); { 178 Point p = new Point (365,50); 179 String containerId= "Form"; 180 boolean autoPositioning = true; 181 boolean lockDimension = false; 182 Rectangle [] bounds = new Rectangle [] { 183 new Rectangle (356, 40, 34, 14) 184 }; 185 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 186 } 187 compPrefSize.put("jLabel2", new Dimension (34, 14)); 190 compPrefSize.put("jLabel2", new Dimension (34, 14)); 191 prefPadding.put("jLabel1-jLabel2-0-0-0", new Integer (10)); ld.endMoving(true); 193 ld.externalSizeChangeHappened(); 195 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 197 compBounds.put("jToggleButton1", new Rectangle (285, 11, 105, 23)); 198 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 199 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 200 compBounds.put("jLabel1", new Rectangle (285, 40, 34, 14)); 201 baselinePosition.put("jLabel1-34-14", new Integer (11)); 202 compPrefSize.put("jLabel1", new Dimension (34, 14)); 203 compBounds.put("jLabel2", new Rectangle (356, 40, 34, 14)); 204 baselinePosition.put("jLabel2-34-14", new Integer (11)); 205 compPrefSize.put("jLabel2", new Dimension (34, 14)); 206 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 207 compBounds.put("jToggleButton1", new Rectangle (285, 11, 105, 23)); 208 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 209 compBounds.put("jLabel1", new Rectangle (285, 40, 34, 14)); 210 baselinePosition.put("jLabel1-34-14", new Integer (11)); 211 compBounds.put("jLabel2", new Rectangle (356, 40, 34, 14)); 212 baselinePosition.put("jLabel2-34-14", new Integer (11)); 213 ld.updateCurrentState(); 214 } 216 217 } 218 | Popular Tags |