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_Resizing06Test extends LayoutTestCase { 31 32 public ALT_Resizing06Test(String name) { 33 super(name); 34 try { 35 className = this.getClass().getName(); 36 className = className.substring(className.lastIndexOf('.') + 1, className.length()); 37 startingFormFile = FileUtil.toFileObject(new File (url.getFile() + goldenFilesPath + className + "-StartingForm.form").getCanonicalFile()); 38 } catch (IOException ioe) { 39 fail(ioe.toString()); 40 } 41 } 42 43 public void doChanges0() { 46 ld.externalSizeChangeHappened(); 47 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 49 compBounds.put("jLabel1", new Rectangle (10, 11, 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 (20, 31, 59, 20)); 53 baselinePosition.put("jTextField1-59-20", new Integer (14)); 54 compPrefSize.put("jTextField1", new Dimension (59, 20)); 55 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 56 baselinePosition.put("jLabel2-34-14", new Integer (11)); 57 compPrefSize.put("jLabel2", new Dimension (34, 14)); 58 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 59 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 60 baselinePosition.put("jLabel1-34-14", new Integer (11)); 61 compBounds.put("jTextField1", new Rectangle (20, 31, 59, 20)); 62 baselinePosition.put("jTextField1-59-20", new Integer (14)); 63 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 64 baselinePosition.put("jLabel2-34-14", new Integer (11)); 65 ld.updateCurrentState(); 66 baselinePosition.put("jTextField1-59-20", new Integer (14)); 69 compPrefSize.put("jTextField1", new Dimension (59, 20)); 70 { 71 String [] compIds = new String [] { 72 "jTextField1" 73 }; 74 Rectangle [] bounds = new Rectangle [] { 75 new Rectangle (20, 31, 59, 20) 76 }; 77 Point hotspot = new Point (79,40); 78 int[] resizeEdges = new int[] { 79 1, 80 -1 81 }; 82 boolean inLayout = true; 83 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 84 } 85 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 89 Point p = new Point (125,46); 90 String containerId= "Form"; 91 boolean autoPositioning = true; 92 boolean lockDimension = false; 93 Rectangle [] bounds = new Rectangle [] { 94 new Rectangle (20, 31, 105, 20) 95 }; 96 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 97 } 98 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 102 Point p = new Point (126,46); 103 String containerId= "Form"; 104 boolean autoPositioning = true; 105 boolean lockDimension = false; 106 Rectangle [] bounds = new Rectangle [] { 107 new Rectangle (20, 31, 106, 20) 108 }; 109 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 110 } 111 prefPaddingInParent.put("Form-jLabel1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jLabel2-0-1", new Integer (10)); prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); ld.endMoving(true); 117 ld.externalSizeChangeHappened(); 119 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 121 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 122 baselinePosition.put("jLabel1-34-14", new Integer (11)); 123 compPrefSize.put("jLabel1", new Dimension (34, 14)); 124 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 125 baselinePosition.put("jLabel2-34-14", new Integer (11)); 126 compPrefSize.put("jLabel2", new Dimension (34, 14)); 127 compBounds.put("jTextField1", new Rectangle (20, 31, 106, 20)); 128 baselinePosition.put("jTextField1-106-20", new Integer (14)); 129 compPrefSize.put("jTextField1", new Dimension (59, 20)); 130 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 131 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 132 baselinePosition.put("jLabel1-34-14", new Integer (11)); 133 compBounds.put("jLabel2", new Rectangle (10, 57, 34, 14)); 134 baselinePosition.put("jLabel2-34-14", new Integer (11)); 135 compBounds.put("jTextField1", new Rectangle (20, 31, 106, 20)); 136 baselinePosition.put("jTextField1-106-20", new Integer (14)); 137 ld.updateCurrentState(); 138 } 140 141 } 142 | Popular Tags |