Class DialogActPanel

java.lang.Object
  |
  +--DialogActPanel

public class DialogActPanel
extends java.lang.Object
implements java.awt.event.ActionListener

This class builts the DialogActPanel, a window (instance of JDialog) which shows for each input or output turn it's role in the dialogue: great, bye, politness formula etc. It implements the ActionListener interface for controlling the buttons of the window. There are three buttons, one for the input term, one for the output term and one for closing the window if the option "Edit data" is selected in the main menu the user can sets and change the type of dialogue act for each turn


Field Summary
(package private)  javax.swing.JToggleButton accept
           
(package private)  javax.swing.JToggleButton backchannel
           
(package private)  javax.swing.JButton button1
           
(package private)  javax.swing.JToggleButton bye
           
(package private)  javax.swing.JToggleButton close
           
(package private)  javax.swing.JToggleButton commit
           
(package private)  javax.swing.JToggleButton confirm
           
(package private)  javax.swing.JToggleButton defer
           
(package private)  javax.swing.JToggleButton deliberate
           
(package private)  javax.swing.JDialog dialog
           
(package private)  Document doc
           
(package private)  javax.swing.JToggleButton greet
           
(package private)  javax.swing.JToggleButton inform_clarify
           
(package private)  javax.swing.JToggleButton inform_digress
           
(package private)  javax.swing.JToggleButton inform_exclude
           
(package private)  javax.swing.JToggleButton inform_give_reason
           
(package private)  javax.swing.JToggleButton init
           
(package private)  javax.swing.JToggleButton input
           
(package private)  javax.swing.JToggleButton introduce
           
(package private)  javax.swing.JFrame mainframe
           
(package private)  javax.swing.JPanel nord
           
(package private)  javax.swing.JToggleButton offer
           
(package private)  javax.swing.JToggleButton output
           
(package private)  javax.swing.JToggleButton politeness_formula
           
(package private)  javax.swing.JToggleButton reject
           
(package private)  javax.swing.JToggleButton request_clarify
           
(package private)  javax.swing.JToggleButton request_comment
           
(package private)  javax.swing.JToggleButton request_commit
           
(package private)  javax.swing.JToggleButton request_suggest
           
(package private)  javax.swing.JToggleButton suggest
           
(package private)  javax.swing.JToggleButton thank
           
(package private)  javax.swing.JTextArea turn
           
(package private)  UserInterface ui
           
 
Constructor Summary
DialogActPanel(javax.swing.JFrame mainframe, UserInterface ui, Document doc)
          The constructor of the DialogActPanel receives a reference of the mainframe, UserInterface and the current document.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Processes the events occured when one of the buttons Input or Output is selected and enables the Save option in the main menu
 void changed(Judgements j)
          displays the next turn with the corresponding dialog act properties.
private  java.lang.String Check()
           
private  void Check(boolean check)
          sets different buttons to the value of the boolean parameter called by changed
private  void Check(java.lang.String value)
          checks which options (JToggleButtons) are selected and depending on this sets the respective buttons as selected called by changed
 void Enable(boolean edit)
          Enables actions on the JToggleButtons if the option "Edit data" in the main menu is validated
 javax.swing.JPanel getDialogActPanelNord()
           
 Document getDoc()
           
 javax.swing.JDialog getTranslationDialog()
           
 UserInterface getUI()
           
private  void init()
          shows in the text area the first turn of the dialogue with the corresponding properties and sets the button "Input" to true
 void ShowDialog()
          packs all components and shows the Dialog Act window
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

dialog

javax.swing.JDialog dialog

nord

javax.swing.JPanel nord

turn

javax.swing.JTextArea turn

greet

javax.swing.JToggleButton greet

bye

javax.swing.JToggleButton bye

introduce

javax.swing.JToggleButton introduce

politeness_formula

javax.swing.JToggleButton politeness_formula

thank

javax.swing.JToggleButton thank

deliberate

javax.swing.JToggleButton deliberate

backchannel

javax.swing.JToggleButton backchannel

init

javax.swing.JToggleButton init

defer

javax.swing.JToggleButton defer

close

javax.swing.JToggleButton close

request_suggest

javax.swing.JToggleButton request_suggest

request_clarify

javax.swing.JToggleButton request_clarify

request_comment

javax.swing.JToggleButton request_comment

request_commit

javax.swing.JToggleButton request_commit

suggest

javax.swing.JToggleButton suggest

inform_digress

javax.swing.JToggleButton inform_digress

inform_exclude

javax.swing.JToggleButton inform_exclude

inform_clarify

javax.swing.JToggleButton inform_clarify

inform_give_reason

javax.swing.JToggleButton inform_give_reason

accept

javax.swing.JToggleButton accept

confirm

javax.swing.JToggleButton confirm

reject

javax.swing.JToggleButton reject

commit

javax.swing.JToggleButton commit

offer

javax.swing.JToggleButton offer

input

javax.swing.JToggleButton input

output

javax.swing.JToggleButton output

button1

javax.swing.JButton button1

mainframe

javax.swing.JFrame mainframe

ui

UserInterface ui

doc

Document doc
Constructor Detail

DialogActPanel

public DialogActPanel(javax.swing.JFrame mainframe,
                      UserInterface ui,
                      Document doc)
The constructor of the DialogActPanel receives a reference of the mainframe, UserInterface and the current document. We pass all these three arguments instead of only mainframe to avoid successively calls as getUserInterface(), getCurrentDocument()
See Also:
MainFrame, UserInterface, Document
Method Detail

getDialogActPanelNord

public javax.swing.JPanel getDialogActPanelNord()
Returns:
the panel situated at the north area of the layout

ShowDialog

public void ShowDialog()
packs all components and shows the Dialog Act window

getDoc

public Document getDoc()
Returns:
the current opened Document
See Also:
UserInterface.getCurrentDocument()

getUI

public UserInterface getUI()
Returns:
the user interface instance with the current settings
See Also:
UserInterface

init

private void init()
shows in the text area the first turn of the dialogue with the corresponding properties and sets the button "Input" to true
See Also:
Document.getData(), changed(Judgements)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Processes the events occured when one of the buttons Input or Output is selected and enables the Save option in the main menu
Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
MyMenu.setSavable(boolean)

getTranslationDialog

public javax.swing.JDialog getTranslationDialog()
Returns:
the current window

Check

private void Check(java.lang.String value)
checks which options (JToggleButtons) are selected and depending on this sets the respective buttons as selected called by changed

Check

private void Check(boolean check)
sets different buttons to the value of the boolean parameter called by changed

Check

private java.lang.String Check()
Returns:
the label of the JToggleButton that was selected called by actionPerformed

changed

public void changed(Judgements j)
displays the next turn with the corresponding dialog act properties. The next turn is selected from the input or output depending on the pressed button

Enable

public void Enable(boolean edit)
Enables actions on the JToggleButtons if the option "Edit data" in the main menu is validated
See Also:
MyMenu.checkedit