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
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.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPopup.TooltipBehavior.TooltipPositionBehaviorprovidesPopup.TooltipBehavior.TooltipPositionBehavior.followPointerNested classes/interfaces inherited from interface net.dermetfan.gdx.scenes.scene2d.ui.Popup.Behavior
Popup.Behavior.Adapter -
Constructor Summary
Constructors Constructor Description TooltipBehavior()TooltipBehavior(float delay)TooltipBehavior(float showDelay, float hideDelay)TooltipBehavior(int showEvents)TooltipBehavior(int showEvents, int hideEvents)TooltipBehavior(int showEvents, int hideEvents, int cancelEvents) -
Method Summary
Modifier and Type Method Description intcancelNotOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)intcancelOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)intgetCancelEvents()floatgetHideDelay()intgetHideEvents()floatgetShowDelay()intgetShowEvents()intgetTargetPopupCancelEvents()intgetTargetPopupHideEvents()intgetTargetPopupShowEvents()Popup.Reactionhandle(com.badlogic.gdx.scenes.scene2d.Event e, Popup popup)inthideNotOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)inthideOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)voidsetCancelEvents(int cancelEvents)voidsetDelay(float delay)voidsetHideDelay(float hideDelay)voidsetHideEvents(int hideEvents)voidsetShowDelay(float showDelay)voidsetShowEvents(int showEvents)voidsetTargetPopupCancelEvents(int targetPopupCancelEvents)voidsetTargetPopupHideEvents(int targetPopupHideEvents)voidsetTargetPopupShowEvents(int targetPopupShowEvents)intshowNotOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)intshowOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)Methods inherited from class net.dermetfan.gdx.scenes.scene2d.ui.Popup.Behavior.Adapter
hide, showMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TooltipBehavior
public TooltipBehavior() -
TooltipBehavior
public TooltipBehavior(float delay)- Parameters:
delay- seesetDelay(float)
-
TooltipBehavior
public TooltipBehavior(float showDelay, float hideDelay)- Parameters:
showDelay- theshowDelayhideDelay- thehideDelay
-
TooltipBehavior
public TooltipBehavior(int showEvents)- Parameters:
showEvents- theshowEvents
-
TooltipBehavior
public TooltipBehavior(int showEvents, int hideEvents)- Parameters:
showEvents- theshowEventshideEvents- thehideEvents
-
TooltipBehavior
public TooltipBehavior(int showEvents, int hideEvents, int cancelEvents)- Parameters:
showEvents- theshowEventshideEvents- thehideEventscancelEvents- thecancelEvents
-
-
Method Details
-
handle
- Specified by:
handlein interfacePopup.Behavior- Overrides:
handlein classPopup.Behavior.Adapter- Parameters:
e- the Event to handlepopup- the Popup this Behavior is attached to- Returns:
null
-
showOn
public int showOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)- Parameters:
event- theInputEvent.Typeon 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- theInputEvent.Typeon 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- theInputEvent.Typeon 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- theInputEvent.Typeon 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- theInputEvent.Typeon 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- theInputEvent.Typeon which to not cancel showing the tooltip- Returns:
- the new value of
cancelEvents
-
setDelay
public void setDelay(float delay)- Parameters:
delay- theshowDelayandhideDelay
-
getShowDelay
public float getShowDelay()- Returns:
- the
showDelay
-
setShowDelay
public void setShowDelay(float showDelay)- Parameters:
showDelay- theshowDelayto set
-
getHideDelay
public float getHideDelay()- Returns:
- the
hideDelay
-
setHideDelay
public void setHideDelay(float hideDelay)- Parameters:
hideDelay- thehideDelayto set
-
getShowEvents
public int getShowEvents()- Returns:
- the
showEvents
-
setShowEvents
public void setShowEvents(int showEvents)- Parameters:
showEvents- theshowEventsto set
-
getHideEvents
public int getHideEvents()- Returns:
- the
hideEvents
-
setHideEvents
public void setHideEvents(int hideEvents)- Parameters:
hideEvents- thehideEventsto set
-
getCancelEvents
public int getCancelEvents()- Returns:
- the
cancelEvents
-
setCancelEvents
public void setCancelEvents(int cancelEvents)- Parameters:
cancelEvents- thecancelEventsto set
-
getTargetPopupShowEvents
public int getTargetPopupShowEvents()- Returns:
- the
targetPopupShowEvents
-
setTargetPopupShowEvents
public void setTargetPopupShowEvents(int targetPopupShowEvents)- Parameters:
targetPopupShowEvents- thetargetPopupShowEventsto set
-
getTargetPopupHideEvents
public int getTargetPopupHideEvents()- Returns:
- the
targetPopupHideEvents
-
setTargetPopupHideEvents
public void setTargetPopupHideEvents(int targetPopupHideEvents)- Parameters:
targetPopupHideEvents- thetargetPopupHideEventsto set
-
getTargetPopupCancelEvents
public int getTargetPopupCancelEvents()- Returns:
- the
targetPopupCancelEvents
-
setTargetPopupCancelEvents
public void setTargetPopupCancelEvents(int targetPopupCancelEvents)- Parameters:
targetPopupCancelEvents- thetargetPopupCancelEventsto set
-