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.Enumeration ; 40 import java.util.Iterator ; 41 import java.util.Vector ; 42 43 44 48 public class FormatCommandDecreaseSpaceV extends FormatCommand { 49 Vector bandElements = null; 50 51 { 52 operationType = OperationType.DECREASE_SPACE_V; 53 } 54 55 boolean preCondition(){ 56 return ( this.getSelectedElements().size() > 1); 57 } 58 59 void executeDeeper(){ 60 Vector bands = getBands(); Band b = null; 62 for (Iterator h = bands.iterator(); h.hasNext(); ) { 63 b = (Band) h.next(); 64 bandElements = getBandElements( b ); 65 bandElements = sortYX( bandElements.elements()); 66 processElements(bandElements.elements()); 69 } 70 } 71 72 public void modify() { 73 74 if (getCurrentElementPosition() > 0 ) { 75 re.setPosition( new Point (re.getPosition().x, 76 Math.max( re.getPosition().y - (5 * (getCurrentElementPosition())), 77 ((ReportElement) bandElements.elementAt(getCurrentElementPosition()-1)).getPosition().y ) ) ); 78 } 79 } 81 82 83 } 84 | Popular Tags |