1 32 33 package it.businesslogic.ireport.gui.command; 34 35 import it.businesslogic.ireport.OperationType; 36 import it.businesslogic.ireport.ReportElement; 37 import java.awt.Point ; 38 39 42 public class FormatCommandAlignHorizontalAxis extends FormatCommand { 43 44 { 45 operationType = OperationType.ALIGN_HORIZONTAL_AXIS; 46 } 47 48 int center; 49 50 public void preparation() { 51 ReportElement re = (ReportElement) this.getSelectedElements().firstElement(); 52 center = re.getPosition().y + (re.getHeight()/2); 53 } 54 55 public void modify() { 56 re.setPosition(new Point (re.getPosition().x, center-(re.getHeight()/2) )); 57 } 58 59 } 60 | Popular Tags |