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_ParallelPosition02Test extends LayoutTestCase { 32 33 public ALT_ParallelPosition02Test(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() { 48 ld.externalSizeChangeHappened(); 49 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 51 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 52 baselinePosition.put("jButton1-75-23", new Integer (15)); 53 compPrefSize.put("jButton1", new Dimension (75, 23)); 54 compBounds.put("jTextField1", new Rectangle (10, 40, 59, 20)); 55 baselinePosition.put("jTextField1-59-20", new Integer (14)); 56 compPrefSize.put("jTextField1", new Dimension (59, 20)); 57 compBounds.put("jToggleButton1", new Rectangle (10, 66, 105, 23)); 58 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 59 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 60 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 61 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 62 baselinePosition.put("jButton1-75-23", new Integer (15)); 63 compBounds.put("jTextField1", new Rectangle (10, 40, 59, 20)); 64 baselinePosition.put("jTextField1-59-20", new Integer (14)); 65 compBounds.put("jToggleButton1", new Rectangle (10, 66, 105, 23)); 66 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 67 ld.updateCurrentState(); 68 baselinePosition.put("jTextField1-59-20", new Integer (14)); 71 compPrefSize.put("jTextField1", new Dimension (59, 20)); 72 { 73 String [] compIds = new String [] { 74 "jTextField1" 75 }; 76 Rectangle [] bounds = new Rectangle [] { 77 new Rectangle (10, 40, 59, 20) 78 }; 79 Point hotspot = new Point (67,52); 80 int[] resizeEdges = new int[] { 81 1, 82 -1 83 }; 84 boolean inLayout = true; 85 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 86 } 87 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 91 Point p = new Point (77,52); 92 String containerId= "Form"; 93 boolean autoPositioning = true; 94 boolean lockDimension = false; 95 Rectangle [] bounds = new Rectangle [] { 96 new Rectangle (10, 40, 75, 20) 97 }; 98 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 99 } 100 prefPaddingInParent.put("Form-jTextField1-0-1", new Integer (10)); { 104 Point p = new Point (78,52); 105 String containerId= "Form"; 106 boolean autoPositioning = true; 107 boolean lockDimension = false; 108 Rectangle [] bounds = new Rectangle [] { 109 new Rectangle (10, 40, 75, 20) 110 }; 111 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 112 } 113 compPrefSize.put("jTextField1", new Dimension (59, 20)); 116 ld.endMoving(true); 117 ld.externalSizeChangeHappened(); 119 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 121 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 122 baselinePosition.put("jButton1-75-23", new Integer (15)); 123 compPrefSize.put("jButton1", new Dimension (75, 23)); 124 compBounds.put("jToggleButton1", new Rectangle (10, 66, 105, 23)); 125 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 126 compPrefSize.put("jToggleButton1", new Dimension (105, 23)); 127 compBounds.put("jTextField1", new Rectangle (10, 40, 75, 20)); 128 baselinePosition.put("jTextField1-75-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("jButton1", new Rectangle (10, 11, 75, 23)); 132 baselinePosition.put("jButton1-75-23", new Integer (15)); 133 compBounds.put("jToggleButton1", new Rectangle (10, 66, 105, 23)); 134 baselinePosition.put("jToggleButton1-105-23", new Integer (15)); 135 compBounds.put("jTextField1", new Rectangle (10, 40, 75, 20)); 136 baselinePosition.put("jTextField1-75-20", new Integer (14)); 137 ld.updateCurrentState(); 138 } 140 141 } 142 | Popular Tags |