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

Legend:

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

    r655 r835  
     1 
    12package de.ugoe.cs.quest.plugin.jfc.eventcore; 
    23 
     
    67 
    78/** 
    8  * TODO comment 
     9 * <p> 
     10 * Enumeration to deal with JFC event ids. 
     11 * </p> 
    912 *  
    10  * @version $Revision: $ $Date: $ 
    11  * @author 2011, last modified by $Author: $ 
     13 * @version 1.0 
     14 * @author Patrick Harms 
    1215 */ 
    1316public enum JFCEventId { 
    14      
    15     MOUSE_CLICKED(MouseEvent.MOUSE_CLICKED), 
    16     MOUSE_PRESSED(MouseEvent.MOUSE_PRESSED), 
    17     MOUSE_RELEASED(MouseEvent.MOUSE_RELEASED), 
    18     MOUSE_MOVED(MouseEvent.MOUSE_MOVED), 
    19     MOUSE_ENTERED(MouseEvent.MOUSE_ENTERED), 
    20     MOUSE_EXITED(MouseEvent.MOUSE_EXITED), 
    21     MOUSE_DRAGGED(MouseEvent.MOUSE_DRAGGED), 
    22     MOUSE_WHEEL(MouseEvent.MOUSE_WHEEL), 
    23     FOCUS_GAINED(FocusEvent.FOCUS_GAINED), 
    24     FOCUS_LOST(FocusEvent.FOCUS_LOST), 
    25     KEY_TYPED(KeyEvent.KEY_TYPED), 
    26     KEY_PRESSED(KeyEvent.KEY_PRESSED), 
    27     KEY_RELEASED(KeyEvent.KEY_RELEASED); 
    2817 
    29     /** the numerical representation of the event type */ 
     18    MOUSE_CLICKED(MouseEvent.MOUSE_CLICKED), MOUSE_PRESSED(MouseEvent.MOUSE_PRESSED), 
     19    MOUSE_RELEASED(MouseEvent.MOUSE_RELEASED), MOUSE_MOVED(MouseEvent.MOUSE_MOVED), MOUSE_ENTERED( 
     20        MouseEvent.MOUSE_ENTERED), MOUSE_EXITED(MouseEvent.MOUSE_EXITED), MOUSE_DRAGGED( 
     21        MouseEvent.MOUSE_DRAGGED), MOUSE_WHEEL(MouseEvent.MOUSE_WHEEL), FOCUS_GAINED( 
     22        FocusEvent.FOCUS_GAINED), FOCUS_LOST(FocusEvent.FOCUS_LOST), KEY_TYPED(KeyEvent.KEY_TYPED), 
     23    KEY_PRESSED(KeyEvent.KEY_PRESSED), KEY_RELEASED(KeyEvent.KEY_RELEASED); 
     24 
     25    /** 
     26     * <p> 
     27     * Numerical representation of the event type. 
     28     * </p> 
     29     */ 
    3030    private int mNumber; 
    3131 
    3232    /** 
     33     * <p> 
     34     * Constructor. Creates a new JFCEventId. 
     35     * </p> 
     36     *  
    3337     * @param number 
     38     *            numerical representation of the event type. 
    3439     */ 
    3540    JFCEventId(int number) { 
     
    3843 
    3944    /** 
    40      * @return Returns the number. 
     45     * <p> 
     46     * Returns the numerical representation of the event type. 
     47     * </p> 
     48     *  
     49     * @return the numerical representation 
    4150     */ 
    4251    public int getNumber() { 
     
    4554 
    4655    /** 
    47      * 
     56     * <p> 
     57     * Parses an {@link String} and returns the respective JFCEventId if possible. 
     58     * </p> 
     59     *  
     60     * @param numberString 
     61     *            String representation of the event type 
     62     * @return created JFCEventId 
     63     * @throws IllegalArgumentException 
     64     *             thrown if there is no JFCEventId that correlates to numberString 
    4865     */ 
    49     public static JFCEventId parseEventId(String numberString) { 
     66    public static JFCEventId parseEventId(String numberString) throws IllegalArgumentException { 
    5067        try { 
    5168            int number = Integer.parseInt(numberString); 
     
    5875 
    5976    /** 
    60      * 
     77     * <p> 
     78     * Returns the JFCEventId associated with an integer. 
     79     * </p> 
     80     *  
     81     * @param number 
     82     *            integer to which the according JFCEventId is returned 
     83     * @return the JFCEventId 
     84     * @throws IllegalArgumentException 
     85     *             thrown if there is no JFCEventId that correlates to number 
    6186     */ 
    62     public static JFCEventId valueOf(int number) { 
     87    public static JFCEventId valueOf(int number) throws IllegalArgumentException { 
    6388        for (JFCEventId type : JFCEventId.values()) { 
    6489            if (type.mNumber == number) { 
Note: See TracChangeset for help on using the changeset viewer.