- Timestamp:
- 09/20/12 14:13:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-misc/src/main/java/de/ugoe/cs/tasktree/keyboardmaps/VirtualKey.java
r655 r838 4 4 5 5 /** 6 * TODO comment 6 * <p> 7 * Enumeration of virtual keys. 8 * </p> 7 9 * 8 * @version $Revision: $ $Date: 01.04.2012$9 * @author 2012, last modified by $Author: patrick$10 * @version 1.0 11 * @author Patrick Harms 10 12 */ 11 13 public enum VirtualKey { … … 233 235 */ 234 236 235 /** the virtual key code of the virtual key. */ 237 /** 238 * <p> 239 * Virtual key code of the virtual key. 240 * </p> 241 */ 236 242 private int virtualKeyCode = -1; 237 243 238 /** the description of the virtual key */ 244 /** 245 * <p> 246 * Description of the virtual key. 247 * </p> 248 */ 239 249 private String description; 240 250 241 251 /** 242 * 243 */ 252 * <p> 253 * Constructor. Creates a new VirtualKey. 254 * </p> 255 * 256 * @param virtualKeyCode 257 * key code of the virtual key 258 */ 244 259 private VirtualKey(int virtualKeyCode) { 245 260 this.virtualKeyCode = virtualKeyCode; … … 248 263 249 264 /** 250 * @return Returns the description. 265 * <p> 266 * Returns the description of the virtual key. 267 * </p> 268 * 269 * @return the description. 251 270 */ 252 271 String getDescription() { … … 255 274 256 275 /** 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 */ 259 282 public boolean isCombinationKey() { 260 283 switch (this) … … 273 296 274 297 /** 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 */ 277 304 public boolean isLockKey() { 278 305 switch (this) … … 289 316 290 317 /** 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 */ 293 324 public boolean isShiftKey() { 294 325 switch (this) … … 303 334 304 335 /** 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 */ 307 342 public boolean isAltKey() { 308 343 switch (this) … … 318 353 319 354 /** 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 */ 322 361 public boolean isControlKey() { 323 362 switch (this) … … 332 371 333 372 /** 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 */ 336 379 public boolean isWindowsKey() { 337 380 switch (this) … … 346 389 347 390 /** 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 */ 350 397 public boolean isMetaKey() { 351 398 switch (this) … … 360 407 361 408 /** 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 */ 364 415 public boolean isLetter() { 365 416 if (virtualKeyCode > -1) { … … 372 423 373 424 /** 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 */ 376 431 public boolean isDigit() { 377 432 if (virtualKeyCode > -1) { … … 384 439 385 440 /** 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 390 450 */ 391 451 public static VirtualKey parseVirtualKey(String string) { … … 401 461 402 462 /** 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 */ 405 473 public static VirtualKey valueOf(int number) { 406 474 for (VirtualKey virtualKey : VirtualKey.values()) {
Note: See TracChangeset
for help on using the changeset viewer.