jade.tools.sniffer
Class MMAbstractAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--jade.tools.sniffer.MMAbstractAction
Direct Known Subclasses:
AboutBoxAction, AddRemoveAgentAction, ClearCanvasAction, DisplayLogFileAction, ExitAction, WriteLogFileAction, WriteMessageListAction

public abstract class MMAbstractAction
extends javax.swing.AbstractAction

MMAbstractAction is the superclass of the actions performed by Sniffer GUI controls. This class is abstract because it does not define the ActionPerformed(ActionEvent evt) method. In every subClass of MMAbstractAction this method performs a specific action and updates the Sniffer GUI. Subclasses of MMAbstractAction are:

Author:
Gianluca Tanca
See Also:
AboutBoxAction, AddRemoveAgentAction, ClearCanvasAction, ExitAction, WriteLogFileAction, DisplayLogFileAction, WriteMessageListAction, Serialized Form

Field Summary
protected  java.lang.String ActionName
          Handler to the name of the action
protected static MMCanvas canvasAgent
          Handler to the Agent Canvas
protected static MMCanvas canvasMess
          Handler to the Message Canvas
protected  javax.swing.Icon img
          Handler to the action icon
protected static java.util.Vector listeners
          Handler to the listeners vector
protected static javax.swing.JScrollPane scrollAgent
           
protected static javax.swing.JScrollPane scrollMess
           
protected static AgentFrame selFrame
          Handler to the Selection Agents frame
protected static MMTree selTree
          Handler to the Selection Tree insidethe Selection Agents window
protected static MMTextMessage text
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Constructor Summary
MMAbstractAction(java.lang.String ActionName)
          Constructor for creating a new action providing the name of the action
MMAbstractAction(java.lang.String IconPath, java.lang.String ActionName)
          Constructor for creating a new action providing the name of the action and the path of the relative icon.
MMAbstractAction(java.lang.String IconKey, java.lang.String ActionName, java.util.Vector listeners)
          Constructor for creating a new action providing the name of the action, the path of the relative icon and a listeners vector.
 
Method Summary
static void AddListener(java.lang.Object current)
          Adds an item to the listeners vector
 java.lang.String getActionName()
          Returns the name of the current action
static java.util.Vector getAllListeners()
          Returns a handler to the vector containing all the registered listeners
static java.lang.Object getFirst()
          Returns the first of the registered listeners for an action.
static java.lang.Object getLast()
          Returns the last of the registered listeners for an action.
static MMCanvas getMMCanvasAgent()
          Returns a handle to Agent Canvas
static MMCanvas getMMCanvasMess()
          Returns a handle to Message Canvas
protected static MMTree getTheTree()
          Returns a handle to the agent names selection tree
static void removeAllListeners()
          Clears all the listeners in the relative vector
static void removeListener(java.lang.Object current)
          Removes an item from the listeners vector
static void setListeners(java.lang.Object[] listenersP)
          Clears the content of the listeners vector then adds the provided array to the mentioned vector
static void setMMCanvasAgent(MMCanvas MyCanvas)
          Sets a handle to Agent Canvas
static void setMMCanvasMess(MMCanvas MyCanvas)
          Sets a handle to Message Canvas
static void setMMScrollAgent(javax.swing.JScrollPane scroll)
          Sets a handle to scrollPane of canvasAgent
static void setMMScrollMess(javax.swing.JScrollPane scroll)
          Sets a handle to scrollPane of canvasMessage
static void setMMTextMessage(MMTextMessage MyText)
          Set a handle to textMessage bar
 
Methods inherited from class javax.swing.AbstractAction
actionPerformed, addPropertyChangeListener, clone, firePropertyChange, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

img

protected javax.swing.Icon img
Handler to the action icon

ActionName

protected java.lang.String ActionName
Handler to the name of the action

listeners

protected static java.util.Vector listeners
Handler to the listeners vector

canvasAgent

protected static MMCanvas canvasAgent
Handler to the Agent Canvas

canvasMess

protected static MMCanvas canvasMess
Handler to the Message Canvas

