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/WindowsVirtualKey.java

    r655 r837  
    55 
    66/** 
    7  * TODO comment 
     7 * <p> 
     8 * Map of virtual keys for MFC. 
     9 * </p> 
    810 *  
    9  * @version $Revision: $ $Date: $ 
    10  * @author 2011, last modified by $Author: $ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1113 */ 
    12 // ------------------------------------------------------------------------------------------------- 
    13  
    14 public enum WindowsVirtualKey 
    15 { 
     14public enum WindowsVirtualKey { 
    1615    // VK_LBUTTON (0x01, "Left mouse button"), 
    1716    // VK_RBUTTON (0x02, "Right mouse button"), 
     
    168167    // VK_OEM_CLEAR (0xFE, "Clear key"); 
    169168 
    170     /** the id of the virtual key */ 
     169    /** 
     170     * <p> 
     171     * Numerical representation of the virtual key. 
     172     * </p> 
     173     */ 
    171174    private int mNumber; 
    172175 
    173     /** the <code>Key</code> represented by this virtual key */ 
     176    /** 
     177     * <p> 
     178     * {@link VirtualKey} represented by this WindowsVirtualKey 
     179     * </p> 
     180     */ 
    174181    private VirtualKey mRepresentedKey; 
    175182 
    176     // ----------------------------------------------------------------------------------------------- 
    177     /** 
     183    /** 
     184     * <p> 
     185     * Constructor. Creates a new WindowsVirtualKey. 
     186     * </p> 
     187     *  
    178188     * @param number 
    179      */ 
    180     // ----------------------------------------------------------------------------------------------- 
    181     WindowsVirtualKey(int number, VirtualKey representedKey) 
    182     { 
     189     *            numerical representation of the virtual key 
     190     * @param representedKey 
     191     *            virtual key that is represented 
     192     */ 
     193    WindowsVirtualKey(int number, VirtualKey representedKey) { 
    183194        mNumber = number; 
    184195        mRepresentedKey = representedKey; 
    185196    } 
    186197 
    187     // ----------------------------------------------------------------------------------------------- 
    188     /** 
    189      * @return Returns the number. 
    190      */ 
    191     // ----------------------------------------------------------------------------------------------- 
    192     int getNumber() 
    193     { 
     198    /** 
     199     * <p> 
     200     * Returns the numerical representation of the virtual key. 
     201     * </p> 
     202     *  
     203     * @return the numerical representation 
     204     */ 
     205    int getNumber() { 
    194206        return mNumber; 
    195207    } 
    196208 
    197     // ----------------------------------------------------------------------------------------------- 
    198     /** 
    199    * 
    200    */ 
    201     // ----------------------------------------------------------------------------------------------- 
    202     public static WindowsVirtualKey parseVirtualKey(String string) 
    203     { 
    204         for (WindowsVirtualKey virtualKey : WindowsVirtualKey.values()) 
    205         { 
    206             if (virtualKey.mNumber == Integer.parseInt(string)) 
    207             { 
     209    /** 
     210     * <p> 
     211     * Parses an {@link String} and returns the respective WindowsVirtualKey if possible. 
     212     * </p> 
     213     *  
     214     * @param string 
     215     *            String representation of the event type 
     216     * @return created WindowsVirtualKey 
     217     * @throws IllegalArgumentException 
     218     *             thrown if there is no WindowsVirtualKey that correlates to string 
     219     */ 
     220    public static WindowsVirtualKey parseVirtualKey(String string) throws IllegalArgumentException { 
     221        for (WindowsVirtualKey virtualKey : WindowsVirtualKey.values()) { 
     222            if (virtualKey.mNumber == Integer.parseInt(string)) { 
    208223                return virtualKey; 
    209224            } 
     
    213228    } 
    214229 
    215     // ----------------------------------------------------------------------------------------------- 
    216     /** 
    217    * 
    218    */ 
    219     // ----------------------------------------------------------------------------------------------- 
    220     public static WindowsVirtualKey valueOf(int number) 
    221     { 
    222         for (WindowsVirtualKey virtualKey : WindowsVirtualKey.values()) 
    223         { 
    224             if (virtualKey.mNumber == number) 
    225             { 
     230    /** 
     231     * <p> 
     232     * Returns the WindowsVirtualKey associated with an integer. 
     233     * </p> 
     234     *  
     235     * @param number 
     236     *            integer to which the according WindowsVirtualKey is returned 
     237     * @return the WindowsVirtualKey 
     238     * @throws IllegalArgumentException 
     239     *             thrown if there is no WindowsVirtualKey that correlates to number 
     240     */ 
     241    public static WindowsVirtualKey valueOf(int number) throws IllegalArgumentException { 
     242        for (WindowsVirtualKey virtualKey : WindowsVirtualKey.values()) { 
     243            if (virtualKey.mNumber == number) { 
    226244                return virtualKey; 
    227245            } 
     
    231249    } 
    232250 
    233     // ----------------------------------------------------------------------------------------------- 
    234     /** 
    235      * TODO: comment 
    236      *  
    237      * @return 
    238      */ 
    239     // ----------------------------------------------------------------------------------------------- 
    240     public VirtualKey getKey() 
    241     { 
     251    /** 
     252     * <p> 
     253     * Returns the {@link VirtualKey} associated with this WindowsVirtualKey. 
     254     * </p> 
     255     *  
     256     * @return the virtual key 
     257     */ 
     258    public VirtualKey getKey() { 
    242259        return mRepresentedKey; 
    243260    } 
Note: See TracChangeset for help on using the changeset viewer.