/*
 * 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 FormatCommandAlignRight extends FormatCommand {
    {
        operationType = OperationType.ALIGN_TOP;
    }
    
    int right;
    // Preparation is called before the while loop
    
    public void preparation() {
        right = ((ReportElement) this.getSelectedElements().firstElement()).getPosition().x +
                ((ReportElement) this.getSelectedElements().firstElement()).getWidth();
        
    }
    
    public void modify() {
        re.setPosition(new Point(right-re.getWidth(), re.getPosition().y));
    }
    
}
