Changeset 837 for trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/eventcore/MFCEventTypeFactory.java
- Timestamp:
- 09/20/12 12:03:03 (12 years ago)
- 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 1 2 package de.ugoe.cs.quest.plugin.mfc.eventcore; 2 3 … … 4 5 5 6 import de.ugoe.cs.quest.eventcore.IEventType; 7 import de.ugoe.cs.quest.eventcore.gui.IInteraction; 6 8 import de.ugoe.cs.quest.eventcore.gui.KeyPressed; 7 9 import de.ugoe.cs.quest.eventcore.gui.KeyReleased; … … 14 16 /** 15 17 * <p> 16 * TODO comment18 * Creates the GUI event types (i.e., {@link IInteraction}s) for MFC events. 17 19 * </p> 18 20 * 19 * @version $Revision: $ $Date: 21.08.2012$20 * @author 2012, last modified by $Author: pharms$21 * @version 1.0 22 * @author Patrick Harms 21 23 */ 22 24 public class MFCEventTypeFactory { 23 25 24 26 /** 25 27 * <p> 26 * the instance of the singleton28 * Instance of the singleton 27 29 * </p> 28 30 */ … … 31 33 /** 32 34 * <p> 33 * TODO: comment35 * Constructor. Creates a new MFCEventTypeFactory. Private to preserve singleton property. 34 36 * </p> 35 * 37 * 36 38 */ 37 private MFCEventTypeFactory() { 38 // prevent external instantiation 39 } 39 private MFCEventTypeFactory() {} 40 40 41 41 /** 42 42 * <p> 43 * TODO: comment43 * Returns the instance of the MFCEventTypeFactory. 44 44 * </p> 45 * 46 * @return 45 * 46 * @return the instance 47 47 */ 48 48 public static MFCEventTypeFactory getInstance() { … … 52 52 /** 53 53 * <p> 54 * TODO: comment54 * Returns the event type based on the name and parameters of a MFC event. 55 55 * </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 59 62 */ 60 public IEventType getEventType(String eventName, 61 Map<String, String> messageParameters) 62 { 63 public IEventType getEventType(String eventName, Map<String, String> messageParameters) { 63 64 if ("LeftClickButton".equals(eventName)) { 64 65 return new MouseClick(MouseButtonInteraction.Button.LEFT); … … 136 137 137 138 /** 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 140 149 */ 141 private VirtualKey getKey(Map<String, String> messageParameters) { 150 private VirtualKey getKey(Map<String, String> messageParameters) 151 throws IllegalArgumentException 152 { 142 153 String value = null; 143 154 144 155 if (messageParameters != null) { 145 156 value = messageParameters.get("key"); 146 157 } 147 158 148 159 if (value == null) { 149 160 throw new IllegalArgumentException … … 157 168 /** 158 169 * <p> 159 * TODO: comment 170 * If the message parameters contain information about a scroll position, the respective 171 * position is returned. 160 172 * </p> 161 * 173 * 162 174 * @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 164 180 */ 165 private int getSelectedValue(Map<String, String> messageParameters) { 181 private int getSelectedValue(Map<String, String> messageParameters) 182 throws IllegalArgumentException 183 { 166 184 String value = null; 167 185 168 186 if (messageParameters != null) { 169 187 value = messageParameters.get("scrollPos"); 170 188 } 171 189 172 190 if (value == null) { 173 191 throw new IllegalArgumentException
Note: See TracChangeset
for help on using the changeset viewer.