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.HashMap ; 28 import org.openide.filesystems.FileObject; 29 import org.openide.filesystems.FileUtil; 30 import org.netbeans.modules.form.RADComponent; 31 32 public class ALT_Resizing02Test extends LayoutTestCase { 33 34 public ALT_Resizing02Test(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("jInternalFrame1", new Rectangle (13, 54, 18, 0)); 50 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 24, 26)); 51 baselinePosition.put("jInternalFrame1-24-26", new Integer (-1)); 52 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 53 compPrefSize.put("jInternalFrame1", new Dimension (24, 26)); 54 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 55 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 56 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 57 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 58 baselinePosition.put("jLabel1-34-14", new Integer (11)); 59 compPrefSize.put("jLabel1", new Dimension (34, 14)); 60 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 24, 26)); 61 baselinePosition.put("jInternalFrame1-24-26", new Integer (-1)); 62 compBounds.put("jScrollPane1", new Rectangle (286, 11, 104, 64)); 63 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 64 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 65 compBounds.put("jButton1", new Rectangle (315, 266, 75, 23)); 66 baselinePosition.put("jButton1-75-23", new Integer (15)); 67 compPrefSize.put("jButton1", new Dimension (75, 23)); 68 compBounds.put("jButton2", new Rectangle (234, 266, 75, 23)); 69 baselinePosition.put("jButton2-75-23", new Integer (15)); 70 compPrefSize.put("jButton2", new Dimension (75, 23)); 71 prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jInternalFrame1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPadding.put("jLabel1-jInternalFrame1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); ld.updateCurrentState(); 83 { 86 String [] compIds = new String [] { 87 "jInternalFrame1" 88 }; 89 Rectangle [] bounds = new Rectangle [] { 90 new Rectangle (10, 31, 24, 26) 91 }; 92 Point hotspot = new Point (32,57); 93 int[] resizeEdges = new int[] { 94 1 95 ,1 96 }; 97 boolean inLayout = true; 98 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 99 } 100 baselinePosition.put("jInternalFrame1-24-26", new Integer (-1)); 101 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 102 prefPaddingInParent.put("Form-jInternalFrame1-1-1", new Integer (11)); prefPadding.put("jInternalFrame1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jScrollPane1-0-0-0", new Integer (6)); { 109 Point p = new Point (262,243); 110 String containerId= "Form"; 111 boolean autoPositioning = true; 112 boolean lockDimension = false; 113 Rectangle [] bounds = new Rectangle [] { 114 new Rectangle (10, 31, 254, 212) 115 }; 116 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 117 } 118 prefPaddingInParent.put("Form-jInternalFrame1-1-1", new Integer (11)); prefPadding.put("jInternalFrame1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jScrollPane1-0-0-0", new Integer (6)); { 125 Point p = new Point (263,243); 126 String containerId= "Form"; 127 boolean autoPositioning = true; 128 boolean lockDimension = false; 129 Rectangle [] bounds = new Rectangle [] { 130 new Rectangle (10, 31, 255, 212) 131 }; 132 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 133 } 134 prefPadding.put("jInternalFrame1-jScrollPane1-0-0-0", new Integer (6)); prefPadding.put("jScrollPane1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jScrollPane1-jButton2-1-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jButton2-1-0-0", new Integer (6)); contInterior.put("jInternalFrame1", new Rectangle (13, 54, 249, 186)); 142 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 255, 212)); 143 baselinePosition.put("jInternalFrame1-255-212", new Integer (-1)); 144 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 145 compPrefSize.put("jInternalFrame1", new Dimension (24, 26)); 146 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 147 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 148 ld.endMoving(true); 149 ld.externalSizeChangeHappened(); 151 contInterior.put("jInternalFrame1", new Rectangle (13, 54, 249, 186)); 153 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 255, 212)); 154 baselinePosition.put("jInternalFrame1-255-212", new Integer (-1)); 155 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 156 compPrefSize.put("jInternalFrame1", new Dimension (255, 212)); 157 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 158 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 159 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 160 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 161 baselinePosition.put("jLabel1-34-14", new Integer (11)); 162 compPrefSize.put("jLabel1", new Dimension (34, 14)); 163 compBounds.put("jScrollPane1", new Rectangle (286, 11, 104, 64)); 164 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 165 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 166 compBounds.put("jButton1", new Rectangle (315, 266, 75, 23)); 167 baselinePosition.put("jButton1-75-23", new Integer (15)); 168 compPrefSize.put("jButton1", new Dimension (75, 23)); 169 compBounds.put("jButton2", new Rectangle (234, 266, 75, 23)); 170 baselinePosition.put("jButton2-75-23", new Integer (15)); 171 compPrefSize.put("jButton2", new Dimension (75, 23)); 172 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 255, 212)); 173 baselinePosition.put("jInternalFrame1-255-212", new Integer (-1)); 174 prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton2-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jInternalFrame1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPadding.put("jLabel1-jInternalFrame1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); ld.updateCurrentState(); 186 } 188 189 } 190 | Popular Tags |