gov.sandia.ccaffeine.dc.user_iface.MVC
Class ViewPython

java.lang.Object
  extended by gov.sandia.ccaffeine.dc.user_iface.MVC.ViewPython
All Implemented Interfaces:
GuiListener, java.util.EventListener

public class ViewPython
extends java.lang.Object
implements GuiListener

An MVC view. This view is used to send querries, commands and data to a client stub. The client stub transports the information to a server skeleton. The server skeleton delivers the information the cca server.


Constructor Summary
ViewPython(PythonStub pythonStub)
          Create an MVC View.
 
Method Summary
 void componentProperties(ComponentPropertiesEvent event)
          The GUI is requesting the cca server to send back or to set the value of a component property.
 void connect(ConnectEvent event)
          The GUI is asking the cca server to connect the Provides Port of a cca component to a Uses Port.
 void disconnect(DisconnectEvent event)
          The GUI is asking the cca server to disconnect the connection between a Provides Port of a cca component and a Uses Port.
 void display(DisplayEvent event)
          Request some information from the server.
 void displayComponent(DisplayComponentEvent event)
          The GUI is requesting the cca server to send back a cca component.
 void displayPalette(DisplayPaletteEvent event)
          The GUI is requesting the cca server to send back all of the components that are in the palette.
 void displayState(DisplayStateEvent event)
          The GUI is requesting the cca server to send back all components that are in the arena and to send back all connections.
 void exit(ExitEvent event)
          The GUI wants to tell the cca server that the GUI is shutting down.
 void getAllInstancesInArena(GetInstancesEvent event)
          The GUI is asking the cca server to send back all of the instantiated cca components.
 void getComponentProperty(GetComponentPropertyEvent event)
          The GUI is requesting the cca server to send back the value of a property that is inside a cca component.
 void getPortParameter(ParamGetCurrentEvent event)
          The GUI is asking the cca server to send back the value of one of the parameters of a port that is on a cca component.
 void go(GoEvent event)
          The GUI wants the cca server to launch an application.
 void goComponentPort(GoComponentPortEvent event)
          The GUI is requesting that the cca server execute the "go" command" on a specific port that is located on a specific component.
 void heartbeat(HeartbeatEvent event)
          The GUI wants to send a heartbeat to the cca server.
 void instantiate(InstantiateEvent event)
          The GUI is asking the cca server to retrieve a cca component.
 void links(DisplayChainEvent event)
          The GUI is requesting the cca server to send back all connections.
 void nukeAll(NukeAllEvent event)
          The GUI is requesting the cca server to delete all components.
 void path(PathEvent event)
          The GUI wants to tell the cca server to send back or to set the file path that contains cca components.
 void portParameter(ParamEvent event)
          The GUI is asking the cca server to get or set one of the parameters of a port that is on a cca port.
 void portProperties(PortPropertiesEvent event)
          The GUI is requesting the cca server to send back or to set the value of a port property.
 void remove(RemoveEvent event)
          The GUI wants the cca server to remove an instantiation of a cca component.
 void repository(RepositoryEvent event)
          The GUI wants the cca server to send back all components that are in the repository or to send back one specific compnonent that is in the repository.
 void sendMessage(StringEvent event)
          The GUI wants to send a message to the cca server.
 void setComponentProperty(SetComponentPropertyEvent event)
          The GUI wants the server to set the value of a property that is inside of a cca component.
 void setDebug(SetDebugEvent event)
          The GUI is asking the cca server to turn on debugging.
 void setNoDebug(SetDebugEvent event)
          The GUI is asking the cca server to turn off debugging
 void setPortParameter(ParamCurrentEvent event)
          The GUI is asking the cca server to set one of the parameters of a port that is on a cca component.
 void shell(ShellEvent event)
          The GUI wants to send an O.S.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewPython

public ViewPython(PythonStub pythonStub)
Create an MVC View. This view writes commands and data to the cca server.

Parameters:
pythonStub - The stub for a python client
Method Detail

instantiate

public void instantiate(InstantiateEvent event)
The GUI is asking the cca server to retrieve a cca component.

Specified by:
instantiate in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to retrieve a cca component.

connect

public void connect(ConnectEvent event)
The GUI is asking the cca server to connect the Provides Port of a cca component to a Uses Port. The Uses Port may be one the same component or may be on a different component.

Specified by:
connect in interface GuiListener
Parameters:
event - The event that is sent whenever the GUI wants to connect a Uses Port with a Provides Port.

goComponentPort

public void goComponentPort(GoComponentPortEvent event)
The GUI is requesting that the cca server execute the "go" command" on a specific port that is located on a specific component.

Specified by:
goComponentPort in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to invoke the "go" command.

go

public void go(GoEvent event)
The GUI wants the cca server to launch an application.

Specified by:
go in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to launch the application.

remove

public void remove(RemoveEvent event)
The GUI wants the cca server to remove an instantiation of a cca component.

Specified by:
remove in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to remove an instantiation of a cca component.

disconnect

public void disconnect(DisconnectEvent event)
The GUI is asking the cca server to disconnect the connection between a Provides Port of a cca component and a Uses Port.

Specified by:
disconnect in interface GuiListener
Parameters:
event - The event that is sent whenever the GUI wants to connect a Uses Port with a Provides Port.

getAllInstancesInArena

public void getAllInstancesInArena(GetInstancesEvent event)
The GUI is asking the cca server to send back all of the instantiated cca components.

Specified by:
getAllInstancesInArena in interface GuiListener
Parameters:
event - That event that is generated whenever the GUI wants to get all of the instantiated cca components.

displayPalette

public void displayPalette(DisplayPaletteEvent event)
The GUI is requesting the cca server to send back all of the components that are in the palette. A palette is a menu of cca components; the end-user can drag components from the palette to the arena (workspace).

