Package com.sun.speech.engine
Class EngineMonitor
java.lang.Object
com.sun.speech.engine.EngineMonitor
- Direct Known Subclasses:
SynthesizerMonitor
Simple GUI for monitoring events and state changes of an
Engine. Used for debugging and testing purposes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classHandles engine events from the engine. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JLabelThe label containing the string "allocated".protected JLabelThe label containing the string "allocating resources".protected JLabelThe label containing the string "deallocated".protected JLabelThe label containing the string "deallocating resources".protected EngineTheEngineto monitor.protected EngineListenerTheEngineListenerregistered with the engine.protected EngineEventPanelThe panel used to post engine events.protected JLabelThe label containing the string "paused".protected JLabelThe label containing the string "resumed".protected JPanelThe panel containing the current engine states. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendBuffer(StringBuffer b, String s) Adds aStringto a buffer, with eachStringbeing separated by a ":".protected StringengineStateString(long state) Returns aStringrepresenting thestate.protected EngineListenerCreates the engine listener if necessary, and then returns it.Gets the panel containing the area to post engine events in.Gets the panel containing the labels for representing the current engine state.protected voidhandleEvent(EngineEvent e) Handles an event from the engine.protected voidChecks the current state of the engine and makes sure the GUI components reflect this state accurately.protected voidChecks the current state of the engine and makes sure the GUI components reflect this state accurately.
-
Field Details
-
engine
protected Engine engineTheEngineto monitor. -
engineListener
protected EngineListener engineListenerTheEngineListenerregistered with the engine. -
eventPanel
The panel used to post engine events. -
statePanel
The panel containing the current engine states. -
deallocatedLabel
The label containing the string "deallocated". -
allocatingResourcesLabel
The label containing the string "allocating resources". -
allocatedLabel
The label containing the string "allocated". -
deallocatingResourcesLabel
The label containing the string "deallocating resources". -
pausedLabel
The label containing the string "paused". -
resumedLabel
The label containing the string "resumed".
-
-
Constructor Details
-
EngineMonitor
public EngineMonitor(Engine eng) Class constructor.- Parameters:
eng- theEngineto watch
-
-
Method Details
-
getEngineListener
protected EngineListener getEngineListener()Creates the engine listener if necessary, and then returns it. There should be only one.- Returns:
- the engine listener
-
getEventPanel
Gets the panel containing the area to post engine events in.- Returns:
- the panel containing the area to post engine events in
-
getStatePanel
Gets the panel containing the labels for representing the current engine state.- Returns:
- the panel containing the labels for representing the current engine state.
-
handleEvent
protected void handleEvent(EngineEvent e) Handles an event from the engine.- Parameters:
e- the event from the engine
-
updateGUIComponents
protected void updateGUIComponents()Checks the current state of the engine and makes sure the GUI components reflect this state accurately. -
updateEngineStateComponents
protected void updateEngineStateComponents()Checks the current state of the engine and makes sure the GUI components reflect this state accurately. -
engineStateString
Returns aStringrepresenting thestate.- Parameters:
state- the state to turn into aString- Returns:
- a
Stringrepresenting thestate
-
appendBuffer
Adds aStringto a buffer, with eachStringbeing separated by a ":".- Parameters:
b- the buffer to which to appendsinvalid input: '<'/code tos- theStringto append tob
-