net.hivecell.hive.agent.hiveui
Class BaseSwingGUIAgentImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--net.hivecell.hive.agent.AgentImpl
                          |
                          +--net.hivecell.hive.agent.EventReceivingAgentImpl
                                |
                                +--net.hivecell.hive.agent.hiveui.BaseUIAgentImpl
                                      |
                                      +--net.hivecell.hive.agent.hiveui.BaseGUIAgentImpl
                                            |
                                            +--net.hivecell.hive.agent.hiveui.BaseSwingGUIAgentImpl
Direct Known Subclasses:
TreeUIAgentImpl

public abstract class BaseSwingGUIAgentImpl
extends BaseGUIAgentImpl

this class is the next level up on top of the base ui agent -- the purpose of this is so we have a standard way to get the popup boxes that we like

Author:
Raffi Krikorian
See Also:
Serialized Form

Field Summary
protected  ComponentManagerShadow cms
          a handle to the CMS so we don't need to look it up every time.
 
Fields inherited from class net.hivecell.hive.agent.hiveui.BaseGUIAgentImpl
acms
 
Fields inherited from class net.hivecell.hive.agent.hiveui.BaseUIAgentImpl
ag, agentAddresses, ama, cellControlAgents, changeMonitoringCellCmd, changeShowCellAgentsCmd, connectCmd, defaultCellCmds, defaultCmds, disconnectAllCmd, disconnectCmd, killCellCmd, killCmd, menu, monitoredCells, moveCmd, propertiesCmd, variablePropertyManipulators
 
Fields inherited from class net.hivecell.hive.agent.EventReceivingAgentImpl
agentSubscriptions
 
Fields inherited from class net.hivecell.hive.agent.AgentImpl
AGENTKILLED, AGENTMOVED, agentThreadGroup, commandList, commands, description, icon, iconName, myAddress, myCell, readyFlag, stopCode, timeToStop
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
BaseSwingGUIAgentImpl()
           
 
Method Summary
protected  void constructMenus()
          a helper function that reads the RDF files and stuff and creates the default menus that we are going to use
 void doBehavior()
          Do the basic behavior for an agent, the agent's main loop.
 void doLocalSetup()
          do our local setup which just involves letting the BaseUIAgent do its stuff, and then we can lookup our agent component manager shadow
 javax.swing.JMenuBar getMenuBar()
          a function that will return an AWT menu that is constructed off the information that is in the menu object
 void showConfigureAgentDialogBox(Agent agent)
          method to bring up a variable sheet editor
 void showCreateAgentByNameDialogBox()
          method to bring up a dialog box to create an agent by its java class name
 void showCreateAgentDialogBox(java.lang.String agent)
          method to bring up the dialog box with the agent icon and stuff like that
 void showMoveAgentDialogBox(Agent agent)
          method to bring up the dialog box with the agent icon for movement
 void showShutdownCellDialogBox()
          method to bring up a dialog box containing which servers we want to shut down
 void showStartMonitorCellDialogBox()
          method to bring up a dialog box to start monitoring another cell
 void showStopMonitorCellDialogBox()
          method to bring up a dialog box containing which server we want to stop monitoring
 
Methods inherited from class net.hivecell.hive.agent.hiveui.BaseGUIAgentImpl
invokeMenuCommand
 
Methods inherited from class net.hivecell.hive.agent.hiveui.BaseUIAgentImpl
connectAgentsCommand, createNewAgentCommand, disconnectAgentAllCommand, disconnectAgentsCommand, doLocalCleanup, getAccessibleVariable, getAccessibleVariableNames, getAccessibleVariableType, getAgentAddress, getAgentIcon, getAgentName, getCellAddress, getMenuNames, getMonitoredCells, invokeCellMenuCommand, killAgentCommand, listIncomingConnections, listOutgoingConnections, monitorCell, moveAgentCommand, notify, renderAgentMessage, renderCellReport, renderConnectAgents, renderDisconnectAgents, renderDisconnectFromAll, renderNewAgent, renderRemoveAgent, setAccessibleVariable, shutdownCellCommand, stopMonitoringCell
 
