gov.sandia.ccaffeine.dc.user_iface.gui.guicmd
Class Gui

java.lang.Object
  extended by gov.sandia.ccaffeine.dc.user_iface.gui.guicmd.Gui
All Implemented Interfaces:
ControllerListener, GuiUserListener, java.util.EventListener

public class Gui
extends java.lang.Object
implements ControllerListener, GuiUserListener

Interface to the GUI.


Constructor Summary
Gui(GlobalData globalData)
          Create a Gui object.
 
Method Summary
 void addComponentClass(AddComponentClassEvent event)
          The cca server added a new class.
 void addGuiListener(GuiListener listener)
           
 void addProvidesPorts(AddProvidesPortsEvent event)
          The cca server added one or more Provides Ports to a component.
 void addUsesPorts(AddUsesPortsEvent event)
          The cca server added one or more Uses Ports to a component.
 void connect(ConnectEvent event)
          The cca server connected a Provides Port from one component to a Uses Port.
 void disconnect(DisconnectEvent event)
          The cca server broke a connection between a Provides Port and a Uses Port.
 void exit(ExitEvent event)
          The cca server has terminated its communication link with this client.
 void getComponentClass(QueryEvent event)
          The end-user wants to send a query to fetch the class of cca component.
 void getComponentInstance(QueryEvent event)
          The end-user wants to send a query to fetch a component instance.
 void getComponentProperty(GetComponentPropertyEvent event)
          The cca server wants the GUI to write, to stdout, the value of a component property.
 void getWaitingForPorts(QueryEvent event)
          The end-user wants to send a query to fetch the "waitingForPorts" flag.
 void instantiate(InstantiateEvent event)
          The cca server used a cca component class to instantiate a new cca component object.
 void load(LoadEvent event)
          The cca server loaded the class of a cca widget.
 void message(MessageEvent event)
          The cca server sent a message to this client.
 void paramCurrent(ParamCurrentEvent event)
          The cca server is sending the current value of a data field.
 void paramDefault(ParamDefaultEvent event)
          The cca server wants to send the default value of a data field.
 void paramDialog(ParamDialogEvent event)
          The cca server wants this client to create (but not display) a dialog box to hold the values of all the data fields that are inside a port.
 void paramEndDialog(ParamEndDialogEvent event)
          The cca server has finished sending information for all the data fields that are inside a port.
 void paramField(ParamFieldEvent event)
          The cca server has sent this client the name of a data field that is inside a port.
 void paramHelp(ParamHelpEvent event)
          The cca server has sent this client some helpful info about this data field.
 void paramNumberRange(ParamNumberRangeEvent event)
          The cca server sent the lowest value and the highest value that the current data field can have.
 void paramPrompt(ParamPromptEvent event)
          The cca server sent us the prompt string for one of the data fields in one of the ports of a cca component.
 void paramStringChoice(ParamStringChoiceEvent event)
          The cca server is sending one, out of many, possible values that can be inserted into a data field.
 void paramTab(ParamTabEvent event)
          The cca server is sending the name of tab.
 void print(PrintEvent event)
          The end-user wants to print a string.
 void println(PrintEvent event)
          The end-user wants to print a string.
 void remove(RemoveEvent event)
          The cca server has removed an instantiation of a cca component.
 void removeGuiListener(GuiListener listener)
           
 void revalidate(RevalidateEvent event)
          The cca server has revalidated all of the cca ports in a cca component.
 void setComponentProperty(SetComponentPropertyEvent event)
          The cca server has set the value of a property that is inside a cca component.
 void setPortProperty(SetPortPropertyEvent event)
          The cca server has set the value of a property that is inside a port of a cca component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gui

public Gui(GlobalData globalData)
Create a Gui object. The object can be used to interact with the GUI.

Parameters:
globalData - Global data store.
Method Detail

addGuiListener

public void addGuiListener(GuiListener listener)

removeGuiListener

public void removeGuiListener(GuiListener listener)

addComponentClass

public void addComponentClass(AddComponentClassEvent event)
The cca server added a new class. The class can be used to instantiate new cca components. A GUI might respond by rendering a box inside of a palette; the box represents the component's class.

Specified by:
addComponentClass in interface ControllerListener
Parameters:
event - The event that is generated when the cca server adds a new class.

addProvidesPorts

public void addProvidesPorts(AddProvidesPortsEvent event)
The cca server added one or more Provides Ports to a component. A GUI might respond by rendering a box for each component. The boxes could be placed on the left side of the component.

Specified by:
addProvidesPorts in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server adds one or more ports to a component.

addUsesPorts

