/*
 * FormatCommandAlignTop.java
 *
 * Created on 9 mei 2005, 21:36
 */

package it.businesslogic.ireport.gui.command;

import it.businesslogic.ireport.OperationType;
import it.businesslogic.ireport.ReportElement;
import java.awt.Point;

/**
 *
 */
public class FormatCommandAlignBottom extends FormatCommand {
    
    {
        operationType = OperationType.ALIGN_TOP;
    }
    
    int bottom;
    // Preparation is called before the while loop
    
    public void preparation() {
        bottom= ((ReportElement) jrf.getSelectedElements().firstElement()).getPosition().y +
                ((ReportElement) jrf.getSelectedElements().firstElement()).height;
        
    }
    
    public void modify() {
        re.setPosition(new Point(re.getPosition().x, bottom-re.height));
    }
    
}
