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

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