source: trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui/KeyPressed.java @ 564

Last change on this file since 564 was 564, checked in by pharms, 12 years ago
  • adaptations to remove some find bugs warnings
  • Property svn:executable set to *
File size: 2.0 KB
Line 
1// Module    : $RCSfile: Click.java,v $
2// Version   : $Revision: 0.0 $  $Author: Patrick $  $Date: 06.11.2011 10:28:39 $
3// Project   : TaskTreePerformanceTest
4// Creation  : 2011 by Patrick
5// Copyright : Patrick Harms, 2011
6
7package de.ugoe.cs.quest.eventcore.gui;
8
9import de.ugoe.cs.tasktree.keyboardmaps.VirtualKey;
10
11/**
12 * TODO comment
13 *
14 * @version $Revision: $ $Date: $
15 * @author 2011, last modified by $Author: $
16 */
17public class KeyPressed extends KeyInteraction {
18
19    /**  */
20    private static final long serialVersionUID = 1L;
21
22    /**
23     * @param key
24     */
25    public KeyPressed(VirtualKey key) {
26        super(key);
27    }
28
29    /*
30     * (non-Javadoc)
31     *
32     * @see de.harms.attef.userinteraction.Interaction#getName()
33     */
34    public String getName() {
35        return "KeyPressed " + super.getKey();
36    }
37
38    /*
39     * (non-Javadoc)
40     *
41     * @see java.lang.Object#toString()
42     */
43    @Override
44    public String toString() {
45        return "pressing key " + super.getKey();
46    }
47
48    /*
49     * (non-Javadoc)
50     *
51     * @see de.harms.attef.userinteraction.Interaction#startsLogicalSequence()
52     */
53    public boolean startsLogicalSequence() {
54        // TODO handle lock keys correctly
55        return super.getKey().isCombinationKey();
56    }
57
58    /*
59     * (non-Javadoc)
60     *
61     * @see de.harms.attef.userinteraction.Interaction#finishesLogicalSequence()
62     */
63    public boolean finishesLogicalSequence() {
64        return false;
65    }
66
67    /*
68     * (non-Javadoc)
69     *
70     * @see java.lang.Object#equals(java.lang.Object)
71     */
72    @Override
73    public boolean equals(Object other) {
74        if (other instanceof KeyPressed) {
75            return (super.getKey() == ((KeyPressed) other).getKey());
76        }
77        else {
78            return false;
79        }
80    }
81
82    /* (non-Javadoc)
83     * @see java.lang.Object#hashCode()
84     */
85    @Override
86    public int hashCode() {
87        return super.getKey().hashCode();
88    }
89
90}
Note: See TracBrowser for help on using the repository browser.