public void addUsesPorts(AddUsesPortsEvent event)
The cca server added one or more Uses Ports to a component. A GUI might respond by rendering a box for each component. The boxes could be placed on the right side of the component.

Specified by:
addUsesPorts in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server adds one or more ports to a component.

connect

public void connect(ConnectEvent event)
The cca server connected a Provides Port from one component to a Uses Port. The Uses Port may be from the same component or may be from a different component. A GUI might respond by drawing a line between the two connected ports.

Specified by:
connect in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server connects a Provides Port with a Uses Port.

disconnect

public void disconnect(DisconnectEvent event)
The cca server broke a connection between a Provides Port and a Uses Port. A GUI might respond by erasing the line that was drawn between the two ports.

Specified by:
disconnect in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server breaks the connection between a Provides Port and a Uses Port.

exit

public void exit(ExitEvent event)
The cca server has terminated its communication link with this client. A GUI might respond by exiting tht program.

Specified by:
exit in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server breaks its communication link with this client.

getComponentProperty

public void getComponentProperty(GetComponentPropertyEvent event)
The cca server wants the GUI to write, to stdout, the value of a component property.

Specified by:
getComponentProperty in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server is querying for the value of a property inside a cca component.

instantiate

public void instantiate(InstantiateEvent event)
The cca server used a cca component class to instantiate a new cca component object. A GUI might respond by rendering a box inside of an arena; the box represents the instantiated component.

Specified by:
instantiate in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server used a cca component class to instantiate a new cca component object.

load

public void load(LoadEvent event)
The cca server loaded the class of a cca widget. The class can be used to instantiate cca widgets. A GUI might respond by rendering a box inside of a palette; the box represents the class of a cca component. The end-user might be able to drag-and-drop components from the palett to the main workspace (the arena).

Specified by:
load in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server loads the java class of a cca widget.

message

public void message(MessageEvent event)
The cca server sent a message to this client. A GUI might respond by printing a string on standard out.

Specified by:
message in interface ControllerListener
Parameters:
event - The event that is created whenever the cca server sends a message to this client.

paramCurrent

public void paramCurrent(ParamCurrentEvent event)
The cca server is sending the current value of a data field.

Cca components contain ports. Some of the ports contain data fields. The cca server is sending the value of one of these data fields. A GUI might respond by displaying the current value on the screen.

Specified by:
paramCurrent in interface ControllerListener
Parameters:
event - The event that is created whenever the cca server wants to send the current value of a data field.

paramDefault

public void paramDefault(ParamDefaultEvent event)
The cca server wants to send the default value of a data field.

Cca components contain ports. Some of the ports contain data fields. The cca server is sending the default value of one of these data fields. A GUI might respond by checking the state of a data field; if the data field does not have a current value then the default value is displayed on the screen.

Specified by:
paramDefault in interface ControllerListener
Parameters:
event - The event that is created whenever the cca server sends the default value of a data field.

paramDialog

public void paramDialog(ParamDialogEvent event)
The cca server wants this client to create (but not display) a dialog box to hold the values of all the data fields that are inside a port.

Cca components contain ports. Some of the ports contain data fields. This event can be used to notify components that the cca server wants the client to create (but not display) a dialog box that contains the values of all the data fields in the port. A GUI might respond by creating an empty dialog box.

Specified by:
paramDialog in interface ControllerListener
Parameters:
event - The event that is created whenever the cca server wants the client to create an empty dialog box.

paramEndDialog

public void paramEndDialog(ParamEndDialogEvent event)
The cca server has finished sending information for all the data fields that are inside a port.

Cca components contain ports. Some of the ports contain data fields. The cca server has finished sending information for all the data fields in a port. A GUI might respond by displaying a dialog box that is populated with information from all the data fields.

Specified by:
paramEndDialog in interface ControllerListener
Parameters:
event - The event that is created whenever the cca server wants the client to display a dialog box that contains the values of all the data fields inside of a port.

paramField

public void paramField(ParamFieldEvent event)
The cca server has sent this client the name of a data field that is inside a port.

Cca components contain ports. Some of the ports contain data fields. This event can be used to notify components that the cca server is sending the name of a data field. A GUI might respond by inserting a line of data into a dialog box.

Specified by:
paramField in interface ControllerListener
Parameters:
event - The event that is created whenever the cca server sends the name of a data field.

paramHelp

public void paramHelp(ParamHelpEvent event)
The cca server has sent this client some helpful info about this data field.

Cca components contain ports. Some of the ports contain data fields. This event can be used to notify components that the cca server is sending the text that contains helpful information on the data field. A GUI might respond by setting up a help system inside of a dialog box.

