Index: trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClickCondenser.java
===================================================================
--- trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClickCondenser.java	(revision 995)
+++ trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClickCondenser.java	(revision 1042)
@@ -72,5 +72,6 @@
                 }
                 else if (mouseClickSequenceFound(mbDown, mbUp)) {
-                    // skip the mouse button down and mouse button up event and add a mouse click
+                    // replace the mouse button down and mouse button up event with a generated
+                    // mouse click
                     index += 2;
                     resultingSequence.add(createClick(mbDown, mbUp));
@@ -78,9 +79,16 @@
                 }
                 else if (mouseDragAndDropSequenceFound(mbDown, mbUp)) {
-                    // skip the mouse button down and mouse button up event and add a mouse click
+                    // replace the mouse button down and mouse button up event with a generated
+                    // mouse drag and drop
                     index += 2;
                     resultingSequence.add(createDragAndDrop(mbDown, mbUp));
                     mouseClickHandled = true;
                 }
+                else if (mouseDoubleClickSequenceFound(mbDown, mbUp)) {
+                    // replace the two mouse click events with a generated mouse double click
+                    index += 2;
+                    resultingSequence.add(createDoubleClick(mbDown, mbUp));
+                    mouseClickHandled = true;
+                }
             }
 
@@ -88,4 +96,16 @@
                 resultingSequence.add(sequence.get(index));
                 index++;
+            }
+            
+            if (resultingSequence.size() > 1) {
+                // check for double clicks
+                int resultingSequenceIndex = resultingSequence.size() - 1;
+                Event click1 = resultingSequence.get(resultingSequenceIndex - 1);
+                Event click2 = resultingSequence.get(resultingSequenceIndex);
+                if (mouseDoubleClickSequenceFound(click1, click2)) {
+                    resultingSequence.remove(resultingSequenceIndex);
+                    resultingSequence.remove(resultingSequenceIndex - 1);
+                    resultingSequence.add(createDoubleClick(click1, click2));
+                }
             }
         }
@@ -195,4 +215,45 @@
 
     /**
+     * 
+     */
+    private boolean mouseDoubleClickSequenceFound(Event click1,
+                                                  Event click2)
+    {
+        // check the first in a row of three for validity
+        if (!(click1.getType() instanceof MouseClick)) {
+            return false;
+        }
+
+        if (((MouseClick) click1.getType()).getButton() != MouseButtonInteraction.Button.LEFT) {
+            return false;
+        }
+        
+        // check the second node for validity
+        if (!(click2.getType() instanceof MouseClick)) {
+            return false;
+        }
+
+        // use 500 milliseconds as timestamp difference as this is more or less similar to default
+        // values in Microsoft Windows 
+        if (!timestampDifferenceSmallerThan(click1, click2, 500)) {
+            return false;
+        }
+        
+        if (!targetsEqual(click1, click2)) {
+            return false;
+        }
+
+        if (!buttonsEqual(click1, click2)) {
+            return false;
+        }
+
+        if (!coordinatesEqual(click1, click2)) {
+            return false;
+        }
+        
+        return true;
+    }
+
+    /**
      *
      */
@@ -204,5 +265,21 @@
         int y = ((MouseButtonDown) mouseButtonDown.getType()).getY();
 
-        return new Event(new MouseClick(button, x, y), mouseButtonDown.getTarget());
+        Event click = new Event(new MouseClick(button, x, y), mouseButtonDown.getTarget());
+        click.setTimestamp(mouseButtonDown.getTimestamp());
+        return click;
+    }
+
+    /**
+     *
+     */
+    private Event createDoubleClick(Event click1, Event click2) {
+        MouseButtonInteraction.Button button = ((MouseClick) click1.getType()).getButton();
+       
+        int x = ((MouseClick) click1.getType()).getX();
+        int y = ((MouseClick) click1.getType()).getY();
+
+        Event doubleClick = new Event(new MouseDoubleClick(button, x, y), click1.getTarget());
+        doubleClick.setTimestamp(click1.getTimestamp());
+        return doubleClick;
     }
 
@@ -216,6 +293,9 @@
         int yEnd = ((MouseButtonUp) mouseButtonUp.getType()).getY();
 
-        return new Event
+        Event dragAndDrop = new Event
             (new MouseDragAndDrop(xStart, yStart, xEnd, yEnd), mouseButtonDown.getTarget());
+        
+        dragAndDrop.setTimestamp(mouseButtonDown.getTimestamp());
+        return dragAndDrop;
     }
 
@@ -248,4 +328,23 @@
      *
      */
+    private boolean timestampDifferenceSmallerThan(Event event1, Event event2, long difference) {
+        long timestamp1 = event1.getTimestamp();
+        
+        if (timestamp1 < 0) {
+            return false;
+        }
+        
+        long timestamp2 = event2.getTimestamp();
+        
+        if (timestamp2 < 0) {
+            return false;
+        }
+        
+        return (Math.abs((timestamp2 - timestamp1))) < difference;
+    }
+
+    /**
+     *
+     */
     private boolean coordinatesEqual(Event event1, Event event2) {
         int x1 =
@@ -256,6 +355,7 @@
             (event2.getType() instanceof MouseButtonInteraction) ?
                 ((MouseButtonInteraction) event2.getType()).getX() : -1;
-                
-        if ((x1 == -1) || (x1 != x2)) {
+        
+        // allow a deviation of one pixel to identify it as click anyway
+        if ((x1 == -1) || (x2 == -1) || (x2 < (x1 - 1)) || ((x1 + 1) < x2)) {
             return false;
         }
@@ -269,5 +369,5 @@
                 ((MouseButtonInteraction) event2.getType()).getY() : -1;
 
-        return (y1 != -1) && (y1 == y2);
+        return (y1 != -1) && (y2 != -1) && ((y1 - 1) < y2) && (y2 < (y1 + 1));
    }
 
