Changeset 1293 for trunk/autoquest-core-usability-evaluation/src/main/java
- Timestamp:
- 08/10/13 10:26:53 (11 years ago)
- Location:
- trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/InteractionPatternBuilder.java
r1217 r1293 25 25 import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.StartsWithEventVisitor; 26 26 import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.StartsWithInteractionPatternVisitor; 27 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTargetFilter; 27 28 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTypeFilter; 28 29 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.TaskTypeFilter; … … 36 37 */ 37 38 public class InteractionPatternBuilder { 38 39 /**40 * <p>41 * Type of root task. Determines the order in which sub task appear.42 * </p>43 */44 protected TaskTypeFilter rootTask;45 46 /**47 * <p>48 * Interaction pattern starts with event.49 * </p>50 */51 protected EventTypeFilter startsWithEvent;52 53 /**54 * <p>55 * Interaction pattern starts with interaction pattern.56 * </p>57 */58 protected InteractionPattern startsWithPattern;59 60 /**61 * <p>62 * Interaction pattern ends with event.63 * </p>64 */65 protected EventTypeFilter endsWithEvent;66 67 /**68 * <p>69 * Interaction pattern ends with interaction pattern.70 * </p>71 */72 protected InteractionPattern endsWithPattern;73 74 /**75 * <p>76 * Interaction pattern contains certain event.77 * </p>78 */79 protected EventTypeFilter containsEvent;80 81 /**82 * <p>83 * Interaction pattern contains certain interaction pattern.84 * </p>85 */86 protected InteractionPattern containsPattern;87 39 88 40 /** … … 107 59 108 60 public StartsWithStep startsWithEvent(EventTypeFilter startsWithEventType); 61 62 public StartsWithStep startsWithEvent(EventTypeFilter startsWithEventType, EventTargetFilter eventTarget); 109 63 110 64 public StartsWithStep startsWithPattern(InteractionPattern endsWithPattern); 111 65 112 66 public ContainsStep containsEvent(EventTypeFilter containsEventType); 67 68 public ContainsStep containsEvent(EventTypeFilter containsEventType, EventTargetFilter eventTarget); 113 69 114 70 public ContainsStep containsPattern(InteractionPattern containsPattern); 115 71 116 72 public EndsWithStep endsWithEvent(EventTypeFilter endsWithEventType); 73 74 public EndsWithStep endsWithEvent(EventTypeFilter endsWithEventType, EventTargetFilter eventTarget); 117 75 118 76 public EndsWithStep endsWithPattern(InteractionPattern endsPattern); … … 125 83 126 84 public ContainsStep containsEvent(EventTypeFilter containsEventType); 85 86 public ContainsStep containsEvent(EventTypeFilter containsEventType, EventTargetFilter eventTarget); 127 87 128 88 public ContainsStep containsPattern(InteractionPattern containsPattern); 129 89 130 90 public EndsWithStep endsWithEvent(EventTypeFilter endsWithEventType); 91 92 public EndsWithStep endsWithEvent(EventTypeFilter endsWithEventType, EventTargetFilter eventTarget); 131 93 132 94 public EndsWithStep endsWithPattern(InteractionPattern endsPattern); … … 138 100 public static interface ContainsStep { 139 101 140 public ContainsStep containsEvent(EventTypeFilter containsEventType);141 142 public ContainsStep containsPattern(InteractionPattern containsPattern);143 144 102 public EndsWithStep endsWithEvent(EventTypeFilter endsWithEventType); 103 104 public EndsWithStep endsWithEvent(EventTypeFilter endsWithEventType, EventTargetFilter eventTarget); 145 105 146 106 public EndsWithStep endsWithPattern(InteractionPattern endsPattern); … … 180 140 return this; 181 141 } 142 143 @Override 144 public StartsWithStep startsWithEvent( 145 EventTypeFilter startsWithEventType, 146 EventTargetFilter startsWithEventTarget) { 147 this.visitors.add(new StartsWithEventVisitor(startsWithEventType, startsWithEventTarget, concernedNode)); 148 return this; 149 } 182 150 183 151 @Override … … 194 162 } 195 163 164 @Override 165 public ContainsStep containsEvent(EventTypeFilter containsEventType, 166 EventTargetFilter containsEventTarget) { 167 this.visitors.add(new ContainsEventVisitor(containsEventType, containsEventTarget ,concernedNode)); 168 return this; 169 } 170 196 171 @Override 197 172 public ContainsStep containsPattern(InteractionPattern containsPattern) { … … 206 181 return this; 207 182 } 183 184 @Override 185 public EndsWithStep endsWithEvent(EventTypeFilter endsWithEventType, 186 EventTargetFilter endsWithEventTarget) { 187 this.visitors.add(new EndsWithEventVisitor(endsWithEventType, endsWithEventTarget ,concernedNode)); 188 return this; 189 } 208 190 209 191 @Override -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/InteractionPatternVisitor.java
r1217 r1293 22 22 import com.google.common.collect.Lists; 23 23 24 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 24 25 import de.ugoe.cs.autoquest.eventcore.IEventType; 25 26 import de.ugoe.cs.autoquest.eventcore.StringEventType; … … 31 32 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 32 33 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskVisitor; 34 import de.ugoe.cs.autoquest.test.DummyGUIElement; 35 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTargetFilter; 33 36 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTypeFilter; 34 37 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.TaskTypeFilter; … … 46 49 47 50 protected EventTypeFilter eventType; 51 52 protected EventTargetFilter eventTarget; 48 53 49 54 protected InteractionPattern containedPattern; … … 62 67 public void visit(IEventTask event) { 63 68 if (!this.present && isEventVisitor()) { 64 IEventType eventType = event.getEventType(); 65 if (eventType instanceof StringEventType) { 66 this.present = eventType.toString().equals(nameOfEventType()); 67 } 68 else { 69 this.present = eventType.getClass().equals(this.eventType.clazz()); 70 } 71 } 72 } 73 74 public boolean isEventVisitor() { 69 boolean matchesEventType = matchesEventType(event.getEventType()); 70 boolean matchesEventTarget = matchesEventTarget(event.getEventTarget()); 71 this.present = eventTarget != null ? matchesEventType && matchesEventTarget : matchesEventType; 72 } 73 } 74 75 private boolean matchesEventType(IEventType eventType) { 76 if (eventType instanceof StringEventType) { 77 return eventType.toString().equals(nameOfEventType()); 78 } 79 else { 80 return eventType.getClass().equals(this.eventType.clazz()); 81 } 82 } 83 84 private boolean matchesEventTarget(IEventTarget eventTarget) { 85 if(this.eventTarget != null) { 86 if(eventTarget instanceof DummyGUIElement) { 87 return false; 88 } else { 89 return eventTarget.getClass().equals(this.eventTarget.clazz()); 90 } 91 } 92 return false; 93 } 94 95 public boolean isEventVisitor() { 75 96 return this.eventType != null && this.containedPattern == null; 76 97 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/LongFormUsageProblem.java
r1217 r1293 25 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 26 26 import de.ugoe.cs.autoquest.usability.EvaluationMethodCaller; 27 import de.ugoe.cs.autoquest.usability.result.UsabilityProblemDescription; 27 28 import de.ugoe.cs.autoquest.usability.result.UsabilityProblemDescriptionResolver; 28 import de.ugoe.cs.autoquest.usability.result.UsabilityProblemDescription;29 29 import de.ugoe.cs.autoquest.usability.rules.UsabilityRule; 30 30 import de.ugoe.cs.autoquest.usability.rules.UsabilityUsageProblem; -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/ContainsEventVisitor.java
r1217 r1293 22 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 23 23 import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 24 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTargetFilter; 24 25 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTypeFilter; 25 26 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.TaskTypeFilter; … … 46 47 } 47 48 48 /* 49 public ContainsEventVisitor(EventTypeFilter eventType, 50 EventTargetFilter eventTarget, TaskTypeFilter taskType) { 51 this.eventType = eventType; 52 this.eventTarget = eventTarget; 53 this.taskType = taskType; 54 } 55 56 /* 49 57 * (non-Javadoc) 50 58 * -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/EndsWithEventVisitor.java
r1217 r1293 19 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 20 20 import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 21 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTargetFilter; 21 22 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTypeFilter; 22 23 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.TaskTypeFilter; … … 44 45 } 45 46 46 /* 47 public EndsWithEventVisitor(EventTypeFilter eventType, 48 EventTargetFilter eventTarget, TaskTypeFilter taskType) { 49 this.eventType = eventType; 50 this.eventTarget = eventTarget; 51 this.taskType = taskType; 52 } 53 54 /* 47 55 * (non-Javadoc) 48 56 * -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/StartsWithEventVisitor.java
r1217 r1293 19 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 20 20 import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 21 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTargetFilter; 21 22 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.EventTypeFilter; 22 23 import de.ugoe.cs.autoquest.usability.taskmodel.filter.types.TaskTypeFilter; … … 44 45 } 45 46 46 /* 47 public StartsWithEventVisitor(EventTypeFilter eventType, 48 EventTargetFilter eventTarget, 49 TaskTypeFilter taskType) { 50 this.eventType = eventType; 51 this.eventTarget = eventTarget; 52 this.taskType = taskType; 53 } 54 55 /* 47 56 * (non-Javadoc) 48 57 *
Note: See TracChangeset
for help on using the changeset viewer.