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