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_Resizing05Test extends LayoutTestCase { 31 32 public ALT_Resizing05Test(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() { 45 ld.externalSizeChangeHappened(); 46 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 48 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 49 baselinePosition.put("jLabel1-34-14", new Integer (11)); 50 compPrefSize.put("jLabel1", new Dimension (34, 14)); 51 compBounds.put("jTextField1", new Rectangle (20, 31, 59, 20)); 52 baselinePosition.put("jTextField1-59-20", new Integer (14)); 53 compPrefSize.put("jTextField1", new Dimension (59, 20)); 54 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 55 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 56 baselinePosition.put("jLabel1-34-14", new Integer (11)); 57 compBounds.put("jTextField1", new Rectangle (20, 31, 59, 20)); 58 baselinePosition.put("jTextField1-59-20", new Integer (14)); 59 ld.updateCurrentState(); 60 baselinePosition.put("jTextField1-59-20", new Integer (14)); 63 compPrefSize.put("jTextField1", new Dimension (59, 20)); 64 { 65 String [] compIds = new String [] { 66 "jTextField1" 67 }; 68 Rectangle [] bounds = new Rectangle [] { 69 new Rectangle (20, 31, 59, 20) 70 }; 71 Point hotspot = new Point (80,42); 72 int[] resizeEdges = new int[] { 73 1, 74 -1 75 }; 76 boolean inLayout = true; 77 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 78 } 79 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 83 Point p = new Point (120,49); 84 String containerId= "Form"; 85 boolean autoPositioning = true; 86 boolean lockDimension = false; 87 Rectangle [] bounds = new Rectangle [] { 88 new Rectangle (20, 31, 99, 20) 89 }; 90 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 91 } 92 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 96 Point p = new Point (121,49); 97 String containerId= "Form"; 98 boolean autoPositioning = true; 99 boolean lockDimension = false; 100 Rectangle [] bounds = new Rectangle [] { 101 new Rectangle (20, 31, 100, 20) 102 }; 103 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 104 } 105 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jTextField1-1-1", new Integer (11)); ld.endMoving(true); 110 ld.externalSizeChangeHappened(); 112 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 114 compBounds.put("jLabel1", new Rectangle (10, 11, 34, 14)); 115 baselinePosition.put("jLabel1-34-14", new Integer (11)); 116 compPrefSize.put("jLabel1", new Dimension (34, 14)); 117 compBounds.put("jTextField1", new Rectangle (20, 31, 100, 20)); 118 baselinePosition.put("jTextField1-100-20", new Integer (14)); 119 compPrefSize.put("jTextField1", new Dimension (59, 20)); 120 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 compBounds.put("jTextField1", new Rectangle (20, 31, 100, 20)); 124 baselinePosition.put("jTextField1-100-20", new Integer (14)); 125 ld.updateCurrentState(); 126 } 128 129 } 130 | Popular Tags |