scrollAgent

protected static javax.swing.JScrollPane scrollAgent

scrollMess

protected static javax.swing.JScrollPane scrollMess

text

protected static MMTextMessage text

selFrame

protected static AgentFrame selFrame
Handler to the Selection Agents frame

selTree

protected static MMTree selTree
Handler to the Selection Tree insidethe Selection Agents window
Constructor Detail

MMAbstractAction

public MMAbstractAction(java.lang.String IconKey,
                        java.lang.String ActionName,
                        java.util.Vector listeners)
Constructor for creating a new action providing the name of the action, the path of the relative icon and a listeners vector. The icon name is searched within the icon loaded from the GuiProperties class
Parameters:
IconPath - name of the icon representing the action
ActionName - name of the action
listeners - listeners vector
See Also:
GuiProperties

MMAbstractAction

public MMAbstractAction(java.lang.String IconPath,
                        java.lang.String ActionName)
Constructor for creating a new action providing the name of the action and the path of the relative icon. The icon name is searched within the icon loaded from the GuiProperties class
Parameters:
IconPath - name of the icon representing the action
ActionName - name of the action
See Also:
GuiProperties

MMAbstractAction

public MMAbstractAction(java.lang.String ActionName)
Constructor for creating a new action providing the name of the action
Parameters:
ActionName - name of the action
Method Detail

getActionName

public java.lang.String getActionName()
Returns the name of the current action
Returns:
name of the action

setListeners

public static void setListeners(java.lang.Object[] listenersP)
Clears the content of the listeners vector then adds the provided array to the mentioned vector
Parameters:
listenersP - array of objects to be inserted in the listeners vector

removeAllListeners

public static void removeAllListeners()
Clears all the listeners in the relative vector

AddListener

public static void AddListener(java.lang.Object current)
Adds an item to the listeners vector
Parameters:
current - handle to the object to be put in the listeners vector

removeListener

public static void removeListener(java.lang.Object current)
Removes an item from the listeners vector
Parameters:
current - handle to the object to be removed from the listeners vector

getAllListeners

public static java.util.Vector getAllListeners()
Returns a handler to the vector containing all the registered listeners
Returns:
handler to the listeners vector

getLast

public static java.lang.Object getLast()
Returns the last of the registered listeners for an action. The listeners are the selected agents in the selection tree in the Selection Agents window
Returns:
handle to the last registered listeners (use casting)

getFirst

public static java.lang.Object getFirst()
Returns the first of the registered listeners for an action. The listeners are the selected agents in the selection tree in the Selection Agents window
Returns:
handle to the first registered listeners (use casting)

getTheTree

protected static MMTree getTheTree()
Returns a handle to the agent names selection tree
Returns:
handle to the selection tree

setMMCanvasAgent

public static void setMMCanvasAgent(MMCanvas MyCanvas)
Sets a handle to Agent Canvas
Parameters:
MyCanvas - handle to Agent Canvas

setMMCanvasMess

public static void setMMCanvasMess(MMCanvas MyCanvas)
Sets a handle to Message Canvas
Parameters:
MyCanvas - handle to Message Canvas

getMMCanvasAgent

public static MMCanvas getMMCanvasAgent()
Returns a handle to Agent Canvas
Returns:
handle to Canvas Agent

getMMCanvasMess

public static MMCanvas getMMCanvasMess()
Returns a handle to Message Canvas
Returns:
handle to Message Canvas

setMMScrollAgent

public static void setMMScrollAgent(javax.swing.JScrollPane scroll)
Sets a handle to scrollPane of canvasAgent
Parameters:
scroll - handle to scrollPane of agent canvas

setMMScrollMess

public static void setMMScrollMess(javax.swing.JScrollPane scroll)
Sets a handle to scrollPane of canvasMessage
Parameters:
scroll - handle to scrollPane of the message canvas

setMMTextMessage

public static void setMMTextMessage(MMTextMessage MyText)
Set a handle to textMessage bar
Parameters:
MyText - handle to text message bar