|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSpeechEvent
EngineEvent
public abstract class EngineEvent
Provides information to applications about changes in the state
of a speech Engine
.
EngineEvent
s are issued to the appropriate EngineListener
attached to an Engine
.
The subclasses of EngineEvent
provide specific
methods and events for the associated types of Engine
s.
Engine
,
EngineListener
Field Summary | |
---|---|
static int |
DEFAULT_MASK
The default mask for events in this class. |
static int |
ENGINE_ALLOCATED
Event issued when Engine allocation is complete. |
static int |
ENGINE_ALLOCATING_RESOURCES
Event issued when Engine allocation has commenced. |
static int |
ENGINE_DEALLOCATED
Event issued when Engine deallocation is complete. |
static int |
ENGINE_DEALLOCATING_RESOURCES
Event issued when Engine deallocation has commenced. |
static int |
ENGINE_DEFOCUSED
Event issued when an Engine loses focus. |
static int |
ENGINE_ERROR
Event issued when an Engine error occurs. |
static int |
ENGINE_FOCUSED
Event issued when an Engine gains focus. |
static int |
ENGINE_PAUSED
Event issued when the Engine is PAUSED . |
static int |
ENGINE_RESUMED
Event issued when the Engine is RESUMED . |
Fields inherited from class SpeechEvent |
---|
DISABLE_ALL, ENABLE_ALL |
Constructor Summary | |
---|---|
EngineEvent(Engine source,
int id,
long oldEngineState,
long newEngineState,
Throwable problem)
Constructs an EngineEvent to indicate a change in state. |
Method Summary | |
---|---|
Throwable |
getEngineError()
Returns the non-null Throwable Object that describes
the problem for an ENGINE_ERROR event. |
long |
getNewEngineState()
Returns the state following this EngineEvent . |
long |
getOldEngineState()
Returns the state preceding this EngineEvent . |
String |
paramString()
Returns a parameter String that contains
the event ID in text form. |
Methods inherited from class SpeechEvent |
---|
getId, getSource, toString |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ENGINE_ALLOCATED
Engine
allocation is complete.
The ALLOCATED
flag from getNewEngineState
is set.
getNewEngineState
,
getId
,
allocate
,
ALLOCATED
,
Constant Field Valuespublic static final int ENGINE_DEALLOCATED
Engine
deallocation is complete.
The DEALLOCATED
flag from getNewEngineState
is set.
getNewEngineState
,
getId
,
deallocate
,
DEALLOCATED
,
Constant Field Valuespublic static final int ENGINE_ALLOCATING_RESOURCES
Engine
allocation has commenced.
The ALLOCATING_RESOURCES
flag from
getNewEngineState
is set.
getNewEngineState
,
getId
,
allocate
,
ALLOCATING_RESOURCES
,
Constant Field Valuespublic static final int ENGINE_DEALLOCATING_RESOURCES
Engine
deallocation has commenced.
The DEALLOCATING_RESOURCES
flag from
getNewEngineState
is set.
getNewEngineState
,
getId
,
deallocate
,
DEALLOCATING_RESOURCES
,
Constant Field Valuespublic static final int ENGINE_PAUSED
Engine
is PAUSED
.
The PAUSED
flag from getNewEngineState
is set.
getNewEngineState
,
getId
,
pause
,
PAUSED
,
Constant Field Valuespublic static final int ENGINE_RESUMED
Engine
is RESUMED
.
The RESUMED
flag from getNewEngineState
is set.
getNewEngineState
,
getId
,
resume
,
RESUMED
,
Constant Field Valuespublic static final int ENGINE_FOCUSED
Engine
gains focus.
The Engine
changes from the
DEFOCUSED
state to the FOCUSED
state.
The FOCUSED
flag from getNewEngineState
is set.
getNewEngineState
,
getId
,
DEFOCUSED
,
FOCUSED
,
ENGINE_DEFOCUSED
,
Constant Field Valuespublic static final int ENGINE_DEFOCUSED
Engine
loses focus.
The Engine
changes from the
FOCUSED
state to the DEFOCUSED
state.
The DEFOCUSED
flag from getNewEngineState
is set.
getNewEngineState
,
getId
,
FOCUSED
,
DEFOCUSED
,
ENGINE_FOCUSED
,
Constant Field Valuespublic static final int ENGINE_ERROR
Engine
error occurs.
This event provides asynchronous notification of an internal error in
the Engine
that prevents normal behavior of that Engine
.
The application should deallocate
the Engine
in this case.
The ERROR_OCCURRED
flag from getNewEngineState
is set.
getNewEngineState
,
getId
,
getEngineError
,
ERROR_OCCURRED
,
deallocate
,
Constant Field Valuespublic static final int DEFAULT_MASK
The following events are delivered by default:
ENGINE_ALLOCATED
, ENGINE_DEALLOCATED
,
ENGINE_PAUSED
, ENGINE_RESUMED
,
ENGINE_FOCUSED
, ENGINE_DEFOCUSED
and
ENGINE_ERROR
.
The events ENGINE_ALLOCATING_RESOURCES
and
ENGINE_DEALLOCATING_RESOURCES
represent transient states and may be enabled if desired.
ENGINE_ALLOCATED
,
ENGINE_ALLOCATING_RESOURCES
,
ENGINE_DEALLOCATED
,
ENGINE_DEALLOCATING_RESOURCES
,
ENGINE_PAUSED
,
ENGINE_RESUMED
,
ENGINE_FOCUSED
,
ENGINE_DEFOCUSED
,
ENGINE_ERROR
,
setEngineMask
,
getEngineMask
,
Constant Field ValuesConstructor Detail |
---|
public EngineEvent(Engine source, int id, long oldEngineState, long newEngineState, Throwable problem) throws IllegalArgumentException
EngineEvent
to indicate a change in state.
oldEngineState
and newEngineState
are 0
if the
Engine
states are unknown or undefined.
problem
applies to ENGINE_ERROR
and
must be null
for other events.
source
- the Engine
that issued the eventid
- the event identifieroldEngineState
- the Engine
state prior to this eventnewEngineState
- the Engine
state following this eventproblem
- non-null
for ENGINE_ERROR
,
otherwise null
IllegalArgumentException
- if called with an inappropriate
event identifier or an invalid parameter valuegetSource
,
getId
,
getOldEngineState
,
getNewEngineState
,
getEngineError
,
getEngineState
,
ENGINE_ERROR
,
ENGINE_ALLOCATED
,
ENGINE_ALLOCATING_RESOURCES
,
ENGINE_DEALLOCATED
,
ENGINE_DEALLOCATING_RESOURCES
,
ENGINE_DEFOCUSED
,
ENGINE_FOCUSED
,
ENGINE_PAUSED
,
ENGINE_RESUMED
Method Detail |
---|
public long getNewEngineState()
EngineEvent
.
In the absence of any other events,
this value matches the value returned from getEngineState
.
Engine
stategetEngineState
,
getOldEngineState
public long getOldEngineState()
EngineEvent
.
Engine
stategetEngineState
,
getNewEngineState
public Throwable getEngineError()
non-null
Throwable
Object that describes
the problem for an ENGINE_ERROR
event.
This method returns null
for all other events.
Exception
or Error
describing the problemENGINE_ERROR
public String paramString()
String
that contains
the event ID in text form.
This method is useful for event-logging and for debugging.
The method toString
may provide more detail.
paramString
in class SpeechEvent
String
that contains the event ID in text formtoString
|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Speech API 2.0,
Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.