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

Legend:

Unmodified
Added
Removed
  • trunk/quest-misc/src/main/java/de/ugoe/cs/tasktree/keyboardmaps/VirtualKey.java

    r655 r838  
    44 
    55/** 
    6  * TODO comment 
     6 * <p> 
     7 * Enumeration of virtual keys. 
     8 * </p> 
    79 *  
    8  * @version $Revision: $ $Date: 01.04.2012$ 
    9  * @author 2012, last modified by $Author: patrick$ 
     10 * @version 1.0 
     11 * @author Patrick Harms 
    1012 */ 
    1113public enum VirtualKey { 
     
    233235     */ 
    234236 
    235     /** the virtual key code of the virtual key. */ 
     237    /** 
     238     * <p> 
     239     * Virtual key code of the virtual key. 
     240     * </p> 
     241     */ 
    236242    private int virtualKeyCode = -1; 
    237243 
    238     /** the description of the virtual key */ 
     244    /** 
     245     * <p> 
     246     * Description of the virtual key. 
     247     * </p> 
     248     */ 
    239249    private String description; 
    240250 
    241251    /** 
    242    * 
    243    */ 
     252     * <p> 
     253     * Constructor. Creates a new VirtualKey. 
     254     * </p> 
     255     *  
     256     * @param virtualKeyCode 
     257     *            key code of the virtual key 
     258     */ 
    244259    private VirtualKey(int virtualKeyCode) { 
    245260        this.virtualKeyCode = virtualKeyCode; 
     
    248263 
    249264    /** 
    250      * @return Returns the description. 
     265     * <p> 
     266     * Returns the description of the virtual key. 
     267     * </p> 
     268     *  
     269     * @return the description. 
    251270     */ 
    252271    String getDescription() { 
     
    255274 
    256275    /** 
    257    * 
    258    */ 
     276     * <p> 
     277     * Returns whether the key is a combination key (e.g., shift, alt) or not. 
     278     * </p> 
     279     *  
     280     * @return true, if the key is a combiniation key; false otherwise 
     281     */ 
    259282    public boolean isCombinationKey() { 
    260283        switch (this) 
     
    273296 
    274297    /** 
    275    * 
    276    */ 
     298     * <p> 
     299     * Returns whether the key is a lock key (e.g., caps lock, num lock) or not. 
     300     * </p> 
     301     *  
     302     * @return true, if the key is a lock key; false otherwise 
     303     */ 
    277304    public boolean isLockKey() { 
    278305        switch (this) 
     
    289316 
    290317    /** 
    291    * 
    292    */ 
     318     * <p> 
     319     * Returns whether the key is shift. 
     320     * </p> 
     321     *  
     322     * @return true, if the key is shift; false otherwise 
     323     */ 
    293324    public boolean isShiftKey() { 
    294325        switch (this) 
     
    303334 
    304335    /** 
    305    * 
    306    */ 
     336     * <p> 
     337     * Returns whether the is an alt key. 
     338     * </p> 
     339     *  
     340     * @return true, if the key is alt or altgr; false otherwise 
     341     */ 
    307342    public boolean isAltKey() { 
    308343        switch (this) 
     
    318353 
    319354    /** 
    320    * 
    321    */ 
     355     * <p> 
     356     * Returns whether the key is control. 
     357     * </p> 
     358     *  
     359     * @return true, if the key is control; false otherwise 
     360     */ 
    322361    public boolean isControlKey() { 
    323362        switch (this) 
     
    332371 
    333372    /** 
    334    * 
    335    */ 
     373     * <p> 
     374     * Returns whether the key is the windows key. 
     375     * </p> 
     376     *  
     377     * @return true, if the key is the windows key; false otherwise 
     378     */ 
    336379    public boolean isWindowsKey() { 
    337380        switch (this) 
     
    346389 
    347390    /** 
    348    * 
    349    */ 
     391     * <p> 
     392     * Returns whether the key is the meta key. 
     393     * </p> 
     394     *  
     395     * @return true, if the key is the meta key; false otherwise 
     396     */ 
    350397    public boolean isMetaKey() { 
    351398        switch (this) 
     
    360407 
    361408    /** 
    362    * 
    363    */ 
     409     * <p> 
     410     * Returns whether the key is a letter. 
     411     * </p> 
     412     *  
     413     * @return true, if the key is a letter; false otherwise 
     414     */ 
    364415    public boolean isLetter() { 
    365416        if (virtualKeyCode > -1) { 
     
    372423 
    373424    /** 
    374    * 
    375    */ 
     425     * <p> 
     426     * Returns whether the key is a digit. 
     427     * </p> 
     428     *  
     429     * @return true, if the key is a digit; false otherwise 
     430     */ 
    376431    public boolean isDigit() { 
    377432        if (virtualKeyCode > -1) { 
     
    384439 
    385440    /** 
    386      * TODO: comment 
    387      *  
    388      * @param parameter 
    389      * @return 
     441     * <p> 
     442     * Parses an {@link String} and returns the respective VirtualKey if possible. 
     443     * </p> 
     444     *  
     445     * @param numberString 
     446     *            String representation of the virtual key 
     447     * @return created VirtualKey 
     448     * @throws IllegalArgumentException 
     449     *             thrown if there is no VirtualKey that correlates to string 
    390450     */ 
    391451    public static VirtualKey parseVirtualKey(String string) { 
     
    401461 
    402462    /** 
    403    * 
    404    */ 
     463     * <p> 
     464     * Returns the VirtualKey associated with an integer. 
     465     * </p> 
     466     *  
     467     * @param number 
     468     *            integer to which the according VirtualKey is returned 
     469     * @return the VirtualKey 
     470     * @throws IllegalArgumentException 
     471     *             thrown if there is no VirtualKey that correlates to number 
     472     */ 
    405473    public static VirtualKey valueOf(int number) { 
    406474        for (VirtualKey virtualKey : VirtualKey.values()) { 
Note: See TracChangeset for help on using the changeset viewer.