diff options
Diffstat (limited to 'embedding')
-rw-r--r-- | embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java | 8 | ||||
-rw-r--r-- | embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java index b44c05e..0e2388f 100644 --- a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java +++ b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java @@ -29,10 +29,13 @@ public class ConsoleFrame extends Frame { + " <script src=\"http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js\" />" + " <script>var charSeq = \"\";</script>" + " <state id=\"idle\">" + + " <transition event=\"error\" target=\"quit\" />" + " <transition event=\"key.released\" cond=\"_event.data.keyChar == 10\">" - + " <log expr=\"charSeq\" />" + + " <send type=\"console\">" + + " <param name=\"foo\" expr=\"charSeq\" />" + + " </send>" + " <script>" - + " charSeq = \"\";" + + " charSeq = \"\"; // reset string" + " </script>" + " </transition>" + " <transition event=\"*\">" @@ -40,6 +43,7 @@ public class ConsoleFrame extends Frame { + " <script>charSeq += String.fromCharCode(_event.data.keyChar);</script>" + " </transition>" + " </state>" + + " <final id=\"quit\" />" + "</scxml>"); diff --git a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java index f0ad491..7dca28d 100644 --- a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java +++ b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java @@ -17,7 +17,7 @@ public class ConsoleIOProc extends IOProcessor implements KeyListener { public IOProcessor create(Interpreter interpreter) { ConsoleIOProc ioProc = new ConsoleIOProc(); ioProc.swigReleaseOwnership(); - + if (ConsoleFrame.perInterpreter.containsKey(interpreter)) { ConsoleFrame.perInterpreter.get(interpreter).addKeyListener(ioProc); } else { |