|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object examples.chat.ChatAgent
This class is mobile code, which will migrate through the peer-network and enables user to exchange textmassages with each other.
Field Summary | |
private JTextArea |
convHist_
|
private JTextField |
convInput_
|
private LinkedList |
convList_
|
private int |
convListIndex_
|
(package private) static boolean |
DEBUG
|
private String |
dest_
|
private JButton |
destButton_
|
private JButton |
exitButton_
|
private JButton |
goButton_
|
private String |
home_
|
private JFrame |
initFrame_
|
private Object |
lock_
|
private MobilityContext |
mob_
|
private AgentCard |
myCard_
|
private JComboBox |
serverChoiceBox_
|
private String |
source_
|
private JFrame |
talkFrame_
|
private ArrayList |
urls_
|
Constructor Summary | |
ChatAgent()
Creates an object of the class ChatAgent |
Method Summary | |
void |
actionPerformed(ActionEvent aEvent)
Defines the specific action sequence of all buttons of this class |
private ArrayList |
findTargets()
Get a list of all peers found in the VICINITY-network |
private void |
initGUI()
Method enables the user to choose a chat-partner in the VICINITY-network |
private boolean |
isHome()
Get a list of all peers found in the VICINITY-network |
void |
resume(ErrorCode err)
After an agent was suspended on a peer, he will migrate to >null< and terminate. |
void |
run()
This method will be executed after an agent has reached a peer. |
private void |
talkGUI()
Method enables the user to create and read textmessages with th choosen chat-partner. |
void |
windowActivated(WindowEvent wEvent)
Is not spezified in this program |
void |
windowClosed(WindowEvent wEvent)
When window closed the agent will leave his locked state |
void |
windowClosing(WindowEvent wEvent)
Dispose all windows and terminate agent |
void |
windowDeactivated(WindowEvent wEvent)
Is not spezified in this program |
void |
windowDeiconified(WindowEvent wEvent)
Is not spezified in this program |
void |
windowIconified(WindowEvent wEvent)
Is not spezified in this program |
void |
windowOpened(WindowEvent wEvent)
Is not spezified in this program |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final boolean DEBUG
private transient JFrame initFrame_
private transient JFrame talkFrame_
private transient JComboBox serverChoiceBox_
private transient MobilityContext mob_
private transient JButton destButton_
private transient JButton goButton_
private transient JButton exitButton_
private transient JTextArea convHist_
private transient JTextField convInput_
private LinkedList convList_
private ArrayList urls_
private int convListIndex_
private String home_
private String source_
private String dest_
private Object lock_
private AgentCard myCard_
Constructor Detail |
public ChatAgent()
Method Detail |
public void resume(ErrorCode err)
resume
in interface Resumable
err
- ErrorCode
Error, which is appeared during the program executionpublic void run()
run
in interface Runnable
InterruptedException
- Interrupts the wait-state of the agentprivate void initGUI()
private void talkGUI()
Exception
- If a problem with the inet-addresses happenspublic void actionPerformed(ActionEvent aEvent)
actionPerformed
in interface ActionListener
aEvent
- ActionEvent
An event from one of the GUI components.
Exception
- If there are migration problemspublic void windowClosed(WindowEvent wEvent)
windowClosed
in interface WindowListener
wEvent
- WindowEvent
An event from one of the windows.public void windowClosing(WindowEvent wEvent)
windowClosing
in interface WindowListener
wEvent
- WindowEvent
An event from one of the windows.public void windowActivated(WindowEvent wEvent)
windowActivated
in interface WindowListener
wEvent
- WindowEvent
An event from one of the windows.public void windowDeactivated(WindowEvent wEvent)
windowDeactivated
in interface WindowListener
wEvent
- WindowEvent
An event from one of the windows.public void windowDeiconified(WindowEvent wEvent)
windowDeiconified
in interface WindowListener
wEvent
- WindowEvent
An event from one of the windows.public void windowIconified(WindowEvent wEvent)
windowIconified
in interface WindowListener
wEvent
- WindowEvent
An event from one of the windows.public void windowOpened(WindowEvent wEvent)
windowOpened
in interface WindowListener
wEvent
- WindowEvent
An event from one of the windows.private boolean isHome()
private ArrayList findTargets()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |