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