1 32 33 package it.businesslogic.ireport.gui.command; 34 35 import it.businesslogic.ireport.OperationType; 36 import it.businesslogic.ireport.ReportElement; 37 import it.businesslogic.ireport.TransformationType; 38 39 import java.awt.Point ; 40 import java.util.Enumeration ; 41 42 43 46 public class FormatCommandSameHeightMin extends FormatCommand { 47 { 48 operationType = OperationType.SAME_HEIGHT_MIN; 49 } 50 51 52 int height; 53 54 public void preparation() { 55 ReportElement re = (ReportElement) this.getSelectedElements().firstElement(); 56 height = re.getHeight(); 59 60 Enumeration enum2 = this.getSelectedElements().elements(); 61 while (enum2.hasMoreElements()) { 62 re = (ReportElement)enum2.nextElement(); 63 if (height > re.getHeight()) height = re.getHeight(); 64 } 65 66 } 67 68 public void modify() { 69 re.trasform(new Point (0, height - re.height), TransformationType.TRANSFORMATION_RESIZE_SE); 70 } 71 72 } 73 | Popular Tags |