|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.EventHandler
public final class EventHandler
EventHandler is used to define the actions that a movie clip or button will execute in response to a particular event. Handlers for movie clips are defined when the movie clip is added to the display list using Place2 or Place3 objects while handlers for buttons are added when the button is created.
Event
Constructor Summary | |
---|---|
EventHandler(EventHandler object)
Creates and initialises a EventHandler object using the values copied from another EventHandler object. |
|
EventHandler(int value,
SWFDecoder coder,
Context context)
Creates and initialises a EventHandler object using values encoded in the Flash binary format. |
|
EventHandler(Set<Event> event,
int character,
List<Action> list)
Creates an EventHandler object that defines the list of actions that will be executed when a particular event occurs or when the specified key is pressed. |
|
EventHandler(Set<Event> event,
List<Action> list)
Creates a ClipEvent object that with a list of actions that will be executed when a particular event occurs. |
Method Summary | |
---|---|
EventHandler |
add(Action anAction)
Adds an action to the list of actions. |
EventHandler |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
List<Action> |
getActions()
Get the list of actions that are executed by the movie clip. |
int |
getEventCode()
Get the value that is encoded to represent the set of events that the handler responds to. |
Set<Event> |
getEvents()
Get the set of events that the handler responds to. |
int |
getKey()
Get the code for the key that triggers the event when pressed. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setActions(List<Action> list)
Sets the list of actions that are executed by the handler in response to specified event(s). |
void |
setEvents(Set<Event> set)
Set the events that the handler responds to. |
void |
setKey(int code)
Sets the code for the key that triggers the event when pressed. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EventHandler(int value, SWFDecoder coder, Context context) throws IOException
value
- is decoded by and it is dependent on the parent object. If
it is a Place2 or Place3 object then the event handler is for
a movie clip and the value represents the the set of events
that the handler responds to. If the parent object is a
button then the value is the length in bytes of the encoded
actions executed by the handler.coder
- an SWFDecoder object that contains the encoded Flash data.context
- a Context object used to manage the decoders for different
type of object and to pass information on how objects are
decoded.
IOException
- if an error occurs while decoding the data.public EventHandler(Set<Event> event, List<Action> list)
event
- the set of Events that the handler will respond to.list
- the list of actions that will be executed when the specified
event occurs.public EventHandler(Set<Event> event, int character, List<Action> list)
event
- the set of Events that the handler will respond to.character
- the ASCII code for the key pressed on the keyboard.list
- the list of actions that will be executed when the specified
event occurs. Must not be null.public EventHandler(EventHandler object)
object
- a EventHandler object from which the values will be
copied.Method Detail |
---|
public int getEventCode()
public Set<Event> getEvents()
public void setEvents(Set<Event> set)
set
- the set of Events for the handler.public int getKey()
public void setKey(int code)
code
- the ASCII code for the key that triggers the event.public List<Action> getActions()
public void setActions(List<Action> list)
list
- the array of actions that will be executed when the specified
event occurs. Must not be null.public EventHandler add(Action anAction)
anAction
- an action object. Must not be null.
public EventHandler copy()
copy
in interface Copyable<Action>
public String toString()
toString
in class Object
public int prepareToEncode(Context context)
prepareToEncode
in interface SWFEncodeable
context
- an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder, Context context) throws IOException
encode
in interface SWFEncodeable
coder
- an SWFEncoder object.context
- an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException
- if an error occurs while encoding the object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |