1 32 33 package it.businesslogic.ireport.gui.command; 34 35 import it.businesslogic.ireport.OperationType; 36 37 import java.awt.Point ; 38 39 40 public class FormatCommandAlignCenter 41 extends FormatCommand 42 { 43 44 47 FormatCommandAlignCenter() 48 { 49 operationType = OperationType.ALIGN_CENTER; 50 } 51 52 int centerx; 53 54 57 public void preparation() 58 { 59 centerx = 10 + jrf.getReport().getWidth() / 2; 60 } 61 62 65 public void modify() 66 { 67 68 int centery = jrf.getReport().getBandYLocation(re.getBand()) + 10 + 69 re.getBand().getHeight() / 2; 70 re.setPosition(new Point (centerx - (re.getWidth() / 2), 71 centery - (re.getHeight() / 2))); 72 } 73 74 78 public int getCenterx() 79 { 80 81 return centerx; 82 } 83 84 89 public void setCenterx(int centerx) 90 { 91 this.centerx = centerx; 92 } 93 } 94 | Popular Tags |