import com.badlogic.gdx.utils.GdxRuntimeException;\r
import com.badlogic.gdx.utils.Pools;\r
\r
-/** 2D scene graph node. An actor has a position, rectangular size, origin, scale, rotation, Z index, and color. The position corresponds to\r
- * the unrotated, unscaled bottom left corner of the actor. The position is relative to the actor's parent. The origin is relative\r
- * to the position and is used for scale and rotation.\r
+/** 2D scene graph node. An actor has a position, rectangular size, origin, scale, rotation, Z index, and color. The position\r
+ * corresponds to the unrotated, unscaled bottom left corner of the actor. The position is relative to the actor's parent. The\r
+ * origin is relative to the position and is used for scale and rotation.\r
* <p>\r
- * An actor has a list of in-progress {@link Action actions} that are applied to the actor (over time). These are generally used to change\r
- * the presentation of the actor (moving it, resizing it, etc). See {@link #act(float)} and {@link Action}.\r
+ * An actor has a list of in-progress {@link Action actions} that are applied to the actor (over time). These are generally used to\r
+ * change the presentation of the actor (moving it, resizing it, etc). See {@link #act(float)} and {@link Action}.\r
* <p>\r
- * An actor has two kinds of listeners associated with it: "capture" and regular. \r
- * The listeners are notified of\r
- * events the actor or its children receive. \r
- * The capture listeners are \r
- * designed to allow a parent or container actor to hide events from child actors. The regular listeners\r
- * are designed to allow an actor to respond to events that have been delivered. See {@link #fire} for more details.\r
+ * An actor has two kinds of listeners associated with it: "capture" and regular. The listeners are notified of events the actor\r
+ * or its children receive. The capture listeners are designed to allow a parent or container actor to hide events from child\r
+ * actors. The regular listeners are designed to allow an actor to respond to events that have been delivered. See {@link #fire}\r
+ * for more details.\r
* <p>\r
- * An {@link InputListener} can receive all the basic input events, and more \r
- * complex listeners (like {@link ClickListener} and {@link ActorGestureListener}) can listen for and combine \r
- * primitive events and recognize complex interactions like multi-click or pinch. \r
+ * An {@link InputListener} can receive all the basic input events, and more complex listeners (like {@link ClickListener} and\r
+ * {@link ActorGestureListener}) can listen for and combine primitive events and recognize complex interactions like multi-click\r
+ * or pinch.\r
* \r
* @author mzechner\r
* @author Nathan Sweet */\r
/** Sets this actor as the event {@link Event#setTarget(Actor) target} and propagates the event to this actor and ancestor\r
* actors as necessary. If this actor is not in the stage, the stage must be set before calling this method.\r
* <p>\r
- * Events are fired in 2 phases. \r
+ * Events are fired in 2 phases.\r
* <ol>\r
- * <li>The first phase (the "capture" phase) notifies listeners on each actor starting at the root and propagating downward\r
- * to (and including) this actor.</li> \r
- * <li>The second phase notifies listeners on each actor starting at this actor and, if\r
- * {@link Event#getBubbles()} is true, propagating upward to the root.</li>\r
+ * <li>The first phase (the "capture" phase) notifies listeners on each actor starting at the root and propagating downward to\r
+ * (and including) this actor.</li>\r
+ * <li>The second phase notifies listeners on each actor starting at this actor and, if {@link Event#getBubbles()} is true,\r
+ * propagating upward to the root.</li>\r
* </ol>\r
- * If the event is {@link Event#stop() stopped} at any time,\r
- * it will not propagate to the next actor.\r
+ * If the event is {@link Event#stop() stopped} at any time, it will not propagate to the next actor.\r
* @return true if the event was {@link Event#cancel() cancelled}. */\r
public boolean fire (Event event) {\r
if (event.getStage() == null) event.setStage(getStage());\r
* {@link #isVisible() visible}, or null if no actor was hit. The point is specified in the actor's local coordinate system (0,0\r
* is the bottom left of the actor and width,height is the upper right).\r
* <p>\r
- * This method is used to delegate touchDown, mouse, and enter/exit events. If this method returns null, those events will not occur on this Actor.\r
+ * This method is used to delegate touchDown, mouse, and enter/exit events. If this method returns null, those events will not\r
+ * occur on this Actor.\r
* <p>\r
* The default implementation returns this actor if the point is within this actor's bounds.\r
* \r
return false;\r
}\r
\r
- /**\r
- * Add a listener to receive events that {@link #hit(float, float, boolean) hit} this actor. \r
- * See {@link #fire(Event)}.\r
+ /** Add a listener to receive events that {@link #hit(float, float, boolean) hit} this actor. See {@link #fire(Event)}.\r
* \r
* @see InputListener\r
* @see ClickListener */\r
actions.clear();\r
}\r
\r
+ /** Removes all listeners on this actor. */\r
+ public void clearListeners () {\r
+ listeners.clear();\r
+ captureListeners.clear();\r
+ }\r
+\r
+ /** Removes all actions and listeners on this actor. */\r
+ public void clear () {\r
+ clearActions();\r
+ clearListeners();\r
+ }\r
+\r
/** Returns the stage that this actor is currently in, or null if not in a stage. */\r
public Stage getStage () {\r
return stage;\r