Index: /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java
===================================================================
--- /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java	(revision 1682)
+++ /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java	(revision 1683)
@@ -31,5 +31,4 @@
 import de.ugoe.cs.util.console.Command;
 import de.ugoe.cs.autoquest.eventcore.Event;
-import de.ugoe.cs.autoquest.eventcore.IEventTarget;
 import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCGUIElement;
 import de.ugoe.cs.util.console.Console;
@@ -114,5 +113,5 @@
         writeLine(writer, "<ComponentMode numberPopupMenues=\"true\" />");
         writeLine(writer,
-                  "<ApplicationStarter procTime=\"5\" duration=\"5\" name=\"HelloWorldSwing\" class=\"HelloWorldSwing\" initclass=\"\" basepath=\"/home/daniel/project/autoquest-jfcmonitor\" classpathext=\"${basepath}/helloswing.jar;${basepath}/.;\" detectDuration=\"false\" captureparams=\"\" replayparams=\"\" uuid=\"a7b7d7b9-caa9-4d6d-b052-cf74d353275e\" />");
+                  "<ApplicationStarter procTime=\"0\" duration=\"0\" name=\"HelloWorldSwing\" class=\"HelloWorldSwing\" initclass=\"\" basepath=\"/home/daniel/project/autoquest-jfcmonitor\" classpathext=\"${basepath}/helloswing.jar;${basepath}/.;\" detectDuration=\"false\" captureparams=\"\" replayparams=\"\" uuid=\"a7b7d7b9-caa9-4d6d-b052-cf74d353275e\" />");
     }
 
@@ -134,9 +133,8 @@
             for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) {
                 Event event = eventIter.next();
-
-                // TODO: do a mapping file or something to map
-                // from autoquest events to jacareto events
+                JFCGUIElement target = (JFCGUIElement) event.getTarget();
+
                 if (event.getType().getName().equals("LeftMouseClick")) {
-                    JFCGUIElement target = (JFCGUIElement) event.getTarget();
+                    generateMouseClick(writer, structure, event.getTimestamp(), target);
 
                     // FIXME: assume that the target is a checkbox for now =)
@@ -145,6 +143,6 @@
                     writeLine(writer,
                         "<ItemEvent "
-                        + "procTime=\"1\" "
-                        + "duration=\"8\" "
+                        + "procTime=\"0\" "
+                        + "duration=\"0\" "
                         + "source=\"" + target.getJacaretoHierarchy() + "\" "
                         + "class=\"" + target.getSpecification().getType() + "\" "
@@ -156,5 +154,5 @@
                     writeLine(writer,
                         "<ActionEvent "
-                        + "procTime=\"1\" "
+                        + "procTime=\"0\" "
                         + "duration=\"0\" "
                         + "source=\"" + target.getJacaretoHierarchy() + "\" "
@@ -246,3 +244,60 @@
         return writer;
     }
+
+    private void writeMouseClickEvent(BufferedWriter writer,
+                                      ArrayList<String> structure,
+                                      long timestamp,
+                                      JFCGUIElement target,
+                                      int jacId) throws IOException
+    {
+        // Note, that all position related attributes appear to be meaningless
+        // for our purposes.
+        // TODO: change procTime and duration to adequate values
+        //@formatter:off
+        writeLine(writer,
+            "<MouseEvent "
+            + "procTime=\"0\" "
+            + "duration=\"150\" "
+            + "source=\"" + target.getJacaretoHierarchy() + "\" "
+            + "class=\"" + target.getSpecification().getType() + "\" "
+            + "uuid=\"" + UUID.randomUUID() + "\" "
+            + "ID=\"" + jacId + "\" "
+            + "component=\"null\" "
+            + "root=\"" + target.getJacaretoRoot() + "\" "
+            + "xPos=\"0\" "
+            + "yPos=\"0\" "
+            + "width=\"0\" "
+            + "height=\"0\" "
+            + "when=\"" + timestamp + "\" " 
+            + "isConsumed=\"false\">" 
+        );
+        writeLine(writer,
+            "<MouseInfo "
+            + "xPosition=\"0\" "
+            + "yPosition=\"0\" "
+            + "rootX=\"0\" "
+            + "rootY=\"0\" "
+            + "clickCount=\"1\" "
+            + "modifiers=\"16\" "
+            + "isPopupTrigger=\"false\" />"
+        );
+        writeLine(writer, "</MouseEvent>");
+        //@formatter:on
+
+        structure.add("<Recordable ref=\"" + (nextRef++) + "\" />");
+    }
+
+    private void generateMouseClick(BufferedWriter writer,
+                                    ArrayList<String> structure,
+                                    long timestamp,
+                                    JFCGUIElement target) throws IOException
+    {
+        structure.add("<StructureElement class=\"jacareto.struct.MouseClick\">");
+
+        writeMouseClickEvent(writer, structure, timestamp, target, 501);
+        writeMouseClickEvent(writer, structure, timestamp, target, 502);
+        writeMouseClickEvent(writer, structure, timestamp, target, 500);
+
+        structure.add("</StructureElement>");
+    }
 }
Index: /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/guimodel/JFCGUIElement.java
===================================================================
--- /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/guimodel/JFCGUIElement.java	(revision 1682)
+++ /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/guimodel/JFCGUIElement.java	(revision 1683)
@@ -178,4 +178,8 @@
     }
 
+    public String getJacaretoRoot() {
+        return getJacaretoHierarchy().split("\\.")[0];
+    }
+
     /*
      * (non-Javadoc)
