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_Resizing01Test extends LayoutTestCase { 33 34 public ALT_Resizing01Test(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() { 48 ld.externalSizeChangeHappened(); 49 contInterior.put("jInternalFrame1", new Rectangle (13, 54, 18, 0)); 51 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 24, 26)); 52 baselinePosition.put("jInternalFrame1-24-26", new Integer (-1)); 53 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 54 compPrefSize.put("jInternalFrame1", new Dimension (24, 26)); 55 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 56 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 57 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 58 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 59 baselinePosition.put("jLabel1-34-14", new Integer (11)); 60 compPrefSize.put("jLabel1", new Dimension (34, 14)); 61 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 24, 26)); 62 baselinePosition.put("jInternalFrame1-24-26", new Integer (-1)); 63 compBounds.put("jScrollPane1", new Rectangle (286, 11, 104, 64)); 64 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 65 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 66 compBounds.put("jButton1", new Rectangle (315, 266, 75, 23)); 67 baselinePosition.put("jButton1-75-23", new Integer (15)); 68 compPrefSize.put("jButton1", new Dimension (75, 23)); 69 compBounds.put("jButton2", new Rectangle (234, 266, 75, 23)); 70 baselinePosition.put("jButton2-75-23", new Integer (15)); 71 compPrefSize.put("jButton2", new Dimension (75, 23)); 72 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(); 84 { 87 String [] compIds = new String [] { 88 "jInternalFrame1" 89 }; 90 Rectangle [] bounds = new Rectangle [] { 91 new Rectangle (10, 31, 24, 26) 92 }; 93 Point hotspot = new Point (35,55); 94 int[] resizeEdges = new int[] { 95 1 96 ,1 97 }; 98 boolean inLayout = true; 99 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 100 } 101 baselinePosition.put("jInternalFrame1-24-26", new Integer (-1)); 102 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 103 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)); { 110 Point p = new Point (276,252); 111 String containerId= "Form"; 112 boolean autoPositioning = true; 113 boolean lockDimension = false; 114 Rectangle [] bounds = new Rectangle [] { 115 new Rectangle (10, 31, 270, 229) 116 }; 117 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 118 } 119 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)); { 126 Point p = new Point (276,253); 127 String containerId= "Form"; 128 boolean autoPositioning = true; 129 boolean lockDimension = false; 130 Rectangle [] bounds = new Rectangle [] { 131 new Rectangle (10, 31, 270, 229) 132 }; 133 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 134 } 135 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, 264, 203)); 142 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 270, 229)); 143 baselinePosition.put("jInternalFrame1-270-229", 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, 264, 203)); 153 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 270, 229)); 154 baselinePosition.put("jInternalFrame1-270-229", new Integer (-1)); 155 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 156 compPrefSize.put("jInternalFrame1", new Dimension (270, 229)); 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, 270, 229)); 173 baselinePosition.put("jInternalFrame1-270-229", new Integer (-1)); 174 prefPadding.put("jLabel1-jScrollPane1-0-0-0", new Integer (4)); prefPadding.put("jInternalFrame1-jScrollPane1-0-0-0", new Integer (6)); 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)); 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)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); ld.updateCurrentState(); 192 } 194 195 } 196 | Popular Tags |