Class ImageWindow

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ImageWindow extends AuxWindow
Window which displays an image using AWT. Image types supported at J2SE1.4 are JPEG, GIF, PNG (I think).
Since:
5 Oct 2004
Author:
Mark Taylor (Starlink)
See Also:
  • Constructor Details

    • ImageWindow

      public ImageWindow(Component parent)
      Constructs a new image window.
      Parameters:
      parent - window
  • Method Details

    • createImage

      public static BufferedImage createImage(String location, boolean allowSystem) throws IOException
      Creates an image from a location, suitable for use with this window.

      This method is potentially time-consuming, and should not be invoked on the Event Dispatch Thread.

      Parameters:
      location - file or URL
      allowSystem - whether to allow system commands in location specification - has security implications
      Returns:
      image
      Throws:
      IOException
    • setImage

      public void setImage(Image image)
      Synchronously configures this window to display an image.

      This method must be invoked from the Event Dispatch Thread.

      Parameters:
      image - image to install
    • resizeToFitImage

      public void resizeToFitImage()
      Resizes this window so that it's the right size to display the current image without scrolling.
    • setImagePoint

      public void setImagePoint(Image image, Point point)
      Synchronously configures this window to display an image and indicate a given X,Y point on it.
      Parameters:
      image - image to install
      point - highlight point
    • setImage

      public void setImage(String location, boolean allowSystem)
      Sets the image to load from a given location. This should be called from the event dispatch thread, but will do most of the work out-of-thread to prevent blocking when loading an image.
      Parameters:
      location - image filename or URL
      allowSystem - whether to allow system commands in location specification - has security implications