ptolemy.domains.ptera.lib
Class EventUtils

java.lang.Object
  extended by ptolemy.domains.ptera.lib.EventUtils

public class EventUtils
extends java.lang.Object

A set of static functions to be used by Ptera events.

Since:
Ptolemy II 8.0
Version:
$Id: EventUtils.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Constructor Summary
EventUtils()
           
 
Method Summary
static void closeTableau(Tableau tableau)
          Close the given tableau when the Java GUI thread is not busy.
static Effigy findToplevelEffigy(NamedObj object)
          Find the effigy associated with the top level of the object, and if not found but the top level has a ContainmentExtender attribute, use that attribute to find the containment extender of the top level and continue the search.
static Tableau getTableau(Event event, StringParameter referredTableau, TableauParameter defaultTableau)
          Get the tableau to be used by the event that requires a tableau in its actions.
static TableauParameter getTableauParameter(Event event, StringParameter referredTableau, TableauParameter defaultTableau)
          Get the TableauParameter to be used by the event that requires a tableau in its actions.
static void setTableau(Event event, StringParameter referredTableau, TableauParameter defaultTableau, Tableau tableau)
          Set the TableauParameter used by the event to represent the given tableau.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventUtils

public EventUtils()
Method Detail

closeTableau

public static void closeTableau(Tableau tableau)
Close the given tableau when the Java GUI thread is not busy.

Parameters:
tableau - The tableau to be closed.

findToplevelEffigy

public static Effigy findToplevelEffigy(NamedObj object)
                                 throws IllegalActionException
Find the effigy associated with the top level of the object, and if not found but the top level has a ContainmentExtender attribute, use that attribute to find the containment extender of the top level and continue the search.

Parameters:
object - The object.
Returns:
The effigy, or null if not found.
Throws:
IllegalActionException - If attributes cannot be retrieved, or the container that an attribute points to is invalid.

getTableau

public static Tableau getTableau(Event event,
                                 StringParameter referredTableau,
                                 TableauParameter defaultTableau)
                          throws IllegalActionException
Get the tableau to be used by the event that requires a tableau in its actions.

Parameters:
event - The event.
referredTableau - The parameter that contains the name of the TableauParameter to be used, if not empty.
defaultTableau - The default TableauParameter to be used.
Returns:
The tableau.
Throws:
IllegalActionException - If the tableau cannot be retrieved.
See Also:
setTableau(Event, StringParameter, TableauParameter, Tableau)

getTableauParameter

public static TableauParameter getTableauParameter(Event event,
                                                   StringParameter referredTableau,
                                                   TableauParameter defaultTableau)
                                            throws IllegalActionException
Get the TableauParameter to be used by the event that requires a tableau in its actions.

Parameters:
event - The event.
referredTableau - The parameter that contains the name of the TableauParameter to be used, if not empty.
defaultTableau - The default TableauParameter to be used.
Returns:
The TableauParameter.
Throws:
IllegalActionException - If the TableauParameter cannot be found.

setTableau

public static void setTableau(Event event,
                              StringParameter referredTableau,
                              TableauParameter defaultTableau,
                              Tableau tableau)
                       throws IllegalActionException
Set the TableauParameter used by the event to represent the given tableau.

Parameters:
event - The event.
referredTableau - The parameter that contains the name of the TableauParameter to be used, if not empty.
defaultTableau - The default TableauParameter to be used.
tableau - The tableau to be set in the TableauParameter.
Throws:
IllegalActionException - If the TableauParameter cannot be found.
See Also:
getTableau(Event, StringParameter, TableauParameter)