Class AnimationEvent

java.lang.Object
com.codename1.ui.events.ActionEvent
com.codename1.ui.events.AnimationEvent

public class AnimationEvent extends ActionEvent

An event reported by an interactive animated image, such as a Rive animation, delivered to the listeners added with Image.addAnimationListener(ActionListener).

The animation designer names each event and may attach custom properties to it. An event of type TYPE_OPEN_URL asks the application to open getUrl(); nothing is opened on its behalf.

  • Field Details

  • Constructor Details

    • AnimationEvent

      public AnimationEvent(Object source, String name, int type, String url, String target, Map<String,Object> properties)

      Creates an event.

      Parameters
      • source: the image that reported the event
      • name: the name the designer gave the event
      • type: TYPE_GENERAL or TYPE_OPEN_URL
      • url: the URL of an open-URL event, or null
      • target: the browser target of an open-URL event, or null
      • properties: the custom properties of the event, or null for none
  • Method Details

    • getName

      public String getName()

      The name the designer gave the event.

      Returns

      the name, never null

    • getType

      public int getType()

      The kind of event, TYPE_GENERAL or TYPE_OPEN_URL.

      Returns

      the type

    • getUrl

      public String getUrl()

      The URL of an open-URL event.

      Returns

      the URL, or null for a general event

    • getTarget

      public String getTarget()

      The browser target of an open-URL event: _blank, _parent, _self or _top.

      Returns

      the target, or null for a general event

    • getProperties

      public Map<String,Object> getProperties()

      The custom properties of the event by name: a Float for a number, a Boolean or a String.

      Returns

      an unmodifiable map, empty when the event has none

    • toString

      public String toString()
      Description copied from class: Object
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object