Changeset 687
- Timestamp:
- 08/29/12 16:08:44 (12 years ago)
- Location:
- trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui/TextInput.java
r681 r687 1 1 package de.ugoe.cs.quest.eventcore.gui; 2 2 3 import java.util.List; 4 5 import de.ugoe.cs.quest.eventcore.Event; 6 3 7 /** 4 * TODO comment 8 * <p> 9 * A text input represents a list of key events that together represent entering text into a 10 * text field or text area. 11 * </p> 5 12 * 6 13 * @version $Revision: $ $Date: $ … … 11 18 /** */ 12 19 private static final long serialVersionUID = 1L; 20 21 /** the text resulting from the text input events */ 22 private String enteredText; 23 24 /** the text input events that caused the entering of the text */ 25 private List<Event> textInputEvents; 26 27 /** 28 * <p> 29 * TODO: comment 30 * </p> 31 * 32 * @param enteredText 33 * @param textInputEvents 34 */ 35 public TextInput(String enteredText, List<Event> textInputEvents) { 36 this.enteredText = enteredText; 37 this.textInputEvents = textInputEvents; 38 } 13 39 14 40 /* … … 18 44 */ 19 45 public String getName() { 20 return "TextInput ";46 return "TextInput(\"" + enteredText + "\")"; 21 47 } 22 48 … … 28 54 @Override 29 55 public String toString() { 30 return "text input"; 56 return "text input \"" + enteredText + "\""; 57 } 58 59 /** 60 * @return the enteredText 61 */ 62 public String getEnteredText() { 63 return enteredText; 64 } 65 66 /** 67 * @return the textInputEvents 68 */ 69 public List<Event> getTextInputEvents() { 70 return textInputEvents; 31 71 } 32 72 … … 56 96 @Override 57 97 public boolean equals(Object obj) { 58 if ( obj instanceof TextInput) {98 if (this == obj) { 59 99 return true; 100 } 101 else if (obj instanceof TextInput) { 102 return 103 enteredText.equals(((TextInput) obj).enteredText) && 104 textInputEvents.equals(((TextInput) obj).textInputEvents); 60 105 } 61 106 return false; … … 69 114 @Override 70 115 public int hashCode() { 71 return getClass().hashCode() ;116 return getClass().hashCode() + enteredText.hashCode() + textInputEvents.size(); 72 117 } 73 118
Note: See TracChangeset
for help on using the changeset viewer.