/*
 * 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 FormatCommandAlignHorizontalAxis extends FormatCommand {
    
    {
        operationType = OperationType.ALIGN_HORIZONTAL_AXIS; 
    }

    int center;
        
    public void preparation() {
        ReportElement re = (ReportElement) this.getSelectedElements().firstElement();
        center = re.getPosition().y + (re.getHeight()/2);
    }
    
    public void modify() {
        re.setPosition(new Point(re.getPosition().x, center-(re.getHeight()/2) ));
    }
    
}
