Package ptolemy.domains.ptera.lib
Class EventUtils
- java.lang.Object
-
- 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$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Constructor Summary
Constructors Constructor Description EventUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
closeTableau(Tableau tableau)
Close the given tableau when the Java GUI thread is not busy.static Effigy
findToplevelEffigy(NamedObj object)
Deprecated.Use ptolemy.actor.gui.Effigy.findToplevelEffigy() insteadstatic 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.
-
-
-
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
@Deprecated public static Effigy findToplevelEffigy(NamedObj object) throws IllegalActionException
Deprecated.Use ptolemy.actor.gui.Effigy.findToplevelEffigy() insteadFind 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)
-
-