Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class AnimationEvent
- Object
- ActionEvent
- AnimationEvent
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.
Fields
public static final int TYPE_GENERAL = 0 | A general event. |
public static final int TYPE_OPEN_URL = 1 | An event asking the application to open a URL, see getUrl(). |
Constructors
public AnimationEvent(Object source, String name, int type, String url, String target, Map<String, Object> properties) | Creates an event. |
Methods
public String getName() | The name the designer gave the event. |
public int getType() | The kind of event, TYPE_GENERAL or TYPE_OPEN_URL. |
public String getUrl() | The URL of an open-URL event. |
public String getTarget() | The browser target of an open-URL event: _blank, _parent, _self or _top. |
public Map<String, Object> getProperties() | The custom properties of the event by name: a Float for a number, a Boolean or a String. |
public String toString() | Returns a string representation of the object. |
Inherited nested types
Inherited methods
Field details
TYPE_GENERAL
public static final int TYPE_GENERAL = 0A general event.
TYPE_OPEN_URL
public static final int TYPE_OPEN_URL = 1An event asking the application to open a URL, see
getUrl().Constructor details
AnimationEvent
public AnimationEvent(Object source, String name, int type, String url, String target, Map<String, Object> properties)Creates an event.
Parameters
sourceObject- the image that reported the event
nameString- the name the designer gave the event
typeintTYPE_GENERALorTYPE_OPEN_URLurlString- the URL of an open-URL event, or null
targetString- the browser target of an open-URL event, or null
propertiesMap<String, Object>- 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()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())