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

package it.businesslogic.ireport.gui.command;

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

/**
 *
 */
public class FormatCommandAlignTopToBand extends FormatCommand {
    {
        operationType = OperationType.ALIGN_TOP_TO_BAND;
    }
    
    public void modify() {
        
        if (re.getBand() != null)
        {
            re.trasform(new Point(0, jrf.getReport().getBandYLocation( re.band) + 10- re.getPosition().y),
                TransformationType.TRANSFORMATION_MOVE);
    
        } else if (re.getCell() != null)
        {
            re.setPosition(new Point(re.getPosition().x, re.getCell().getTop() + 10));
            re.updateRelativePosition();
        }
    }
    
}
