unsw.cse.mica.tools
Class LogDebugger

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

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

An agent that displays mobs as the are added/removed/changed. It also includes some basic search functions.

Author:
mmcgill

Field Summary
static java.lang.String CLEAR
           
static java.lang.String DELETE
           
static java.lang.String DELETE_ALL
           
static java.util.Date emptyDate
           
static java.lang.String HIDE
           
static java.lang.String LOG
           
static java.lang.String PARAM_EXPAND
           
static java.lang.String PARAM_SCROLL
           
static java.lang.String REFRESH
           
static java.lang.String REFRESH_CURRENT
           
static java.lang.String SEARCH
           
static java.lang.String SEARCH_ALL_MOBS
           
 
Fields inherited from class unsw.cse.mica.agent.DefaultAgent2
PARAM_NAME
 
Constructor Summary
LogDebugger()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 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 handleReplacedMob(Mob oldMob, Mob newMob)
          This method is called whenever a mob is replaced on the blackboard with a type for which the agent has registered interest.
 void init(MicaProperties args)
          Connect using the value given for param "name" in the args if the value exists, otherwise use the class name
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, 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

REFRESH

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

REFRESH_CURRENT

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

CLEAR

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

HIDE

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

SEARCH

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

LOG

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

DELETE

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

DELETE_ALL

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

SEARCH_ALL_MOBS

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

emptyDate

public static java.util.Date emptyDate
Constructor Detail

LogDebugger

public LogDebugger()
Method Detail

init

public void init(MicaProperties args)
          throws MicaException
Description copied from class: DefaultAgent2
Connect using the value given for param "name" in the args if the value exists, otherwise use the class name

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

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

handleReplacedMob

public void handleReplacedMob(Mob oldMob,
                              Mob newMob)
Description copied from interface: MessageHandler
This method is called whenever a mob is replaced on the blackboard with a type for which the agent has registered interest.

Specified by:
handleReplacedMob in interface MessageHandler
Overrides:
handleReplacedMob in class DefaultAgent2
Parameters:
oldMob - the old value of the mob (where the name is cleared)
newMob - the new value of the mob

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

createComponents

public void createComponents(MicaProperties args)
                      throws MicaException
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
Throws:
MicaException - If any errors occur construction the GUI components.

actionPerformed

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

main

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