Class Popup.TooltipBehavior

java.lang.Object
net.dermetfan.gdx.scenes.scene2d.ui.Popup.Behavior.Adapter
net.dermetfan.gdx.scenes.scene2d.ui.Popup.TooltipBehavior
All Implemented Interfaces:
Popup.Behavior
Enclosing class:
Popup<T extends com.badlogic.gdx.scenes.scene2d.Actor>

public static class Popup.TooltipBehavior
extends Popup.Behavior.Adapter
The Behavior of a classic tooltip. Does nothing in Popup.Behavior.Adapter.show(Event, Popup) and Popup.Behavior.Adapter.hide(Event, Popup). Hides on escape. Add the Popup using this TooltipBehavior to an EventMultiplexer high in the hierarchy (e.g. on the Stage) to make sure events on other Actors are received so that the TooltipBehavior can hide properly.
  • Constructor Details

    • TooltipBehavior

      public TooltipBehavior()
    • TooltipBehavior

      public TooltipBehavior​(float delay)
      Parameters:
      delay - see setDelay(float)
    • TooltipBehavior

      public TooltipBehavior​(float showDelay, float hideDelay)
      Parameters:
      showDelay - the showDelay
      hideDelay - the hideDelay
    • TooltipBehavior

      public TooltipBehavior​(int showEvents)
      Parameters:
      showEvents - the showEvents
    • TooltipBehavior

      public TooltipBehavior​(int showEvents, int hideEvents)
      Parameters:
      showEvents - the showEvents
      hideEvents - the hideEvents
    • TooltipBehavior

      public TooltipBehavior​(int showEvents, int hideEvents, int cancelEvents)
      Parameters:
      showEvents - the showEvents
      hideEvents - the hideEvents
      cancelEvents - the cancelEvents
  • Method Details

    • handle

      public Popup.Reaction handle​(com.badlogic.gdx.scenes.scene2d.Event e, Popup popup)
      Specified by:
      handle in interface Popup.Behavior
      Overrides:
      handle in class Popup.Behavior.Adapter
      Parameters:
      e - the Event to handle
      popup - the Popup this Behavior is attached to
      Returns:
      null
    • showOn

      public int showOn​(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
      Parameters:
      event - the InputEvent.Type on which to show the tooltip
      Returns:
      the new value of showEvents
    • showNotOn

      public int showNotOn​(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
      Parameters:
      event - the InputEvent.Type on which not to show the tooltip
      Returns:
      the new value of showEvents
    • hideOn

      public int hideOn​(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
      Parameters:
      event - the InputEvent.Type on which to hide the tooltip
      Returns:
      the new value of hideEvents
    • hideNotOn

      public int hideNotOn​(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
      Parameters:
      event - the InputEvent.Type on which not to hide the tooltip
      Returns:
      the new value of hideEvents
    • cancelOn

      public int cancelOn​(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
      Parameters:
      event - the InputEvent.Type on which to cancel showing the tooltip
      Returns:
      the new value of cancelEvents
    • cancelNotOn

      public int cancelNotOn​(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
      Parameters:
      event - the InputEvent.Type on which to not cancel showing the tooltip
      Returns:
      the new value of cancelEvents
    • setDelay

      public void setDelay​(float delay)
      Parameters:
      delay - the showDelay and hideDelay
    • getShowDelay

      public float getShowDelay()
      Returns:
      the showDelay
    • setShowDelay

      public void setShowDelay​(float showDelay)
      Parameters:
      showDelay - the showDelay to set
    • getHideDelay

      public float getHideDelay()
      Returns:
      the hideDelay
    • setHideDelay

      public void setHideDelay​(float hideDelay)
      Parameters:
      hideDelay - the hideDelay to set
    • getShowEvents

      public int getShowEvents()
      Returns:
      the showEvents
    • setShowEvents

      public void setShowEvents​(int showEvents)
      Parameters:
      showEvents - the showEvents to set
    • getHideEvents

      public int getHideEvents()
      Returns:
      the hideEvents
    • setHideEvents

      public void setHideEvents​(int hideEvents)
      Parameters:
      hideEvents - the hideEvents to set
    • getCancelEvents

      public int getCancelEvents()
      Returns:
      the cancelEvents
    • setCancelEvents

      public void setCancelEvents​(int cancelEvents)
      Parameters:
      cancelEvents - the cancelEvents to set
    • getTargetPopupShowEvents

      public int getTargetPopupShowEvents()
      Returns:
      the targetPopupShowEvents
    • setTargetPopupShowEvents

      public void setTargetPopupShowEvents​(int targetPopupShowEvents)
      Parameters:
      targetPopupShowEvents - the targetPopupShowEvents to set
    • getTargetPopupHideEvents

      public int getTargetPopupHideEvents()
      Returns:
      the targetPopupHideEvents
    • setTargetPopupHideEvents

      public void setTargetPopupHideEvents​(int targetPopupHideEvents)
      Parameters:
      targetPopupHideEvents - the targetPopupHideEvents to set
    • getTargetPopupCancelEvents

      public int getTargetPopupCancelEvents()
      Returns:
      the targetPopupCancelEvents
    • setTargetPopupCancelEvents

      public void setTargetPopupCancelEvents​(int targetPopupCancelEvents)
      Parameters:
      targetPopupCancelEvents - the targetPopupCancelEvents to set