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_Resizing03Test extends LayoutTestCase { 33 34 public ALT_Resizing03Test(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 (24,56); 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)); { 106 Point p = new Point (33,283); 107 String containerId= "Form"; 108 boolean autoPositioning = true; 109 boolean lockDimension = false; 110 Rectangle [] bounds = new Rectangle [] { 111 new Rectangle (10, 31, 24, 258) 112 }; 113 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 114 } 115 prefPaddingInParent.put("Form-jInternalFrame1-1-1", new Integer (11)); { 119 Point p = new Point (32,283); 120 String containerId= "Form"; 121 boolean autoPositioning = true; 122 boolean lockDimension = false; 123 Rectangle [] bounds = new Rectangle [] { 124 new Rectangle (10, 31, 24, 258) 125 }; 126 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 127 } 128 prefPadding.put("jInternalFrame1-jButton2-0-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jScrollPane1-0-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jButton2-0-0-0", new Integer (6)); contInterior.put("jInternalFrame1", new Rectangle (13, 54, 18, 232)); 134 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 24, 258)); 135 baselinePosition.put("jInternalFrame1-24-258", new Integer (-1)); 136 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 137 compPrefSize.put("jInternalFrame1", new Dimension (24, 26)); 138 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 139 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 140 ld.endMoving(true); 141 ld.externalSizeChangeHappened(); 143 contInterior.put("jInternalFrame1", new Rectangle (13, 54, 18, 232)); 145 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 24, 258)); 146 baselinePosition.put("jInternalFrame1-24-258", new Integer (-1)); 147 compMinSize.put("jInternalFrame1", new Dimension (30, 26)); 148 compPrefSize.put("jInternalFrame1", new Dimension (24, 258)); 149 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 150 hasExplicitPrefSize.put("jInternalFrame1", new Boolean (false)); 151 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 152 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 153 baselinePosition.put("jLabel1-34-14", new Integer (11)); 154 compPrefSize.put("jLabel1", new Dimension (34, 14)); 155 compBounds.put("jScrollPane1", new Rectangle (286, 11, 104, 64)); 156 baselinePosition.put("jScrollPane1-104-64", new Integer (0)); 157 compPrefSize.put("jScrollPane1", new Dimension (104, 64)); 158 compBounds.put("jButton1", new Rectangle (315, 266, 75, 23)); 159 baselinePosition.put("jButton1-75-23", new Integer (15)); 160 compPrefSize.put("jButton1", new Dimension (75, 23)); 161 compBounds.put("jButton2", new Rectangle (234, 266, 75, 23)); 162 baselinePosition.put("jButton2-75-23", new Integer (15)); 163 compPrefSize.put("jButton2", new Dimension (75, 23)); 164 compBounds.put("jInternalFrame1", new Rectangle (10, 31, 24, 258)); 165 baselinePosition.put("jInternalFrame1-24-258", new Integer (-1)); 166 prefPaddingInParent.put("Form-jLabel1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jInternalFrame1-0-0", new Integer (10)); prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPadding.put("jLabel1-jScrollPane1-0-0-0", new Integer (4)); prefPadding.put("jLabel1-jButton2-0-0-0", new Integer (4)); prefPadding.put("jInternalFrame1-jScrollPane1-0-0-0", new Integer (6)); prefPadding.put("jInternalFrame1-jButton2-0-0-0", new Integer (6)); prefPaddingInParent.put("Form-jScrollPane1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jButton2-1-1", new Integer (11)); prefPadding.put("jLabel1-jInternalFrame1-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jInternalFrame1-1-1", new Integer (11)); prefPaddingInParent.put("Form-jScrollPane1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel1-1-0", new Integer (11)); ld.updateCurrentState(); 182 } 184 185 } 186 | Popular Tags |