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 1683)
+++ /trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java	(revision 1684)
@@ -135,38 +135,21 @@
                 JFCGUIElement target = (JFCGUIElement) event.getTarget();
 
-                if (event.getType().getName().equals("LeftMouseClick")) {
-                    generateMouseClick(writer, structure, event.getTimestamp(), target);
-
-                    // FIXME: assume that the target is a checkbox for now =)
-                    // this is an item event and an action event in jacareto
-                    //@formatter:off
-                    writeLine(writer,
-                        "<ItemEvent "
-                        + "procTime=\"0\" "
-                        + "duration=\"0\" "
-                        + "source=\"" + target.getJacaretoHierarchy() + "\" "
-                        + "class=\"" + target.getSpecification().getType() + "\" "
-                        + "uuid=\"" + UUID.randomUUID() + "\" "
-                        + "ID=\"701\" "
-                        + "item=\"\" "
-                        + "stateChange=\"1\" />"
-                    );
-                    writeLine(writer,
-                        "<ActionEvent "
-                        + "procTime=\"0\" "
-                        + "duration=\"0\" "
-                        + "source=\"" + target.getJacaretoHierarchy() + "\" "
-                        + "class=\"" + target.getSpecification().getType() + "\" "
-                        + "uuid=\"" + UUID.randomUUID() + "\" "
-                        + "ID=\"1001\" "
-                        + "command=" + target.getName() + " "
-                        + "modifiers=\"16\" />"
-                    );
-                    //@formatter:on
-                    structure.add("<StructureElement class=\"jacareto.struct.ItemStateChange\">");
-                    structure.add("<Recordable ref=\"" + (nextRef++) + "\" />");
-                    structure.add("<Recordable ref=\"" + (nextRef++) + "\" />");
-                    structure.add("</StructureElement>");
+                switch (event.getType().getName())
+                {
+                    case "LeftMouseButtonDown":
+                        structure.add("<StructureElement class=\"jacareto.struct.MouseClick\">");
+                        writeMouseClickEvent(writer, structure, event.getTimestamp(), target, 501);
+                        break;
+                    case "LeftMouseButtonUp":
+                        writeMouseClickEvent(writer, structure, event.getTimestamp(), target, 502);
+                        break;
+                    case "LeftMouseClick":
+                        writeMouseClickEvent(writer, structure, event.getTimestamp(), target, 500);
+                        structure.add("</StructureElement>");
+                        // FIXME: don't always write an item action
+                        writeItemActionEvent(writer, structure, target);
+                        break;
                 }
+
             }
         }
@@ -245,4 +228,38 @@
     }
 
+    private void writeItemActionEvent(BufferedWriter writer,
+                                      ArrayList<String> structure,
+                                      JFCGUIElement target) throws IOException
+    {
+        //@formatter:off
+        writeLine(writer,
+            "<ItemEvent "
+            + "procTime=\"0\" "
+            + "duration=\"0\" "
+            + "source=\"" + target.getJacaretoHierarchy() + "\" "
+            + "class=\"" + target.getSpecification().getType() + "\" "
+            + "uuid=\"" + UUID.randomUUID() + "\" "
+            + "ID=\"701\" "
+            + "item=\"\" "
+            + "stateChange=\"1\" />"
+        );
+        writeLine(writer,
+            "<ActionEvent "
+            + "procTime=\"0\" "
+            + "duration=\"0\" "
+            + "source=\"" + target.getJacaretoHierarchy() + "\" "
+            + "class=\"" + target.getSpecification().getType() + "\" "
+            + "uuid=\"" + UUID.randomUUID() + "\" "
+            + "ID=\"1001\" "
+            + "command=" + target.getName() + " "
+            + "modifiers=\"16\" />"
+        );
+        //@formatter:on
+        structure.add("<StructureElement class=\"jacareto.struct.ItemStateChange\">");
+        structure.add("<Recordable ref=\"" + (nextRef++) + "\" />");
+        structure.add("<Recordable ref=\"" + (nextRef++) + "\" />");
+        structure.add("</StructureElement>");
+    }
+
     private void writeMouseClickEvent(BufferedWriter writer,
                                       ArrayList<String> structure,
@@ -287,17 +304,3 @@
         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>");
-    }
 }
