1 32 33 package it.businesslogic.ireport.gui.command; 34 35 import it.businesslogic.ireport.Band; 36 import it.businesslogic.ireport.OperationType; 37 import it.businesslogic.ireport.ReportElement; 38 import java.awt.Point ; 39 import java.util.Iterator ; 40 import java.util.Vector ; 41 42 43 47 public class FormatCommandDecreaseSpaceH extends FormatCommand { 48 Vector bandElements = null; 49 50 { 51 operationType = OperationType.DECREASE_SPACE_H; 52 } 53 54 boolean preCondition(){ 55 return ( this.getSelectedElements().size() > 1); 56 } 57 58 void executeDeeper(){ 59 Vector bands = getBands(); Band b = null; 61 for (Iterator h = bands.iterator(); h.hasNext(); ) { 62 b = (Band) h.next(); 63 bandElements = getBandElements( b ); 64 bandElements = sortXY( bandElements.elements()); 65 processElements(bandElements.elements()); 68 } 69 } 70 71 public void modify() { 72 73 if (getCurrentElementPosition() > 0 ) { 74 re.setPosition( new Point ( 75 Math.max( re.getPosition().x - (5 * (getCurrentElementPosition())), 76 ((ReportElement) bandElements.elementAt(getCurrentElementPosition()-1)).getPosition().x ) , re.getPosition().y )); 77 } 78 } 80 81 82 } 83 | Popular Tags |