1 30 31 package it.businesslogic.ireport.gui.command; 32 33 import it.businesslogic.ireport.OperationType; 34 import it.businesslogic.ireport.ReportElement; 35 import it.businesslogic.ireport.TransformationType; 36 37 import java.awt.Point ; 38 39 import java.util.Enumeration ; 40 41 46 public class FormatCommandSameWidthMin 47 extends FormatCommand 48 { 49 50 51 { 52 operationType = OperationType.SAME_WIDTH_MIN; 53 } 54 55 int width; 56 57 60 public void preparation() 61 { 62 63 ReportElement re = (ReportElement)this.getSelectedElements().firstElement(); 64 65 width = re.getWidth(); 68 69 Enumeration enum2 = this.getSelectedElements().elements(); 70 71 while (enum2.hasMoreElements()) 72 { 73 re = (ReportElement)enum2.nextElement(); 74 75 if (width > re.getWidth()) 76 { 77 width = re.getWidth(); 78 } 79 } 80 81 } 82 83 86 public void modify() 87 { 88 re.trasform(new Point (width - re.getWidth(), 0), 89 TransformationType.TRANSFORMATION_RESIZE_SE); 90 } 91 } 92 93 | Popular Tags |