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 967)
+++ trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClickCondenser.java	(revision 995)
@@ -30,5 +30,4 @@
  * condensed to the mouse click event.
  * </p>
- * TODO correctly identify drag and drop
  * 
  * @version 1.0
@@ -78,4 +77,10 @@
                     mouseClickHandled = true;
                 }
+                else if (mouseDragAndDropSequenceFound(mbDown, mbUp)) {
+                    // skip the mouse button down and mouse button up event and add a mouse click
+                    index += 2;
+                    resultingSequence.add(createDragAndDrop(mbDown, mbUp));
+                    mouseClickHandled = true;
+                }
             }
 
@@ -105,26 +110,13 @@
         }
 
-        IEventTarget eventTarget = mouseButtonDown.getTarget();
-
-        if (!eventTarget.equals(mouseClick.getTarget())) {
-            return false;
-        }
-
-        MouseButtonInteraction.Button button =
-            ((MouseButtonDown) mouseButtonDown.getType()).getButton();
-
-        if (!button.equals(((MouseClick) mouseClick.getType()).getButton())) {
-            return false;
-        }
-
-        int x = ((MouseButtonDown) mouseButtonDown.getType()).getX();
-
-        if (x != ((MouseClick) mouseClick.getType()).getX()) {
-            return false;
-        }
-        
-        int y = ((MouseButtonDown) mouseButtonDown.getType()).getY();
-
-        if (y != ((MouseClick) mouseClick.getType()).getY()) {
+        if (!targetsEqual(mouseButtonDown, mouseClick)) {
+            return false;
+        }
+        
+        if (!buttonsEqual(mouseButtonDown, mouseClick)) {
+            return false;
+        }
+
+        if (!coordinatesEqual(mouseButtonDown, mouseClick)) {
             return false;
         }
@@ -149,26 +141,51 @@
         }
 
-        IEventTarget eventTarget = mouseButtonDown.getTarget();
-
-        if (!eventTarget.equals(mouseButtonUp.getTarget())) {
-            return false;
-        }
-
+        if (!targetsEqual(mouseButtonDown, mouseButtonUp)) {
+            return false;
+        }
+        
+        if (!buttonsEqual(mouseButtonDown, mouseButtonUp)) {
+            return false;
+        }
+
+        if (!coordinatesEqual(mouseButtonDown, mouseButtonUp)) {
+            return false;
+        }
+        
+        return true;
+    }
+
+    /**
+     * 
+     */
+    private boolean mouseDragAndDropSequenceFound(Event mouseButtonDown,
+                                                  Event mouseButtonUp)
+    {
+        // check the first in a row of three for validity
+        if (!(mouseButtonDown.getType() instanceof MouseButtonDown)) {
+            return false;
+        }
+
+        // check the second node for validity
+        if (!(mouseButtonUp.getType() instanceof MouseButtonUp)) {
+            return false;
+        }
+
+        if (!targetsEqual(mouseButtonDown, mouseButtonUp)) {
+            return false;
+        }
+        
         MouseButtonInteraction.Button button =
             ((MouseButtonDown) mouseButtonDown.getType()).getButton();
-
-        if (!button.equals(((MouseButtonUp) mouseButtonUp.getType()).getButton())) {
-            return false;
-        }
-
-        int x = ((MouseButtonDown) mouseButtonDown.getType()).getX();
-
-        if (x != ((MouseButtonUp) mouseButtonUp.getType()).getX()) {
-            return false;
-        }
-        
-        int y = ((MouseButtonDown) mouseButtonDown.getType()).getY();
-
-        if (y != ((MouseButtonUp) mouseButtonUp.getType()).getY()) {
+        
+        if (MouseButtonInteraction.Button.LEFT != button) {
+            return false;
+        }
+        
+        if (!buttonsEqual(mouseButtonDown, mouseButtonUp)) {
+            return false;
+        }
+
+        if (coordinatesEqual(mouseButtonDown, mouseButtonUp)) {
             return false;
         }
@@ -190,3 +207,68 @@
     }
 
+    /**
+     *
+     */
+    private Event createDragAndDrop(Event mouseButtonDown, Event mouseButtonUp) {
+        int xStart = ((MouseButtonDown) mouseButtonDown.getType()).getX();
+        int yStart = ((MouseButtonDown) mouseButtonDown.getType()).getY();
+        int xEnd = ((MouseButtonUp) mouseButtonUp.getType()).getX();
+        int yEnd = ((MouseButtonUp) mouseButtonUp.getType()).getY();
+
+        return new Event
+            (new MouseDragAndDrop(xStart, yStart, xEnd, yEnd), mouseButtonDown.getTarget());
+    }
+
+    /**
+     *
+     */
+    private boolean targetsEqual(Event event1, Event event2) {
+        IEventTarget target1 = event1.getTarget();
+        IEventTarget target2 = event2.getTarget();
+
+        return target1 == null ? target2 == null : target1.equals(target2);
+    }
+
+    /**
+     *
+     */
+    private boolean buttonsEqual(Event event1, Event event2) {
+        MouseButtonInteraction.Button button1 =
+            (event1.getType() instanceof MouseButtonInteraction) ?
+                ((MouseButtonInteraction) event1.getType()).getButton() : null;
+                
+        MouseButtonInteraction.Button button2 =
+            (event2.getType() instanceof MouseButtonInteraction) ?
+                ((MouseButtonInteraction) event2.getType()).getButton() : null;
+
+        return button1 == null ? button2 == null : button1.equals(button2);
+    }
+
+    /**
+     *
+     */
+    private boolean coordinatesEqual(Event event1, Event event2) {
+        int x1 =
+            (event1.getType() instanceof MouseButtonInteraction) ?
+                ((MouseButtonInteraction) event1.getType()).getX() : -1;
+               
+        int x2 =
+            (event2.getType() instanceof MouseButtonInteraction) ?
+                ((MouseButtonInteraction) event2.getType()).getX() : -1;
+                
+        if ((x1 == -1) || (x1 != x2)) {
+            return false;
+        }
+
+        int y1 =
+            (event1.getType() instanceof MouseButtonInteraction) ?
+                ((MouseButtonInteraction) event1.getType()).getY() : -1;
+                           
+        int y2 =
+            (event2.getType() instanceof MouseButtonInteraction) ?
+                ((MouseButtonInteraction) event2.getType()).getY() : -1;
+
+        return (y1 != -1) && (y1 == y2);
+   }
+
 }
