Class javax.speech.SpeechEvent
java.lang.Object
|
+--java.util.EventObject
|
+--javax.speech.SpeechEvent
- Subclasses:
- AudioEvent, EngineEvent, GrammarEvent, ResultEvent, SpeakableEvent
- public class SpeechEvent
- extends EventObject
The root event class for all speech events.
All events from a speech engine (recognizer or synthesizer)
are synchronized with the AWT event queue. This allows an
application to mix speech and AWT events with being concerned
with multi-threading problems.
Note to Engine Developers
The AWT event queue is obtained through the AWT Toolkit:
import java.awt.*;
...
EventQueue q = Toolkit.getDefaultToolkit().getSystemEventQueue();
An engine should create a sub-class of AWTEvent
that can be placed on the AWT event queue. The engine also
needs to create a non-visual AWT Component
to
receive the engine's AWTEvent
. When the
AWT event is notified to the engine's component, the engine
should issue the approporiate speech event. The speech event
can be issued either from the AWT event thread or from a
separate thread created by the speech engine.
(Note that SpeechEvent
is not a sub-class
of AWTEvent
so speech events can not be placed
directly onto the AWT event queue.)
- See Also:
- Serialized Form
Field Summary
|
int
|
id
Event identifier. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
id
protected int id
- Event identifier. Id values are defined for each sub-class
of
SpeechEvent
.
- See Also:
- getId
SpeechEvent
protected SpeechEvent(Object source)
- Constructs a
SpeechEvent
with a specified source.
The source must be non-null.
SpeechEvent
protected SpeechEvent(Object source,
int id)
- Constructs a
SpeechEvent
.
- Parameters:
source
- the object that issued the event
id
- the identifier for the event type
getId
public int getId()
- Return the event identifier. Id values are defined for each sub-class
of
SpeechEvent
.
paramString
public String paramString()
- Returns a parameter string identifying this event.
This method is useful for event-logging and for debugging.
- Returns:
- a string identifying the event
toString
public String toString()
- Return a printable String. Useful for event-logging and debugging.
- Overrides:
- toString in class EventObject
JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com