JMenuItem target = (JMenuItem) e.getSource();
String actionCommand = target.getActionCommand();
try {
if (actionCommand.equals("Listen to Director")) {
Effigy effigy = (Effigy) getTableau().getContainer();
// Create a new text effigy inside this one.
Effigy textEffigy = new TextEffigy(effigy, effigy
.uniqueName("debug listener"));
DebugListenerTableau tableau = new DebugListenerTableau(
textEffigy, textEffigy.uniqueName("debugListener"));
tableau
.setDebuggable(((FSMActor) getModel())
.getDirector());
} else if (actionCommand.equals("Listen to State Machine")) {
Effigy effigy = (Effigy) getTableau().getContainer();
// Create a new text effigy inside this one.
Effigy textEffigy = new TextEffigy(effigy, effigy
.uniqueName("debug listener"));
DebugListenerTableau tableau = new DebugListenerTableau(
textEffigy, textEffigy.uniqueName("debugListener"));
tableau.setDebuggable(getModel());
} else if (actionCommand.equals("Animate States")) {
// Dialog to ask for a delay time.
Query query = new Query();
query.addLine("delay", "Time (in ms) to hold highlight",