Class ImageItem

All Implemented Interfaces:
IFeedbackProvider, IDrawable, EventListener

public class ImageItem extends RectangleItem
A RectangleItem that displays a BufferedImage scaled to its bounds, with no fill or outline drawn for the rectangle itself.

All standard interactions are enabled by default (draggable, selectable, resizable, rotatable, deletable, right-clickable, unlocked). If no explicit bounds are given, the item is sized and positioned to the image's natural dimensions, centered in the container.

  • Constructor Details

    • ImageItem

      public ImageItem(Layer layer, Rectangle2D.Double wr, BufferedImage image)
      Create a world image object.
      Parameters:
      layer - the z layer this item is on.
      wr - the initial bounds of the item. If null, the image size is used.
      image - the image to display.
  • Method Details

    • drawItem

      public void drawItem(Graphics2D g2, IContainer container)
      Custom drawer for the item.
      Overrides:
      drawItem in class PathBasedItem
      Parameters:
      g2 - the graphics context.
      container - the graphical container being rendered.