/*
 * 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 FormatCommandAlignVerticalAxis extends FormatCommand {
    
    {
        operationType = OperationType.ALIGN_VERTICAL_AXIS;
    }
    int center;
    
    public void preparation() {
        ReportElement re = (ReportElement) this.getSelectedElements().firstElement();
        center = re.getPosition().x + (re.getWidth()/2);
        
    }
    
    public void modify() {
        re.setPosition(new Point(center-(re.getWidth()/2), re.getPosition().y));
    }
    
}
