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 class
Popup.TooltipBehavior.TooltipPositionBehavior
providesPopup.TooltipBehavior.TooltipPositionBehavior.followPointer
Nested 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 int
cancelNotOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
int
cancelOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
int
getCancelEvents()
float
getHideDelay()
int
getHideEvents()
float
getShowDelay()
int
getShowEvents()
int
getTargetPopupCancelEvents()
int
getTargetPopupHideEvents()
int
getTargetPopupShowEvents()
Popup.Reaction
handle(com.badlogic.gdx.scenes.scene2d.Event e, Popup popup)
int
hideNotOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
int
hideOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
void
setCancelEvents(int cancelEvents)
void
setDelay(float delay)
void
setHideDelay(float hideDelay)
void
setHideEvents(int hideEvents)
void
setShowDelay(float showDelay)
void
setShowEvents(int showEvents)
void
setTargetPopupCancelEvents(int targetPopupCancelEvents)
void
setTargetPopupHideEvents(int targetPopupHideEvents)
void
setTargetPopupShowEvents(int targetPopupShowEvents)
int
showNotOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
int
showOn(com.badlogic.gdx.scenes.scene2d.InputEvent.Type event)
Methods inherited from class net.dermetfan.gdx.scenes.scene2d.ui.Popup.Behavior.Adapter
hide, show
Methods 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
- theshowDelay
hideDelay
- thehideDelay
-
TooltipBehavior
public TooltipBehavior(int showEvents)- Parameters:
showEvents
- theshowEvents
-
TooltipBehavior
public TooltipBehavior(int showEvents, int hideEvents)- Parameters:
showEvents
- theshowEvents
hideEvents
- thehideEvents
-
TooltipBehavior
public TooltipBehavior(int showEvents, int hideEvents, int cancelEvents)- Parameters:
showEvents
- theshowEvents
hideEvents
- thehideEvents
cancelEvents
- thecancelEvents
-
-
Method Details
-
handle
- Specified by:
handle
in interfacePopup.Behavior
- Overrides:
handle
in 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.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
- theInputEvent.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
- theInputEvent.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
- theInputEvent.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
- theInputEvent.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
- theInputEvent.Type
on which to not cancel showing the tooltip- Returns:
- the new value of
cancelEvents
-
setDelay
public void setDelay(float delay)- Parameters:
delay
- theshowDelay
andhideDelay
-
getShowDelay
public float getShowDelay()- Returns:
- the
showDelay
-
setShowDelay
public void setShowDelay(float showDelay)- Parameters:
showDelay
- theshowDelay
to set
-
getHideDelay
public float getHideDelay()- Returns:
- the
hideDelay
-
setHideDelay
public void setHideDelay(float hideDelay)- Parameters:
hideDelay
- thehideDelay
to set
-
getShowEvents
public int getShowEvents()- Returns:
- the
showEvents
-
setShowEvents
public void setShowEvents(int showEvents)- Parameters:
showEvents
- theshowEvents
to set
-
getHideEvents
public int getHideEvents()- Returns:
- the
hideEvents
-
setHideEvents
public void setHideEvents(int hideEvents)- Parameters:
hideEvents
- thehideEvents
to set
-
getCancelEvents
public int getCancelEvents()- Returns:
- the
cancelEvents
-
setCancelEvents
public void setCancelEvents(int cancelEvents)- Parameters:
cancelEvents
- thecancelEvents
to set
-
getTargetPopupShowEvents
public int getTargetPopupShowEvents()- Returns:
- the
targetPopupShowEvents
-
setTargetPopupShowEvents
public void setTargetPopupShowEvents(int targetPopupShowEvents)- Parameters:
targetPopupShowEvents
- thetargetPopupShowEvents
to set
-
getTargetPopupHideEvents
public int getTargetPopupHideEvents()- Returns:
- the
targetPopupHideEvents
-
setTargetPopupHideEvents
public void setTargetPopupHideEvents(int targetPopupHideEvents)- Parameters:
targetPopupHideEvents
- thetargetPopupHideEvents
to set
-
getTargetPopupCancelEvents
public int getTargetPopupCancelEvents()- Returns:
- the
targetPopupCancelEvents
-
setTargetPopupCancelEvents
public void setTargetPopupCancelEvents(int targetPopupCancelEvents)- Parameters:
targetPopupCancelEvents
- thetargetPopupCancelEvents
to set
-