Specified by:
paramHelp in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server sends this client helpful info about a data field that is inside a port.

paramNumberRange

public void paramNumberRange(ParamNumberRangeEvent event)
The cca server sent the lowest value and the highest value that the current data field can have.

Cca components contain ports. Some of the ports contain data fields. Some of the data fields restrict the range that a value can have. The cca server is sending the lowest value and the highest value that a data field value can have. A GUI can use to information to might respond by verify that the input values for this data field is within the allowed range.

Specified by:
paramNumberRange in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server sends this client the lowest value and the highest value the current data field can contain.
componentInstanceName - The name of the cca component that contains the port which contains the data field. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "TimeStamper0"
portInstanceName - The name of a port that contains the data field. Example: "configure_port"
dataFieldName - The name of the data field.
dataFieldMinValue - The smallest value that can be inserted into the data field.
dataFieldPrompt - The prompt string; a view entity might display the string to prompt the end-user for the value of this data field.

paramPrompt

public void paramPrompt(ParamPromptEvent event)
The cca server sent us the prompt string for one of the data fields in one of the ports of a cca component.

Cca components contain ports. Some of the ports contain data fields. This event can be used to notify components that the cca server is sending a prompt string for a data field. A GUI might display the string to prompt the end-user for the value of this data field.

Specified by:
paramPrompt in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server sends this client the contents of a help string.

paramStringChoice

public void paramStringChoice(ParamStringChoiceEvent event)
The cca server is sending one, out of many, possible values that can be inserted into a data field.

Cca components contain ports. Some of the ports contain data fields. For some data fields, the value must be one of the items in a set (e.g. "red", "green", "blue"). The cca server is sending one item that belongs in such a set. A GUI can display the items in the set as a pull down menu.

Specified by:
paramStringChoice in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server sends this client one, out of many, possible values that can be inserted into this data field.

paramTab

public void paramTab(ParamTabEvent event)
The cca server is sending the name of tab.

Cca components contain ports. Some of the ports contain data fields. Sometimes, the data fields are grouped into sets. The cca server is sending the name of such a set. A GUI can display each set as a tabbed pane.

Specified by:
paramTab in interface ControllerListener

remove

public void remove(RemoveEvent event)
The cca server has removed an instantiation of a cca component. A GUI might respond by removing the component from the arena.

Specified by:
remove in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server removes an instantiation of a cca component.

revalidate

public void revalidate(RevalidateEvent event)
The cca server has revalidated all of the cca ports in a cca component. A GUI might respond by re-rendering all of the ports that are inside a cca component.

Specified by:
revalidate in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server revalidates all of the cca ports in a cca component.

setComponentProperty

public void setComponentProperty(SetComponentPropertyEvent event)
The cca server has set the value of a property that is inside a cca component. A GUI might respond by saving the new value of the property.

Specified by:
setComponentProperty in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server sets the value of a property that is inside a cca component.

setPortProperty

public void setPortProperty(SetPortPropertyEvent event)
The cca server has set the value of a property that is inside a port of a cca component. A GUI might respond by saving the new value of the property.

Specified by:
setPortProperty in interface ControllerListener
Parameters:
event - The event that is generated whenever the cca server sets the value of a property that is inside a port of a cca component.

print

public void print(PrintEvent event)
The end-user wants to print a string. A GUI might respond by writing the string to standard out.

Specified by:
print in interface GuiUserListener
Parameters:
event - The event that is generated whenever the end-user wants to print a string.

println

public void println(PrintEvent event)
The end-user wants to print a string. A GUI might respond by writing the string to standard out.

Specified by:
println in interface GuiUserListener
Parameters:
event - The event that is generated whenever the end-user wants to print a string.

getComponentInstance

public void getComponentInstance(QueryEvent event)
The end-user wants to send a query to fetch a component instance. A GUI might respond by sending back a ResultSetEvent.

Specified by:
getComponentInstance in interface GuiUserListener
Parameters:
event - The event that is created whenever an entity wants to fetch a component instance.

getComponentClass

public void getComponentClass(QueryEvent event)
The end-user wants to send a query to fetch the class of cca component. A view entity might respond by sending back a ResultSetEvent.

Specified by:
getComponentClass in interface GuiUserListener
Parameters:
event - The event that is created whenever the end-user wants to fetch the class of a component.

getWaitingForPorts

public void getWaitingForPorts(QueryEvent event)
The end-user wants to send a query to fetch the "waitingForPorts" flag. A GUI might respond by sending back a ResultSetEvent.

Specified by:
getWaitingForPorts in interface GuiUserListener
Parameters:
event - The event that is created whenever the end-user wants to fetch the "waitingForPorts" flag.