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_ParallelPosition21Test extends LayoutTestCase { 34 35 public ALT_ParallelPosition21Test(String name) { 36 super(name); 37 try { 38 className = this.getClass().getName(); 39 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 40 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 41 } catch (IOException ioe) { 42 fail(ioe.toString()); 43 } 44 } 45 46 public void doChanges0() { 50 ld.externalSizeChangeHappened(); 51 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 53 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 54 baselinePosition.put("jLabel1-34-14", new Integer (11)); 55 compPrefSize.put("jLabel1", new Dimension (34, 14)); 56 compBounds.put("jScrollPane1", new Rectangle (157, 11, 37, 132)); 57 baselinePosition.put("jScrollPane1-37-132", new Integer (0)); 58 compPrefSize.put("jScrollPane1", new Dimension (37, 132)); 59 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 60 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 61 baselinePosition.put("jLabel1-34-14", new Integer (11)); 62 compBounds.put("jScrollPane1", new Rectangle (157, 11, 37, 132)); 63 baselinePosition.put("jScrollPane1-37-132", new Integer (0)); 64 ld.updateCurrentState(); 65 lc = new LayoutComponent("jScrollPane2", false); 67 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 69 { 70 LayoutComponent[] comps = new LayoutComponent[] { lc }; 71 Rectangle [] bounds = new Rectangle [] { 72 new Rectangle (0, 0, 104, 64) 73 }; 74 String defaultContId = null; 75 Point hotspot = new Point (48,32); 76 ld.startAdding(comps, bounds, hotspot, defaultContId); 77 } 78 prefPaddingInParent.put("Form-jScrollPane2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane2-1-1", new Integer (11)); prefPadding.put("jLabel1-jScrollPane2-1-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jLabel1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane2-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jScrollPane2-0-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jScrollPane1-0-0-0", new Integer (6)); { 89 Point p = new Point (63,114); 90 String containerId= "Form"; 91 boolean autoPositioning = true; 92 boolean lockDimension = false; 93 Rectangle [] bounds = new Rectangle [] { 94 new Rectangle (10, 79, 104, 64) 95 }; 96 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 97 } 98 prefPaddingInParent.put("Form-jScrollPane2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane2-1-1", new Integer (11)); prefPadding.put("jLabel1-jScrollPane2-1-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jLabel1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane2-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jScrollPane2-0-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jScrollPane1-0-0-0", new Integer (6)); { 109 Point p = new Point (63,115); 110 String containerId= "Form"; 111 boolean autoPositioning = true; 112 boolean lockDimension = false; 113 Rectangle [] bounds = new Rectangle [] { 114 new Rectangle (10, 79, 104, 64) 115 }; 116 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 117 } 118 compPrefSize.put("jScrollPane2", new Dimension (104, 64)); 121 compPrefSize.put("jScrollPane2", new Dimension (104, 64)); 122 prefPadding.put("jScrollPane2-jScrollPane1-0-0-0", new Integer (10)); prefPadding.put("jLabel1-jScrollPane2-1-0-0", new Integer (10)); ld.endMoving(true); 125 ld.externalSizeChangeHappened(); 127 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 129 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 130 baselinePosition.put("jLabel1-34-14", new Integer (11)); 131 compPrefSize.put("jLabel1", new Dimension (34, 14)); 132 compBounds.put("jScrollPane1", new Rectangle (157, 11, 37, 132)); 133 baselinePosition.put("jScrollPane1-37-132", new Integer (0)); 134 compPrefSize.put("jScrollPane1", new Dimension (37, 132)); 135 compBounds.put("jScrollPane2", new Rectangle (10, 79, 104, 64)); 136 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 137 compPrefSize.put("jScrollPane2", new Dimension (104, 64)); 138 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 139 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 140 baselinePosition.put("jLabel1-34-14", new Integer (11)); 141 compBounds.put("jScrollPane1", new Rectangle (157, 11, 37, 132)); 142 baselinePosition.put("jScrollPane1-37-132", new Integer (0)); 143 compBounds.put("jScrollPane2", new Rectangle (10, 79, 104, 64)); 144 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 145 ld.updateCurrentState(); 146 } 148 149 public void doChanges1() { 153 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 155 { 156 String [] compIds = new String [] { 157 "jScrollPane2" 158 }; 159 Rectangle [] bounds = new Rectangle [] { 160 new Rectangle (10, 79, 104, 64) 161 }; 162 Point hotspot = new Point (59,115); 163 ld.startMoving(compIds, bounds, hotspot); 164 } 165 prefPaddingInParent.put("Form-jScrollPane2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane2-1-1", new Integer (11)); prefPadding.put("jLabel1-jScrollPane2-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane2-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jScrollPane2-0-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jScrollPane1-0-0-0", new Integer (6)); { 175 Point p = new Point (58,146); 176 String containerId= "Form"; 177 boolean autoPositioning = true; 178 boolean lockDimension = false; 179 Rectangle [] bounds = new Rectangle [] { 180 new Rectangle (10, 110, 104, 64) 181 }; 182 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 183 } 184 prefPaddingInParent.put("Form-jScrollPane2-1-0", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane2-1-1", new Integer (11)); prefPadding.put("jLabel1-jScrollPane2-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane2-0-1", new Integer (10)); prefPadding.put("jScrollPane1-jScrollPane2-0-0-0", new Integer (6)); prefPadding.put("jScrollPane2-jScrollPane1-0-0-0", new Integer (6)); { 194 Point p = new Point (58,147); 195 String containerId= "Form"; 196 boolean autoPositioning = true; 197 boolean lockDimension = false; 198 Rectangle [] bounds = new Rectangle [] { 199 new Rectangle (10, 111, 104, 64) 200 }; 201 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 202 } 203 prefPadding.put("jLabel1-jScrollPane2-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane2-1-1", new Integer (11)); prefPadding.put("jScrollPane2-jScrollPane1-0-0-0", new Integer (6)); ld.endMoving(true); 210 ld.externalSizeChangeHappened(); 212 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 214 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 215 baselinePosition.put("jLabel1-34-14", new Integer (11)); 216 compPrefSize.put("jLabel1", new Dimension (34, 14)); 217 compBounds.put("jScrollPane1", new Rectangle (157, 11, 37, 132)); 218 baselinePosition.put("jScrollPane1-37-132", new Integer (0)); 219 compPrefSize.put("jScrollPane1", new Dimension (37, 132)); 220 compBounds.put("jScrollPane2", new Rectangle (10, 111, 104, 64)); 221 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 222 compPrefSize.put("jScrollPane2", new Dimension (104, 64)); 223 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 224 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 225 baselinePosition.put("jLabel1-34-14", new Integer (11)); 226 compBounds.put("jScrollPane1", new Rectangle (157, 11, 37, 132)); 227 baselinePosition.put("jScrollPane1-37-132", new Integer (0)); 228 compBounds.put("jScrollPane2", new Rectangle (10, 111, 104, 64)); 229 baselinePosition.put("jScrollPane2-104-64", new Integer (0)); 230 ld.updateCurrentState(); 231 } 233 234 } 235 | Popular Tags |