/*
 * @(#)DrawingChangeEvent.java 5.1
 *
 */

package CH.ifa.draw.framework;

import java.awt.Rectangle;
import java.util.EventObject;

import de.renew.draw.storables.ontology.Drawing;

/**
 * The event passed to DrawingChangeListeners.
 *
 * @deprecated This class is not to be used externally. Please use {@link de.renew.draw.storables.ontology.DrawingChangeEvent} instead.
 */
@Deprecated
public class DrawingChangeEvent extends EventObject
    implements de.renew.draw.storables.ontology.DrawingChangeEvent
{

    /**
     * Represents the area in the drawing that is being modified or tracked.
     */
    private final Rectangle _rectangle;

    /**
     * Constructs a drawing change event.
     * @param source drawing the event comes from
     * @param r the rectangle describing the area of the drawing the event relates to
     *
     * @deprecated This constructor is not to be used externally. Please use the method {@link de.renew.draw.storables.api.StorableApi#createDrawingChangeEvent(Drawing, Rectangle)} instead.
     * */
    @Deprecated
    public DrawingChangeEvent(Drawing source, Rectangle r) {
        super(source);
        _rectangle = r;
    }

    @Override
    public Drawing getDrawing() {
        return (Drawing) getSource();
    }

    @Override
    public Rectangle getInvalidatedRectangle() {
        return _rectangle;
    }
}