Package qupath.lib.gui.viewer.overlays
Class AbstractOverlay
java.lang.Object
qupath.lib.gui.viewer.overlays.AbstractOverlay
- All Implemented Interfaces:
PathOverlay
- Direct Known Subclasses:
AbstractImageOverlay
,GridOverlay
,HierarchyOverlay
,TMAGridOverlay
Abstract class to help with implementing PathOverlays.
- Author:
- Pete Bankhead
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Define a function to perform the task ofPathOverlay.getLocationString(ImageData, double, double, int, int)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AlphaComposite
getLocationString
(ImageData<BufferedImage> imageData, double x, double y, int z, int t) Get a location string to display when showing a specified image.protected AbstractOverlay.LocationStringFunction
double
Get opacity, between 0 (completely transparent) and 1 (completely opaque).Get the overlay options, which may influence the display of this overlay.Return the preferred overlay color.boolean
Check overlay visibility status.protected void
void
Set a custom function to calculate a location string for the overlay.void
setOpacity
(double opacity) Set opacity between 0 (completely transparent) and 1 (completely opaque).void
setPreferredOverlayColor
(Color color) Set a preferred overlay color, which the overlay may or may not make use of.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface qupath.lib.gui.viewer.overlays.PathOverlay
paintOverlay
-
Constructor Details
-
AbstractOverlay
-
-
Method Details
-
getOverlayOptions
Get the overlay options, which may influence the display of this overlay.- Returns:
-
getAlphaComposite
-
setAlphaComposite
-
isVisible
public boolean isVisible()Check overlay visibility status. If isVisible() returnsfalse
, then calls to paintOverlay() will not do anything.- Returns:
-
setPreferredOverlayColor
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
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
Set a custom function to calculate a location string for the overlay.- Parameters:
fun
-
-
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 interfacePathOverlay
- 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 viewedt
- t-index for the region currently being viewed- Returns:
-