/*
 * FormatCommandSameWidth.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 it.businesslogic.ireport.TransformationType;
import java.awt.Point;

/**
 *
 */
public class FormatCommandSameSize extends FormatCommand {
    {
        operationType = OperationType.SAME_SIZE;
    }
    
    
    int width;
    int height;
    
    
    public void preparation() {
        ReportElement re = ((ReportElement) jrf.getSelectedElements().firstElement());
        width = re.getWidth();
        height = re.getHeight();
    }
    
    public void modify() {
        re.trasform(new Point(width - re.getWidth(), height - re.height), TransformationType.TRANSFORMATION_RESIZE_SE);
    }
    
}