The cca server will send back all of the components that are in the palette. A GUI might respond by rending an icon, in the palette, for each component.

Specified by:
displayPalette in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to know what components are in the palette.

links

public void links(DisplayChainEvent event)
The GUI is requesting the cca server to send back all connections. A connection connects a user port of a component to a provider port; the two ports may be on the same cca component or may be on different components.

Specified by:
links in interface GuiListener
Parameters:
event - The event that is created whenever the GUI wants to know what connections are in the arena.

getPortParameter

public void getPortParameter(ParamGetCurrentEvent event)
The GUI is asking the cca server to send back the value of one of the parameters of a port that is on a cca component.

Specified by:
getPortParameter in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants the value of one of the data fields.

setPortParameter

public void setPortParameter(ParamCurrentEvent event)
The GUI is asking the cca server to set one of the parameters of a port that is on a cca component.

Specified by:
setPortParameter in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to set the value of a data field.

componentProperties

public void componentProperties(ComponentPropertiesEvent event)
The GUI is requesting the cca server to send back or to set the value of a component property. An example of a component property is the "name" of the component.

Specified by:
componentProperties in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to either get or set the value of a component property.

getComponentProperty

public void getComponentProperty(GetComponentPropertyEvent event)
The GUI is requesting the cca server to send back the value of a property that is inside a cca component.

Specified by:
getComponentProperty in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants the value of a property that is inside a component.

nukeAll

public void nukeAll(NukeAllEvent event)
The GUI is requesting the cca server to delete all components.

The server will respond by deleting all components. The GUI might respond by removing all components from the workspace. param event The event that is created whenever the GUI wants to to delete all components.

Specified by:
nukeAll in interface GuiListener

setDebug

public void setDebug(SetDebugEvent event)
The GUI is asking the cca server to turn on debugging.

Specified by:
setDebug in interface GuiListener

setNoDebug

public void setNoDebug(SetDebugEvent event)
The GUI is asking the cca server to turn off debugging

Specified by:
setNoDebug in interface GuiListener

portParameter

public void portParameter(ParamEvent event)
The GUI is asking the cca server to get or set one of the parameters of a port that is on a cca port.

Specified by:
portParameter in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to get or set the value of one of the data fields.

display

public void display(DisplayEvent event)
Request some information from the server. We can request the following info:
    display palette
    display arena
    display chain
    display component
    display state

If the GUI wants to get information on the components that are in the palette, or on the components that are in the arena, or on the connections that are established inside the arena, or on a particular component, or on the components and the connections that are in the arena, then the GUI will encapsulate the request as a DisplayEvent and will then invoke this method. This method will send the request to the cca server.

Specified by:
display in interface GuiListener
Parameters:
DisplayEvent - The event that is generated whenever an entity is requesting some information from the server.

displayComponent

public void displayComponent(DisplayComponentEvent event)
The GUI is requesting the cca server to send back a cca component.

The cca server will respond by sending back one cca component. The GUI might respond by rendering the component in the workspace.

Specified by:
displayComponent in interface GuiListener
Parameters:
source - The entity that created this event.
componentInstanceName - The name of the cca component object. The instance name is usually the name of the component's java class (without the package name) concatenated with an index number. EXAMPLE: "StarterComponent0"
event - The event that is created whenever the GUI wants some information on a cca component.

displayState

public void displayState(DisplayStateEvent event)
The GUI is requesting the cca server to send back all components that are in the arena and to send back all connections. A connection connects a user port of a component with a provider port; the two ports may be on the same cca component or may be on different components.

The cca server will respond by sending back all of the components that are in the workspace and all of the connections. A GUI might respond by rendering an icon, in the work area, for each component and by drawing lines between the components to connect them.

Specified by:
displayState in interface GuiListener
Parameters:
event - The event that is created whenever we want to know the state of the arena.

portProperties

public void portProperties(PortPropertiesEvent event)
The GUI is requesting the cca server to send back or to set the value of a port property.

Specified by:
portProperties in interface GuiListener
Parameters:
event - The event that is generated whenever an entity wants to either get or set the value of a port property.

setComponentProperty

public void setComponentProperty(SetComponentPropertyEvent event)
The GUI wants the server to set the value of a property that is inside of a cca component.

Specified by:
setComponentProperty in interface GuiListener
Parameters:
event - The event that is created whenever the GUI wants to set the value of a property.

sendMessage

public void sendMessage(StringEvent event)
The GUI wants to send a message to the cca server.

Specified by:
sendMessage in interface GuiListener
Parameters:
event - The event that is created the GUI wants to send a string to the cca server.

heartbeat

public void heartbeat(HeartbeatEvent event)
The GUI wants to send a heartbeat to the cca server.

Specified by:
heartbeat in interface GuiListener
Parameters:
event - The event that is fabricated the GUI wants to emit a heartbeat.

exit

public void exit(ExitEvent event)
The GUI wants to tell the cca server that the GUI is shutting down.

Specified by:
exit in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to exit the application.

path

public void path(PathEvent event)
The GUI wants to tell the cca server to send back or to set the file path that contains cca components.

Specified by:
path in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants either to set the path to a new value or to query for the path value.

repository

public void repository(RepositoryEvent event)
The GUI wants the cca server to send back all components that are in the repository or to send back one specific compnonent that is in the repository.

Specified by:
repository in interface GuiListener
Parameters:
event - The event that is created whenever the GUI wants to get one component or all components from the repository,

shell

public void shell(ShellEvent event)
The GUI wants to send an O.S. command to the cca server. The cca server will execute the command.

Specified by:
shell in interface GuiListener
Parameters:
event - The event that is created whenever the GUI wants an O.S. command executed.