Interface Overlay

All Known Implementing Classes:
AbstractOverlay

public interface Overlay
A graphic object displayed over images.

To implement a new overlay, you should extend AbstractOverlay rather than directly implementing this interface.

Overlays are not thread safe. In a GUI, all methods must be called on the Swing/AWT event dispatch thread. (This means that Overlay implementations do not need to worry about threading.)

See Also:
  • Method Details

    • getTitle

      String getTitle()
      Return a human-readable name for this overlay.
      Returns:
      the overlay title
    • paintOverlay

      void paintOverlay(Graphics2D graphicsContext, Rectangle screenRect, DisplaySettings displaySettings, List<Image> images, Image primaryImage, Rectangle2D.Float imageViewPort)
      Paint the overlay to the given graphics context.
      Parameters:
      graphicsContext - the graphics context to paint with
      screenRect - the screen region displaying part or all of the image, in the graphics context's coordinates
      displaySettings - the current display settings of the display window
      images - the images on which the overlay is to be drawn (multiple images if in composite color mode)
      primaryImage - the currently selected image (if in composite color mode) or the single displayed image (otherwise)
      imageViewPort - the visible region of the image, in image coordinates
    • getConfigurationComponent

      JComponent getConfigurationComponent()
      Return the configuration UI component for this overlay.

      The component should work well when laid out with a fixed width and height, determined based on its minimum and maximum sizes. The width of the component may be changed in response to layout changes, but the component must not actively resize itself. It is recommended that the preferred width be no more than 480 pixels.

      This method should return the same object every time it is called, throughout the lifetime of this Overlay instance. If the overlay does not require any user configuration, null may be returned.

      Important: The Overlay must not create any UI objects unless this method is called, and still support all other methods. This is to support headless use of overlays.

      Returns:
      the configuration UI component, or null
    • getConfiguration

      PropertyMap getConfiguration()
      Return the user-customizable settings for this overlay.

      The configuration should contain all parameters needed to reproduce the same overlay on another display window.

      Returns:
      a property map containing current parameters of the overlay
    • setConfiguration

      void setConfiguration(PropertyMap config)
      Configure the overlay with the given parameters.
      Parameters:
      config - a property map previously returned by getConfiguration of an overlay of the same class.
    • isVisible

      boolean isVisible()
      Return whether this overlay is shown.

      Note: AbstractOverlay implements this method.

      Returns:
      true if overlay is visible
    • setVisible

      void setVisible(boolean visible)
      Show or hide this overlay.

      Note: AbstractOverlay implements this method.

      Parameters:
      visible - whether to show the overlay
    • addOverlayListener

      void addOverlayListener(OverlayListener listener)
      Add a listener.

      Note: AbstractOverlay implements this method.

      Parameters:
      listener - the listener to add
    • removeOverlayListener

      void removeOverlayListener(OverlayListener listener)
      Remove a listener.

      Note: AbstractOverlay implements this method.

      Parameters:
      listener - the listener to remove