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_Resizing09Test extends LayoutTestCase { 33 34 public ALT_Resizing09Test(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("Form", new Rectangle (0, 0, 400, 300)); 50 compBounds.put("jLabel2", new Rectangle (10, 40, 68, 14)); 51 baselinePosition.put("jLabel2-68-14", new Integer (11)); 52 compPrefSize.put("jLabel2", new Dimension (68, 14)); 53 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 54 baselinePosition.put("jLabel1-34-14", new Integer (11)); 55 compPrefSize.put("jLabel1", new Dimension (34, 14)); 56 compBounds.put("jTextField2", new Rectangle (82, 11, 90, 20)); 57 baselinePosition.put("jTextField2-90-20", new Integer (14)); 58 compPrefSize.put("jTextField2", new Dimension (59, 20)); 59 compBounds.put("jTextField1", new Rectangle (82, 37, 90, 20)); 60 baselinePosition.put("jTextField1-90-20", new Integer (14)); 61 compPrefSize.put("jTextField1", new Dimension (59, 20)); 62 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 63 compBounds.put("jLabel2", new Rectangle (10, 40, 68, 14)); 64 baselinePosition.put("jLabel2-68-14", new Integer (11)); 65 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 66 baselinePosition.put("jLabel1-34-14", new Integer (11)); 67 compBounds.put("jTextField2", new Rectangle (82, 11, 90, 20)); 68 baselinePosition.put("jTextField2-90-20", new Integer (14)); 69 compBounds.put("jTextField1", new Rectangle (82, 37, 90, 20)); 70 baselinePosition.put("jTextField1-90-20", new Integer (14)); 71 ld.updateCurrentState(); 72 baselinePosition.put("jTextField2-90-20", new Integer (14)); 75 compPrefSize.put("jTextField2", new Dimension (59, 20)); 76 { 77 String [] compIds = new String [] { 78 "jTextField2" 79 }; 80 Rectangle [] bounds = new Rectangle [] { 81 new Rectangle (82, 11, 90, 20) 82 }; 83 Point hotspot = new Point (82,22); 84 int[] resizeEdges = new int[] { 85 0, 86 -1 87 }; 88 boolean inLayout = true; 89 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 90 } 91 prefPadding.put("jLabel1-jTextField2-0-0-0", new Integer (4)); { 95 Point p = new Point (52,20); 96 String containerId= "Form"; 97 boolean autoPositioning = true; 98 boolean lockDimension = false; 99 Rectangle [] bounds = new Rectangle [] { 100 new Rectangle (48, 11, 124, 20) 101 }; 102 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 103 } 104 prefPadding.put("jLabel1-jTextField2-0-0-0", new Integer (4)); { 108 Point p = new Point (51,20); 109 String containerId= "Form"; 110 boolean autoPositioning = true; 111 boolean lockDimension = false; 112 Rectangle [] bounds = new Rectangle [] { 113 new Rectangle (48, 11, 124, 20) 114 }; 115 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 116 } 117 ld.endMoving(true); 120 ld.externalSizeChangeHappened(); 122 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 124 compBounds.put("jLabel2", new Rectangle (10, 40, 68, 14)); 125 baselinePosition.put("jLabel2-68-14", new Integer (11)); 126 compPrefSize.put("jLabel2", new Dimension (68, 14)); 127 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 128 baselinePosition.put("jLabel1-34-14", new Integer (11)); 129 compPrefSize.put("jLabel1", new Dimension (34, 14)); 130 compBounds.put("jTextField1", new Rectangle (82, 37, 90, 20)); 131 baselinePosition.put("jTextField1-90-20", new Integer (14)); 132 compPrefSize.put("jTextField1", new Dimension (59, 20)); 133 compBounds.put("jTextField2", new Rectangle (48, 11, 124, 20)); 134 baselinePosition.put("jTextField2-124-20", new Integer (14)); 135 compPrefSize.put("jTextField2", new Dimension (59, 20)); 136 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 137 compBounds.put("jLabel2", new Rectangle (10, 40, 68, 14)); 138 baselinePosition.put("jLabel2-68-14", new Integer (11)); 139 compBounds.put("jLabel1", new Rectangle (10, 14, 34, 14)); 140 baselinePosition.put("jLabel1-34-14", new Integer (11)); 141 compBounds.put("jTextField1", new Rectangle (82, 37, 90, 20)); 142 baselinePosition.put("jTextField1-90-20", new Integer (14)); 143 compBounds.put("jTextField2", new Rectangle (48, 11, 124, 20)); 144 baselinePosition.put("jTextField2-124-20", new Integer (14)); 145 ld.updateCurrentState(); 146 } 148 149 } 150 | Popular Tags |