Class InteractiveImage

All Implemented Interfaces:
ImageObserver, Drawable, Interactive, Measurable

public class InteractiveImage extends InteractiveShape implements ImageObserver
An image is bounded by hot spots for dragging and resizing.
Version:
1.0
Author:
W. Christian
  • Field Details

    • image

      protected Image image
  • Constructor Details

    • InteractiveImage

      public InteractiveImage(Image image, double x, double y)
      Constructs an interactive image centered at the given location.
      Parameters:
      x - double
      y - double
      image - Image
  • Method Details

    • isInside

      public boolean isInside(DrawingPanel panel, int xpix, int ypix)
      Determines if the shape is enabled and if the given pixel coordinates are within the image.
      Overrides:
      isInside in class InteractiveShape
      Parameters:
      panel - DrawingPanel
      xpix - int
      ypix - int
      Returns:
      boolean
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Draws the image.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class InteractiveShape
      Parameters:
      panel - the world in which the image is viewed
      g - the graphics context upon which to draw
    • imageUpdate

      public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
      Specified by:
      imageUpdate in interface ImageObserver