org.apache.batik.dom.events

Class DocumentEventSupport

public class DocumentEventSupport extends Object

This class implements the behavior of DocumentEvent.
Nested Class Summary
protected static classDocumentEventSupport.CustomEventFactory
To create a Custom event.
interfaceDocumentEventSupport.EventFactory
This interface represents an event factory.
protected static classDocumentEventSupport.KeyboardEventFactory
To create a keyboard event.
protected static classDocumentEventSupport.KeyEventFactory
To create a key event.
protected static classDocumentEventSupport.MouseEventFactory
To create a mouse event.
protected static classDocumentEventSupport.MutationEventFactory
To create a mutation event.
protected static classDocumentEventSupport.MutationNameEventFactory
To create a mutation name event.
protected static classDocumentEventSupport.SimpleEventFactory
To create a simple event.
protected static classDocumentEventSupport.TextEventFactory
To create a Text event.
protected static classDocumentEventSupport.UIEventFactory
To create a UI event.
Field Summary
static StringCUSTOM_EVENT_TYPE
The CustomEvent type.
protected HashTableeventFactories
The event factories table.
static StringEVENT_DOM2_TYPE
The Event type.
static StringEVENT_TYPE
The Event type.
static StringKEYBOARD_EVENT_TYPE
The KeyEvent type.
static StringKEY_EVENT_DOM2_TYPE
The KeyEvent type.
static StringMOUSE_EVENT_DOM2_TYPE
The MouseEvent type.
static StringMOUSE_EVENT_TYPE
The MouseEvent type.
static StringMUTATION_EVENT_DOM2_TYPE
The MutationEvent type.
static StringMUTATION_EVENT_TYPE
The MutationEvent type.
static StringMUTATION_NAME_EVENT_TYPE
The MutationNameEvent type.
static StringTEXT_EVENT_TYPE
The TextEvent type.
static StringUI_EVENT_DOM2_TYPE
The UIEvent type.
static StringUI_EVENT_TYPE
The UIEvent type.
Method Summary
EventcreateEvent(String eventType)
Creates a new Event depending on the specified parameter.
voidregisterEventFactory(String eventType, DocumentEventSupport.EventFactory factory)
Registers a new EventFactory object.

Field Detail

CUSTOM_EVENT_TYPE

public static final String CUSTOM_EVENT_TYPE
The CustomEvent type.

eventFactories

protected HashTable eventFactories
The event factories table.

EVENT_DOM2_TYPE

public static final String EVENT_DOM2_TYPE
The Event type.

EVENT_TYPE

public static final String EVENT_TYPE
The Event type.

KEYBOARD_EVENT_TYPE

public static final String KEYBOARD_EVENT_TYPE
The KeyEvent type.

KEY_EVENT_DOM2_TYPE

public static final String KEY_EVENT_DOM2_TYPE
The KeyEvent type.

MOUSE_EVENT_DOM2_TYPE

public static final String MOUSE_EVENT_DOM2_TYPE
The MouseEvent type.

MOUSE_EVENT_TYPE

public static final String MOUSE_EVENT_TYPE
The MouseEvent type.

MUTATION_EVENT_DOM2_TYPE

public static final String MUTATION_EVENT_DOM2_TYPE
The MutationEvent type.

MUTATION_EVENT_TYPE

public static final String MUTATION_EVENT_TYPE
The MutationEvent type.

MUTATION_NAME_EVENT_TYPE

public static final String MUTATION_NAME_EVENT_TYPE
The MutationNameEvent type.

TEXT_EVENT_TYPE

public static final String TEXT_EVENT_TYPE
The TextEvent type.

UI_EVENT_DOM2_TYPE

public static final String UI_EVENT_DOM2_TYPE
The UIEvent type.

UI_EVENT_TYPE

public static final String UI_EVENT_TYPE
The UIEvent type.

Method Detail

createEvent

public Event createEvent(String eventType)
Creates a new Event depending on the specified parameter.

Parameters: eventType The eventType parameter specifies the type of Event interface to be created. If the Event interface specified is supported by the implementation this method will return a new Event of the interface type requested. If the Event is to be dispatched via the dispatchEvent method the appropriate event init method must be called after creation in order to initialize the Event's values. As an example, a user wishing to synthesize some kind of UIEvent would call createEvent with the parameter "UIEvent". The initUIEvent method could then be called on the newly created UIEvent to set the specific type of UIEvent to be dispatched and set its context information.The createEvent method is used in creating Events when it is either inconvenient or unnecessary for the user to create an Event themselves. In cases where the implementation provided Event is insufficient, users may supply their own Event implementations for use with the dispatchEvent method.

Returns: The newly created Event

Throws: DOMException NOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Event interface requested

registerEventFactory

public void registerEventFactory(String eventType, DocumentEventSupport.EventFactory factory)
Registers a new EventFactory object.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.