public class ChatAgentWindow extends AgentInternalFrame
Use: java AgentWindow -pPORT# -n"NAME" -lLAC#, where PORT# is the desired port for the agent to use, NAME is the desired name for the agent, and LAC# is an optional parameter for the location (port) of a LAC to log on to.
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Field and Description |
---|---|
private static int |
buttonSEND |
protected JButton |
buttonSendBroadcast |
protected JButton |
buttonSendDirected |
private static int |
buttonSENDDIRECTED |
protected JButton |
buttonSendWhisper |
private static int |
buttonSENDWHISPER |
protected static int |
chatAgentFrame_LAST_EVENT |
(package private) static int |
DEFAULT_X |
(package private) static int |
DEFAULT_Y |
protected JList |
listMessages |
protected ChatMessageListModel |
listMessagesModel |
private static int |
listSCROLLED |
private JMenuItem |
menuAddFriend |
(package private) JMenuBar |
menuBar |
protected JMenuItem |
menuCD_MembersSelectAll |
protected JMenuItem |
menuCD_MembersSelectNone |
protected JCheckBoxMenuItem |
menuCD_setRetrieveHistory |
private static int |
menuCDMEMBERSSELECTALL |
private static int |
menuCDMEMBERSSELECTNONE |
private static int |
menuSETRETRIEVEHISTORY |
protected JTextField |
textMessage |
agentFrame_LAST_EVENT
buttonEXECUTE, buttonPAUSE, buttonRESUME, buttonSTEP, closingPort, contentPanel, debugBar, HORIZONTAL, menuADD_NEW_TAB, menuAgent_editOntology, menuAgent_Exit, menuAgent_options, menuAgent_setDebug, menuAgent_showMessageArea, menuAgent_showTrace, menuCD, menuCD_Join, menuCLEARDEBUG, menuEDIT_ONTOLOGY, menuEDIT_ONTOLOGY_GRAPHICAL, menuEXIT, menuFIRST_DYNAMIC_EVENT, menuGETYELLOWPAGES, menuHIDE_DEBUG_BAR, menuHIDE_MESSAGE_AREA, menuINFO, menuINVITECD, menuJOINCD, menuLAC, menuLAC_RegisterInstance, menuLAC_UnregisterInstance, menuLAST_DYNAMIC_EVENT, menuOPTIONS, menuREGISTER, menuSET_ACK_PROTOCOL, menuSHOW_DEBUG_BAR, menuSHOW_MESSAGE_AREA, menuSHOWTRACE, menuUNREGISTER, menuUserManual, menuWindow_hideDebugBar, menuWindow_showDebugBar, menuWITHDRAWCD, menuYP, noAction, pauseButton, pausedLabel, resumeButton, splitPanes, stepButton, transientAgentFrame_LAST_EVENT, VERTICAL
appIconSet, commandPanel, frame, guiObserver, jFrame, jInternalFrame, listCDMembers, listCDs, menuAgent, menuAgent_editActs, menuAgent_editPerformatives, menuAgentCommands, menuCD_Invite, menuCD_Withdraw, menuEDIT_ACT_TYPES, menuEDIT_PERFORMATIVE_TYPES, menuEditTypes, menuEDITTYPES, menuHelp, menuHelp_helpJade, menuHelp_helpLisp, menuHelp_helpOWL2, menuHelp_homepage, menuHelp_htmanual, menuHelp_info, menuHelp_javadoc, menuHelp_umanual, menuHelpJade, menuHelpLisp, menuHelpOWL2, menuHomePage, menuHowTo, menuJavaDoc, menuNEW_MENU_ITEM, menuOptions, menuScripts, menuSET_CREATE_PROXY_WINDOWS, menuSET_SHOW_INACTIVE, menuSETDEBUG, menuShowTrace, menuSYSTEM_CLEAR_TAGS_TYPES, menuSYSTEM_LAC_DAEMON_TYPES, menuSYSTEM_Preferences, menuTools, menuWindow, process
agent, showEvents, showInfo, showMessages, showTrace, showUnknown
TYPE_ANY, TYPE_BOOLEAN, TYPE_FLOAT, TYPE_INT, TYPE_STRING
Constructor and Description |
---|
ChatAgentWindow(ChatAgent agent,
Container aFrame)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
implementation of the ActionListener interface
|
private void |
addChatFriends()
Allows the user to add ChatFriends to a list...
|
protected void |
CDSelectionChanged()
Updates window if a different CD is selected.
|
ChatAgentInterface |
getChatAgent() |
Dimension |
getPreferredSize() |
void |
internalFrameActivated(InternalFrameEvent e)
stub implementation of method from InternalFrameListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
private void |
invitationCDReceived() |
protected void |
inviteToCD() |
protected JPanel |
makeCDPanel()
+------------------------------------------------------------+
| +---------------------------+----------------------------+ |
| | Cooperation Domains | CD Participants | |
| |---------------------------|----------------------------| |
| | listCDs |^| listMembers |^| | makeCDpanel
| | in | | in | | |
| | scrollCDlist | | ScrollCDparticipants | | |
| | |v| |v| |
| +---------------------------+----------------------------+ |
+------------------------------------------------------------+
| Messages Received |
| +--------------------------------------------------------+ |
| | listMessages |^| |
| | in | | |
| | scrollCDmessages |v| |
| +--------------------------------------------------------+ |makeCtrpanel
| +---------------+ +---------+ +--------+ +-------+ |
| Message | textMessage | |Broadcast| |Directed| |Whisper| |
| +---------------+ +---------+ +--------+ +-------+ |
+------------------------------------------------------------+
|
protected JPanel |
makeCtrPanel()
Makes and returns a message panel that looks like:
|
protected JMenuBar |
makeMenuBar()
Factory Method to create a generic Agent menu bar.
|
protected JTabbedPane |
makeTabPane() |
private ChatMessageListModel |
newChatMessageModelWithAutoScrolling(JList list)
Creates a new model for a given JList.
|
private void |
sendMessage(Tristate whisper)
Called when a message is to be sent.
|
private void |
setAccessRights() |
protected JPanel |
setInfoPanel()
Displays information about the agent in infoPanel.
|
void |
updateEventHandler(Observable observable,
String event,
Object argObject)
Observer will be notified when the agent's state is STATE_CLOSE_PORT.
|
protected void |
updateMemberList() |
private void |
updateMessageList()
Updates the message models; for auto-scrolling, find the handler in
#makeCtrPanel(int) . |
void |
windowClosed(WindowEvent e)
overridden implementation of WindowListener interface method from AbstractWindow
this simply calls System.exit(0)
|
closeInternalFrame, getAgent, getBounds, resetFromPersistentData, start, updateAgent
ask, getOutStream, getTransientAgent, print, print, println, printStatus, setDebugBar, takesHTML, updateHandler
addFrameListener, addScript, addTab, CDMembersMouseHook, closeWindow, createRequestedMenuItem, dispose, doDefaultCloseAction, getBuildTime, getCommandPanel, getContentPane, getDesktopIcon, getFrame, getHeight, getLayeredPane, getListCDMembers, getMenuBarMenu, getRootPane, getTab, getTabComponent, getTabPane, getTitle, getWidth, insertMenuBar, insertMenuBarAfter, insertMenuBarBefore, insertTab, insertTabAfter, internalFrameClosed, internalFrameClosing, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened, isClosed, isIcon, isInternalFrameClosable, isMaximized, makeAgentMenu, makeCommandPanel, makeHelpMenu, makeToolsMenu, makeTypeEditDialog, makeWindowMenu, pack, refreshTabMenu, removeTab, replaceMenuBar, replaceTabComponent, runInEventDispatchThread, runInEventDispatchThread, setClosable, setContentPane, setFrameIcon, setIcon, setIconifiable, setInfoPanel, setJMenuBar, setLocation, setMaximizable, setMaximized, setName, setOpaque, setResizable, setSelected, setSelectedTab, setSize, setTitle, setVisible, show, toFront, update, updateCDListFromAgent, updateCDmemberJList, updateOptions, updateStrategyPanel, validate, windowActivated, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened, withdrawCD
eval, evalWithHistory, handleEvent, handleOther, printlnObject
protected JCheckBoxMenuItem menuCD_setRetrieveHistory
protected JMenuItem menuCD_MembersSelectAll
protected JMenuItem menuCD_MembersSelectNone
private static final int buttonSEND
private static final int buttonSENDDIRECTED
private static final int buttonSENDWHISPER
private static final int listSCROLLED
private static final int menuSETRETRIEVEHISTORY
private static final int menuCDMEMBERSSELECTALL
private static final int menuCDMEMBERSSELECTNONE
protected static final int chatAgentFrame_LAST_EVENT
private JMenuItem menuAddFriend
protected JList listMessages
protected ChatMessageListModel listMessagesModel
protected JButton buttonSendBroadcast
protected JButton buttonSendDirected
protected JButton buttonSendWhisper
protected JTextField textMessage
static int DEFAULT_X
static int DEFAULT_Y
JMenuBar menuBar
public ChatAgentInterface getChatAgent()
protected JTabbedPane makeTabPane()
makeTabPane
in class AbstractInternalFrame
protected JPanel makeCtrPanel()
+------------------------------------------------------------+ | Messages Received | | +--------------------------------------------------------+ | | | listMessages |^| | | | in | | | | | scrollCDmessages |v| | | +--------------------------------------------------------+ | | +---------------+ +---------+ +--------+ +-------+ | | Message | textMessage | |Broadcast| |Directed| |Whisper| | | +---------------+ +---------+ +--------+ +-------+ | +------------------------------------------------------------+All components added to vectors will be an index i. TODO: rkyee: is this i parameter even used? I've updated the MVC pattern to actually glue the model and view together... but it looks like they aren't being used at all. This i parameter makes things needlessly complex and hard to read.
i
- private final ChatMessageListModel newChatMessageModelWithAutoScrolling(JList list)
list
- the list to bind the model toChatMessageListModel
for the provided listprotected JMenuBar makeMenuBar()
TransientAgentInternalFrame
makeMenuBar
in class TransientAgentInternalFrame
protected JPanel makeCDPanel()
+------------------------------------------------------------+ | +---------------------------+----------------------------+ | | | Cooperation Domains | CD Participants | | | |---------------------------|----------------------------| | | | listCDs |^| listMembers |^| | makeCDpanel | | in | | in | | | | | scrollCDlist | | ScrollCDparticipants | | | | | |v| |v| | | +---------------------------+----------------------------+ | +------------------------------------------------------------+ | Messages Received | | +--------------------------------------------------------+ | | | listMessages |^| | | | in | | | | | scrollCDmessages |v| | | +--------------------------------------------------------+ |makeCtrpanel | +---------------+ +---------+ +--------+ +-------+ | | Message | textMessage | |Broadcast| |Directed| |Whisper| | | +---------------+ +---------+ +--------+ +-------+ | +------------------------------------------------------------+
makeCDPanel
in class AbstractInternalFrame
private void setAccessRights()
public Dimension getPreferredSize()
private void sendMessage(Tristate whisper)
whisper
- private void addChatFriends()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
actionPerformed
in class AgentInternalFrame
e
- --> Object implemented as a listener. It interacts with
getActionCommand() & intValue(). The value returned is
assigned to the variable: command <-- used in the switch
in order to set the activity of the Window, i.e. closeWindow()public void updateEventHandler(Observable observable, String event, Object argObject)
updateEventHandler
in class TransientAgentInternalFrame
observable
- argument
- protected JPanel setInfoPanel()
AbstractInternalFrame
setInfoPanel
in class AbstractInternalFrame
protected void CDSelectionChanged()
CDSelectionChanged
in class AbstractInternalFrame
private void updateMessageList()
#makeCtrPanel(int)
.protected void updateMemberList()
updateMemberList
in class AbstractInternalFrame
private void invitationCDReceived()
public void windowClosed(WindowEvent e)
windowClosed
in interface WindowListener
windowClosed
in class AbstractInternalFrame
e
- <-- see above explanation.protected void inviteToCD()
inviteToCD
in class TransientAgentInternalFrame
public void internalFrameActivated(InternalFrameEvent e)
AbstractInternalFrame
internalFrameActivated
in interface InternalFrameListener
internalFrameActivated
in class AbstractInternalFrame