[439] | 1 | //------------------------------------------------------------------------------------------------- |
---|
| 2 | // Module : $RCSfile: TextInputSequenceImpl.java,v $ |
---|
| 3 | // Version : $Revision: 0.0 $ $Author: patrick $ $Date: 10.06.2012 $ |
---|
| 4 | // Project : TaskTreeImpl |
---|
| 5 | // Creation : 2012 by patrick |
---|
| 6 | // Copyright : Patrick Harms, 2012 |
---|
| 7 | //------------------------------------------------------------------------------------------------- |
---|
| 8 | package de.ugoe.cs.quest.tasktrees.treeimpl; |
---|
| 9 | |
---|
[451] | 10 | import de.ugoe.cs.quest.eventcore.guimodel.GUIElement; |
---|
| 11 | import de.ugoe.cs.quest.eventcore.userinteraction.TextInput; |
---|
[439] | 12 | import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNode; |
---|
| 13 | import de.ugoe.cs.quest.tasktrees.treeifc.TextInputInteractionTask; |
---|
| 14 | |
---|
| 15 | //------------------------------------------------------------------------------------------------- |
---|
| 16 | /** |
---|
| 17 | * TODO comment |
---|
| 18 | * |
---|
| 19 | * @version $Revision: $ $Date: 10.06.2012$ |
---|
| 20 | * @author 2012, last modified by $Author: patrick$ |
---|
| 21 | */ |
---|
| 22 | //------------------------------------------------------------------------------------------------- |
---|
| 23 | public class TextInputInteractionTaskImpl extends InteractionTaskImpl |
---|
| 24 | implements TextInputInteractionTask |
---|
| 25 | { |
---|
| 26 | |
---|
| 27 | /** the text, that was finally entered in this sequence without all backspaces, etc. */ |
---|
| 28 | private String mEnteredText; |
---|
| 29 | |
---|
| 30 | //----------------------------------------------------------------------------------------------- |
---|
| 31 | /** |
---|
| 32 | * TODO: comment |
---|
| 33 | * |
---|
| 34 | * @param name |
---|
| 35 | */ |
---|
| 36 | //----------------------------------------------------------------------------------------------- |
---|
| 37 | TextInputInteractionTaskImpl(GUIElement guiElement) |
---|
| 38 | { |
---|
| 39 | super(guiElement, new TextInput()); |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | //----------------------------------------------------------------------------------------------- |
---|
| 43 | /* (non-Javadoc) |
---|
| 44 | * @see de.ugoe.cs.tasktree.treeimpl.TaskTreeNodeImpl#clone() |
---|
| 45 | */ |
---|
| 46 | //----------------------------------------------------------------------------------------------- |
---|
| 47 | @Override |
---|
| 48 | public TextInputInteractionTaskImpl clone() |
---|
| 49 | { |
---|
| 50 | TextInputInteractionTaskImpl clone = new TextInputInteractionTaskImpl(super.getGUIElement()); |
---|
| 51 | clone.setDescription(super.getDescription()); |
---|
| 52 | clone.setEnteredText(this.getEnteredText()); |
---|
| 53 | |
---|
| 54 | for (TaskTreeNode child : getChildren()) |
---|
| 55 | { |
---|
| 56 | clone.addChild(child); |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | return clone; |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | //----------------------------------------------------------------------------------------------- |
---|
| 63 | /* (non-Javadoc) |
---|
| 64 | * @see de.ugoe.cs.tasktree.treeifc.TextInputSequence#getEnteredText() |
---|
| 65 | */ |
---|
| 66 | //----------------------------------------------------------------------------------------------- |
---|
| 67 | @Override |
---|
| 68 | public String getEnteredText() |
---|
| 69 | { |
---|
| 70 | return mEnteredText; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | //----------------------------------------------------------------------------------------------- |
---|
| 74 | /* (non-Javadoc) |
---|
| 75 | * @see de.ugoe.cs.tasktree.treeifc.TextInputSequence#setEnteredText(java.lang.String) |
---|
| 76 | */ |
---|
| 77 | //----------------------------------------------------------------------------------------------- |
---|
| 78 | @Override |
---|
| 79 | public void setEnteredText(String text) |
---|
| 80 | { |
---|
| 81 | mEnteredText = text; |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | //----------------------------------------------------------------------------------------------- |
---|
| 85 | /* (non-Javadoc) |
---|
| 86 | * @see java.lang.Object#toString() |
---|
| 87 | */ |
---|
| 88 | //----------------------------------------------------------------------------------------------- |
---|
| 89 | @Override |
---|
| 90 | public synchronized String toString() |
---|
| 91 | { |
---|
| 92 | if (super.getChildren() == null) |
---|
| 93 | { |
---|
| 94 | return super.getName(); |
---|
| 95 | } |
---|
| 96 | else |
---|
| 97 | { |
---|
| 98 | return "TextInputInteraction(\"" + mEnteredText + "\", " + super.getChildren().size() + |
---|
| 99 | " children)"; |
---|
| 100 | } |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | } |
---|