[449] | 1 | //-------------------------------------------------------------------------------------------------
|
---|
| 2 | // Module : $RCSfile: Click.java,v $
|
---|
| 3 | // Version : $Revision: 0.0 $ $Author: Patrick $ $Date: 06.11.2011 10:28:39 $
|
---|
| 4 | // Project : TaskTreePerformanceTest
|
---|
| 5 | // Creation : 2011 by Patrick
|
---|
| 6 | // Copyright : Patrick Harms, 2011
|
---|
| 7 | //-------------------------------------------------------------------------------------------------
|
---|
| 8 |
|
---|
| 9 | package de.ugoe.cs.quest.eventcore.userinteraction;
|
---|
| 10 |
|
---|
| 11 | import de.ugoe.cs.tasktree.keyboardmaps.VirtualKey;
|
---|
| 12 |
|
---|
| 13 | //-------------------------------------------------------------------------------------------------
|
---|
| 14 | /**
|
---|
| 15 | * TODO comment
|
---|
| 16 | *
|
---|
| 17 | * @version $Revision: $ $Date: $
|
---|
| 18 | * @author 2011, last modified by $Author: $
|
---|
| 19 | */
|
---|
| 20 | //-------------------------------------------------------------------------------------------------
|
---|
| 21 | public class KeyPressed extends KeyInteraction
|
---|
| 22 | {
|
---|
| 23 | //-----------------------------------------------------------------------------------------------
|
---|
| 24 | /**
|
---|
| 25 | * @param key
|
---|
| 26 | */
|
---|
| 27 | //-----------------------------------------------------------------------------------------------
|
---|
| 28 | public KeyPressed(VirtualKey key)
|
---|
| 29 | {
|
---|
| 30 | super(key);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | //-----------------------------------------------------------------------------------------------
|
---|
| 34 | /* (non-Javadoc)
|
---|
| 35 | * @see de.harms.attef.userinteraction.Interaction#getName()
|
---|
| 36 | */
|
---|
| 37 | //-----------------------------------------------------------------------------------------------
|
---|
| 38 | public String getName()
|
---|
| 39 | {
|
---|
| 40 | return "KeyPressed " + super.getKey();
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | //-----------------------------------------------------------------------------------------------
|
---|
| 44 | /* (non-Javadoc)
|
---|
| 45 | * @see java.lang.Object#toString()
|
---|
| 46 | */
|
---|
| 47 | //-----------------------------------------------------------------------------------------------
|
---|
| 48 | @Override
|
---|
| 49 | public String toString()
|
---|
| 50 | {
|
---|
| 51 | return "pressing key " + super.getKey();
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | //-----------------------------------------------------------------------------------------------
|
---|
| 55 | /* (non-Javadoc)
|
---|
| 56 | * @see de.harms.attef.userinteraction.Interaction#startsLogicalSequence()
|
---|
| 57 | */
|
---|
| 58 | //-----------------------------------------------------------------------------------------------
|
---|
| 59 | public boolean startsLogicalSequence()
|
---|
| 60 | {
|
---|
| 61 | // TODO handle lock keys correctly
|
---|
| 62 | return super.getKey().isCombinationKey();
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | //-----------------------------------------------------------------------------------------------
|
---|
| 66 | /* (non-Javadoc)
|
---|
| 67 | * @see de.harms.attef.userinteraction.Interaction#finishesLogicalSequence()
|
---|
| 68 | */
|
---|
| 69 | //-----------------------------------------------------------------------------------------------
|
---|
| 70 | public boolean finishesLogicalSequence()
|
---|
| 71 | {
|
---|
| 72 | // TODO Auto-generated method stub
|
---|
| 73 | return false;
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | //-----------------------------------------------------------------------------------------------
|
---|
| 77 | /* (non-Javadoc)
|
---|
| 78 | * @see java.lang.Object#equals(java.lang.Object)
|
---|
| 79 | */
|
---|
| 80 | //-----------------------------------------------------------------------------------------------
|
---|
| 81 | @Override
|
---|
| 82 | public boolean equals(Object other)
|
---|
| 83 | {
|
---|
| 84 | if (other instanceof KeyPressed)
|
---|
| 85 | {
|
---|
| 86 | return (super.getKey() == ((KeyPressed) other).getKey());
|
---|
| 87 | }
|
---|
| 88 | else
|
---|
| 89 | {
|
---|
| 90 | return false;
|
---|
| 91 | }
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 | }
|
---|