All Implemented Interfaces:
Serializable, Evented, Identifiable, LayerPopupFunctions, LayerTooltipFunctions, ExecutableFunctions

public class Tooltip extends DivOverlay
Used to display small texts on top of map layers. Extends DivOverlay.
See Also:
  • Constructor Details

    • Tooltip

      public Tooltip(String content)
      Creates a new tooltip with the given HTML content and assigns it to the tooltipPane.
      Parameters:
      content - the HTML content of the tooltip
  • Method Details

    • getDirection

      public String getDirection()
      Returns the direction where the tooltip opens relative to its anchor. Possible values are right, left, top, bottom, center and auto.
      Returns:
      the direction where the tooltip opens
    • setDirection

      public void setDirection(String direction)
      Sets the direction where the tooltip opens relative to its anchor. Possible values are right, left, top, bottom, center and auto.
      Parameters:
      direction - the direction where the tooltip opens
    • isPermanent

      public boolean isPermanent()
      Returns whether the tooltip is displayed permanently instead of only on hover.
      Returns:
      true if the tooltip is permanent, false otherwise
    • setPermanent

      public void setPermanent(boolean permanent)
      Sets whether the tooltip is displayed permanently instead of only on hover.
      Parameters:
      permanent - true to display the tooltip permanently, false otherwise
    • isSticky

      public boolean isSticky()
      Returns whether the tooltip follows the mouse pointer instead of being fixed at its anchor.
      Returns:
      true if the tooltip is sticky, false otherwise
    • setSticky

      public void setSticky(boolean sticky)
      Sets whether the tooltip follows the mouse pointer instead of being fixed at its anchor.
      Parameters:
      sticky - true to make the tooltip follow the mouse pointer, false otherwise
    • isInteractive

      public boolean isInteractive()
      Returns whether the tooltip listens to and fires mouse events.
      Returns:
      true if the tooltip is interactive, false otherwise
    • setInteractive

      public void setInteractive(boolean interactive)
      Sets whether the tooltip listens to and fires mouse events.
      Parameters:
      interactive - true to make the tooltip interactive, false otherwise
    • getOpacity

      public double getOpacity()
      Returns the opacity of the tooltip, between 0 and 1.
      Returns:
      the opacity of the tooltip
    • setOpacity

      public void setOpacity(double opacity)
      Sets the opacity of the tooltip, between 0 and 1.
      Parameters:
      opacity - the opacity of the tooltip