public class ProcessWindow extends AbstractInternalFrame implements WindowListener, AgentUI, ActionListener
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 String[] |
args |
protected CASAProcess |
casaProcess |
(package private) boolean |
closeInProgress |
(package private) long |
closingWaitTime |
protected Vector<TransientAgentInternalFrame> |
currentFrames |
protected JToolBar |
debugBar |
protected LACDesktop |
desktopFrame |
protected MDIDesktopManager |
desktopManagerObject |
protected JSplitPane |
lacLeftFrame |
protected int |
lacPort |
protected JSplitPane |
lacWindow |
protected JCheckBoxMenuItem |
menuItemShowInactive |
protected JMenuItem |
menuSystemCASAPreferences |
protected JMenuItem |
menuSystemClearTags |
protected JMenuItem |
menuSystemLACDaemon |
protected JMenuItem |
menuWindow_hideDebugBar |
protected JMenuItem |
menuWindow_showDebugBar |
protected JButton |
pauseButton |
protected JLabel |
pausedLabel |
boolean |
protection |
protected JButton |
resumeButton |
protected JButton |
stepButton |
protected String |
userNameORTitle |
appIconSet, buttonPAUSE, buttonRESUME, buttonSTEP, 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, menuHIDE_DEBUG_BAR, menuHomePage, menuHowTo, menuINFO, menuJavaDoc, menuNEW_MENU_ITEM, menuOptions, menuOPTIONS, menuScripts, menuSET_CREATE_PROXY_WINDOWS, menuSET_SHOW_INACTIVE, menuSETDEBUG, menuSHOW_DEBUG_BAR, menuShowTrace, menuSHOWTRACE, menuSYSTEM_CLEAR_TAGS_TYPES, menuSYSTEM_LAC_DAEMON_TYPES, menuSYSTEM_Preferences, menuTools, menuUserManual, menuWindow, noAction, process
agent, showEvents, showInfo, showMessages, showTrace, showUnknown
TYPE_ANY, TYPE_BOOLEAN, TYPE_FLOAT, TYPE_INT, TYPE_STRING
Constructor and Description |
---|
ProcessWindow(CASAProcess casaProcess,
String[] args) |
ProcessWindow(CASAProcess casaProcess,
String name,
String[] args) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
addAgentWindow(TransientAgentInternalFrame w) |
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 |
closeWindow()
When the user either exits the system from the File -> Exit
JMenuItem or from the
default closing button of this JFrame , the following event will occur:
Prompt the user if the exit event should really happen
If the user confirms the terminate event, the LAC will trigger a set of
messages to all its registered agents. |
protected JMenu |
createSystemMenu() |
void |
doDefaultCloseAction()
Adaptor method.
|
TransientAgentInternalFrame |
findFrameForAgent(PolicyAgentInterface agent)
Search for and return a frame in the agent view frame that represents
the agent.
|
JFrame |
getJFrame() |
OutputStream |
getOutStream()
Returns an output stream that can be used to write to the interface
|
protected void |
init()
Handles the creation of the LACWindow internal components such as the JSplitPane which
contains two main splits:
A LeftFrame that is composed of the LAC's tree and JTabbedPane
Viewer: DesktopViewer
LACInfo: Provides information about this LAC
A RightFrame composed if the desktop environment
A menu that hanldes:
The Creation of new ChatAgents
Navigating through each one of the JInternalFrames (i.e.
|
protected boolean |
isWindowClosable() |
protected JMenuBar |
makeMenuBar()
Method used to create a menuBar for the Main Frame.
|
protected JTabbedPane |
makeTabPane() |
(package private) JTabbedPane |
makeTreeTabPane() |
void |
print(String txt) |
void |
println(String txt) |
protected void |
printStatus(Status status,
String commandString) |
boolean |
removeFrame(TransientAgentInternalFrame frame)
Remove a frame by removing it and calling dispose()
on the frame.
|
protected void |
saveWindowInfo() |
protected void |
setDebugBar() |
private void |
setDesktopWatcher()
method that sets the LACDesktopManager - Links it with the DesktopWatcher
|
protected JPanel |
setInfoPanel()
Handles the creation of the JTabbedPane and its components:
DestopWatcher
LACInfo
|
void |
start()
Lets the UI know that it should "start" displaying itself.
|
boolean |
takesHTML() |
void |
updateEventHandler(Observable observable,
String event,
Object obj)
Title: Observer Interface
|
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. |
void |
windowActivated(WindowEvent e)
stub implementation of method from WindowListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
void |
windowClosed(WindowEvent e)
stub implementation of method from WindowListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
void |
windowClosing(WindowEvent e)
stub implementation of method from WindowListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
void |
windowDeactivated(WindowEvent e)
stub implementation of method from WindowListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
void |
windowDeiconified(WindowEvent e)
stub implementation of method from WindowListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
void |
windowIconified(WindowEvent e)
stub implementation of method from WindowListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
void |
windowOpened(WindowEvent e)
stub implementation of method from WindowListener interface
as the abstract window is it's own internalframe event listener
sub classes should override this as needed |
addFrameListener, addScript, addTab, CDMembersMouseHook, CDSelectionChanged, closeInternalFrame, createRequestedMenuItem, dispose, 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, 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, updateMemberList, updateOptions, updateStrategyPanel, validate, withdrawCD
eval, evalWithHistory, handleEvent, handleOther, printlnObject
protected JSplitPane lacWindow
protected JSplitPane lacLeftFrame
protected JCheckBoxMenuItem menuItemShowInactive
protected JMenuItem menuSystemClearTags
protected JMenuItem menuSystemCASAPreferences
protected JMenuItem menuSystemLACDaemon
protected JMenuItem menuWindow_showDebugBar
protected JMenuItem menuWindow_hideDebugBar
protected JLabel pausedLabel
protected JToolBar debugBar
protected JButton pauseButton
protected JButton resumeButton
protected JButton stepButton
protected LACDesktop desktopFrame
protected CASAProcess casaProcess
protected MDIDesktopManager desktopManagerObject
protected String userNameORTitle
protected String[] args
protected int lacPort
public boolean protection
protected Vector<TransientAgentInternalFrame> currentFrames
long closingWaitTime
boolean closeInProgress
public ProcessWindow(CASAProcess casaProcess, String[] args)
casaProcess
- args
- public ProcessWindow(CASAProcess casaProcess, String name, String[] args)
protected void init()
JTabbedPane makeTreeTabPane()
protected JTabbedPane makeTabPane()
makeTabPane
in class AbstractInternalFrame
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public OutputStream getOutStream()
getOutStream
in interface AgentUI
protected void setDebugBar()
protected JPanel setInfoPanel()
setInfoPanel
in class AbstractInternalFrame
private void setDesktopWatcher()
protected JMenu createSystemMenu()
protected JMenuBar makeMenuBar()
makeMenuBar
in class AbstractInternalFrame
public void updateEventHandler(Observable observable, String event, Object obj)
Title: Observer Interface
Description: adapted from the previous update(). The structure
belongs to the author of the previous version. Update() now uses ObserverNotification
and
ML
.
updateEventHandler
in class AbstractInternalFrame
observable
- The Observable that triggered this update callevent
- The eventobj
- The parameter to the eventpublic 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 TransientAgentInternalFrame findFrameForAgent(PolicyAgentInterface agent)
agent
- find the frame for this agentpublic boolean removeFrame(TransientAgentInternalFrame frame)
frame
- the frame to be destroyed (may be null, in which case this method does nothing).protected boolean isWindowClosable()
public void windowClosing(WindowEvent e)
AbstractInternalFrame
windowClosing
in interface WindowListener
windowClosing
in class AbstractInternalFrame
public void windowDeactivated(WindowEvent e)
AbstractInternalFrame
windowDeactivated
in interface WindowListener
windowDeactivated
in class AbstractInternalFrame
public void windowDeiconified(WindowEvent e)
AbstractInternalFrame
windowDeiconified
in interface WindowListener
windowDeiconified
in class AbstractInternalFrame
public void windowActivated(WindowEvent e)
AbstractInternalFrame
windowActivated
in interface WindowListener
windowActivated
in class AbstractInternalFrame
public void windowIconified(WindowEvent e)
AbstractInternalFrame
windowIconified
in interface WindowListener
windowIconified
in class AbstractInternalFrame
public void windowOpened(WindowEvent e)
AbstractInternalFrame
windowOpened
in interface WindowListener
windowOpened
in class AbstractInternalFrame
public void windowClosed(WindowEvent e)
AbstractInternalFrame
windowClosed
in interface WindowListener
windowClosed
in class AbstractInternalFrame
public void doDefaultCloseAction()
doDefaultCloseAction
in class AbstractInternalFrame
protected void closeWindow()
JMenuItem
or from the
default closing button of this JFrame
, the following event will occur:
LAC
will trigger a set of
messages to all its registered agents. These messages inform that the LACWindow
is closing. The action that the agents will take is unregister.instance. closeWindow
in class AbstractInternalFrame
protected void saveWindowInfo()
public void addAgentWindow(TransientAgentInternalFrame w)
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 void start()
AgentUI
public JFrame getJFrame()