Changeset 786 for trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui/MouseClickCondenser.java
- Timestamp:
- 09/06/12 16:47:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui/MouseClickCondenser.java
r721 r786 1 // Module : $RCSfile: MouseClickCondenser.java,v $ 2 // Version : $Revision: 0.0 $ $Author: pharms $ $Date: 31.08.2012 $ 3 // Project : quest-core-events 4 // Creation : 2012 by pharms 5 // Copyright : Patrick Harms, 2012 1 6 2 package de.ugoe.cs.quest.eventcore.gui; 7 3 … … 14 10 /** 15 11 * <p> 16 * This class condenses mouse clicks, i.e. it reduces a sequence of mouse button down, 17 * mouse button up and mouse click with the same button on the same event target to a single18 * mouse click with that button on that target. The mouse button down and mouse button up events19 * are discarded. For this, it iterates the provided sequence and identifies any match of the named20 * event sequencepattern. This match is condensed to the mouse click event.12 * This class condenses mouse clicks, i.e. it reduces a sequence of mouse button down, mouse button 13 * up and mouse click with the same button on the same event target to a single mouse click with 14 * that button on that target. The mouse button down and mouse button up events are discarded. For 15 * this, it iterates the provided sequence and identifies any match of the named event sequence 16 * pattern. This match is condensed to the mouse click event. 21 17 * </p> 22 18 * 23 * @version $Revision: $ $Date: 31.08.2012$24 * @author 2012, last modified by $Author: pharms$19 * @version 1.0 20 * @author Patrick Harms 25 21 */ 26 22 public class MouseClickCondenser { … … 29 25 * <p> 30 26 * This method performs the work described in the description of the class. A new list is 31 * instantiated and returned. This list is filled with the events provided by the sequence 32 * being the parameter of the method except for mouse button down and mouse button up events33 * which arefollowed by a mouse click event with the same button on the same target.27 * instantiated and returned. This list is filled with the events provided by the sequence being 28 * the parameter of the method except for mouse button down and mouse button up events which are 29 * followed by a mouse click event with the same button on the same target. 34 30 * </p> 35 31 * 36 * @param sequence the event sequence to condense the mouse clicks in 32 * @param sequence 33 * the event sequence to condense the mouse clicks in 37 34 * 38 35 * @return the resulting sequence, in which mouse clicks are condensed to single mouse click … … 41 38 public List<Event> condenseMouseClicks(List<Event> sequence) { 42 39 List<Event> resultingSequence = new LinkedList<Event>(); 43 40 44 41 int index = 0; 45 42 while (index < sequence.size()) // -2 because we don't need to go to the end
Note: See TracChangeset
for help on using the changeset viewer.