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_ParallelPosition17Test extends LayoutTestCase { 35 36 public ALT_ParallelPosition17Test(String name) { 37 super(name); 38 try { 39 className = this.getClass().getName(); 40 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 41 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 42 } catch (IOException ioe) { 43 fail(ioe.toString()); 44 } 45 } 46 47 public void doChanges0() { 49 ld.externalSizeChangeHappened(); 50 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 52 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 53 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 54 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 55 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 56 baselinePosition.put("jLabel1-34-14", new Integer (11)); 57 compPrefSize.put("jLabel1", new Dimension (34, 14)); 58 compBounds.put("jButton1", new Rectangle (87, 40, 75, 23)); 59 baselinePosition.put("jButton1-75-23", new Integer (15)); 60 compPrefSize.put("jButton1", new Dimension (75, 23)); 61 compBounds.put("jButton2", new Rectangle (215, 40, 75, 23)); 62 baselinePosition.put("jButton2-75-23", new Integer (15)); 63 compPrefSize.put("jButton2", new Dimension (75, 23)); 64 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 65 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 66 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 67 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 68 baselinePosition.put("jLabel1-34-14", new Integer (11)); 69 compBounds.put("jButton1", new Rectangle (87, 40, 75, 23)); 70 baselinePosition.put("jButton1-75-23", new Integer (15)); 71 compBounds.put("jButton2", new Rectangle (215, 40, 75, 23)); 72 baselinePosition.put("jButton2-75-23", new Integer (15)); 73 ld.updateCurrentState(); 74 baselinePosition.put("jButton1-75-23", new Integer (15)); 77 compPrefSize.put("jButton1", new Dimension (75, 23)); 78 { 79 String [] compIds = new String [] { 80 "jButton1" 81 }; 82 Rectangle [] bounds = new Rectangle [] { 83 new Rectangle (87, 40, 75, 23) 84 }; 85 Point hotspot = new Point (164,52); 86 int[] resizeEdges = new int[] { 87 1, 88 -1 89 }; 90 boolean inLayout = true; 91 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 92 } 93 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); { 97 Point p = new Point (183,51); 98 String containerId= "Form"; 99 boolean autoPositioning = true; 100 boolean lockDimension = false; 101 Rectangle [] bounds = new Rectangle [] { 102 new Rectangle (87, 40, 94, 23) 103 }; 104 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 105 } 106 prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); { 110 Point p = new Point (184,51); 111 String containerId= "Form"; 112 boolean autoPositioning = true; 113 boolean lockDimension = false; 114 Rectangle [] bounds = new Rectangle [] { 115 new Rectangle (87, 40, 102, 23) 116 }; 117 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 118 } 119 prefPadding.put("jLabel1-jButton1-0-0-0", new Integer (4)); prefPadding.put("jButton1-jButton2-0-0-0", new Integer (6)); compPrefSize.put("jButton1", new Dimension (75, 23)); 124 ld.endMoving(true); 125 ld.externalSizeChangeHappened(); 127 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 129 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 130 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 131 compPrefSize.put("jToggleButton1", new Dimension (179, 23)); 132 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 133 baselinePosition.put("jLabel1-34-14", new Integer (11)); 134 compPrefSize.put("jLabel1", new Dimension (34, 14)); 135 compBounds.put("jButton2", new Rectangle (215, 40, 75, 23)); 136 baselinePosition.put("jButton2-75-23", new Integer (15)); 137 compPrefSize.put("jButton2", new Dimension (75, 23)); 138 compBounds.put("jButton1", new Rectangle (87, 40, 102, 23)); 139 baselinePosition.put("jButton1-102-23", new Integer (15)); 140 compPrefSize.put("jButton1", new Dimension (75, 23)); 141 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 142 compBounds.put("jToggleButton1", new Rectangle (10, 11, 179, 23)); 143 baselinePosition.put("jToggleButton1-179-23", new Integer (15)); 144 compBounds.put("jLabel1", new Rectangle (10, 44, 34, 14)); 145 baselinePosition.put("jLabel1-34-14", new Integer (11)); 146 compBounds.put("jButton2", new Rectangle (215, 40, 75, 23)); 147 baselinePosition.put("jButton2-75-23", new Integer (15)); 148 compBounds.put("jButton1", new Rectangle (87, 40, 102, 23)); 149 baselinePosition.put("jButton1-102-23", new Integer (15)); 150 ld.updateCurrentState(); 151 } 153 154 } 155 | Popular Tags |