 /*
  * @(#) PlanarImageLoadedEvent.java 1.0 2000/21/1
  * Copyright (c) 2000 Lawrence Rodrigues
  */
package com.vistech.jai.imageio;
import java.awt.*;
import java.io.*;
import javax.media.jai.*;
/** The event-state class for the planarImageLoaded event. Depending on the source bean,
  * it can carry a single or multiple images.
  * @version 1.0  21 Jan 2000
  * @author Lawrence Rodrigues
  **/
public class PlanarImageLoadedEvent  extends java.util.EventObject
       implements Serializable{
   protected PlanarImage image;
   protected PlanarImage[] imageset;

   /** Constructor for a single image.
     * @param obj the source object.
     * @param img the image to be sent to the target.
     */
   public PlanarImageLoadedEvent(Object obj, PlanarImage img){
      super(obj);
      image = img;
      imageset = new PlanarImage[] {img};
   }

  /**  Constructor for multiple images.
     * @param obj the source object.
     * @param img an array of images to be sent to the target.
     */
   public PlanarImageLoadedEvent(Object obj, PlanarImage[] img){
      super(obj);
      imageset = img;
      if((img != null) && (img.length >0))image = img[0];
   }

   /** Returns the planar image loaded by the source bean.
     * @return the planar image.*/
   public PlanarImage getImage(){return image;}

   /** Returns an array of planar images loaded by the source bean.
     * @return an array of planar images.
     */
   public PlanarImage[] getImages(){return imageset;}
}

