[544] | 1 | // Module : $RCSfile: TextSelection.java,v $
|
---|
| 2 | // Version : $Revision: 0.0 $ $Author: Patrick $ $Date: 27.11.2011 18:11:29 $
|
---|
| 3 | // Project : TaskTreePerformanceTest
|
---|
| 4 | // Creation : 2011 by Patrick
|
---|
| 5 | // Copyright : Patrick Harms, 2011
|
---|
| 6 |
|
---|
| 7 | package de.ugoe.cs.quest.eventcore.gui;
|
---|
| 8 |
|
---|
| 9 | /**
|
---|
| 10 | * TODO comment
|
---|
| 11 | *
|
---|
| 12 | * @version $Revision: $ $Date: $
|
---|
| 13 | * @author 2011, last modified by $Author: $
|
---|
| 14 | */
|
---|
| 15 | public class ValueSelection<T> implements IInteraction {
|
---|
| 16 |
|
---|
| 17 | /** */
|
---|
| 18 | private static final long serialVersionUID = 1L;
|
---|
| 19 |
|
---|
| 20 | /** */
|
---|
[550] | 21 | private T selectedValue;
|
---|
[544] | 22 |
|
---|
| 23 | /**
|
---|
| 24 | * TODO: comment
|
---|
| 25 | *
|
---|
| 26 | * @param selectedValue
|
---|
| 27 | */
|
---|
| 28 | public ValueSelection(T selectedValue) {
|
---|
[550] | 29 | this.selectedValue = selectedValue;
|
---|
[544] | 30 | }
|
---|
| 31 |
|
---|
| 32 | /*
|
---|
| 33 | * (non-Javadoc)
|
---|
| 34 | *
|
---|
| 35 | * @see de.harms.attef.userinteraction.Interaction#getName()
|
---|
| 36 | */
|
---|
| 37 | public String getName() {
|
---|
| 38 | return "ValueSelection";
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | /*
|
---|
| 42 | * (non-Javadoc)
|
---|
| 43 | *
|
---|
| 44 | * @see java.lang.Object#toString()
|
---|
| 45 | */
|
---|
| 46 | @Override
|
---|
| 47 | public String toString() {
|
---|
| 48 | return "select value";
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | /*
|
---|
| 52 | * (non-Javadoc)
|
---|
| 53 | *
|
---|
| 54 | * @see de.harms.attef.userinteraction.Interaction#startsLogicalSequence()
|
---|
| 55 | */
|
---|
| 56 | public boolean startsLogicalSequence() {
|
---|
| 57 | return false;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | /*
|
---|
| 61 | * (non-Javadoc)
|
---|
| 62 | *
|
---|
| 63 | * @see de.harms.attef.userinteraction.Interaction#finishesLogicalSequence()
|
---|
| 64 | */
|
---|
| 65 | public boolean finishesLogicalSequence() {
|
---|
| 66 | return false;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | /**
|
---|
| 70 | * @return the selectedValue
|
---|
| 71 | */
|
---|
| 72 | public T getSelectedValue() {
|
---|
[550] | 73 | return selectedValue;
|
---|
[544] | 74 | }
|
---|
| 75 |
|
---|
| 76 | /*
|
---|
| 77 | * (non-Javadoc)
|
---|
| 78 | *
|
---|
| 79 | * @see java.lang.Object#equals(java.lang.Object)
|
---|
| 80 | */
|
---|
| 81 | @Override
|
---|
| 82 | public boolean equals(Object obj) {
|
---|
| 83 | if ((obj == null) || (!(obj instanceof ValueSelection<?>))) {
|
---|
| 84 | return false;
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | ValueSelection<?> otherValueSelection = (ValueSelection<?>) obj;
|
---|
| 88 |
|
---|
| 89 | return
|
---|
| 90 | ((otherValueSelection != null) &&
|
---|
[550] | 91 | ((selectedValue == otherValueSelection.selectedValue) ||
|
---|
| 92 | ((selectedValue != null) &&
|
---|
| 93 | (selectedValue.equals(otherValueSelection.selectedValue)))));
|
---|
[544] | 94 | }
|
---|
| 95 |
|
---|
| 96 | }
|
---|