/* @(#) ShapeEvent.java 1.1 99/21/11
 * Copyright (c) 1999 Lawrence Rodrigues
 */
package com.vistech.roi;
import java.awt.geom.*;
import java.awt.*;
import java.io.*;

/** An event-state class that carries the Shape object. The ShapeEvent object is sent to
  * when a shapeEvent occurs. The receiving object extracts the Shape from the ShapeEvent object.
  * @version 1.0  21 Nov 1999
  * @author Lawrence Rodrigues
  **/
public class ShapeEvent extends java.util.EventObject implements Serializable{
   protected Shape shape;
   protected int command;

   /** The ShapeEvent contsructor.
     * @param src the source object where the shape originated.
     * @param sh the shape.
     **/
   public ShapeEvent(Object src,Shape sh){
      super(src);
      shape = sh;
   }

   /** Returns the Shape object.
     * @return the shape.
     */
   public Shape getShape(){
      return shape;
   }

   /** Sets the command that caused the shape event to get fired.
     * @param command the type of command.
     * @see com.vistech.roi.ShapeMarker.
     */
   public void setCommand(int command){
      this.command = command;
   }

   /** Returns the command. Shape events are fired as a result of executing certain
     * commands. For example, "Draw", "Move", "Paste". The recepients of the shape events
     * may need the command that was the cause of the shape event.
     * @return the command that created the shape.
     */
   public int getCommand(){
      return command;
   }
}
