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_ParallelPosition09Test extends LayoutTestCase { 34 35 public ALT_ParallelPosition09Test(String name) { 36 super(name); 37 try { 38 className = this.getClass().getName(); 39 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 40 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 41 } catch (IOException ioe) { 42 fail(ioe.toString()); 43 } 44 } 45 46 public void doChanges0() { 49 ld.externalSizeChangeHappened(); 50 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 52 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 53 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 54 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 55 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 56 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 57 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 58 ld.updateCurrentState(); 59 lc = new LayoutComponent("jButton1", false); 61 baselinePosition.put("jButton1-75-23", new Integer (15)); 63 { 64 LayoutComponent[] comps = new LayoutComponent[] { lc }; 65 Rectangle [] bounds = new Rectangle [] { 66 new Rectangle (0, 0, 75, 23) 67 }; 68 String defaultContId = null; 69 Point hotspot = new Point (33,11); 70 ld.startAdding(comps, bounds, hotspot, defaultContId); 71 } 72 prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 82 Point p = new Point (343,50); 83 String containerId= "Form"; 84 boolean autoPositioning = true; 85 boolean lockDimension = false; 86 Rectangle [] bounds = new Rectangle [] { 87 new Rectangle (315, 40, 75, 23) 88 }; 89 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 90 } 91 prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 101 Point p = new Point (344,50); 102 String containerId= "Form"; 103 boolean autoPositioning = true; 104 boolean lockDimension = false; 105 Rectangle [] bounds = new Rectangle [] { 106 new Rectangle (315, 40, 75, 23) 107 }; 108 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 109 } 110 compPrefSize.put("jButton1", new Dimension (75, 23)); 113 compPrefSize.put("jButton1", new Dimension (75, 23)); 114 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (10)); ld.endMoving(true); 117 ld.externalSizeChangeHappened(); 119 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 121 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 122 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 123 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 124 compBounds.put("jButton1", new Rectangle (315, 40, 75, 23)); 125 baselinePosition.put("jButton1-75-23", new Integer (15)); 126 compPrefSize.put("jButton1", new Dimension (75, 23)); 127 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 128 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 129 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 130 compBounds.put("jButton1", new Rectangle (315, 40, 75, 23)); 131 baselinePosition.put("jButton1-75-23", new Integer (15)); 132 ld.updateCurrentState(); 133 lc = new LayoutComponent("jButton2", false); 135 baselinePosition.put("jButton2-75-23", new Integer (15)); 137 { 138 LayoutComponent[] comps = new LayoutComponent[] { lc }; 139 Rectangle [] bounds = new Rectangle [] { 140 new Rectangle (315, 40, 75, 23) 141 }; 142 String defaultContId= "Form"; 143 Point hotspot = new Point (348,51); 144 ld.startAdding(comps, bounds, hotspot, defaultContId); 145 } 146 prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton2-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton2-0-0-2", new Integer (10)); { 158 Point p = new Point (255,56); 159 String containerId= "Form"; 160 boolean autoPositioning = true; 161 boolean lockDimension = false; 162 Rectangle [] bounds = new Rectangle [] { 163 new Rectangle (221, 40, 75, 23) 164 }; 165 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 166 } 167 prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton2-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton2-0-0-2", new Integer (10)); { 179 Point p = new Point (254,56); 180 String containerId= "Form"; 181 boolean autoPositioning = true; 182 boolean lockDimension = false; 183 Rectangle [] bounds = new Rectangle [] { 184 new Rectangle (221, 40, 75, 23) 185 }; 186 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 187 } 188 compPrefSize.put("jButton2", new Dimension (75, 23)); 191 compPrefSize.put("jButton2", new Dimension (75, 23)); 192 prefPadding.put("jButton2-jButton1-0-0-0", new Integer (10)); ld.endMoving(true); 194 ld.externalSizeChangeHappened(); 196 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 198 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 199 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 200 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 201 compBounds.put("jButton1", new Rectangle (315, 40, 75, 23)); 202 baselinePosition.put("jButton1-75-23", new Integer (15)); 203 compPrefSize.put("jButton1", new Dimension (75, 23)); 204 compBounds.put("jButton2", new Rectangle (221, 40, 75, 23)); 205 baselinePosition.put("jButton2-75-23", new Integer (15)); 206 compPrefSize.put("jButton2", new Dimension (75, 23)); 207 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 208 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 209 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 210 compBounds.put("jButton1", new Rectangle (315, 40, 75, 23)); 211 baselinePosition.put("jButton1-75-23", new Integer (15)); 212 compBounds.put("jButton2", new Rectangle (221, 40, 75, 23)); 213 baselinePosition.put("jButton2-75-23", new Integer (15)); 214 ld.updateCurrentState(); 215 } 217 218 public void doChanges1() { 220 baselinePosition.put("jButton1-75-23", new Integer (15)); 222 compPrefSize.put("jButton1", new Dimension (75, 23)); 223 { 224 String [] compIds = new String [] { 225 "jButton1" 226 }; 227 Rectangle [] bounds = new Rectangle [] { 228 new Rectangle (315, 40, 75, 23) 229 }; 230 Point hotspot = new Point (315,50); 231 int[] resizeEdges = new int[] { 232 0, 233 -1 234 }; 235 boolean inLayout = true; 236 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 237 } 238 prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 243 Point p = new Point (306,51); 244 String containerId= "Form"; 245 boolean autoPositioning = true; 246 boolean lockDimension = false; 247 Rectangle [] bounds = new Rectangle [] { 248 new Rectangle (302, 40, 88, 23) 249 }; 250 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 251 } 252 prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 257 Point p = new Point (306,52); 258 String containerId= "Form"; 259 boolean autoPositioning = true; 260 boolean lockDimension = false; 261 Rectangle [] bounds = new Rectangle [] { 262 new Rectangle (302, 40, 88, 23) 263 }; 264 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 265 } 266 compPrefSize.put("jButton1", new Dimension (75, 23)); 269 ld.endMoving(true); 270 ld.externalSizeChangeHappened(); 272 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 274 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 275 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 276 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 277 compBounds.put("jButton2", new Rectangle (221, 40, 75, 23)); 278 baselinePosition.put("jButton2-75-23", new Integer (15)); 279 compPrefSize.put("jButton2", new Dimension (75, 23)); 280 compBounds.put("jButton1", new Rectangle (302, 40, 88, 23)); 281 baselinePosition.put("jButton1-88-23", new Integer (15)); 282 compPrefSize.put("jButton1", new Dimension (75, 23)); 283 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 284 compBounds.put("jToggleButton1", new Rectangle (211, 11, 179, 23)); 285 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 286 compBounds.put("jButton2", new Rectangle (221, 40, 75, 23)); 287 baselinePosition.put("jButton2-75-23", new Integer (15)); 288 compBounds.put("jButton1", new Rectangle (302, 40, 88, 23)); 289 baselinePosition.put("jButton1-88-23", new Integer (15)); 290 ld.updateCurrentState(); 291 } 293 294 } 295 | Popular Tags |