Index: trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseDragAndDrop.java
===================================================================
--- trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseDragAndDrop.java	(revision 995)
+++ trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseDragAndDrop.java	(revision 995)
@@ -0,0 +1,147 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.eventcore.gui;
+
+/**
+ * <p>
+ * Event type for a mouse drag and drop, i.e., pressing the left mouse button on an element,
+ * moving the mouse and releasing the mouse button afterwards.
+ * </p>
+ * 
+ * @version 1.0
+ * @author Patrick Harms
+ */
+public class MouseDragAndDrop extends MouseButtonInteraction {
+
+    /**
+     * <p>
+     * Id for object serialization.
+     * </p>
+     */
+    private static final long serialVersionUID = 1L;
+    
+    /**
+     * <p>
+     * the x coordinate, where the drag started
+     * </p>
+     */
+    private int xStart;
+    
+    /**
+     * <p>
+     * the y coordinate, where the drag started
+     * </p>
+     */
+    private int yStart;
+
+    /**
+     * <p>
+     * Constructor. Creates a new {@link MouseDragAndDrop} event type with the left mouse button
+     * as button per default
+     * </p>
+     * 
+     * @param xStart the x coordinate, where the drag started
+     * @param yStart the y coordinate, where the drag started
+     * @param xEnd   the x coordinate, where the drop ended
+     * @param yEnd   the y coordinate, where the drop ended
+     * 
+     * 
+     * @see MouseButtonInteraction#MouseButtonInteraction(Button,int,int)
+     */
+    public MouseDragAndDrop(int xStart, int yStart, int xEnd, int yEnd) {
+        super(Button.LEFT, xEnd, yEnd);
+        this.xStart = xStart;
+        this.yStart = yStart;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.harms.attef.userinteraction.Interaction#getName()
+     */
+    public String getName() {
+        return "MouseDragAndDrop";
+    }
+
+    /**
+     * @return the x coordinate, where the drag started
+     */
+    public int getXStart() {
+        return xStart;
+    }
+
+    /**
+     * @return the y coordinate, where the drag started
+     */
+    public int getYStart() {
+        return yStart;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return "mouse drag and drop ((" +
+            xStart + "," + yStart + ")-->(" + getX() + "," + getY() + "))";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.harms.attef.userinteraction.Interaction#startsLogicalSequence()
+     */
+    public boolean startsLogicalSequence() {
+        return false;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.harms.attef.userinteraction.Interaction#finishesLogicalSequence()
+     */
+    public boolean finishesLogicalSequence() {
+        return false;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof MouseDragAndDrop) {
+            return
+                (getX() == ((MouseDragAndDrop) obj).getX()) &&
+                (getY() == ((MouseDragAndDrop) obj).getY()) &&
+                (getXStart() == ((MouseDragAndDrop) obj).getXStart()) &&
+                (getYStart() == ((MouseDragAndDrop) obj).getYStart());
+        }
+        return false;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return getX() + getY() + getXStart() + getYStart();
+    }
+}
