Changeset 780 for trunk


Ignore:
Timestamp:
09/06/12 13:14:24 (12 years ago)
Author:
sherbold
Message:
  • code documentation
Location:
trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/IEventTarget.java

    r681 r780  
     1 
    12package de.ugoe.cs.quest.eventcore; 
    23 
     
    45 
    56/** 
    6  *  
    77 * <p> 
    8  * TODO comment 
     8 * Common interface for event targets. An event target can, e.g., be an element of a GUI or Web 
     9 * server. A concrete event-driven software platform can define its event targets through the 
     10 * implementation of this interface. 
    911 * </p> 
    1012 *  
    11  * @version $Revision: $ $Date: Aug 16, 2012$ 
    12  * @author 2012, last modified by $Author: sherbold$ 
     13 * @version 1.0 
     14 * @author Steffen Herbold 
    1315 */ 
    1416public interface IEventTarget extends Serializable { 
    1517 
     18    /** 
     19     * <p> 
     20     * Returns the name of event-driven software platform to which the target belongs. 
     21     * </p> 
     22     *  
     23     * @return name of the platform 
     24     */ 
    1625    public String getPlatform(); 
    17      
     26 
     27    /** 
     28     * <p> 
     29     * Returns a string identifier of the target. This is very convenient for visualizations of 
     30     * events. 
     31     * </p> 
     32     *  
     33     * @return target identifier 
     34     */ 
    1835    public String getStringIdentifier(); 
    1936} 
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/IEventType.java

    r543 r780  
     1 
    12package de.ugoe.cs.quest.eventcore; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Common interface for event types. An event type can be, e.g., a mouse click, a keyboard 
     9 * interactions in case of GUI platforms or a HTTP request in case of a Web application. 
    810 * </p> 
    911 *  
    10  * @version $Revision: $ $Date: Aug 16, 2012$ 
    11  * @author 2012, last modified by $Author: sherbold$ 
     12 * @version 1.0 
     13 * @author Steffen Herbold 
    1214 */ 
    1315public interface IEventType extends Serializable { 
    1416 
    1517    /** 
    16      * @return 
     18     * <p> 
     19     * Returns the name of the event type. 
     20     * </p> 
     21     *  
     22     * @return name of the event type 
    1723     */ 
    1824    public String getName(); 
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui/KeyInteractionSorter.java

    r765 r780  
    1414 
    1515/** 
    16  *  
    1716 * <p> 
    18  * TODO comment 
     17 * This class provides the functionality to sort and clean up all key interactions in a log. In 
     18 * particular: 
     19 * <ol> 
     20 * <li>In case a combination key (e.g., shift, alt, control) is held down, multiple 
     21 * {@link KeyPressed} events are logged, even though only the first one is of importance. This class 
     22 * removes all {@link KeyPressed} events for combination keys except the first.</li> 
     23 * <li>In case a normal key is held down, multiple {@link KeyPressed} events are logged, but there 
     24 * is only one {@link KeyReleased} event. This class adds a {@link KeyReleased} event for all such 
     25 * {@link KeyPressed} events.</li> 
     26 * <li>Due to message filtering of applications, it is possible that a {@link KeyReleased} event 
     27 * without a preceding {@link KeyPressed} event is logged. This class either adds the missing 
     28 * {@link KeyPressed} right in front of the {@link KeyReleased} or removes the {@link KeyReleased} 
     29 * depending on the {@link #mode}. 
     30 * <li>As a result of steps 2-3, we have always a matching {@link KeyPressed}/{@link KeyReleased} 
     31 * pairs for all normal keys. This class replaces these pairs with a {@link KeyTyped} event at the 
     32 * position of the {@link KeyPressed} event.</li> 
     33 * <li>Sometimes combination keys are not released in the same order they have been pressed. This 
     34 * class ensures that the {@link KeyReleased} are in the opposite order of the {@link KeyPressed} 
     35 * events for all combination keys.</li> 
     36 * </ol> 
    1937 * </p> 
    2038 *  
    21  * @version $Revision: $ $Date: Sep 4, 2012$ 
    22  * @author 2012, last modified by $Author: sherbold$ 
     39 * @version 1.0 
     40 * @author Steffen Herbold 
    2341 */ 
    2442public class KeyInteractionSorter { 
     
    2947     * </p> 
    3048     *  
    31      * @version $Revision: $ $Date: Sep 3, 2012$ 
    32      * @author 2012, last modified by $Author: sherbold$ 
     49     * @version 1.0 
     50     * @author Steffen Herbold 
    3351     */ 
    3452    public static enum CleanupMode { 
    35         REMOVAL, ADDITION 
     53        /** 
     54         * <p> 
     55         * Single {@link KeyReleased} are removed from the sequence. 
     56         * </p> 
     57         */ 
     58        REMOVAL, 
     59 
     60        /** 
     61         * <p> 
     62         * {@link KeyPressed} events are added to single {@link KeyReleased} events 
     63         * </p> 
     64         */ 
     65        ADDITION 
    3666    }; 
    3767 
     68    /** 
     69     * <p> 
     70     *  
     71     * </p> 
     72     */ 
    3873    private final CleanupMode mode; 
    3974 
     75    /** 
     76     * <p> 
     77     * Constructor. Creates a new {@link KeyInteractionSorter} with {@link #mode}= 
     78     * {@link CleanupMode#ADDITION}. 
     79     * </p> 
     80     */ 
    4081    public KeyInteractionSorter() { 
    4182        this(CleanupMode.ADDITION); 
    4283    } 
    4384 
     85    /** 
     86     * <p> 
     87     * Constructor. Creates a new {@link KeyInteractionSorter}. 
     88     * </p> 
     89     *  
     90     * @param mode 
     91     *            {@link #mode} of the instance 
     92     */ 
    4493    public KeyInteractionSorter(CleanupMode mode) { 
    4594        this.mode = mode; 
    4695    } 
    4796 
     97    /** 
     98     * <p> 
     99     * Sorts and cleans up key interactions according to the class specification (@see 
     100     * {@link KeyInteractionSorter} class comment). 
     101     * </p> 
     102     * <p> 
     103     * This method returns a sorted copy of a sequence, the sequence itself is not changed. 
     104     * </p> 
     105     *  
     106     * @param sequence 
     107     *            sequence which is sorted 
     108     * @return sorted copy of sequence 
     109     */ 
    48110    public List<Event> sortKeyInteractions(final List<Event> sequence) { 
    49111        List<Event> sortedSequence = new LinkedList<Event>(sequence); 
     
    55117    } 
    56118 
     119    /** 
     120     * <p> 
     121     * Performs tasks 1-4 defined in the class description. Operations are performed in-place on the 
     122     * passed sequence. 
     123     * </p> 
     124     *  
     125     * @param sequence 
     126     *            sequence which is sorted 
     127     */ 
    57128    private void sortCombinationKeyPairs(List<Event> sequence) { 
    58129        LinkedList<VirtualKey> pressedCombinationKeys = new LinkedList<VirtualKey>(); 
     
    99170    } 
    100171 
     172    /** 
     173     * <p> 
     174     * Performs task 5 defined in the class description. Operations are performed in-place on the 
     175     * passed sequence. 
     176     * </p> 
     177     *  
     178     * @param sequence 
     179     *            sequence which is sorted 
     180     */ 
    101181    private void handleIncompleteKeyPairs(List<Event> sequence) { 
    102182        Set<VirtualKey> pressedKeys = new HashSet<VirtualKey>(); 
Note: See TracChangeset for help on using the changeset viewer.