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_ParallelPosition08Test extends LayoutTestCase { 33 34 public ALT_ParallelPosition08Test(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() { 48 ld.externalSizeChangeHappened(); 49 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 51 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 52 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 53 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 54 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 55 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 56 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 57 ld.updateCurrentState(); 58 lc = new LayoutComponent("jButton1", false); 60 baselinePosition.put("jButton1-75-23", new Integer (15)); 62 { 63 LayoutComponent[] comps = new LayoutComponent[] { lc }; 64 Rectangle [] bounds = new Rectangle [] { 65 new Rectangle (0, 0, 75, 23) 66 }; 67 String defaultContId = null; 68 Point hotspot = new Point (33,11); 69 ld.startAdding(comps, bounds, hotspot, defaultContId); 70 } 71 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)); { 81 Point p = new Point (58,55); 82 String containerId= "Form"; 83 boolean autoPositioning = true; 84 boolean lockDimension = false; 85 Rectangle [] bounds = new Rectangle [] { 86 new Rectangle (20, 40, 75, 23) 87 }; 88 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 89 } 90 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)); { 100 Point p = new Point (58,54); 101 String containerId= "Form"; 102 boolean autoPositioning = true; 103 boolean lockDimension = false; 104 Rectangle [] bounds = new Rectangle [] { 105 new Rectangle (20, 40, 75, 23) 106 }; 107 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 108 } 109 compPrefSize.put("jButton1", new Dimension (75, 23)); 112 compPrefSize.put("jButton1", new Dimension (75, 23)); 113 prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (10)); ld.endMoving(true); 116 ld.externalSizeChangeHappened(); 118 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 120 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 121 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 122 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 123 compBounds.put("jButton1", new Rectangle (20, 40, 75, 23)); 124 baselinePosition.put("jButton1-75-23", new Integer (15)); 125 compPrefSize.put("jButton1", new Dimension (75, 23)); 126 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 127 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 128 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 129 compBounds.put("jButton1", new Rectangle (20, 40, 75, 23)); 130 baselinePosition.put("jButton1-75-23", new Integer (15)); 131 ld.updateCurrentState(); 132 lc = new LayoutComponent("jButton2", false); 134 baselinePosition.put("jButton2-75-23", new Integer (15)); 136 { 137 LayoutComponent[] comps = new LayoutComponent[] { lc }; 138 Rectangle [] bounds = new Rectangle [] { 139 new Rectangle (20, 40, 75, 23) 140 }; 141 String defaultContId= "Form"; 142 Point hotspot = new Point (53,51); 143 ld.startAdding(comps, bounds, hotspot, defaultContId); 144 } 145 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)); { 157 Point p = new Point (145,54); 158 String containerId= "Form"; 159 boolean autoPositioning = true; 160 boolean lockDimension = false; 161 Rectangle [] bounds = new Rectangle [] { 162 new Rectangle (114, 40, 75, 23) 163 }; 164 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 165 } 166 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)); { 178 Point p = new Point (146,54); 179 String containerId= "Form"; 180 boolean autoPositioning = true; 181 boolean lockDimension = false; 182 Rectangle [] bounds = new Rectangle [] { 183 new Rectangle (114, 40, 75, 23) 184 }; 185 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 186 } 187 compPrefSize.put("jButton2", new Dimension (75, 23)); 190 compPrefSize.put("jButton2", new Dimension (75, 23)); 191 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (10)); ld.endMoving(true); 193 ld.externalSizeChangeHappened(); 195 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 197 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 198 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 199 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 200 compBounds.put("jButton1", new Rectangle (20, 40, 75, 23)); 201 baselinePosition.put("jButton1-75-23", new Integer (15)); 202 compPrefSize.put("jButton1", new Dimension (75, 23)); 203 compBounds.put("jButton2", new Rectangle (114, 40, 75, 23)); 204 baselinePosition.put("jButton2-75-23", new Integer (15)); 205 compPrefSize.put("jButton2", new Dimension (75, 23)); 206 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 207 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 208 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 209 compBounds.put("jButton1", new Rectangle (20, 40, 75, 23)); 210 baselinePosition.put("jButton1-75-23", new Integer (15)); 211 compBounds.put("jButton2", new Rectangle (114, 40, 75, 23)); 212 baselinePosition.put("jButton2-75-23", new Integer (15)); 213 ld.updateCurrentState(); 214 } 216 217 public void doChanges1() { 219 baselinePosition.put("jButton1-75-23", new Integer (15)); 221 compPrefSize.put("jButton1", new Dimension (75, 23)); 222 { 223 String [] compIds = new String [] { 224 "jButton1" 225 }; 226 Rectangle [] bounds = new Rectangle [] { 227 new Rectangle (20, 40, 75, 23) 228 }; 229 Point hotspot = new Point (21,50); 230 int[] resizeEdges = new int[] { 231 0, 232 -1 233 }; 234 boolean inLayout = true; 235 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 236 } 237 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 242 Point p = new Point (14,51); 243 String containerId= "Form"; 244 boolean autoPositioning = true; 245 boolean lockDimension = false; 246 Rectangle [] bounds = new Rectangle [] { 247 new Rectangle (10, 40, 85, 23) 248 }; 249 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 250 } 251 prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 256 Point p = new Point (13,51); 257 String containerId= "Form"; 258 boolean autoPositioning = true; 259 boolean lockDimension = false; 260 Rectangle [] bounds = new Rectangle [] { 261 new Rectangle (10, 40, 85, 23) 262 }; 263 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 264 } 265 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); ld.endMoving(true); 269 ld.externalSizeChangeHappened(); 271 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 273 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 274 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 275 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 276 compBounds.put("jButton2", new Rectangle (114, 40, 75, 23)); 277 baselinePosition.put("jButton2-75-23", new Integer (15)); 278 compPrefSize.put("jButton2", new Dimension (75, 23)); 279 compBounds.put("jButton1", new Rectangle (10, 40, 85, 23)); 280 baselinePosition.put("jButton1-85-23", new Integer (15)); 281 compPrefSize.put("jButton1", new Dimension (75, 23)); 282 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 283 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 284 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 285 compBounds.put("jButton2", new Rectangle (114, 40, 75, 23)); 286 baselinePosition.put("jButton2-75-23", new Integer (15)); 287 compBounds.put("jButton1", new Rectangle (10, 40, 85, 23)); 288 baselinePosition.put("jButton1-85-23", new Integer (15)); 289 ld.updateCurrentState(); 290 } 292 293 } 294 | Popular Tags |