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_ParallelPosition05Test extends LayoutTestCase { 33 34 public ALT_ParallelPosition05Test(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 (10, 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 (10, 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 (27,52); 81 String containerId= "Form"; 82 boolean autoPositioning = true; 83 boolean lockDimension = false; 84 Rectangle [] bounds = new Rectangle [] { 85 new Rectangle (10, 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 (26,52); 100 String containerId= "Form"; 101 boolean autoPositioning = true; 102 boolean lockDimension = false; 103 Rectangle [] bounds = new Rectangle [] { 104 new Rectangle (10, 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-jLabel1-1-1", new Integer (10)); ld.endMoving(true); 115 ld.externalSizeChangeHappened(); 117 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 119 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 120 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 121 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 122 compBounds.put("jLabel1", new Rectangle (10, 40, 34, 14)); 123 baselinePosition.put("jLabel1-34-14", new Integer (11)); 124 compPrefSize.put("jLabel1", new Dimension (34, 14)); 125 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 126 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 127 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 128 compBounds.put("jLabel1", new Rectangle (10, 40, 34, 14)); 129 baselinePosition.put("jLabel1-34-14", new Integer (11)); 130 ld.updateCurrentState(); 131 lc = new LayoutComponent("jLabel2", false); 133 baselinePosition.put("jLabel2-34-14", new Integer (11)); 135 { 136 LayoutComponent[] comps = new LayoutComponent[] { lc }; 137 Rectangle [] bounds = new Rectangle [] { 138 new Rectangle (10, 40, 34, 14) 139 }; 140 String defaultContId= "Form"; 141 Point hotspot = new Point (23,47); 142 ld.startAdding(comps, bounds, hotspot, defaultContId); 143 } 144 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)); { 156 Point p = new Point (88,54); 157 String containerId= "Form"; 158 boolean autoPositioning = true; 159 boolean lockDimension = false; 160 Rectangle [] bounds = new Rectangle [] { 161 new Rectangle (81, 40, 34, 14) 162 }; 163 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 164 } 165 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)); { 177 Point p = new Point (88,53); 178 String containerId= "Form"; 179 boolean autoPositioning = true; 180 boolean lockDimension = false; 181 Rectangle [] bounds = new Rectangle [] { 182 new Rectangle (81, 40, 34, 14) 183 }; 184 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 185 } 186 compPrefSize.put("jLabel2", new Dimension (34, 14)); 189 compPrefSize.put("jLabel2", new Dimension (34, 14)); 190 prefPadding.put("jLabel1-jLabel2-0-0-0", new Integer (10)); ld.endMoving(true); 192 ld.externalSizeChangeHappened(); 194 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 196 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 197 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 198 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 199 compBounds.put("jLabel1", new Rectangle (10, 40, 34, 14)); 200 baselinePosition.put("jLabel1-34-14", new Integer (11)); 201 compPrefSize.put("jLabel1", new Dimension (34, 14)); 202 compBounds.put("jLabel2", new Rectangle (81, 40, 34, 14)); 203 baselinePosition.put("jLabel2-34-14", new Integer (11)); 204 compPrefSize.put("jLabel2", new Dimension (34, 14)); 205 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 206 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 207 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 208 compBounds.put("jLabel1", new Rectangle (10, 40, 34, 14)); 209 baselinePosition.put("jLabel1-34-14", new Integer (11)); 210 compBounds.put("jLabel2", new Rectangle (81, 40, 34, 14)); 211 baselinePosition.put("jLabel2-34-14", new Integer (11)); 212 ld.updateCurrentState(); 213 } 215 216 } 217 | Popular Tags |