Methods inherited from class net.hivecell.hive.agent.EventReceivingAgentImpl
connectTo, diePlease, disconnectFrom, disconnectFromAll, listAllIncomingConnections, notify, subscribeTo
 
Methods inherited from class net.hivecell.hive.agent.AgentImpl
addActionCommand, blockUntilReady, configure, getActionCommands, getAddress, getCell, getComponentManagerShadow, getDescription, getIcon, getIconName, getName, getThreadGroup, invokeActionCommand, isReady, isTimeToStop, listAllOutgoingConnections, loadIcon, moveTo, onDying, onMoving, setCell, setDescription, setIconName, setIsReady, setThreadGroup, setTimeToStop, waitUntilDeath
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cms

protected ComponentManagerShadow cms
a handle to the CMS so we don't need to look it up every time.
Constructor Detail

BaseSwingGUIAgentImpl

public BaseSwingGUIAgentImpl()
                      throws java.rmi.RemoteException
Method Detail

doLocalSetup

public void doLocalSetup()
                  throws AgentInitializationException
do our local setup which just involves letting the BaseUIAgent do its stuff, and then we can lookup our agent component manager shadow
Overrides:
doLocalSetup in class BaseGUIAgentImpl
Tags copied from class: AgentImpl
Throws:
AgentInitializationException - can be thrown by the agent if for some reason it cannot fufil its setup stuff

doBehavior

public void doBehavior()
Description copied from class: AgentImpl
Do the basic behavior for an agent, the agent's main loop. Override this to provide your particular agent's behavior. Note: the doBehavior loop should not exit. Please call waitUntilDeath() at the end of this method, this will prevent the Cell from believing this agent prematurely exited.
Overrides:
doBehavior in class BaseGUIAgentImpl
Tags copied from class: AgentImpl
See Also:
timeToStop, doLocalSetup

constructMenus

protected void constructMenus()
a helper function that reads the RDF files and stuff and creates the default menus that we are going to use
Overrides:
constructMenus in class BaseGUIAgentImpl

getMenuBar

public javax.swing.JMenuBar getMenuBar()
a function that will return an AWT menu that is constructed off the information that is in the menu object
Returns:
the awt menu

showShutdownCellDialogBox

public void showShutdownCellDialogBox()
method to bring up a dialog box containing which servers we want to shut down
Overrides:
showShutdownCellDialogBox in class BaseGUIAgentImpl

showStartMonitorCellDialogBox

public void showStartMonitorCellDialogBox()
method to bring up a dialog box to start monitoring another cell
Overrides:
showStartMonitorCellDialogBox in class BaseGUIAgentImpl

showStopMonitorCellDialogBox

public void showStopMonitorCellDialogBox()
method to bring up a dialog box containing which server we want to stop monitoring
Overrides:
showStopMonitorCellDialogBox in class BaseGUIAgentImpl

showCreateAgentByNameDialogBox

public void showCreateAgentByNameDialogBox()
method to bring up a dialog box to create an agent by its java class name
Overrides:
showCreateAgentByNameDialogBox in class BaseGUIAgentImpl

showCreateAgentDialogBox

public void showCreateAgentDialogBox(java.lang.String agent)
method to bring up the dialog box with the agent icon and stuff like that
Overrides:
showCreateAgentDialogBox in class BaseGUIAgentImpl
Parameters:
agent - the name of the agent to create -- this has to be correct, am making assumptions at this level

showMoveAgentDialogBox

public void showMoveAgentDialogBox(Agent agent)
method to bring up the dialog box with the agent icon for movement
Overrides:
showMoveAgentDialogBox in class BaseGUIAgentImpl
Parameters:
agen - the agent to move

showConfigureAgentDialogBox

public void showConfigureAgentDialogBox(Agent agent)
method to bring up a variable sheet editor
Overrides:
showConfigureAgentDialogBox in class BaseGUIAgentImpl
Parameters:
agent - the agent to bring the editor up for