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_Bug66431_3Test extends LayoutTestCase { 31 32 public ALT_Bug66431_3Test(String name) { 33 super(name); 34 try { 35 className = this.getClass().getName(); 36 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 37 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 38 } catch (IOException ioe) { 39 fail(ioe.toString()); 40 } 41 } 42 43 public void doChanges0() { 47 ld.externalSizeChangeHappened(); 48 contInterior.put("Form", new Rectangle (0, 0, 400, 313)); 50 compBounds.put("jScrollPane1", new Rectangle (10, 40, 380, 196)); 51 baselinePosition.put("jScrollPane1-380-196", new Integer (0)); 52 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 53 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 54 baselinePosition.put("jButton1-75-23", new Integer (15)); 55 compPrefSize.put("jButton1", new Dimension (75, 23)); 56 compBounds.put("jButton2", new Rectangle (91, 11, 75, 23)); 57 baselinePosition.put("jButton2-75-23", new Integer (15)); 58 compPrefSize.put("jButton2", new Dimension (75, 23)); 59 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); compPrefSize.put("jButton1", new Dimension (75, 23)); 71 compPrefSize.put("jButton2", new Dimension (75, 23)); 72 prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); ld.updateCurrentState(); 75 ld.externalSizeChangeHappened(); 77 contInterior.put("Form", new Rectangle (0, 0, 400, 313)); 79 compBounds.put("jScrollPane1", new Rectangle (10, 40, 380, 196)); 80 baselinePosition.put("jScrollPane1-380-196", new Integer (0)); 81 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 82 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 83 baselinePosition.put("jButton1-75-23", new Integer (15)); 84 compPrefSize.put("jButton1", new Dimension (75, 23)); 85 compBounds.put("jButton2", new Rectangle (91, 11, 75, 23)); 86 baselinePosition.put("jButton2-75-23", new Integer (15)); 87 compPrefSize.put("jButton2", new Dimension (75, 23)); 88 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); compPrefSize.put("jButton1", new Dimension (75, 23)); 100 compPrefSize.put("jButton2", new Dimension (75, 23)); 101 prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); ld.updateCurrentState(); 104 baselinePosition.put("Form-400-313", new Integer (-1)); 107 prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); { 109 String [] compIds = new String [] { 110 "Form" 111 }; 112 Rectangle [] bounds = new Rectangle [] { 113 new Rectangle (0, 0, 400, 313) 114 }; 115 Point hotspot = new Point (139,312); 116 int[] resizeEdges = new int[] { 117 -1, 118 1 119 }; 120 boolean inLayout = false; 121 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 122 } 123 { 126 Point p = new Point (146,253); 127 String containerId = null; 128 boolean autoPositioning = true; 129 boolean lockDimension = false; 130 Rectangle [] bounds = new Rectangle [] { 131 new Rectangle (0, 0, 400, 247) 132 }; 133 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 134 } 135 { 138 Point p = new Point (146,252); 139 String containerId = null; 140 boolean autoPositioning = true; 141 boolean lockDimension = false; 142 Rectangle [] bounds = new Rectangle [] { 143 new Rectangle (0, 0, 400, 247) 144 }; 145 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 146 } 147 contInterior.put("Form", new Rectangle (0, 0, 400, 247)); 150 compBounds.put("jScrollPane1", new Rectangle (10, 40, 380, 196)); 151 baselinePosition.put("jScrollPane1-380-196", new Integer (0)); 152 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 153 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 154 baselinePosition.put("jButton1-75-23", new Integer (15)); 155 compPrefSize.put("jButton1", new Dimension (75, 23)); 156 compBounds.put("jButton2", new Rectangle (91, 11, 75, 23)); 157 baselinePosition.put("jButton2-75-23", new Integer (15)); 158 compPrefSize.put("jButton2", new Dimension (75, 23)); 159 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); compPrefSize.put("jButton1", new Dimension (75, 23)); 172 compPrefSize.put("jButton2", new Dimension (75, 23)); 173 prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); ld.endMoving(true); 177 ld.externalSizeChangeHappened(); 179 contInterior.put("Form", new Rectangle (0, 0, 400, 247)); 181 compBounds.put("jScrollPane1", new Rectangle (10, 40, 380, 196)); 182 baselinePosition.put("jScrollPane1-380-196", new Integer (0)); 183 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 184 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 185 baselinePosition.put("jButton1-75-23", new Integer (15)); 186 compPrefSize.put("jButton1", new Dimension (75, 23)); 187 compBounds.put("jButton2", new Rectangle (91, 11, 75, 23)); 188 baselinePosition.put("jButton2-75-23", new Integer (15)); 189 compPrefSize.put("jButton2", new Dimension (75, 23)); 190 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); compPrefSize.put("jButton1", new Dimension (75, 23)); 203 compPrefSize.put("jButton2", new Dimension (75, 23)); 204 prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); ld.updateCurrentState(); 208 baselinePosition.put("Form-400-247", new Integer (-1)); 211 compMinSize.put("Form", new Dimension (176, 247)); 212 { 213 String [] compIds = new String [] { 214 "Form" 215 }; 216 Rectangle [] bounds = new Rectangle [] { 217 new Rectangle (0, 0, 400, 247) 218 }; 219 Point hotspot = new Point (148,249); 220 int[] resizeEdges = new int[] { 221 -1, 222 1 223 }; 224 boolean inLayout = false; 225 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 226 } 227 { 230 Point p = new Point (149,329); 231 String containerId = null; 232 boolean autoPositioning = true; 233 boolean lockDimension = false; 234 Rectangle [] bounds = new Rectangle [] { 235 new Rectangle (0, 0, 400, 327) 236 }; 237 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 238 } 239 { 242 Point p = new Point (150,329); 243 String containerId = null; 244 boolean autoPositioning = true; 245 boolean lockDimension = false; 246 Rectangle [] bounds = new Rectangle [] { 247 new Rectangle (0, 0, 400, 327) 248 }; 249 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 250 } 251 contInterior.put("Form", new Rectangle (0, 0, 400, 327)); 254 compBounds.put("jScrollPane1", new Rectangle (10, 40, 380, 196)); 255 baselinePosition.put("jScrollPane1-380-196", new Integer (0)); 256 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 257 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 258 baselinePosition.put("jButton1-75-23", new Integer (15)); 259 compPrefSize.put("jButton1", new Dimension (75, 23)); 260 compBounds.put("jButton2", new Rectangle (91, 11, 75, 23)); 261 baselinePosition.put("jButton2-75-23", new Integer (15)); 262 compPrefSize.put("jButton2", new Dimension (75, 23)); 263 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); compPrefSize.put("jButton1", new Dimension (75, 23)); 271 compPrefSize.put("jButton2", new Dimension (75, 23)); 272 prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); ld.endMoving(true); 280 ld.externalSizeChangeHappened(); 282 contInterior.put("Form", new Rectangle (0, 0, 400, 327)); 284 compBounds.put("jScrollPane1", new Rectangle (10, 40, 380, 196)); 285 baselinePosition.put("jScrollPane1-380-196", new Integer (0)); 286 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 287 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 288 baselinePosition.put("jButton1-75-23", new Integer (15)); 289 compPrefSize.put("jButton1", new Dimension (75, 23)); 290 compBounds.put("jButton2", new Rectangle (91, 11, 75, 23)); 291 baselinePosition.put("jButton2-75-23", new Integer (15)); 292 compPrefSize.put("jButton2", new Dimension (75, 23)); 293 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-0", new Integer (11)); prefPadding.put("jButton1-jScrollPane1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jScrollPane1-1-0-0", new Integer (6)); ld.updateCurrentState(); 303 } 305 306 } 307 | Popular Tags |