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_Resizing08Test extends LayoutTestCase { 32 33 public ALT_Resizing08Test(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() { 46 ld.externalSizeChangeHappened(); 47 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 49 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 50 baselinePosition.put("jLabel1-34-14", new Integer (11)); 51 compPrefSize.put("jLabel1", new Dimension (34, 14)); 52 compBounds.put("jTextField1", new Rectangle (48, 11, 59, 20)); 53 baselinePosition.put("jTextField1-59-20", new Integer (14)); 54 compPrefSize.put("jTextField1", new Dimension (59, 20)); 55 compBounds.put("jButton1", new Rectangle (315, 37, 75, 23)); 56 baselinePosition.put("jButton1-75-23", new Integer (15)); 57 compPrefSize.put("jButton1", new Dimension (75, 23)); 58 compBounds.put("jLabel3", new Rectangle (315, 14, 34, 14)); 59 baselinePosition.put("jLabel3-34-14", new Integer (11)); 60 compPrefSize.put("jLabel3", new Dimension (34, 14)); 61 compBounds.put("jLabel2", new Rectangle (355, 14, 34, 14)); 62 baselinePosition.put("jLabel2-34-14", new Integer (11)); 63 compPrefSize.put("jLabel2", new Dimension (34, 14)); 64 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 65 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 66 baselinePosition.put("jLabel1-34-14", new Integer (11)); 67 compBounds.put("jTextField1", new Rectangle (48, 11, 59, 20)); 68 baselinePosition.put("jTextField1-59-20", new Integer (14)); 69 compBounds.put("jButton1", new Rectangle (315, 37, 75, 23)); 70 baselinePosition.put("jButton1-75-23", new Integer (15)); 71 compBounds.put("jLabel3", new Rectangle (315, 14, 34, 14)); 72 baselinePosition.put("jLabel3-34-14", new Integer (11)); 73 compBounds.put("jLabel2", new Rectangle (355, 14, 34, 14)); 74 baselinePosition.put("jLabel2-34-14", new Integer (11)); 75 ld.updateCurrentState(); 76 baselinePosition.put("jTextField1-59-20", new Integer (14)); 79 compPrefSize.put("jTextField1", new Dimension (59, 20)); 80 { 81 String [] compIds = new String [] { 82 "jTextField1" 83 }; 84 Rectangle [] bounds = new Rectangle [] { 85 new Rectangle (48, 11, 59, 20) 86 }; 87 Point hotspot = new Point (105,21); 88 int[] resizeEdges = new int[] { 89 1, 90 -1 91 }; 92 boolean inLayout = true; 93 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 94 } 95 prefPadding.put("jTextField1-jLabel3-0-0-0", new Integer (4)); prefPadding.put("jTextField1-jLabel2-0-0-0", new Integer (4)); prefPadding.put("jTextField1-jButton1-0-0-0", new Integer (6)); prefPadding.put("jTextField1-jLabel3-0-0-0", new Integer (4)); { 102 Point p = new Point (306,31); 103 String containerId= "Form"; 104 boolean autoPositioning = true; 105 boolean lockDimension = false; 106 Rectangle [] bounds = new Rectangle [] { 107 new Rectangle (48, 11, 261, 20) 108 }; 109 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 110 } 111 prefPadding.put("jTextField1-jLabel3-0-0-0", new Integer (4)); prefPadding.put("jTextField1-jLabel2-0-0-0", new Integer (4)); prefPadding.put("jTextField1-jButton1-0-0-0", new Integer (6)); prefPadding.put("jTextField1-jLabel3-0-0-0", new Integer (4)); { 118 Point p = new Point (307,31); 119 String containerId= "Form"; 120 boolean autoPositioning = true; 121 boolean lockDimension = false; 122 Rectangle [] bounds = new Rectangle [] { 123 new Rectangle (48, 11, 261, 20) 124 }; 125 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 126 } 127 ld.endMoving(true); 130 ld.externalSizeChangeHappened(); 132 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 134 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 135 baselinePosition.put("jLabel1-34-14", new Integer (11)); 136 compPrefSize.put("jLabel1", new Dimension (34, 14)); 137 compBounds.put("jButton1", new Rectangle (315, 37, 75, 23)); 138 baselinePosition.put("jButton1-75-23", new Integer (15)); 139 compPrefSize.put("jButton1", new Dimension (75, 23)); 140 compBounds.put("jLabel3", new Rectangle (315, 14, 34, 14)); 141 baselinePosition.put("jLabel3-34-14", new Integer (11)); 142 compPrefSize.put("jLabel3", new Dimension (34, 14)); 143 compBounds.put("jLabel2", new Rectangle (355, 14, 34, 14)); 144 baselinePosition.put("jLabel2-34-14", new Integer (11)); 145 compPrefSize.put("jLabel2", new Dimension (34, 14)); 146 compBounds.put("jTextField1", new Rectangle (48, 11, 261, 20)); 147 baselinePosition.put("jTextField1-261-20", new Integer (14)); 148 compPrefSize.put("jTextField1", new Dimension (59, 20)); 149 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 150 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 151 baselinePosition.put("jLabel1-34-14", new Integer (11)); 152 compBounds.put("jButton1", new Rectangle (315, 37, 75, 23)); 153 baselinePosition.put("jButton1-75-23", new Integer (15)); 154 compBounds.put("jLabel3", new Rectangle (315, 14, 34, 14)); 155 baselinePosition.put("jLabel3-34-14", new Integer (11)); 156 compBounds.put("jLabel2", new Rectangle (355, 14, 34, 14)); 157 baselinePosition.put("jLabel2-34-14", new Integer (11)); 158 compBounds.put("jTextField1", new Rectangle (48, 11, 261, 20)); 159 baselinePosition.put("jTextField1-261-20", new Integer (14)); 160 ld.updateCurrentState(); 161 } 163 164 } 165 | Popular Tags |