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_ParallelPosition15Test extends LayoutTestCase { 34 35 public ALT_ParallelPosition15Test(String name) { 36 super(name); 37 try { 38 className = this.getClass().getName(); 39 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 40 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 41 } catch (IOException ioe) { 42 fail(ioe.toString()); 43 } 44 } 45 46 public void doChanges0() { 48 ld.externalSizeChangeHappened(); 49 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 51 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 52 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 53 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 54 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 55 baselinePosition.put("jLabel1-34-14", new Integer (11)); 56 compPrefSize.put("jLabel1", new Dimension (34, 14)); 57 compBounds.put("jButton1", new Rectangle (87, 40, 75, 23)); 58 baselinePosition.put("jButton1-75-23", new Integer (15)); 59 compPrefSize.put("jButton1", new Dimension (75, 23)); 60 compBounds.put("jButton2", new Rectangle (229, 40, 75, 23)); 61 baselinePosition.put("jButton2-75-23", new Integer (15)); 62 compPrefSize.put("jButton2", new Dimension (75, 23)); 63 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 64 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 65 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 66 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 67 baselinePosition.put("jLabel1-34-14", new Integer (11)); 68 compBounds.put("jButton1", new Rectangle (87, 40, 75, 23)); 69 baselinePosition.put("jButton1-75-23", new Integer (15)); 70 compBounds.put("jButton2", new Rectangle (229, 40, 75, 23)); 71 baselinePosition.put("jButton2-75-23", new Integer (15)); 72 ld.updateCurrentState(); 73 baselinePosition.put("jButton1-75-23", new Integer (15)); 76 { 77 String [] compIds = new String [] { 78 "jButton1" 79 }; 80 Rectangle [] bounds = new Rectangle [] { 81 new Rectangle (87, 40, 75, 23) 82 }; 83 Point hotspot = new Point (121,55); 84 ld.startMoving(compIds, bounds, hotspot); 85 } 86 prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jToggleButton1-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPadding.put("jLabel1-jButton1-0-0-0", new Integer (4)); prefPadding.put("jButton1-jLabel1-0-0-0", new Integer (4)); prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 106 Point p = new Point (146,55); 107 String containerId= "Form"; 108 boolean autoPositioning = true; 109 boolean lockDimension = false; 110 Rectangle [] bounds = new Rectangle [] { 111 new Rectangle (114, 40, 75, 23) 112 }; 113 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 114 } 115 prefPaddingInParent.put("Form-jButton1-1-0", new Integer (11)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); prefPadding.put("jToggleButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jToggleButton1-1-0-0", new Integer (6)); prefPadding.put("jLabel1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton2-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jLabel1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton1-1-0-0", new Integer (6)); prefPadding.put("jButton1-jButton2-1-0-0", new Integer (6)); prefPaddingInParent.put("Form-jButton1-0-0", new Integer (10)); prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPadding.put("jLabel1-jButton1-0-0-0", new Integer (4)); prefPadding.put("jButton1-jLabel1-0-0-0", new Integer (4)); prefPadding.put("jButton2-jButton1-0-0-0", new Integer (6)); prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); prefPadding.put("jToggleButton1-jButton1-0-0-2", new Integer (10)); { 135 Point p = new Point (147,55); 136 String containerId= "Form"; 137 boolean autoPositioning = true; 138 boolean lockDimension = false; 139 Rectangle [] bounds = new Rectangle [] { 140 new Rectangle (114, 40, 75, 23) 141 }; 142 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 143 } 144 prefPadding.put("jLabel1-jButton1-0-0-0", new Integer (4)); prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); ld.endMoving(true); 149 ld.externalSizeChangeHappened(); 151 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 153 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 154 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 155 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 156 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 157 baselinePosition.put("jLabel1-34-14", new Integer (11)); 158 compPrefSize.put("jLabel1", new Dimension (34, 14)); 159 compBounds.put("jButton2", new Rectangle (229, 40, 75, 23)); 160 baselinePosition.put("jButton2-75-23", new Integer (15)); 161 compPrefSize.put("jButton2", new Dimension (75, 23)); 162 compBounds.put("jButton1", new Rectangle (114, 40, 75, 23)); 163 baselinePosition.put("jButton1-75-23", new Integer (15)); 164 compPrefSize.put("jButton1", new Dimension (75, 23)); 165 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 166 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 167 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 168 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 169 baselinePosition.put("jLabel1-34-14", new Integer (11)); 170 compBounds.put("jButton2", new Rectangle (229, 40, 75, 23)); 171 baselinePosition.put("jButton2-75-23", new Integer (15)); 172 compBounds.put("jButton1", new Rectangle (114, 40, 75, 23)); 173 baselinePosition.put("jButton1-75-23", new Integer (15)); 174 ld.updateCurrentState(); 175 } 177 178 } 179 | Popular Tags |