fi.hut.tml.xsmiles.mlfc.xforms.dialog
Class DialogGUIDebug

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xforms.dialog.DialogGUIDebug
All Implemented Interfaces:
java.awt.event.ActionListener, DialogUI, java.util.EventListener, XRecognizerListener
Direct Known Subclasses:
DialogGUITest

public class DialogGUIDebug
extends java.lang.Object
implements DialogUI, java.awt.event.ActionListener, XRecognizerListener

This creates an additional Dialog UI layer on top of an XForms document. It is possible to operate thee Dialog UI with a voice recognizer and voice output for instance

Author:
honkkis

Field Summary
protected  XInput answerInput
           
protected  java.awt.Container bottomPanel
           
protected  java.awt.Container buttonPanel
           
protected static ComponentFactory cfactory
           
protected  javax.swing.JFrame frame
           
protected  XButton installButton
           
protected  java.util.Vector listeners
           
protected  java.awt.Container mainPanel
           
protected  XTextArea questionArea
           
protected  XLabelCompound recCompound
           
protected  Recognizer recognizer
           
protected  XSelectBoolean recSelect
           
protected  XButton speakButton
           
protected  XLabelCompound speechCompound
           
protected  XSelectBoolean speechSelect
           
protected  XCaption statusLabel
           
protected  XButton stopButton
           
protected  Synth synth
           
protected  java.awt.Container topPanel
           
 
Fields inherited from interface fi.hut.tml.xsmiles.speech.XRecognizerListener
statusIdle, statusInitializing, statusRecognizing
 
Constructor Summary
DialogGUIDebug()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent arg0)
           
 void addActionListener(java.awt.event.ActionListener l)
           
 void append(java.lang.String text)
           
protected  void createListeners()
           
 void destroy()
           
protected  void enableRecognizer(boolean enable)
           
protected  void enableSpeech(boolean enable)
           
protected  void fireEvent(java.awt.event.ActionEvent e)
           
protected  ComponentFactory getComponentFactory()
           
static DialogGUIDebug getInstance(ComponentFactory f)
           
protected  void registerKeyboardAction(javax.swing.KeyStroke stroke, java.awt.event.ActionListener listener)
           
 void removeActionListener(java.awt.event.ActionListener l)
           
 void resultEvent(XResultEvent e)
           
 void setComponentFactory(ComponentFactory f)
           
 void setGrammar(java.io.Reader r)
           
 void showDialog()
           
 void showQuestion(java.lang.String question, java.io.Reader grammar)
           
protected  void speak(java.lang.String s)
           
protected  void speakButtonPressed()
           
protected  void speakButtonPressedSync()
           
 void start()
           
 void statusChange(short statusCode, java.lang.String statusMessage)
           
 void stopAll()
          stops both the speech synth and recognizer
protected  void stopButtonPressed()
           
 void stopRecognizer()
           
 void stopSpeech()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

protected javax.swing.JFrame frame

mainPanel

protected java.awt.Container mainPanel

bottomPanel

protected java.awt.Container bottomPanel

topPanel

protected java.awt.Container topPanel

buttonPanel

protected java.awt.Container buttonPanel

cfactory

protected static ComponentFactory cfactory

questionArea

protected XTextArea questionArea

answerInput

protected XInput answerInput

statusLabel

protected XCaption statusLabel

speechSelect

protected XSelectBoolean speechSelect

speechCompound

protected XLabelCompound speechCompound

recSelect

protected XSelectBoolean recSelect

recCompound

protected XLabelCompound recCompound

speakButton

protected XButton speakButton

stopButton

protected XButton stopButton

installButton

protected XButton installButton

listeners

protected java.util.Vector listeners

synth

protected Synth synth

recognizer

protected Recognizer recognizer
Constructor Detail

DialogGUIDebug

public DialogGUIDebug()
Method Detail

getInstance

public static DialogGUIDebug getInstance(ComponentFactory f)

start

public void start()

showDialog

public void showDialog()

getComponentFactory

protected ComponentFactory getComponentFactory()

setComponentFactory

public void setComponentFactory(ComponentFactory f)

speakButtonPressed

protected void speakButtonPressed()

stopButtonPressed

protected void stopButtonPressed()

speakButtonPressedSync

protected void speakButtonPressedSync()

enableSpeech

protected void enableSpeech(boolean enable)

enableRecognizer

protected void enableRecognizer(boolean enable)

speak

protected void speak(java.lang.String s)

showQuestion

public void showQuestion(java.lang.String question,
                         java.io.Reader grammar)
Specified by:
showQuestion in interface DialogUI

fireEvent

protected void fireEvent(java.awt.event.ActionEvent e)

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Specified by:
addActionListener in interface DialogUI

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Specified by:
removeActionListener in interface DialogUI

destroy

public void destroy()
Specified by:
destroy in interface DialogUI

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent arg0)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

append

public void append(java.lang.String text)
Specified by:
append in interface DialogUI

setGrammar

public void setGrammar(java.io.Reader r)
Specified by:
setGrammar in interface DialogUI

createListeners

protected void createListeners()

registerKeyboardAction

protected void registerKeyboardAction(javax.swing.KeyStroke stroke,
                                      java.awt.event.ActionListener listener)

resultEvent

public void resultEvent(XResultEvent e)
Specified by:
resultEvent in interface XRecognizerListener

statusChange

public void statusChange(short statusCode,
                         java.lang.String statusMessage)
Specified by:
statusChange in interface XRecognizerListener

stopSpeech

public void stopSpeech()
Specified by:
stopSpeech in interface DialogUI

stopRecognizer

public void stopRecognizer()
Specified by:
stopRecognizer in interface DialogUI

stopAll

public void stopAll()
Description copied from interface: DialogUI
stops both the speech synth and recognizer

Specified by:
stopAll in interface DialogUI


X-Smiles 1.2