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

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

public class DisplayEvent
extends java.util.EventObject

This event can be used to notify components that an entity wants some information. This event can be used to request the following info:
    display palette
    display arena
    display chain
    display component
    display state

A view might respond to a "draw palette" by rendering icons in a palette. The end-user can drag-and-drop icons from the palette to the main workspace (the arena).

A view might respond to a "draw arena" by redendering cca components in the main workspace. An end-user can drag components to different locations, remove components, view or set property values, draw a line between two different components, etc.

A view might respond to a "draw chain" by drawing a line between two ports that are inside of two different cca components. A port is usually rendered as a small rectangle inside of a component.

A view might respond to a "draw component" by rendering one cca component in the main workspace (the arena). The end-user can drag the component to a new location, remove the component, draw a line to/from to different component, view or edit the component's properties, etc.

A view might respond to a "draw state" by redering components in the main workspace (the arena) and by rendering lines between all of the components that are connected.

See Also:
Serialized Form

Field Summary
static java.lang.String ARENA
          One of the entity values
static java.lang.String CHAIN
          One of the entity values
static java.lang.String COMPONENT
          One of the entity values
protected  java.lang.String componentInstanceName
           
protected  java.lang.String entity
           
protected  int numberOfArguments
           
static java.lang.String PALETTE
          One of the entity values
static java.lang.String STATE
          One of the entity values
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DisplayEvent(java.lang.Object source, int numberOfArguments, java.lang.String entity)
          Create a DisplayEvent.
DisplayEvent(java.lang.Object source, int numberOfArguments, java.lang.String entity, java.lang.String componentInstanceName)
          Create a DisplayEvent.
DisplayEvent(java.lang.Object source, java.lang.String entity)
          Create a DisplayEvent.
 
Method Summary
 java.lang.String getComponentInstanceName()
           
 java.lang.String getEntity()
           
 int getNumberOfArguments()
          Retrieve the number of arguments in the request string.
 
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

PALETTE

public static final java.lang.String PALETTE
One of the entity values

See Also:
Constant Field Values

ARENA

public static final java.lang.String ARENA
One of the entity values

See Also:
Constant Field Values

CHAIN

public static final java.lang.String CHAIN
One of the entity values

See Also:
Constant Field Values

COMPONENT

public static final java.lang.String COMPONENT
One of the entity values

See Also:
Constant Field Values

STATE

public static final java.lang.String STATE
One of the entity values

See Also:
Constant Field Values

entity

protected java.lang.String entity

componentInstanceName

protected java.lang.String componentInstanceName
Constructor Detail

DisplayEvent

public DisplayEvent(java.lang.Object source,
                    java.lang.String entity)
Create a DisplayEvent. This event can be used to notify components that an entity wants some information. This event can be used to request the following info:
    display palette
    display arena
    display chain
    display component
    display state

Parameters:
source - The entity that created this event.
entity - We are requesting info on which entity? We can request info on the PALETTE, ARENA, CHAIN, COMPONENT, STATE.

DisplayEvent

public DisplayEvent(java.lang.Object source,
                    int numberOfArguments,
                    java.lang.String entity)
Create a DisplayEvent. This event can be used to notify components that an entity wants some information. This event can be used to request the following info:
    display palette
    display arena
    display chain
    display component
    display state

Parameters:
source - The entity that created this event.
entity - We are requesting info on which entity? We can request info on the PALETTE, ARENA, CHAIN, COMPONENT, STATE.

DisplayEvent

public DisplayEvent(java.lang.Object source,
                    int numberOfArguments,
                    java.lang.String entity,
                    java.lang.String componentInstanceName)
Create a DisplayEvent. This event can be used to notify components that an entity wants some information. This event can be used to request the following info:
    display palette
    display arena
    display chain
    display component
    display state

Parameters:
source - The entity that created this event.
entity - We are requesting info on which entity? We can request info on the PALETTE, ARENA, CHAIN, COMPONENT, STATE.
componentInstanceName - If an entity wants some info on a particular component, then that entity has to supply the name of the component. The instance name is usually the name of the component's java class (without the package name) concatenated with an index number. EXAMPLE: "StarterComponent0" Can be set to null.
Method Detail

getNumberOfArguments

public int getNumberOfArguments()
Retrieve the number of arguments in the request string.

Returns:
The number of arguments in the request string.

getEntity

public java.lang.String getEntity()

getComponentInstanceName

public java.lang.String getComponentInstanceName()