unsw.cse.mica.tools
Class Debugger

java.lang.Object
  extended by unsw.cse.mica.agent.DefaultAgent2
      extended by unsw.cse.mica.agent.GUIAgent
          extended by unsw.cse.mica.tools.Debugger
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, Agent, MessageHandler

public class Debugger
extends GUIAgent
implements java.awt.event.ActionListener

A simple agent that displays mobs as they are added to the blackboard.

Author:
waleed

Field Summary
static java.lang.String CLEAR_ALL
           
static java.lang.String CLEAR_DELETED
           
static java.lang.String CLEAR_TRANSIENT
           
static java.lang.String DELETE_ALL
           
static java.lang.String PARAM_EXPAND
           
static java.lang.String PARAM_SCROLL
           
static java.lang.String REFRESH
           
static java.lang.String TYPE_CONNECTED
           
static java.lang.String TYPE_DELETED
           
static java.lang.String TYPE_PERSISTENT
           
static java.lang.String TYPE_TRANSIENT
           
 
Fields inherited from class unsw.cse.mica.agent.DefaultAgent2
PARAM_NAME
 
Constructor Summary
Debugger()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 void createComponents(MicaProperties args)
          Function that is called in the init method that should be overridden by subclasses.
 void handleDeletedMob(Mob m)
          This method is called whenever a non-transient MICA object is deleted from the blackboard that the agent has registered interest it.
 void handleNewMob(Mob m)
          This method is called when a new MICA object has arrived.
 void init(MicaProperties args)
          The init method accepts the following parameters: "autoexpand" must be a boolean specifies whether the tree should be automatically expanded when mobs arrive "autoscroll" specifies whether the tree should be scrolled to show new mobs when they arrive "x" and "y" specify the location of the frame "width" and "height" specify the size of the frame
static void main(java.lang.String[] args)
           
 
Methods inherited from class unsw.cse.mica.agent.GUIAgent
terminate
 
Methods inherited from class unsw.cse.mica.agent.DefaultAgent2
getTransport, handleReplacedMob, handleTypeManagerChanged, isATypeOf, setTransport
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_EXPAND

public static final java.lang.String PARAM_EXPAND
See Also:
Constant Field Values

PARAM_SCROLL

public static final java.lang.String PARAM_SCROLL
See Also:
Constant Field Values

TYPE_PERSISTENT

public static final java.lang.String TYPE_PERSISTENT
See Also:
Constant Field Values

TYPE_CONNECTED

public static final java.lang.String TYPE_CONNECTED
See Also:
Constant Field Values

TYPE_TRANSIENT

public static final java.lang.String TYPE_TRANSIENT
See Also:
Constant Field Values

TYPE_DELETED

public static final java.lang.String TYPE_DELETED
See Also:
Constant Field Values

CLEAR_TRANSIENT

public static final java.lang.String CLEAR_TRANSIENT
See Also:
Constant Field Values

CLEAR_DELETED

public static final java.lang.String CLEAR_DELETED
See Also:
Constant Field Values

CLEAR_ALL

public static final java.lang.String CLEAR_ALL
See Also:
Constant Field Values

REFRESH

public static final java.lang.String REFRESH
See Also:
Constant Field Values

DELETE_ALL

public static final java.lang.String DELETE_ALL
See Also:
Constant Field Values
Constructor Detail

Debugger

public Debugger()
Method Detail

init

public void init(MicaProperties args)
          throws MicaException
The init method accepts the following parameters: "autoexpand" must be a boolean specifies whether the tree should be automatically expanded when mobs arrive "autoscroll" specifies whether the tree should be scrolled to show new mobs when they arrive "x" and "y" specify the location of the frame "width" and "height" specify the size of the frame

Specified by:
init in interface Agent
Overrides:
init in class GUIAgent
Parameters:
args - Additional arguments provided to the agent. If the agent is started from with the 'Runner' tool, the args array contains the values provided from within the runner's XML configuration file. Otherwise, the exact contents will depend on the calling method.
Throws:
MicaException
See Also:
Agent.init(MicaProperties)

createComponents

public void createComponents(MicaProperties args)
Description copied from class: GUIAgent
Function that is called in the init method that should be overridden by subclasses. Subclasses should use this method to construct the elements for their GUIs and place the elements in frame.

Specified by:
createComponents in class GUIAgent
Parameters:
args - the args passed to the init method

handleNewMob

public void handleNewMob(Mob m)
Description copied from interface: MessageHandler
This method is called when a new MICA object has arrived.

Whenever a mob is written to the blackboard that the agent has registered an interest in the handleNewMob is called. It is passed the new Mob (MICA object) as a parameter so it can decide any further actions.

Note: The handleNewMob is called asynchronously. You should not make any assumptions about its synchronizations.

Specified by:
handleNewMob in interface MessageHandler
Overrides:
handleNewMob in class DefaultAgent2
Parameters:
m - the mob that has been written to the blackboard

handleDeletedMob

public void handleDeletedMob(Mob m)
Description copied from interface: MessageHandler
This method is called whenever a non-transient MICA object is deleted from the blackboard that the agent has registered interest it.

Whenever a mob is deleted from the blackboard that the agent has registered an interest in the handleDeletedMob method is called.

Specified by:
handleDeletedMob in interface MessageHandler
Overrides:
handleDeletedMob in class DefaultAgent2
Parameters:
m - the mob that has been deleted

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

main

public static void main(java.lang.String[] args)
                 throws MicaException
Throws:
MicaException