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 class
Handles engine events from the engine. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JLabel
The label containing the string "allocated".protected JLabel
The label containing the string "allocating resources".protected JLabel
The label containing the string "deallocated".protected JLabel
The label containing the string "deallocating resources".protected Engine
TheEngine
to monitor.protected EngineListener
TheEngineListener
registered with the engine.protected EngineEventPanel
The panel used to post engine events.protected JLabel
The label containing the string "paused".protected JLabel
The label containing the string "resumed".protected JPanel
The panel containing the current engine states. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendBuffer
(StringBuffer b, String s) Adds aString
to a buffer, with eachString
being separated by a ":".protected String
engineStateString
(long state) Returns aString
representing thestate
.protected EngineListener
Creates 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 void
handleEvent
(EngineEvent e) Handles an event from the engine.protected void
Checks the current state of the engine and makes sure the GUI components reflect this state accurately.protected void
Checks the current state of the engine and makes sure the GUI components reflect this state accurately.
-
Field Details
-
engine
protected Engine engineTheEngine
to monitor. -
engineListener
protected EngineListener engineListenerTheEngineListener
registered 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
- theEngine
to 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 aString
representing thestate
.- Parameters:
state
- the state to turn into aString
- Returns:
- a
String
representing thestate
-
appendBuffer
Adds aString
to a buffer, with eachString
being separated by a ":".- Parameters:
b
- the buffer to which to appendsinvalid input: '<'/code to
s
- theString
to append tob
-