Package com.sun.speech.engine
Class EngineMonitor
- java.lang.Object
-
- com.sun.speech.engine.EngineMonitor
-
- Direct Known Subclasses:
SynthesizerMonitor
public class EngineMonitor extends java.lang.Object
Simple GUI for monitoring events and state changes of anEngine
. Used for debugging and testing purposes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
EngineMonitor.EngineMonitorEngineListener
Handles engine events from the engine.
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.JLabel
allocatedLabel
The label containing the string "allocated".protected javax.swing.JLabel
allocatingResourcesLabel
The label containing the string "allocating resources".protected javax.swing.JLabel
deallocatedLabel
The label containing the string "deallocated".protected javax.swing.JLabel
deallocatingResourcesLabel
The label containing the string "deallocating resources".protected Engine
engine
TheEngine
to monitor.protected EngineListener
engineListener
TheEngineListener
registered with the engine.protected EngineEventPanel
eventPanel
The panel used to post engine events.protected javax.swing.JLabel
pausedLabel
The label containing the string "paused".protected javax.swing.JLabel
resumedLabel
The label containing the string "resumed".protected javax.swing.JPanel
statePanel
The panel containing the current engine states.
-
Constructor Summary
Constructors Constructor Description EngineMonitor(Engine eng)
Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendBuffer(java.lang.StringBuffer b, java.lang.String s)
Adds aString
to a buffer, with eachString
being separated by a ":".protected java.lang.String
engineStateString(long state)
Returns aString
representing thestate
.protected EngineListener
getEngineListener()
Creates the engine listener if necessary, and then returns it.java.awt.Component
getEventPanel()
Gets the panel containing the area to post engine events in.java.awt.Component
getStatePanel()
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
updateEngineStateComponents()
Checks the current state of the engine and makes sure the GUI components reflect this state accurately.protected void
updateGUIComponents()
Checks the current state of the engine and makes sure the GUI components reflect this state accurately.
-
-
-
Field Detail
-
engine
protected Engine engine
TheEngine
to monitor.
-
engineListener
protected EngineListener engineListener
TheEngineListener
registered with the engine.
-
eventPanel
protected EngineEventPanel eventPanel
The panel used to post engine events.
-
statePanel
protected javax.swing.JPanel statePanel
The panel containing the current engine states.
-
deallocatedLabel
protected javax.swing.JLabel deallocatedLabel
The label containing the string "deallocated".
-
allocatingResourcesLabel
protected javax.swing.JLabel allocatingResourcesLabel
The label containing the string "allocating resources".
-
allocatedLabel
protected javax.swing.JLabel allocatedLabel
The label containing the string "allocated".
-
deallocatingResourcesLabel
protected javax.swing.JLabel deallocatingResourcesLabel
The label containing the string "deallocating resources".
-
pausedLabel
protected javax.swing.JLabel pausedLabel
The label containing the string "paused".
-
resumedLabel
protected javax.swing.JLabel resumedLabel
The label containing the string "resumed".
-
-
Method Detail
-
getEngineListener
protected EngineListener getEngineListener()
Creates the engine listener if necessary, and then returns it. There should be only one.- Returns:
- the engine listener
-
getEventPanel
public java.awt.Component getEventPanel()
Gets the panel containing the area to post engine events in.- Returns:
- the panel containing the area to post engine events in
-
getStatePanel
public java.awt.Component 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
protected java.lang.String engineStateString(long state)
Returns aString
representing thestate
.- Parameters:
state
- the state to turn into aString
- Returns:
- a
String
representing thestate
-
appendBuffer
protected void appendBuffer(java.lang.StringBuffer b, java.lang.String s)
Adds aString
to a buffer, with eachString
being separated by a ":".- Parameters:
b
- the buffer to which to appends
s
- theString
to append tob
-
-