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_Indent04Test extends LayoutTestCase { 32 33 public ALT_Indent04Test(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() { 48 ld.externalSizeChangeHappened(); 49 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 51 compBounds.put("jLabel1", new Rectangle (10, 73, 34, 14)); 52 baselinePosition.put("jLabel1-34-14", new Integer (11)); 53 compPrefSize.put("jLabel1", new Dimension (34, 14)); 54 compBounds.put("jLabel2", new Rectangle (175, 73, 34, 14)); 55 baselinePosition.put("jLabel2-34-14", new Integer (11)); 56 compPrefSize.put("jLabel2", new Dimension (34, 14)); 57 compBounds.put("jLabel3", new Rectangle (78, 53, 34, 14)); 58 baselinePosition.put("jLabel3-34-14", new Integer (11)); 59 compPrefSize.put("jLabel3", new Dimension (34, 14)); 60 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 61 compBounds.put("jLabel1", new Rectangle (10, 73, 34, 14)); 62 baselinePosition.put("jLabel1-34-14", new Integer (11)); 63 compBounds.put("jLabel2", new Rectangle (175, 73, 34, 14)); 64 baselinePosition.put("jLabel2-34-14", new Integer (11)); 65 compBounds.put("jLabel3", new Rectangle (78, 53, 34, 14)); 66 baselinePosition.put("jLabel3-34-14", new Integer (11)); 67 ld.updateCurrentState(); 68 lc = new LayoutComponent("jLabel4", false); 70 baselinePosition.put("jLabel4-34-14", new Integer (11)); 72 { 73 LayoutComponent[] comps = new LayoutComponent[] { lc }; 74 Rectangle [] bounds = new Rectangle [] { 75 new Rectangle (0, 0, 34, 14) 76 }; 77 String defaultContId = null; 78 Point hotspot = new Point (13,7); 79 ld.startAdding(comps, bounds, hotspot, defaultContId); 80 } 81 prefPaddingInParent.put("Form-jLabel4-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel4-1-1", new Integer (11)); prefPadding.put("jLabel3-jLabel4-1-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel3-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jLabel4-1-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel4-1-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel2-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel4-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel4-0-1", new Integer (10)); prefPadding.put("jLabel1-jLabel4-0-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel1-0-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel4-0-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel2-0-0-0", new Integer (6)); prefPadding.put("jLabel3-jLabel4-0-0-2", new Integer (10)); { 99 Point p = new Point (100,85); 100 String containerId= "Form"; 101 boolean autoPositioning = true; 102 boolean lockDimension = false; 103 Rectangle [] bounds = new Rectangle [] { 104 new Rectangle (88, 73, 34, 14) 105 }; 106 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 107 } 108 prefPaddingInParent.put("Form-jLabel4-1-0", new Integer (11)); prefPaddingInParent.put("Form-jLabel4-1-1", new Integer (11)); prefPadding.put("jLabel3-jLabel4-1-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel3-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jLabel4-1-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel4-1-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel2-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jLabel4-0-0", new Integer (10)); prefPaddingInParent.put("Form-jLabel4-0-1", new Integer (10)); prefPadding.put("jLabel1-jLabel4-0-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel1-0-0-0", new Integer (6)); prefPadding.put("jLabel2-jLabel4-0-0-0", new Integer (6)); prefPadding.put("jLabel4-jLabel2-0-0-0", new Integer (6)); prefPadding.put("jLabel3-jLabel4-0-0-2", new Integer (10)); { 126 Point p = new Point (101,84); 127 String containerId= "Form"; 128 boolean autoPositioning = true; 129 boolean lockDimension = false; 130 Rectangle [] bounds = new Rectangle [] { 131 new Rectangle (88, 73, 34, 14) 132 }; 133 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 134 } 135 compPrefSize.put("jLabel4", new Dimension (34, 14)); 138 compPrefSize.put("jLabel4", new Dimension (34, 14)); 139 prefPadding.put("jLabel1-jLabel4-0-0-0", new Integer (10)); prefPadding.put("jLabel4-jLabel2-0-0-0", new Integer (10)); ld.endMoving(true); 142 ld.externalSizeChangeHappened(); 144 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 146 compBounds.put("jLabel1", new Rectangle (10, 73, 34, 14)); 147 baselinePosition.put("jLabel1-34-14", new Integer (11)); 148 compPrefSize.put("jLabel1", new Dimension (34, 14)); 149 compBounds.put("jLabel2", new Rectangle (175, 73, 34, 14)); 150 baselinePosition.put("jLabel2-34-14", new Integer (11)); 151 compPrefSize.put("jLabel2", new Dimension (34, 14)); 152 compBounds.put("jLabel3", new Rectangle (78, 53, 34, 14)); 153 baselinePosition.put("jLabel3-34-14", new Integer (11)); 154 compPrefSize.put("jLabel3", new Dimension (34, 14)); 155 compBounds.put("jLabel4", new Rectangle (88, 73, 34, 14)); 156 baselinePosition.put("jLabel4-34-14", new Integer (11)); 157 compPrefSize.put("jLabel4", new Dimension (34, 14)); 158 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 159 compBounds.put("jLabel1", new Rectangle (10, 73, 34, 14)); 160 baselinePosition.put("jLabel1-34-14", new Integer (11)); 161 compBounds.put("jLabel2", new Rectangle (175, 73, 34, 14)); 162 baselinePosition.put("jLabel2-34-14", new Integer (11)); 163 compBounds.put("jLabel3", new Rectangle (78, 53, 34, 14)); 164 baselinePosition.put("jLabel3-34-14", new Integer (11)); 165 compBounds.put("jLabel4", new Rectangle (88, 73, 34, 14)); 166 baselinePosition.put("jLabel4-34-14", new Integer (11)); 167 ld.updateCurrentState(); 168 } 170 171 } 172 | Popular Tags |