Class TooltipManagerImpl

  • All Implemented Interfaces:
    TooltipManager

    public class TooltipManagerImpl
    extends java.lang.Object
    implements TooltipManager
    Manages the tooltip display. An AbstractLabel is moved/resized to display a tooltip text for an "active" GUI element.
    • Constructor Detail

      • TooltipManagerImpl

        public TooltipManagerImpl()
    • Method Detail

      • setScreenSize

        public void setScreenSize​(int windowWidth,
                                  int windowHeight)
        Updates the current window size.
        Parameters:
        windowWidth - the window width
        windowHeight - the window height
      • setTooltip

        public void setTooltip​(@Nullable
                               @Nullable AbstractLabel tooltip)
        Sets the tooltip label.
        Parameters:
        tooltip - the tooltip label, or null
      • reset

        public void reset()
        Removes the tooltip. Does nothing if no tooltip is active.
      • setElement

        public void setElement​(@NotNull
                               @NotNull AbstractGUIElement guiElement)
        Description copied from interface: TooltipManager
        Displays the tooltip for a GUI element.
        Specified by:
        setElement in interface TooltipManager
        Parameters:
        guiElement - the GUI element to show the tooltip of
      • unsetElement

        public void unsetElement​(@NotNull
                                 @NotNull AbstractGUIElement guiElement)
        Description copied from interface: TooltipManager
        Removes the tooltip of a GUI element. Does nothing if the given GUI element is not active.
        Specified by:
        unsetElement in interface TooltipManager
        Parameters:
        guiElement - the gui element to remove the tooltip of
      • tooltipTextChanged

        public void tooltipTextChanged​(@NotNull
                                       @NotNull GUIElement element)
        Description copied from interface: TooltipManager
        Reports a possibly changed tooltip text.
        Specified by:
        tooltipTextChanged in interface TooltipManager
        Parameters:
        element - the GUI element that may have changed