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_ParallelPosition01Test extends LayoutTestCase { 31 32 public ALT_ParallelPosition01Test(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() { 49 ld.externalSizeChangeHappened(); 50 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 52 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 53 baselinePosition.put("jLabel1-34-14", new Integer (11)); 54 compPrefSize.put("jLabel1", new Dimension (34, 14)); 55 compBounds.put("jTextField1", new Rectangle (20, 31, 59, 20)); 56 baselinePosition.put("jTextField1-59-20", new Integer (14)); 57 compPrefSize.put("jTextField1", new Dimension (59, 20)); 58 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 59 baselinePosition.put("jLabel2-34-14", new Integer (11)); 60 compPrefSize.put("jLabel2", new Dimension (34, 14)); 61 compBounds.put("jTextField2", new Rectangle (20, 77, 59, 20)); 62 baselinePosition.put("jTextField2-59-20", new Integer (14)); 63 compPrefSize.put("jTextField2", new Dimension (59, 20)); 64 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 65 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 66 baselinePosition.put("jLabel1-34-14", new Integer (11)); 67 compBounds.put("jTextField1", new Rectangle (20, 31, 59, 20)); 68 baselinePosition.put("jTextField1-59-20", new Integer (14)); 69 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 70 baselinePosition.put("jLabel2-34-14", new Integer (11)); 71 compBounds.put("jTextField2", new Rectangle (20, 77, 59, 20)); 72 baselinePosition.put("jTextField2-59-20", new Integer (14)); 73 ld.updateCurrentState(); 74 baselinePosition.put("jTextField1-59-20", new Integer (14)); 77 compPrefSize.put("jTextField1", new Dimension (59, 20)); 78 { 79 String [] compIds = new String [] { 80 "jTextField1" 81 }; 82 Rectangle [] bounds = new Rectangle [] { 83 new Rectangle (20, 31, 59, 20) 84 }; 85 Point hotspot = new Point (80,43); 86 int[] resizeEdges = new int[] { 87 1, 88 -1 89 }; 90 boolean inLayout = true; 91 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 92 } 93 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 97 Point p = new Point (121,43); 98 String containerId= "Form"; 99 boolean autoPositioning = true; 100 boolean lockDimension = false; 101 Rectangle [] bounds = new Rectangle [] { 102 new Rectangle (20, 31, 100, 20) 103 }; 104 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 105 } 106 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 110 Point p = new Point (122,43); 111 String containerId= "Form"; 112 boolean autoPositioning = true; 113 boolean lockDimension = false; 114 Rectangle [] bounds = new Rectangle [] { 115 new Rectangle (20, 31, 101, 20) 116 }; 117 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 118 } 119 prefPaddingInParent.put("Form-jLabel1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jLabel2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jTextField2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); ld.endMoving(true); 126 ld.externalSizeChangeHappened(); 128 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 130 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 131 baselinePosition.put("jLabel1-34-14", new Integer (11)); 132 compPrefSize.put("jLabel1", new Dimension (34, 14)); 133 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 134 baselinePosition.put("jLabel2-34-14", new Integer (11)); 135 compPrefSize.put("jLabel2", new Dimension (34, 14)); 136 compBounds.put("jTextField2", new Rectangle (20, 77, 59, 20)); 137 baselinePosition.put("jTextField2-59-20", new Integer (14)); 138 compPrefSize.put("jTextField2", new Dimension (59, 20)); 139 compBounds.put("jTextField1", new Rectangle (20, 31, 101, 20)); 140 baselinePosition.put("jTextField1-101-20", new Integer (14)); 141 compPrefSize.put("jTextField1", new Dimension (59, 20)); 142 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 143 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 144 baselinePosition.put("jLabel1-34-14", new Integer (11)); 145 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 146 baselinePosition.put("jLabel2-34-14", new Integer (11)); 147 compBounds.put("jTextField2", new Rectangle (20, 77, 59, 20)); 148 baselinePosition.put("jTextField2-59-20", new Integer (14)); 149 compBounds.put("jTextField1", new Rectangle (20, 31, 101, 20)); 150 baselinePosition.put("jTextField1-101-20", new Integer (14)); 151 ld.updateCurrentState(); 152 baselinePosition.put("jTextField2-59-20", new Integer (14)); 155 compPrefSize.put("jTextField2", new Dimension (59, 20)); 156 { 157 String [] compIds = new String [] { 158 "jTextField2" 159 }; 160 Rectangle [] bounds = new Rectangle [] { 161 new Rectangle (20, 77, 59, 20) 162 }; 163 Point hotspot = new Point (80,87); 164 int[] resizeEdges = new int[] { 165 1, 166 -1 167 }; 168 boolean inLayout = true; 169 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 170 } 171 prefPaddingInParent.put("Form-jTextField2-0-1", new Integer (10)); { 175 Point p = new Point (116,88); 176 String containerId= "Form"; 177 boolean autoPositioning = true; 178 boolean lockDimension = false; 179 Rectangle [] bounds = new Rectangle [] { 180 new Rectangle (20, 77, 101, 20) 181 }; 182 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 183 } 184 prefPaddingInParent.put("Form-jTextField2-0-1", new Integer (10)); { 188 Point p = new Point (117,88); 189 String containerId= "Form"; 190 boolean autoPositioning = true; 191 boolean lockDimension = false; 192 Rectangle [] bounds = new Rectangle [] { 193 new Rectangle (20, 77, 101, 20) 194 }; 195 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 196 } 197 compPrefSize.put("jTextField2", new Dimension (59, 20)); 200 prefPaddingInParent.put("Form-jTextField2-1-1", new Integer (11)); ld.endMoving(true); 202 ld.externalSizeChangeHappened(); 204 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 206 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 207 baselinePosition.put("jLabel1-34-14", new Integer (11)); 208 compPrefSize.put("jLabel1", new Dimension (34, 14)); 209 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 210 baselinePosition.put("jLabel2-34-14", new Integer (11)); 211 compPrefSize.put("jLabel2", new Dimension (34, 14)); 212 compBounds.put("jTextField1", new Rectangle (20, 31, 101, 20)); 213 baselinePosition.put("jTextField1-101-20", new Integer (14)); 214 compPrefSize.put("jTextField1", new Dimension (59, 20)); 215 compBounds.put("jTextField2", new Rectangle (20, 77, 101, 20)); 216 baselinePosition.put("jTextField2-101-20", new Integer (14)); 217 compPrefSize.put("jTextField2", new Dimension (59, 20)); 218 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 219 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 220 baselinePosition.put("jLabel1-34-14", new Integer (11)); 221 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 222 baselinePosition.put("jLabel2-34-14", new Integer (11)); 223 compBounds.put("jTextField1", new Rectangle (20, 31, 101, 20)); 224 baselinePosition.put("jTextField1-101-20", new Integer (14)); 225 compBounds.put("jTextField2", new Rectangle (20, 77, 101, 20)); 226 baselinePosition.put("jTextField2-101-20", new Integer (14)); 227 ld.updateCurrentState(); 228 } 230 231 } 232 | Popular Tags |