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_ParallelPosition04Test extends LayoutTestCase { 32 33 public ALT_ParallelPosition04Test(String 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 (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 39 } catch (IOException ioe) { 40 fail(ioe.toString()); 41 } 42 } 43 44 public void doChanges0() { 48 ld.externalSizeChangeHappened(); 49 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 51 compBounds.put("jButton1", new Rectangle (10, 11, 41, 23)); 52 baselinePosition.put("jButton1-41-23", new Integer (15)); 53 compPrefSize.put("jButton1", new Dimension (41, 23)); 54 compBounds.put("jButton2", new Rectangle (10, 40, 47, 23)); 55 baselinePosition.put("jButton2-47-23", new Integer (15)); 56 compPrefSize.put("jButton2", new Dimension (47, 23)); 57 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 58 baselinePosition.put("jButton3-75-23", new Integer (15)); 59 compPrefSize.put("jButton3", new Dimension (75, 23)); 60 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 61 compBounds.put("jButton1", new Rectangle (10, 11, 41, 23)); 62 baselinePosition.put("jButton1-41-23", new Integer (15)); 63 compBounds.put("jButton2", new Rectangle (10, 40, 47, 23)); 64 baselinePosition.put("jButton2-47-23", new Integer (15)); 65 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 66 baselinePosition.put("jButton3-75-23", new Integer (15)); 67 ld.updateCurrentState(); 68 baselinePosition.put("jButton2-47-23", new Integer (15)); 71 { 72 String [] compIds = new String [] { 73 "jButton2" 74 }; 75 Rectangle [] bounds = new Rectangle [] { 76 new Rectangle (10, 40, 47, 23) 77 }; 78 Point hotspot = new Point (22,55); 79 ld.startMoving(compIds, bounds, hotspot); 80 } 81 prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton2-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton3-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton2-jButton3-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-2", new Integer (10)); { 93 Point p = new Point (44,59); 94 String containerId= "Form"; 95 boolean autoPositioning = true; 96 boolean lockDimension = false; 97 Rectangle [] bounds = new Rectangle [] { 98 new Rectangle (38, 40, 47, 23) 99 }; 100 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 101 } 102 prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton2-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton3-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton2-jButton3-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-2", new Integer (10)); { 114 Point p = new Point (44,60); 115 String containerId= "Form"; 116 boolean autoPositioning = true; 117 boolean lockDimension = false; 118 Rectangle [] bounds = new Rectangle [] { 119 new Rectangle (38, 40, 47, 23) 120 }; 121 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 122 } 123 prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); ld.endMoving(true); 127 ld.externalSizeChangeHappened(); 129 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 131 compBounds.put("jButton1", new Rectangle (10, 11, 41, 23)); 132 baselinePosition.put("jButton1-41-23", new Integer (15)); 133 compPrefSize.put("jButton1", new Dimension (41, 23)); 134 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 135 baselinePosition.put("jButton3-75-23", new Integer (15)); 136 compPrefSize.put("jButton3", new Dimension (75, 23)); 137 compBounds.put("jButton2", new Rectangle (38, 40, 47, 23)); 138 baselinePosition.put("jButton2-47-23", new Integer (15)); 139 compPrefSize.put("jButton2", new Dimension (47, 23)); 140 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 141 compBounds.put("jButton1", new Rectangle (10, 11, 41, 23)); 142 baselinePosition.put("jButton1-41-23", new Integer (15)); 143 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 144 baselinePosition.put("jButton3-75-23", new Integer (15)); 145 compBounds.put("jButton2", new Rectangle (38, 40, 47, 23)); 146 baselinePosition.put("jButton2-47-23", new Integer (15)); 147 ld.updateCurrentState(); 148 baselinePosition.put("jButton1-41-23", new Integer (15)); 151 { 152 String [] compIds = new String [] { 153 "jButton1" 154 }; 155 Rectangle [] bounds = new Rectangle [] { 156 new Rectangle (10, 11, 41, 23) 157 }; 158 Point hotspot = new Point (37,27); 159 ld.startMoving(compIds, bounds, hotspot); 160 } 161 prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPadding.put("jButton2-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton3-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton3-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); { 172 Point p = new Point (72,27); 173 String containerId= "Form"; 174 boolean autoPositioning = true; 175 boolean lockDimension = false; 176 Rectangle [] bounds = new Rectangle [] { 177 new Rectangle (44, 11, 41, 23) 178 }; 179 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 180 } 181 prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPadding.put("jButton2-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jButton3-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton3-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); { 192 Point p = new Point (73,27); 193 String containerId= "Form"; 194 boolean autoPositioning = true; 195 boolean lockDimension = false; 196 Rectangle [] bounds = new Rectangle [] { 197 new Rectangle (44, 11, 41, 23) 198 }; 199 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 200 } 201 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton3-0-0", new Integer (10)); prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); ld.endMoving(true); 208 ld.externalSizeChangeHappened(); 210 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 212 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 213 baselinePosition.put("jButton3-75-23", new Integer (15)); 214 compPrefSize.put("jButton3", new Dimension (75, 23)); 215 compBounds.put("jButton2", new Rectangle (38, 40, 47, 23)); 216 baselinePosition.put("jButton2-47-23", new Integer (15)); 217 compPrefSize.put("jButton2", new Dimension (47, 23)); 218 compBounds.put("jButton1", new Rectangle (44, 11, 41, 23)); 219 baselinePosition.put("jButton1-41-23", new Integer (15)); 220 compPrefSize.put("jButton1", new Dimension (41, 23)); 221 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 222 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 223 baselinePosition.put("jButton3-75-23", new Integer (15)); 224 compBounds.put("jButton2", new Rectangle (38, 40, 47, 23)); 225 baselinePosition.put("jButton2-47-23", new Integer (15)); 226 compBounds.put("jButton1", new Rectangle (44, 11, 41, 23)); 227 baselinePosition.put("jButton1-41-23", new Integer (15)); 228 ld.updateCurrentState(); 229 baselinePosition.put("jButton2-47-23", new Integer (15)); 232 compPrefSize.put("jButton2", new Dimension (47, 23)); 233 { 234 String [] compIds = new String [] { 235 "jButton2" 236 }; 237 Rectangle [] bounds = new Rectangle [] { 238 new Rectangle (38, 40, 47, 23) 239 }; 240 Point hotspot = new Point (39,51); 241 int[] resizeEdges = new int[] { 242 0, 243 -1 244 }; 245 boolean inLayout = true; 246 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 247 } 248 prefPaddingInParent.put("Form-jButton2-0-0", new Integer (10)); prefPadding.put("jButton1-jButton2-0-0-2", new Integer (10)); { 253 Point p = new Point (14,55); 254 String containerId= "Form"; 255 boolean autoPositioning = true; 256 boolean lockDimension = false; 257 Rectangle [] bounds = new Rectangle [] { 258 new Rectangle (10, 40, 75, 23) 259 }; 260 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 261 } 262 prefPaddingInParent.put("Form-jButton2-0-0", new Integer (10)); prefPadding.put("jButton1-jButton2-0-0-2", new Integer (10)); { 267 Point p = new Point (13,55); 268 String containerId= "Form"; 269 boolean autoPositioning = true; 270 boolean lockDimension = false; 271 Rectangle [] bounds = new Rectangle [] { 272 new Rectangle (10, 40, 75, 23) 273 }; 274 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 275 } 276 compPrefSize.put("jButton2", new Dimension (47, 23)); 279 ld.endMoving(true); 280 ld.externalSizeChangeHappened(); 282 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 284 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 285 baselinePosition.put("jButton3-75-23", new Integer (15)); 286 compPrefSize.put("jButton3", new Dimension (75, 23)); 287 compBounds.put("jButton1", new Rectangle (44, 11, 41, 23)); 288 baselinePosition.put("jButton1-41-23", new Integer (15)); 289 compPrefSize.put("jButton1", new Dimension (41, 23)); 290 compBounds.put("jButton2", new Rectangle (10, 40, 75, 23)); 291 baselinePosition.put("jButton2-75-23", new Integer (15)); 292 compPrefSize.put("jButton2", new Dimension (47, 23)); 293 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 294 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 295 baselinePosition.put("jButton3-75-23", new Integer (15)); 296 compBounds.put("jButton1", new Rectangle (44, 11, 41, 23)); 297 baselinePosition.put("jButton1-41-23", new Integer (15)); 298 compBounds.put("jButton2", new Rectangle (10, 40, 75, 23)); 299 baselinePosition.put("jButton2-75-23", new Integer (15)); 300 ld.updateCurrentState(); 301 baselinePosition.put("jButton1-41-23", new Integer (15)); 304 compPrefSize.put("jButton1", new Dimension (41, 23)); 305 { 306 String [] compIds = new String [] { 307 "jButton1" 308 }; 309 Rectangle [] bounds = new Rectangle [] { 310 new Rectangle (44, 11, 41, 23) 311 }; 312 Point hotspot = new Point (45,25); 313 int[] resizeEdges = new int[] { 314 0, 315 -1 316 }; 317 boolean inLayout = true; 318 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 319 } 320 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); { 324 Point p = new Point (10,27); 325 String containerId= "Form"; 326 boolean autoPositioning = true; 327 boolean lockDimension = false; 328 Rectangle [] bounds = new Rectangle [] { 329 new Rectangle (10, 11, 75, 23) 330 }; 331 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 332 } 333 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); { 337 Point p = new Point (9,27); 338 String containerId= "Form"; 339 boolean autoPositioning = true; 340 boolean lockDimension = false; 341 Rectangle [] bounds = new Rectangle [] { 342 new Rectangle (10, 11, 75, 23) 343 }; 344 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 345 } 346 compPrefSize.put("jButton1", new Dimension (41, 23)); 349 ld.endMoving(true); 350 ld.externalSizeChangeHappened(); 352 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 354 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 355 baselinePosition.put("jButton3-75-23", new Integer (15)); 356 compPrefSize.put("jButton3", new Dimension (75, 23)); 357 compBounds.put("jButton2", new Rectangle (10, 40, 75, 23)); 358 baselinePosition.put("jButton2-75-23", new Integer (15)); 359 compPrefSize.put("jButton2", new Dimension (47, 23)); 360 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 361 baselinePosition.put("jButton1-75-23", new Integer (15)); 362 compPrefSize.put("jButton1", new Dimension (41, 23)); 363 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 364 compBounds.put("jButton3", new Rectangle (10, 69, 75, 23)); 365 baselinePosition.put("jButton3-75-23", new Integer (15)); 366 compBounds.put("jButton2", new Rectangle (10, 40, 75, 23)); 367 baselinePosition.put("jButton2-75-23", new Integer (15)); 368 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 369 baselinePosition.put("jButton1-75-23", new Integer (15)); 370 ld.updateCurrentState(); 371 } 373 374 } 375 | Popular Tags |