gov.sandia.ccaffeine.dc.user_iface.MVC.event
Class RemoveEvent

java.lang.Object
  extended by java.util.EventObject
      extended by gov.sandia.ccaffeine.dc.user_iface.MVC.event.RemoveEvent
All Implemented Interfaces:
java.io.Serializable

public class RemoveEvent
extends java.util.EventObject

Is used to notify entities that a component is to be removed or has already been removed.

Whenever the cca server removes an instantiation of a cca component, a RemoveEvent is sent to the GUI. The GUI might respond by removing the component from the arena.

Whenever the GUI wants to remove a component from the arena, the GUI sends a RemoveEvent to the view. The view might respond by sending a message to the cca server.

Possible Scenario
The end-user highlights a cca component and clicks on the remove button
The GUI sends a RemoveEvent to the view.
The view sends a message to the cca server
The cca server removes the instantiation of the component.
The cca server sends a message to the controller.
The controller sends a RemoveEvent to the GUI
The GUI removes the component from the arena

See Also:
Serialized Form

Field Summary
protected  java.lang.String componentInstanceName
          The name of the component that has been, or will be, removed.
protected  int numberOfArguments
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
RemoveEvent(java.lang.Object source, int numberOfArguments, java.lang.String componentInstanceName)
          Create a RemoveEvent.
RemoveEvent(java.lang.Object source, java.lang.String componentInstanceName)
          Create a RemoveEvent.
 
Method Summary
 java.lang.String getComponentInstanceName()
          Get the name of the component that has been, or will be, removed.
 int getNumberOfArguments()
          Retrieve the number of arguments in the "remove" command.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numberOfArguments

protected int numberOfArguments

componentInstanceName

protected java.lang.String componentInstanceName
The name of the component that has been, or will be, removed. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"

Constructor Detail

RemoveEvent

public RemoveEvent(java.lang.Object source,
                   java.lang.String componentInstanceName)
Create a RemoveEvent.

Is used to notify entities that a component is to be removed or has already been removed.

Parameters:
source - The entity that created this event.
componentInstanceName - The name of the component that has been, or will be, removed. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"

RemoveEvent

public RemoveEvent(java.lang.Object source,
                   int numberOfArguments,
                   java.lang.String componentInstanceName)
Create a RemoveEvent.

Is used to notify entities that a component is to be removed or has already been removed.

Parameters:
source - The entity that created this event.
numberOfArguments - The number of arguments in the "remove" command.
componentInstanceName - The name of the component that was removed. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"
Method Detail

getNumberOfArguments

public int getNumberOfArguments()
Retrieve the number of arguments in the "remove" command.

Returns:
The number of arguments in the "remove" command.

getComponentInstanceName

public java.lang.String getComponentInstanceName()
Get the name of the component that has been, or will be, removed. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"