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_ParallelPosition03Test extends LayoutTestCase { 32 33 public ALT_ParallelPosition03Test(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() { 47 ld.externalSizeChangeHappened(); 48 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 50 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 51 ld.updateCurrentState(); 52 lc = new LayoutComponent("jToggleButton1", false); 54 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 56 { 57 LayoutComponent[] comps = new LayoutComponent[] { lc }; 58 Rectangle [] bounds = new Rectangle [] { 59 new Rectangle (0, 0, 105, 23) 60 }; 61 String defaultContId = null; 62 Point hotspot = new Point (48,11); 63 ld.startAdding(comps, bounds, hotspot, defaultContId); 64 } 65 prefPaddingInParent.put("Form-jToggleButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jToggleButton1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jToggleButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jToggleButton1-0-1", new Integer (10)); { 72 Point p = new Point (61,27); 73 String containerId= "Form"; 74 boolean autoPositioning = true; 75 boolean lockDimension = false; 76 Rectangle [] bounds = new Rectangle [] { 77 new Rectangle (10, 11, 105, 23) 78 }; 79 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 80 } 81 prefPaddingInParent.put("Form-jToggleButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jToggleButton1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jToggleButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jToggleButton1-0-1", new Integer (10)); { 88 Point p = new Point (60,27); 89 String containerId= "Form"; 90 boolean autoPositioning = true; 91 boolean lockDimension = false; 92 Rectangle [] bounds = new Rectangle [] { 93 new Rectangle (10, 11, 105, 23) 94 }; 95 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 96 } 97 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 100 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 101 prefPaddingInParent.put("Form-jToggleButton1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jToggleButton1-1-1", new Integer (10)); ld.endMoving(true); 104 ld.externalSizeChangeHappened(); 106 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 108 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 109 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 110 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 111 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 112 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 113 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 114 ld.updateCurrentState(); 115 lc = new LayoutComponent("jScrollPane1", false); 117 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 119 { 120 LayoutComponent[] comps = new LayoutComponent[] { lc }; 121 Rectangle [] bounds = new Rectangle [] { 122 new Rectangle (0, 0, 104, 64) 123 }; 124 String defaultContId = null; 125 Point hotspot = new Point (48,32); 126 ld.startAdding(comps, bounds, hotspot, defaultContId); 127 } 128 prefPaddingInParent.put("Form-jScrollPane1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPadding.put("jToggleButton1-jScrollPane1-0-0-0", new Integer (6)); prefPadding.put("jScrollPane1-jToggleButton1-0-0-0", new Integer (6)); { 137 Point p = new Point (172,47); 138 String containerId= "Form"; 139 boolean autoPositioning = true; 140 boolean lockDimension = false; 141 Rectangle [] bounds = new Rectangle [] { 142 new Rectangle (121, 11, 104, 64) 143 }; 144 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 145 } 146 prefPaddingInParent.put("Form-jScrollPane1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPadding.put("jToggleButton1-jScrollPane1-0-0-0", new Integer (6)); prefPadding.put("jScrollPane1-jToggleButton1-0-0-0", new Integer (6)); { 155 Point p = new Point (172,46); 156 String containerId= "Form"; 157 boolean autoPositioning = true; 158 boolean lockDimension = false; 159 Rectangle [] bounds = new Rectangle [] { 160 new Rectangle (121, 11, 104, 64) 161 }; 162 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 163 } 164 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 167 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 168 prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (10)); ld.endMoving(true); 171 ld.externalSizeChangeHappened(); 173 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 175 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 176 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 177 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 178 compBounds.put("jScrollPane1", new Rectangle (121, 11, 104, 64)); 179 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 180 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 181 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 182 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 183 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 184 compBounds.put("jScrollPane1", new Rectangle (121, 11, 104, 64)); 185 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 186 ld.updateCurrentState(); 187 lc = new LayoutComponent("jButton1", false); 189 baselinePosition.put("jButton1-75-23", new Integer (15)); 191 { 192 LayoutComponent[] comps = new LayoutComponent[] { lc }; 193 Rectangle [] bounds = new Rectangle [] { 194 new Rectangle (0, 0, 75, 23) 195 }; 196 String defaultContId = null; 197 Point hotspot = new Point (33,11); 198 ld.startAdding(comps, bounds, hotspot, defaultContId); 199 } 200 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("jScrollPane1-jButton1-0-0-0", new Integer (6)); prefPadding.put("jButton1-jScrollPane1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 212 Point p = new Point (70,48); 213 String containerId= "Form"; 214 boolean autoPositioning = true; 215 boolean lockDimension = false; 216 Rectangle [] bounds = new Rectangle [] { 217 new Rectangle (40, 40, 75, 23) 218 }; 219 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 220 } 221 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("jScrollPane1-jButton1-0-0-0", new Integer (6)); prefPadding.put("jButton1-jScrollPane1-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 233 Point p = new Point (71,48); 234 String containerId= "Form"; 235 boolean autoPositioning = true; 236 boolean lockDimension = false; 237 Rectangle [] bounds = new Rectangle [] { 238 new Rectangle (40, 40, 75, 23) 239 }; 240 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 241 } 242 compPrefSize.put("jButton1", new Dimension (75, 23)); 245 compPrefSize.put("jButton1", new Dimension (75, 23)); 246 prefPaddingInParent.put("Form-jToggleButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); ld.endMoving(true); 249 ld.externalSizeChangeHappened(); 251 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 253 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 254 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 255 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 256 compBounds.put("jScrollPane1", new Rectangle (121, 11, 104, 64)); 257 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 258 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 259 compBounds.put("jButton1", new Rectangle (40, 40, 75, 23)); 260 baselinePosition.put("jButton1-75-23", new Integer (15)); 261 compPrefSize.put("jButton1", new Dimension (75, 23)); 262 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 263 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 264 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 265 compBounds.put("jScrollPane1", new Rectangle (121, 11, 104, 64)); 266 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 267 compBounds.put("jButton1", new Rectangle (40, 40, 75, 23)); 268 baselinePosition.put("jButton1-75-23", new Integer (15)); 269 ld.updateCurrentState(); 270 } 272 273 public void doChanges1() { 276 baselinePosition.put("jButton1-75-23", new Integer (15)); 278 compPrefSize.put("jButton1", new Dimension (75, 23)); 279 { 280 String [] compIds = new String [] { 281 "jButton1" 282 }; 283 Rectangle [] bounds = new Rectangle [] { 284 new Rectangle (40, 40, 75, 23) 285 }; 286 Point hotspot = new Point (36,49); 287 int[] resizeEdges = new int[] { 288 0, 289 -1 290 }; 291 boolean inLayout = true; 292 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 293 } 294 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 299 Point p = new Point (10,49); 300 String containerId= "Form"; 301 boolean autoPositioning = true; 302 boolean lockDimension = false; 303 Rectangle [] bounds = new Rectangle [] { 304 new Rectangle (10, 40, 105, 23) 305 }; 306 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 307 } 308 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 313 Point p = new Point (9,49); 314 String containerId= "Form"; 315 boolean autoPositioning = true; 316 boolean lockDimension = false; 317 Rectangle [] bounds = new Rectangle [] { 318 new Rectangle (10, 40, 105, 23) 319 }; 320 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 321 } 322 compPrefSize.put("jButton1", new Dimension (75, 23)); 325 ld.endMoving(true); 326 ld.externalSizeChangeHappened(); 328 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 330 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 331 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 332 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 333 compBounds.put("jScrollPane1", new Rectangle (121, 11, 104, 64)); 334 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 335 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 336 compBounds.put("jButton1", new Rectangle (10, 40, 105, 23)); 337 baselinePosition.put("jButton1-105-23", new Integer (15)); 338 compPrefSize.put("jButton1", new Dimension (75, 23)); 339 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 340 compBounds.put("jToggleButton1", new Rectangle (10, 11, 105, 23)); 341 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 342 compBounds.put("jScrollPane1", new Rectangle (121, 11, 104, 64)); 343 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 344 compBounds.put("jButton1", new Rectangle (10, 40, 105, 23)); 345 baselinePosition.put("jButton1-105-23", new Integer (15)); 346 ld.updateCurrentState(); 347 } 349 350 } 351 | Popular Tags |