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_ParallelPosition07Test extends LayoutTestCase { 33 34 public ALT_ParallelPosition07Test(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() { 47 ld.externalSizeChangeHappened(); 48 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 50 compBounds.put("jScrollPane1", new Rectangle (10, 11, 104, 64)); 51 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 52 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 53 compBounds.put("jToggleButton1", new Rectangle (120, 11, 105, 23)); 54 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 55 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 56 compBounds.put("jScrollPane2", new Rectangle (231, 11, 104, 64)); 57 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 58 compPrefSize.put("jScrollPane2", new Dimension (104, 64)); 59 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 60 compBounds.put("jScrollPane1", new Rectangle (10, 11, 104, 64)); 61 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 62 compBounds.put("jToggleButton1", new Rectangle (120, 11, 105, 23)); 63 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 64 compBounds.put("jScrollPane2", new Rectangle (231, 11, 104, 64)); 65 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 66 ld.updateCurrentState(); 67 lc = new LayoutComponent("jLabel1", false); 69 baselinePosition.put("jLabel1-34-14", new Integer (11)); 71 { 72 LayoutComponent[] comps = new LayoutComponent[] { lc }; 73 Rectangle [] bounds = new Rectangle [] { 74 new Rectangle (0, 0, 34, 14) 75 }; 76 String defaultContId = null; 77 Point hotspot = new Point (13,7); 78 ld.startAdding(comps, bounds, hotspot, defaultContId); 79 } 80 prefPaddingInParent.put("Form-jLabel1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel1-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jLabel1-0-0-0", new Integer (4)); prefPadding.put("jLabel1-jScrollPane1-0-0-0", new Integer (4)); prefPadding.put("jScrollPane2-jLabel1-0-0-0", new Integer (4)); prefPadding.put("jLabel1-jScrollPane2-0-0-0", new Integer (4)); prefPadding.put("jToggleButton1-jLabel1-0-0-2", new Integer (10)); { 94 Point p = new Point (137,52); 95 String containerId= "Form"; 96 boolean autoPositioning = true; 97 boolean lockDimension = false; 98 Rectangle [] bounds = new Rectangle [] { 99 new Rectangle (118, 40, 34, 14) 100 }; 101 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 102 } 103 prefPaddingInParent.put("Form-jLabel1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel1-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jLabel1-0-0-0", new Integer (4)); prefPadding.put("jLabel1-jScrollPane1-0-0-0", new Integer (4)); prefPadding.put("jScrollPane2-jLabel1-0-0-0", new Integer (4)); prefPadding.put("jLabel1-jScrollPane2-0-0-0", new Integer (4)); prefPadding.put("jToggleButton1-jLabel1-0-0-2", new Integer (10)); { 117 Point p = new Point (136,52); 118 String containerId= "Form"; 119 boolean autoPositioning = true; 120 boolean lockDimension = false; 121 Rectangle [] bounds = new Rectangle [] { 122 new Rectangle (118, 40, 34, 14) 123 }; 124 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 125 } 126 compPrefSize.put("jLabel1", new Dimension (34, 14)); 129 compPrefSize.put("jLabel1", new Dimension (34, 14)); 130 prefPadding.put("jToggleButton1-jScrollPane2-0-0-0", new Integer (6)); prefPadding.put("jLabel1-jScrollPane2-0-0-0", new Integer (10)); ld.endMoving(true); 133 ld.externalSizeChangeHappened(); 135 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 137 compBounds.put("jScrollPane1", new Rectangle (10, 11, 104, 64)); 138 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 139 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 140 compBounds.put("jToggleButton1", new Rectangle (120, 11, 105, 23)); 141 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 142 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 143 compBounds.put("jScrollPane2", new Rectangle (231, 11, 104, 64)); 144 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 145 compPrefSize.put("jScrollPane2", new Dimension (104, 64)); 146 compBounds.put("jLabel1", new Rectangle (120, 40, 34, 14)); 147 baselinePosition.put("jLabel1-34-14", new Integer (11)); 148 compPrefSize.put("jLabel1", new Dimension (34, 14)); 149 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 150 compBounds.put("jScrollPane1", new Rectangle (10, 11, 104, 64)); 151 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 152 compBounds.put("jToggleButton1", new Rectangle (120, 11, 105, 23)); 153 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 154 compBounds.put("jScrollPane2", new Rectangle (231, 11, 104, 64)); 155 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 156 compBounds.put("jLabel1", new Rectangle (120, 40, 34, 14)); 157 baselinePosition.put("jLabel1-34-14", new Integer (11)); 158 ld.updateCurrentState(); 159 lc = new LayoutComponent("jLabel2", false); 161 baselinePosition.put("jLabel2-34-14", new Integer (11)); 163 { 164 LayoutComponent[] comps = new LayoutComponent[] { lc }; 165 Rectangle [] bounds = new Rectangle [] { 166 new Rectangle (118, 40, 34, 14) 167 }; 168 String defaultContId= "Form"; 169 Point hotspot = new Point (131,47); 170 ld.startAdding(comps, bounds, hotspot, defaultContId); 171 } 172 prefPaddingInParent.put("Form-jLabel2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel2-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel2-1-0-0", new Integer (6)); prefPadding.put("jLabel2-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel2-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jLabel2-0-0-0", new Integer (4)); prefPadding.put("jLabel2-jScrollPane1-0-0-0", new Integer (4)); prefPadding.put("jLabel1-jLabel2-0-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel1-0-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jLabel2-0-0-0", new Integer (4)); prefPadding.put("jLabel2-jScrollPane2-0-0-0", new Integer (4)); prefPadding.put("jToggleButton1-jLabel2-0-0-2", new Integer (10)); { 188 Point p = new Point (197,53); 189 String containerId= "Form"; 190 boolean autoPositioning = true; 191 boolean lockDimension = false; 192 Rectangle [] bounds = new Rectangle [] { 193 new Rectangle (191, 40, 34, 14) 194 }; 195 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 196 } 197 prefPaddingInParent.put("Form-jLabel2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel2-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jLabel2-1-0-0", new Integer (6)); prefPadding.put("jLabel2-jToggleButton1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel2-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jLabel2-0-0-0", new Integer (4)); prefPadding.put("jLabel2-jScrollPane1-0-0-0", new Integer (4)); prefPadding.put("jLabel1-jLabel2-0-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel1-0-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jLabel2-0-0-0", new Integer (4)); prefPadding.put("jLabel2-jScrollPane2-0-0-0", new Integer (4)); prefPadding.put("jToggleButton1-jLabel2-0-0-2", new Integer (10)); { 213 Point p = new Point (198,53); 214 String containerId= "Form"; 215 boolean autoPositioning = true; 216 boolean lockDimension = false; 217 Rectangle [] bounds = new Rectangle [] { 218 new Rectangle (191, 40, 34, 14) 219 }; 220 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 221 } 222 compPrefSize.put("jLabel2", new Dimension (34, 14)); 225 compPrefSize.put("jLabel2", new Dimension (34, 14)); 226 prefPadding.put("jLabel1-jLabel2-0-0-0", new Integer (10)); ld.endMoving(true); 228 ld.externalSizeChangeHappened(); 230 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 232 compBounds.put("jScrollPane1", new Rectangle (10, 11, 104, 64)); 233 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 234 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 235 compBounds.put("jToggleButton1", new Rectangle (120, 11, 105, 23)); 236 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 237 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 238 compBounds.put("jScrollPane2", new Rectangle (231, 11, 104, 64)); 239 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 240 compPrefSize.put("jScrollPane2", new Dimension (104, 64)); 241 compBounds.put("jLabel1", new Rectangle (120, 40, 34, 14)); 242 baselinePosition.put("jLabel1-34-14", new Integer (11)); 243 compPrefSize.put("jLabel1", new Dimension (34, 14)); 244 compBounds.put("jLabel2", new Rectangle (191, 40, 34, 14)); 245 baselinePosition.put("jLabel2-34-14", new Integer (11)); 246 compPrefSize.put("jLabel2", new Dimension (34, 14)); 247 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 248 compBounds.put("jScrollPane1", new Rectangle (10, 11, 104, 64)); 249 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 250 compBounds.put("jToggleButton1", new Rectangle (120, 11, 105, 23)); 251 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 252 compBounds.put("jScrollPane2", new Rectangle (231, 11, 104, 64)); 253 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 254 compBounds.put("jLabel1", new Rectangle (120, 40, 34, 14)); 255 baselinePosition.put("jLabel1-34-14", new Integer (11)); 256 compBounds.put("jLabel2", new Rectangle (191, 40, 34, 14)); 257 baselinePosition.put("jLabel2-34-14", new Integer (11)); 258 ld.updateCurrentState(); 259 } 261 262 } 263 | Popular Tags |