1 32 33 package it.businesslogic.ireport.gui.command; 34 35 import it.businesslogic.ireport.OperationType; 36 import it.businesslogic.ireport.crosstab.CrosstabCell; 37 import java.awt.Point ; 38 39 42 public class FormatCommandCenterInBandH extends FormatCommand { 43 { 44 operationType = OperationType.CENTER_IN_BAND_V; 45 } 46 47 int centerx; 48 49 void preparation() { 50 int insideWidth = jrf.getReport().getWidth() - jrf.getReport().getRightMargin() - jrf.getReport().getLeftMargin() ; 52 centerx = jrf.getReport().getLeftMargin() + 10+ insideWidth/2; 53 54 } 55 56 void modify() { 57 if (re.getBand() == null) { 59 CrosstabCell cell = re.getCell(); 60 if (cell == null) return; 61 centerx = cell.getLeft() + 10 + (cell.getWidth()/2); 62 63 64 re.setPosition(new Point (centerx-(re.getWidth()/2), re.getPosition().y)); 65 re.updateRelativePosition(); 66 } 67 else 68 { 69 re.setPosition(new Point (centerx-(re.getWidth()/2), re.getPosition().y)); 70 } 71 72 } 73 74 } 75 | Popular Tags |