Last change
on this file since 765 was
765,
checked in by sherbold, 12 years ago
|
- complete rewrite of keyboard interaction sorting. As a result, the command cleanupKeyInteractions is deprecated.
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.6 KB
|
Line | |
---|
1 | |
---|
2 | package de.ugoe.cs.quest.eventcore.gui; |
---|
3 | |
---|
4 | import de.ugoe.cs.tasktree.keyboardmaps.VirtualKey; |
---|
5 | |
---|
6 | public class KeyTyped extends KeyInteraction { |
---|
7 | |
---|
8 | /** */ |
---|
9 | private static final long serialVersionUID = 1L; |
---|
10 | |
---|
11 | /** |
---|
12 | * @param key |
---|
13 | */ |
---|
14 | public KeyTyped(VirtualKey key) { |
---|
15 | super(key); |
---|
16 | } |
---|
17 | |
---|
18 | /* |
---|
19 | * (non-Javadoc) |
---|
20 | * |
---|
21 | * @see de.harms.attef.userinteraction.Interaction#getName() |
---|
22 | */ |
---|
23 | public String getName() { |
---|
24 | return "KeyTyped " + super.getKey(); |
---|
25 | } |
---|
26 | |
---|
27 | /* |
---|
28 | * (non-Javadoc) |
---|
29 | * |
---|
30 | * @see java.lang.Object#toString() |
---|
31 | */ |
---|
32 | @Override |
---|
33 | public String toString() { |
---|
34 | return "typed key " + super.getKey(); |
---|
35 | } |
---|
36 | |
---|
37 | /* |
---|
38 | * (non-Javadoc) |
---|
39 | * |
---|
40 | * @see de.harms.attef.userinteraction.Interaction#startsLogicalSequence() |
---|
41 | */ |
---|
42 | public boolean startsLogicalSequence() { |
---|
43 | // TODO handle lock keys correctly |
---|
44 | return super.getKey().isCombinationKey(); |
---|
45 | } |
---|
46 | |
---|
47 | /* |
---|
48 | * (non-Javadoc) |
---|
49 | * |
---|
50 | * @see de.harms.attef.userinteraction.Interaction#finishesLogicalSequence() |
---|
51 | */ |
---|
52 | public boolean finishesLogicalSequence() { |
---|
53 | return false; |
---|
54 | } |
---|
55 | |
---|
56 | /* |
---|
57 | * (non-Javadoc) |
---|
58 | * |
---|
59 | * @see java.lang.Object#equals(java.lang.Object) |
---|
60 | */ |
---|
61 | @Override |
---|
62 | public boolean equals(Object other) { |
---|
63 | if (other instanceof KeyTyped) { |
---|
64 | return (super.getKey() == ((KeyTyped) other).getKey()); |
---|
65 | } |
---|
66 | else { |
---|
67 | return false; |
---|
68 | } |
---|
69 | } |
---|
70 | |
---|
71 | /* |
---|
72 | * (non-Javadoc) |
---|
73 | * |
---|
74 | * @see java.lang.Object#hashCode() |
---|
75 | */ |
---|
76 | @Override |
---|
77 | public int hashCode() { |
---|
78 | return super.getKey().hashCode(); |
---|
79 | } |
---|
80 | |
---|
81 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.