Ignore:
Timestamp:
09/20/12 12:03:03 (12 years ago)
Author:
sherbold
Message:
  • code documentation and clean-up
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/eventcore/MFCEventTypeFactory.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.eventcore; 
    23 
     
    45 
    56import de.ugoe.cs.quest.eventcore.IEventType; 
     7import de.ugoe.cs.quest.eventcore.gui.IInteraction; 
    68import de.ugoe.cs.quest.eventcore.gui.KeyPressed; 
    79import de.ugoe.cs.quest.eventcore.gui.KeyReleased; 
     
    1416/** 
    1517 * <p> 
    16  * TODO comment 
     18 * Creates the GUI event types (i.e., {@link IInteraction}s) for MFC events. 
    1719 * </p> 
    1820 *  
    19  * @version $Revision: $ $Date: 21.08.2012$ 
    20  * @author 2012, last modified by $Author: pharms$ 
     21 * @version 1.0 
     22 * @author Patrick Harms 
    2123 */ 
    2224public class MFCEventTypeFactory { 
    23      
     25 
    2426    /** 
    2527     * <p> 
    26      * the instance of the singleton 
     28     * Instance of the singleton 
    2729     * </p> 
    2830     */ 
     
    3133    /** 
    3234     * <p> 
    33      * TODO: comment 
     35     * Constructor. Creates a new MFCEventTypeFactory. Private to preserve singleton property. 
    3436     * </p> 
    35      * 
     37     *  
    3638     */ 
    37     private MFCEventTypeFactory() { 
    38         // prevent external instantiation 
    39     } 
     39    private MFCEventTypeFactory() {} 
    4040 
    4141    /** 
    4242     * <p> 
    43      * TODO: comment 
     43     * Returns the instance of the MFCEventTypeFactory. 
    4444     * </p> 
    45      * 
    46      * @return 
     45     *  
     46     * @return the instance 
    4747     */ 
    4848    public static MFCEventTypeFactory getInstance() { 
     
    5252    /** 
    5353     * <p> 
    54      * TODO: comment 
     54     * Returns the event type based on the name and parameters of a MFC event. 
    5555     * </p> 
    56      * 
    57      * @param currentRuleName 
    58      * @return 
     56     *  
     57     * @param eventName 
     58     *            name of the MFC event 
     59     * @param messageParameters 
     60     *            parameters of the MFC event 
     61     * @return the event type 
    5962     */ 
    60     public IEventType getEventType(String              eventName, 
    61                                    Map<String, String> messageParameters) 
    62     { 
     63    public IEventType getEventType(String eventName, Map<String, String> messageParameters) { 
    6364        if ("LeftClickButton".equals(eventName)) { 
    6465            return new MouseClick(MouseButtonInteraction.Button.LEFT); 
     
    136137 
    137138    /** 
    138      * @param message 
    139      * @return 
     139     * <p> 
     140     * If the message parameters contain information about a key that has been pressed, the 
     141     * associated {@link VirtualKey} is returned. 
     142     * </p> 
     143     *  
     144     * @param messageParameters 
     145     *            the message parameters 
     146     * @return key extracted from the message parameters 
     147     * @throws IllegalArgumentException 
     148     *             thrown if the messageParameters do not contain information about a key 
    140149     */ 
    141     private VirtualKey getKey(Map<String, String> messageParameters) { 
     150    private VirtualKey getKey(Map<String, String> messageParameters) 
     151        throws IllegalArgumentException 
     152    { 
    142153        String value = null; 
    143          
     154 
    144155        if (messageParameters != null) { 
    145156            value = messageParameters.get("key"); 
    146157        } 
    147          
     158 
    148159        if (value == null) { 
    149160            throw new IllegalArgumentException 
     
    157168    /** 
    158169     * <p> 
    159      * TODO: comment 
     170     * If the message parameters contain information about a scroll position, the respective 
     171     * position is returned. 
    160172     * </p> 
    161      * 
     173     *  
    162174     * @param messageParameters 
    163      * @return 
     175     *            the message parameters 
     176     * @return the scroll position 
     177     * @throws IllegalArgumentException 
     178     *             thrown if the messageParameters do not contain information about a scroll 
     179     *             position 
    164180     */ 
    165     private int getSelectedValue(Map<String, String> messageParameters) { 
     181    private int getSelectedValue(Map<String, String> messageParameters) 
     182        throws IllegalArgumentException 
     183    { 
    166184        String value = null; 
    167          
     185 
    168186        if (messageParameters != null) { 
    169187            value = messageParameters.get("scrollPos"); 
    170188        } 
    171          
     189 
    172190        if (value == null) { 
    173191            throw new IllegalArgumentException 
Note: See TracChangeset for help on using the changeset viewer.