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_DefaultSize01Test extends LayoutTestCase { 32 33 public ALT_DefaultSize01Test(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() { 46 ld.externalSizeChangeHappened(); 47 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 49 compBounds.put("jButton1", new Rectangle (10, 11, 137, 23)); 50 baselinePosition.put("jButton1-137-23", new Integer (15)); 51 compPrefSize.put("jButton1", new Dimension (75, 23)); 52 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 53 compBounds.put("jButton1", new Rectangle (10, 11, 137, 23)); 54 baselinePosition.put("jButton1-137-23", new Integer (15)); 55 ld.updateCurrentState(); 56 baselinePosition.put("jButton1-137-23", new Integer (15)); 59 compPrefSize.put("jButton1", new Dimension (75, 23)); 60 { 61 String [] compIds = new String [] { 62 "jButton1" 63 }; 64 Rectangle [] bounds = new Rectangle [] { 65 new Rectangle (10, 11, 137, 23) 66 }; 67 Point hotspot = new Point (148,21); 68 int[] resizeEdges = new int[] { 69 1, 70 -1 71 }; 72 boolean inLayout = true; 73 ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout); 74 } 75 prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); { 79 Point p = new Point (89,25); 80 String containerId= "Form"; 81 boolean autoPositioning = true; 82 boolean lockDimension = false; 83 Rectangle [] bounds = new Rectangle [] { 84 new Rectangle (10, 11, 75, 23) 85 }; 86 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 87 } 88 prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); { 92 Point p = new Point (88,25); 93 String containerId= "Form"; 94 boolean autoPositioning = true; 95 boolean lockDimension = false; 96 Rectangle [] bounds = new Rectangle [] { 97 new Rectangle (10, 11, 75, 23) 98 }; 99 ld.move(p, containerId, autoPositioning, lockDimension, bounds); 100 } 101 prefPaddingInParent.put("Form-jButton1-0-1", new Integer (10)); prefPaddingInParent.put("Form-jButton1-1-1", new Integer (11)); ld.endMoving(true); 106 ld.externalSizeChangeHappened(); 108 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 110 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 111 baselinePosition.put("jButton1-75-23", new Integer (15)); 112 compPrefSize.put("jButton1", new Dimension (75, 23)); 113 contInterior.put("Form", new Rectangle (0, 0, 400, 300)); 114 compBounds.put("jButton1", new Rectangle (10, 11, 75, 23)); 115 baselinePosition.put("jButton1-75-23", new Integer (15)); 116 ld.updateCurrentState(); 117 } 119 120 } 121 | Popular Tags |