Class zEvent

Description

The zEvent class is based on the DOM Event interface and is used to provide contextual information about an event to the handler processing the event. A subclass of zEvent is generally passed as the first parameter to an event handler. More specific context information is passed to event handlers by deriving additional subclasses from zEvent which contain information directly relating to the type of event they accompany.

Author:

Nicholas C. Zakas, http://www.nczonline.net/

Version:

1.0

Since:

1.0

Field Summary

boolean cancelable
Indicates whether or not the event's default action can be cancelled.
zEventTarget target
The object that fired the event.
long timeStamp
The time that the event occurred in milliseconds since midnight, January 1, 1970.
String type
The type of event that was fired (i.e., "click").

Constructor Summary

zEvent()
Creates a new instance of zEvent.

Method Summary

void initEvent(String type, boolean cancelable)
Initializes the event's type and cancelable fields to the specified values.
void preventDefault()
Prevents the default action for an event (only if the event is cancelable).

Field Detail

cancelable

public boolean cancelable

Indicates whether or not the event's default action can be cancelled.


target

public zEventTarget target

The object that fired the event.


timeStamp

public long timeStamp

The time that the event occurred in milliseconds since midnight, January 1, 1970.


type

public String type

The type of event that was fired (i.e., "click").

Constructor Detail

zEvent

public zEvent()

Creates a new instance of zEvent.

Method Detail

initEvent

public void initEvent(String type, boolean cancelable)

Initializes the event's type and cancelable fields to the specified values.

Arguments:


preventDefault

public void preventDefault()

Prevents the default action of an event if the event is cancelable.