Class AbstractOverlay

java.lang.Object
qupath.lib.gui.viewer.overlays.AbstractOverlay
All Implemented Interfaces:
PathOverlay
Direct Known Subclasses:
AbstractImageOverlay, GridOverlay, HierarchyOverlay, TMAGridOverlay

public abstract class AbstractOverlay extends Object implements PathOverlay
Abstract class to help with implementing PathOverlays.
Author:
Pete Bankhead
  • Constructor Details

  • Method Details

    • getOverlayOptions

      public OverlayOptions getOverlayOptions()
      Get the overlay options, which may influence the display of this overlay.
      Returns:
    • getAlphaComposite

      protected AlphaComposite getAlphaComposite()
    • setAlphaComposite

      protected void setAlphaComposite(Graphics2D g2d)
    • isVisible

      public boolean isVisible()
      Check overlay visibility status. If isVisible() returns false, then calls to paintOverlay() will not do anything.
      Returns:
    • setPreferredOverlayColor

      public void setPreferredOverlayColor(Color color)
      Set a preferred overlay color, which the overlay may or may not make use of. The aim is to provide a means to suggest drawing with a light color on a dark image, or a dark color on a light image.
      Parameters:
      color -
    • getPreferredOverlayColor

      public Color getPreferredOverlayColor()
      Return the preferred overlay color.
      Returns:
      See Also:
    • getOpacity

      public double getOpacity()
      Get opacity, between 0 (completely transparent) and 1 (completely opaque).
      Returns:
    • setOpacity

      public void setOpacity(double opacity)
      Set opacity between 0 (completely transparent) and 1 (completely opaque).
      Parameters:
      opacity -
    • setLocationStringFunction

      public void setLocationStringFunction(AbstractOverlay.LocationStringFunction fun)
      Set a custom function to calculate a location string for the overlay.
      Parameters:
      fun -
    • getLocationStringFunction

      protected AbstractOverlay.LocationStringFunction getLocationStringFunction()
    • getLocationString

      public String getLocationString(ImageData<BufferedImage> imageData, double x, double y, int z, int t)
      Description copied from interface: PathOverlay
      Get a location string to display when showing a specified image.

      The default implementation returns null. If subclasses override this method, they must return quickly, as it may be used to determine text to display as the mouse moves over an image.

      Specified by:
      getLocationString in interface PathOverlay
      Parameters:
      imageData -
      x - x-coordinate, in the image space (not the viewer component space)
      y - y-coordinate, in the image space (not the viewer component space)
      z - z-index for the region currently being viewed
      t - t-index for the region currently being viewed
      Returns: