public class TransientAgentInternalFrame extends AbstractInternalFrame implements ActionListener
+-------------------------------------------------------------+ | Title Bar | +-------------------------------------------------------------+ | Menu Bar makeJMenuBar() | +-------------------------------------------------------------+ | Agent URL Panel makeAgentURLPanel() | +-------------------------------------------------------------+ | ______________ ________________ _____________________ | | / CD | / Commitments | / Command | | | |makeCDPanel() | |agent. | |makeCommandTabPanel()| | | | | |getStrategyGUI()| | | | | +---------------------------------------------------------+ | | | | | | | | | | | | | | +---------------------------------------------------------+ | +-------------------------------------------------------------+Subclasses may override any of the make*() factory methods to yield appropriate behaviour. To add a tab, simply override the
#addPanels(Container, int)
method,
and if necessary the unsplit method to remove any additional panels
created.
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 |
---|---|
protected static int |
buttonEXECUTE |
protected static int |
buttonPAUSE |
protected static int |
buttonRESUME |
protected static int |
buttonSTEP |
protected boolean |
closingPort |
protected JPanel |
contentPanel
/************ Tab panels in the interface *****************
/**********************************************************
/**
The pane that contains the various tab panels.
|
protected JToolBar |
debugBar |
(package private) static int |
DEFAULT_X |
(package private) static int |
DEFAULT_Y |
protected static boolean |
HORIZONTAL |
protected static int |
menuADD_NEW_TAB |
protected JMenuItem |
menuAgent_editOntology |
protected JMenuItem |
menuAgent_Exit |
protected JMenuItem |
menuAgent_options |
protected JCheckBoxMenuItem |
menuAgent_setDebug |
protected JCheckBoxMenuItem |
menuAgent_showMessageArea |
protected JMenuItem |
menuAgent_showTrace |
protected JMenu |
menuCD |
protected JMenuItem |
menuCD_Join |
protected static int |
menuCLEARDEBUG |
protected static int |
menuEDIT_ONTOLOGY |
protected static int |
menuEDIT_ONTOLOGY_GRAPHICAL |
protected static int |
menuEXIT |
protected static int |
menuFIRST_DYNAMIC_EVENT |
protected static int |
menuGETYELLOWPAGES |
protected static int |
menuHIDE_DEBUG_BAR |
protected static int |
menuHIDE_MESSAGE_AREA |
protected static int |
menuINFO |
protected static int |
menuINVITECD |
protected static int |
menuJOINCD |
protected JMenu |
menuLAC |
protected JMenuItem |
menuLAC_RegisterInstance |
protected JMenuItem |
menuLAC_UnregisterInstance |
protected static int |
menuLAST_DYNAMIC_EVENT |
protected static int |
menuOPTIONS |
protected static int |
menuREGISTER |
protected static int |
menuSET_ACK_PROTOCOL |
protected static int |
menuSHOW_DEBUG_BAR |
protected static int |
menuSHOW_MESSAGE_AREA |
protected static int |
menuSHOWTRACE |
protected static int |
menuUNREGISTER |
protected static int |
menuUserManual |
protected JMenuItem |
menuWindow_hideDebugBar |
protected JMenuItem |
menuWindow_showDebugBar |
protected static int |
menuWITHDRAWCD |
protected JMenu |
menuYP |
protected static int |
noAction |
protected JButton |
pauseButton |
(package private) JLabel |
pausedLabel |
private JTextField |
port |
private JPanel |
registrationPanel |
protected JButton |
resumeButton |
protected LinkedList<JSplitPane> |
splitPanes |
protected JButton |
stepButton |
protected static int |
transientAgentFrame_LAST_EVENT |
protected static boolean |
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 |
---|
TransientAgentInternalFrame(TransientAgent agent,
String title,
Container aFrame)
Constructor: builds a TransientAgentInternalFrame by calling
makeJMenuBar and #addPanels . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
implementation of the ActionListener interface
|
String |
ask(String prompt,
String help,
int type,
String _default)
The general contract is that the UI will return a string from the user
after prompting the use, that conforms to the the type specified by the
type parameter.
|
protected void |
closeInternalFrame()
Adaptor method: when isInternalFrameClosable() returns true, this method
calls the agent's exit() method to shut down the agent.
|
OutputStream |
getOutStream()
Returns an output stream that can be used to write to the interface
|
private JPanel |
getRegistrationPanel() |
TransientAgentInterface |
getTransientAgent() |
protected void |
inviteToCD() |
private void |
joinCD()
If the user chooses to join a CD, a dialog will pop up offering three
possibilities of joining a CD: local, create and Join a local CD, or
provide the IP:Port of a non-local CD.
|
protected JMenuBar |
makeMenuBar()
Factory Method to create a generic Agent menu bar.
|
void |
print(String txt) |
void |
print(String tempTxt,
boolean tempNormal,
String color)
These variables are a work around so that we may access them in anonymous classes
particularly that found in print(String,boolean).
|
void |
println(String txt) |
protected void |
printStatus(Status status,
String commandString) |
private void |
registerAgent() |
protected void |
setDebugBar() |
void |
start()
Starts displaying the UI
|
boolean |
takesHTML() |
private void |
unregisterAgent() |
void |
updateEventHandler(Observable observable,
String event,
Object argObject)
This method is called whenever the
AbstractInternalFrame.update(Observable, Object)
gets an Object that's a ObserverNotification . |
void |
updateHandler(Observable observable,
Object obj)
This method is called from
AbstractInternalFrame.update(Observable, Object) but
this method to always be executed in the AWT Event thread. |
addFrameListener, addScript, addTab, CDMembersMouseHook, CDSelectionChanged, closeWindow, createRequestedMenuItem, dispose, doDefaultCloseAction, getBuildTime, getCommandPanel, getContentPane, getDesktopIcon, getFrame, getHeight, getLayeredPane, getListCDMembers, getMenuBarMenu, getRootPane, getTab, getTabComponent, getTabPane, getTitle, getWidth, insertMenuBar, insertMenuBarAfter, insertMenuBarBefore, insertTab, insertTabAfter, internalFrameActivated, internalFrameClosed, internalFrameClosing, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened, isClosed, isIcon, isInternalFrameClosable, isMaximized, makeAgentMenu, makeCDPanel, makeCommandPanel, makeHelpMenu, makeTabPane, makeToolsMenu, makeTypeEditDialog, makeWindowMenu, pack, refreshTabMenu, removeTab, replaceMenuBar, replaceTabComponent, runInEventDispatchThread, runInEventDispatchThread, setClosable, setContentPane, setFrameIcon, setIcon, setIconifiable, setInfoPanel, setInfoPanel, setJMenuBar, setLocation, setMaximizable, setMaximized, setName, setOpaque, setResizable, setSelected, setSelectedTab, setSize, setTitle, setVisible, show, toFront, update, updateCDListFromAgent, updateCDmemberJList, updateMemberList, updateOptions, updateStrategyPanel, validate, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened, withdrawCD
eval, evalWithHistory, handleEvent, handleOther, printlnObject
protected JCheckBoxMenuItem menuAgent_setDebug
protected JMenuItem menuAgent_showTrace
protected JCheckBoxMenuItem menuAgent_showMessageArea
protected JMenuItem menuAgent_options
protected JMenuItem menuAgent_editOntology
protected JMenuItem menuAgent_Exit
protected JMenu menuLAC
protected JMenuItem menuLAC_RegisterInstance
protected JMenuItem menuLAC_UnregisterInstance
protected JMenu menuYP
protected JMenu menuCD
protected JMenuItem menuCD_Join
protected JMenuItem menuWindow_showDebugBar
protected JMenuItem menuWindow_hideDebugBar
protected final JPanel contentPanel
protected JToolBar debugBar
protected JButton pauseButton
protected JButton resumeButton
protected JButton stepButton
JLabel pausedLabel
protected LinkedList<JSplitPane> splitPanes
protected boolean closingPort
protected static final int noAction
protected static final int menuREGISTER
protected static final int menuUNREGISTER
protected static final int menuINVITECD
protected static final int menuGETYELLOWPAGES
protected static final int menuCLEARDEBUG
protected static final int menuEXIT
protected static final int menuJOINCD
protected static final int menuWITHDRAWCD
protected static final int menuSET_ACK_PROTOCOL
protected static final int menuOPTIONS
protected static final int menuSHOWTRACE
protected static final int menuEDIT_ONTOLOGY
protected static final int menuSHOW_MESSAGE_AREA
protected static final int menuHIDE_MESSAGE_AREA
protected static final int buttonEXECUTE
protected static final int menuINFO
protected static final int buttonPAUSE
protected static final int buttonRESUME
protected static final int buttonSTEP
protected static final int menuSHOW_DEBUG_BAR
protected static final int menuHIDE_DEBUG_BAR
protected static final int menuEDIT_ONTOLOGY_GRAPHICAL
protected static final int menuADD_NEW_TAB
protected static final int menuUserManual
protected static final int menuFIRST_DYNAMIC_EVENT
protected static final int menuLAST_DYNAMIC_EVENT
protected static final int transientAgentFrame_LAST_EVENT
protected static final boolean VERTICAL
protected static final boolean HORIZONTAL
static int DEFAULT_X
static int DEFAULT_Y
private JPanel registrationPanel
private JTextField port
public TransientAgentInternalFrame(TransientAgent agent, String title, Container aFrame)
makeJMenuBar
and #addPanels
.agent
- the agent for which this an interfacetitle
- The title of the windowaFrame
- Either a JFrame or a JInternal Frame object to use for the
frame.protected void closeInternalFrame()
closeInternalFrame
in class AbstractInternalFrame
protected JMenuBar makeMenuBar()
makeMenuBar
in class AbstractInternalFrame
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
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()protected void setDebugBar()
protected void inviteToCD()
private void joinCD()
private void registerAgent()
private JPanel getRegistrationPanel()
private void unregisterAgent()
public void updateHandler(Observable observable, Object obj)
AbstractInternalFrame
AbstractInternalFrame.update(Observable, Object)
but
this method to always be executed in the AWT Event thread. You should
use this instead of AbstractInternalFrame.update(Observable, Object)
(which is final).updateHandler
in class AbstractInternalFrame
observable
- The Observable that triggered this update callobj
- The parameter objectpublic void updateEventHandler(Observable observable, String event, Object argObject)
AbstractInternalFrame
AbstractInternalFrame.update(Observable, Object)
gets an Object that's a ObserverNotification
. The ObserverNotification
is split into the components, and that forms the arguments to this method.
Note that if you need to you the raw info from AbstractInternalFrame.update(Observable, Object)
,
then you should put your code in AbstractInternalFrame.updateHandler(Observable, Object)
which is unconditionally called with the raw parameters.
You can expect this method to always be executed in the AWT Event thread.updateEventHandler
in class AbstractInternalFrame
event
- argObject
- observable
- The Observable that triggered this update callpublic void print(String tempTxt, boolean tempNormal, String color)
public String ask(String prompt, String help, int type, String _default)
AgentUI
ask
in interface AgentUI
prompt
- The prompt the use will seehelp
- An extended prompt if the user enters something inappropriatetype
- The type which may be
Integer.parseInt(String)
Float.parseFloat(String)
_default
- The value to return (unchecked) if the user just hits [return]public OutputStream getOutStream()
getOutStream
in interface AgentUI
public TransientAgentInterface getTransientAgent()