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 import java.awt.Point ; 39 40 43 public class FormatCommandElementMaximize extends FormatCommand { 44 45 { 46 operationType = OperationType.ELEMENT_MAXIMIZE; 47 } 48 49 void executeDeeper() { 50 51 resetEnumeration(); 52 53 processElements(); 55 sleepUndo = true; 56 57 getCommand(OperationType.ALIGN_TOP_TO_BAND).execute(); 58 getCommand(OperationType.ALIGN_TO_LEFT_MARGIN).execute(); 59 60 int height = 0; 61 int insideWidth = jrf.getReport().getWidth() - jrf.getReport().getRightMargin() - jrf.getReport().getLeftMargin() ; 62 63 resetEnumeration(); 65 while (e.hasMoreElements()) { 66 re = (ReportElement) e.nextElement(); 67 68 if (re.getBand() != null) 69 { 70 height = re.getBand().getHeight(); 71 72 re.trasform(new Point (insideWidth-re.getWidth(), height-re.getHeight()), TransformationType.TRANSFORMATION_RESIZE_SE); 73 re.updateBounds(); 74 } 75 else 76 { 77 re.trasform(new Point (re.getCell().getWidth()-re.getWidth(), re.getCell().getHeight()-re.getHeight()), TransformationType.TRANSFORMATION_RESIZE_SE); 78 re.updateBounds(); 79 } 80 } 81 82 updateElements(); 83 84 sleepUndo = false; 85 } 86 87 } 88 | Popular Tags |