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_Resizing07Test extends LayoutTestCase { 32 33 public ALT_Resizing07Test(String name) { 34 super(name); 35 try { 36 className = this.getClass().getName(); 37 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 38 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 39 } catch (IOException ioe) { 40 fail(ioe.toString()); 41 } 42 } 43 44 public void doChanges0() { 47 ld.externalSizeChangeHappened(); 48 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 50 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 51 baselinePosition.put("jLabel1-34-14", new Integer (11)); 52 compPrefSize.put("jLabel1", new Dimension (34, 14)); 53 compBounds.put("jTextField1", new Rectangle (103, 11, 59, 20)); 54 baselinePosition.put("jTextField1-59-20", new Integer (14)); 55 compPrefSize.put("jTextField1", new Dimension (59, 20)); 56 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 57 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 58 baselinePosition.put("jLabel1-34-14", new Integer (11)); 59 compBounds.put("jTextField1", new Rectangle (103, 11, 59, 20)); 60 baselinePosition.put("jTextField1-59-20", new Integer (14)); 61 ld.updateCurrentState(); 62 baselinePosition.put("jTextField1-59-20", new Integer (14)); 65 compPrefSize.put("jTextField1", new Dimension (59, 20)); 66 { 67 String [] compIds = new String [] { 68 "jTextField1" 69 }; 70 Rectangle [] bounds = new Rectangle [] { 71 new Rectangle (103, 11, 59, 20) 72 }; 73 Point hotspot = new Point (102,19); 74 int[] resizeEdges = new int[] { 75 0, 76 -1 77 }; 78 boolean inLayout = true; 79 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 80 } 81 prefPadding.put("jLabel1-jTextField1-0-0-0", new Integer (4)); { 85 Point p = new Point (89,22); 86 String containerId= "Form"; 87 boolean autoPositioning = true; 88 boolean lockDimension = false; 89 Rectangle [] bounds = new Rectangle [] { 90 new Rectangle (90, 11, 72, 20) 91 }; 92 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 93 } 94 prefPadding.put("jLabel1-jTextField1-0-0-0", new Integer (4)); { 98 Point p = new Point (88,22); 99 String containerId= "Form"; 100 boolean autoPositioning = true; 101 boolean lockDimension = false; 102 Rectangle [] bounds = new Rectangle [] { 103 new Rectangle (89, 11, 73, 20) 104 }; 105 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 106 } 107 prefPadding.put("jLabel1-jTextField1-0-0-0", new Integer (4)); prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); ld.endMoving(true); 112 ld.externalSizeChangeHappened(); 114 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 116 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 117 baselinePosition.put("jLabel1-34-14", new Integer (11)); 118 compPrefSize.put("jLabel1", new Dimension (34, 14)); 119 compBounds.put("jTextField1", new Rectangle (89, 11, 73, 20)); 120 baselinePosition.put("jTextField1-73-20", new Integer (14)); 121 compPrefSize.put("jTextField1", new Dimension (59, 20)); 122 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 123 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 124 baselinePosition.put("jLabel1-34-14", new Integer (11)); 125 compBounds.put("jTextField1", new Rectangle (89, 11, 73, 20)); 126 baselinePosition.put("jTextField1-73-20", new Integer (14)); 127 ld.updateCurrentState(); 128 baselinePosition.put("jTextField1-73-20", new Integer (14)); 131 compPrefSize.put("jTextField1", new Dimension (59, 20)); 132 { 133 String [] compIds = new String [] { 134 "jTextField1" 135 }; 136 Rectangle [] bounds = new Rectangle [] { 137 new Rectangle (89, 11, 73, 20) 138 }; 139 Point hotspot = new Point (161,18); 140 int[] resizeEdges = new int[] { 141 1, 142 -1 143 }; 144 boolean inLayout = true; 145 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 146 } 147 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 151 Point p = new Point (380,24); 152 String containerId= "Form"; 153 boolean autoPositioning = true; 154 boolean lockDimension = false; 155 Rectangle [] bounds = new Rectangle [] { 156 new Rectangle (89, 11, 292, 20) 157 }; 158 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 159 } 160 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 164 Point p = new Point (379,24); 165 String containerId= "Form"; 166 boolean autoPositioning = true; 167 boolean lockDimension = false; 168 Rectangle [] bounds = new Rectangle [] { 169 new Rectangle (89, 11, 291, 20) 170 }; 171 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 172 } 173 prefPadding.put("jLabel1-jTextField1-0-0-0", new Integer (4)); prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); ld.endMoving(true); 178 ld.externalSizeChangeHappened(); 180 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 182 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 183 baselinePosition.put("jLabel1-34-14", new Integer (11)); 184 compPrefSize.put("jLabel1", new Dimension (34, 14)); 185 compBounds.put("jTextField1", new Rectangle (89, 11, 291, 20)); 186 baselinePosition.put("jTextField1-291-20", new Integer (14)); 187 compPrefSize.put("jTextField1", new Dimension (59, 20)); 188 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 189 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 190 baselinePosition.put("jLabel1-34-14", new Integer (11)); 191 compBounds.put("jTextField1", new Rectangle (89, 11, 291, 20)); 192 baselinePosition.put("jTextField1-291-20", new Integer (14)); 193 ld.updateCurrentState(); 194 } 196 197 } 198 | Popular Tags |