libgdx API

com.badlogic.gdx.scenes.scene2d
Class Event

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.Event
All Implemented Interfaces:
Pool.Poolable
Direct Known Subclasses:
ChangeListener.ChangeEvent, FocusListener.FocusEvent, InputEvent

public class Event
extends java.lang.Object
implements Pool.Poolable

The base class for all events.

See Also:
InputEvent, Actor.fire(Event)

Constructor Summary
Event()
           
 
Method Summary
 void cancel()
          Marks this event has being cancelled.
 boolean getBubbles()
           
 Actor getListenerActor()
          Returns the actor that this listener is attached to.
 Stage getStage()
          The stage for the actor the event was fired on.
 Actor getTarget()
          Returns the actor that the event originated from.
 void handle()
          Marks this event has being handled.
 boolean isCancelled()
           
 boolean isCapture()
          If true, the event was fired during the capture phase.
 boolean isHandled()
          handle()
 boolean isStopped()
           
 void reset()
          Resets the object for reuse.
 void setBubbles(boolean bubbles)
          If true, after the event is fired on the target actor, it will also be fired on each of the parent actors, all the way to the root.
 void setCapture(boolean capture)
           
 void setListenerActor(Actor listenerActor)
           
 void setStage(Stage stage)
           
 void setTarget(Actor targetActor)
           
 void stop()
          Marks this event has being stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Event

public Event()
Method Detail

handle

public void handle()
Marks this event has being handled. This does not affect event propagation inside scene2d, but causes the Stage event methods to return false, which will eat the event so it is not passed on to the application under the stage.


cancel

public void cancel()
Marks this event has being cancelled. This handles the event and stops the event propagation. It also cancels any default action that would have been taken by the code that fired the event. Eg, if the event is for a checkbox being checked, cancelling the event could uncheck the checkbox.


stop

public void stop()
Marks this event has being stopped. This halts event propagation. Any other listeners on the listener actor are notified, but after that no other listeners are notified.


reset

public void reset()
Description copied from interface: Pool.Poolable
Resets the object for reuse. Object references should be nulled and fields may be set to default values.

Specified by:
reset in interface Pool.Poolable

getTarget

public Actor getTarget()
Returns the actor that the event originated from.


setTarget

public void setTarget(Actor targetActor)

getListenerActor

public Actor getListenerActor()
Returns the actor that this listener is attached to.


setListenerActor

public void setListenerActor(Actor listenerActor)

getBubbles

public boolean getBubbles()

setBubbles

public void setBubbles(boolean bubbles)
If true, after the event is fired on the target actor, it will also be fired on each of the parent actors, all the way to the root.


isHandled

public boolean isHandled()
handle()


isStopped

public boolean isStopped()
See Also:
stop()

isCancelled

public boolean isCancelled()
See Also:
cancel()

setCapture

public void setCapture(boolean capture)

isCapture

public boolean isCapture()
If true, the event was fired during the capture phase.

See Also:
Actor.fire(Event)

setStage

public void setStage(Stage stage)

getStage

public Stage getStage()
The stage for the actor the event was fired on.


libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)