moteaccess
Class SwingTOSMoteAccessUI

java.lang.Object
  extended bymoteaccess.SwingTOSMoteAccessUI
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener, TOSMoteAccessUI

public class SwingTOSMoteAccessUI
extends java.lang.Object
implements TOSMoteAccessUI, javax.swing.event.ListSelectionListener

Author:
Matteo Giani

Nested Class Summary
private  class SwingTOSMoteAccessUI.RequestWrapper
           
 
Field Summary
private  java.lang.String DEFAULT_DESCRIPTION_TEXT
           
(package private)  javax.swing.JLabel descriptionLabel
           
(package private)  javax.swing.JScrollPane descriptionScrollPane
           
(package private)  javax.swing.JTextArea descriptionTextArea
           
(package private)  javax.swing.JFrame frame
           
(package private)  javax.swing.JLabel listLabel
           
(package private)  javax.swing.DefaultListModel listmodel
           
(package private)  javax.swing.JScrollPane listscrollpane
           
(package private)  javax.swing.JLabel messagesLabel
           
(package private)  java.awt.Container pane
           
(package private)  javax.swing.JButton quitButton
           
(package private)  javax.swing.JList requestlist
           
private  java.util.HashMap ridtowrapper
           
(package private)  javax.swing.JButton setParameterButton
           
(package private)  javax.swing.JButton stopButton
           
(package private)  javax.swing.JTextArea textarea
           
(package private)  javax.swing.JScrollPane textscrollpane
           
private  TOSMoteAccess tma
           
 
Constructor Summary
SwingTOSMoteAccessUI(TOSMoteAccess tmaccess)
           
 
Method Summary
 void addedReaction(RequestID rid, MoteReaction req)
          Notifies the user that a new reaction has been installed.
 void addedRequest(RequestID rid, MoteRequest req)
          Notifies the user that a new request is being sent to the network.
 void printStatusLine(java.lang.String status)
          Prints a status message.
 void stoppedReaction(RequestID rid, MoteReaction req, java.lang.String reason)
          Notifies the user that a reaction was stopped.
 void stoppedRequest(RequestID rid, MoteRequest req, java.lang.String reason)
          Notifies the user that a running request was stopped.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Required by the ListSelectionListener interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DESCRIPTION_TEXT

private final java.lang.String DEFAULT_DESCRIPTION_TEXT
See Also:
Constant Field Values

frame

javax.swing.JFrame frame

pane

java.awt.Container pane

textarea

javax.swing.JTextArea textarea

textscrollpane

javax.swing.JScrollPane textscrollpane

messagesLabel

javax.swing.JLabel messagesLabel

listLabel

javax.swing.JLabel listLabel

descriptionLabel

javax.swing.JLabel descriptionLabel

descriptionTextArea

javax.swing.JTextArea descriptionTextArea

descriptionScrollPane

javax.swing.JScrollPane descriptionScrollPane

listmodel

javax.swing.DefaultListModel listmodel

requestlist

javax.swing.JList requestlist

listscrollpane

javax.swing.JScrollPane listscrollpane

stopButton

javax.swing.JButton stopButton

quitButton

javax.swing.JButton quitButton

setParameterButton

javax.swing.JButton setParameterButton

tma

private TOSMoteAccess tma

ridtowrapper

private java.util.HashMap ridtowrapper
Constructor Detail

SwingTOSMoteAccessUI

public SwingTOSMoteAccessUI(TOSMoteAccess tmaccess)
Method Detail

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Required by the ListSelectionListener interface.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

printStatusLine

public void printStatusLine(java.lang.String status)
Prints a status message.

Specified by:
printStatusLine in interface TOSMoteAccessUI
Parameters:
status - : status message to print.

addedRequest

public void addedRequest(RequestID rid,
                         MoteRequest req)
Notifies the user that a new request is being sent to the network.

Specified by:
addedRequest in interface TOSMoteAccessUI
Parameters:
req - : the MoteRequest object describing the new request.

addedReaction

public void addedReaction(RequestID rid,
                          MoteReaction req)
Notifies the user that a new reaction has been installed.

Specified by:
addedReaction in interface TOSMoteAccessUI
Parameters:
req - : the MoteReaction object describing the new reaction.

stoppedRequest

public void stoppedRequest(RequestID rid,
                           MoteRequest req,
                           java.lang.String reason)
Notifies the user that a running request was stopped.

Specified by:
stoppedRequest in interface TOSMoteAccessUI
Parameters:
req - : the MoteRequest that just stopped.
reason - : the reason why the request was stopped.

stoppedReaction

public void stoppedReaction(RequestID rid,
                            MoteReaction req,
                            java.lang.String reason)
Notifies the user that a reaction was stopped.

Specified by:
stoppedReaction in interface TOSMoteAccessUI
Parameters:
req - : the MoteReaction that just stopped.
reason - : the reason why the reaction was stopped.