- Timestamp:
- 04/08/13 16:50:21 (12 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsAndEndsWithEventTest.java
r1151 r1152 17 17 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.MOUSE_CLICK; 18 18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT; 19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.ITERATION;20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SELECTION;21 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SEQUENCE;19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION; 20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SELECTION; 21 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE; 22 22 import static org.fest.assertions.api.Assertions.assertThat; 23 23 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsEventTest.java
r1151 r1152 16 16 17 17 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT; 18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.ITERATION;19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SELECTION;20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SEQUENCE;18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION; 19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SELECTION; 20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE; 21 21 import static org.fest.assertions.api.Assertions.assertThat; 22 22 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsPatternTest.java
r1151 r1152 16 16 17 17 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT; 18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.ITERATION;19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SELECTION;20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SEQUENCE;18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION; 19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SELECTION; 20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE; 21 21 import static org.fest.assertions.api.Assertions.assertThat; 22 22 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithEventTest.java
r1151 r1152 16 16 17 17 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT; 18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.ITERATION;19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SELECTION;20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SEQUENCE;18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION; 19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SELECTION; 20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE; 21 21 import static org.fest.assertions.api.Assertions.assertThat; 22 22 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithPatternTest.java
r1151 r1152 17 17 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.MOUSE_CLICK; 18 18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT; 19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.ITERATION;20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SELECTION;21 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SEQUENCE;19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION; 20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SELECTION; 21 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE; 22 22 import static org.fest.assertions.api.Assertions.assertThat; 23 23 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/GenerateTaskTreeUtil.java
r1141 r1152 24 24 import de.ugoe.cs.autoquest.commands.usability.CMDgenerateTaskTree; 25 25 import de.ugoe.cs.autoquest.plugin.jfc.commands.CMDparseJFC; 26 import de.ugoe.cs.autoquest.tasktrees.TaskTree Instantiator;26 import de.ugoe.cs.autoquest.tasktrees.TaskTreeDecoder; 27 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 28 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; … … 48 48 public static ITaskTree getTaskTreeFromSpec(String spec) { 49 49 TaskTreeNodeFactory factory = new TaskTreeNodeFactory(); 50 ITaskTreeNode taskTree = new TaskTree Instantiator(new TaskTreeNodeFactory(), new TaskTreeBuilder()).instantiateTaskTree(spec);50 ITaskTreeNode taskTree = new TaskTreeDecoder(new TaskTreeNodeFactory(), new TaskTreeBuilder()).instantiateTaskTree(spec); 51 51 return factory.createTaskTree(taskTree); 52 52 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/CMDperformUsabilityEvaluation.java
r1138 r1152 20 20 21 21 import de.ugoe.cs.autoquest.CommandHelpers; 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 23 23 import de.ugoe.cs.autoquest.usability.rules.EmptyRuleset; 24 24 import de.ugoe.cs.autoquest.usability.rules.UsabilityResult; … … 50 50 public void run(List<Object> parameters) { 51 51 String nameOfTaskTree = getTaskTreeParameter(parameters); 52 Optional<ITask Tree> taskTree = getTaskTreeFromDataContainer(nameOfTaskTree);53 if (taskTree.isPresent()) {52 Optional<ITaskModel> taskModel = getTaskModelFromDataContainer(nameOfTaskTree); 53 if (taskModel.isPresent()) { 54 54 UsabilityRuleset ruleset = getUsabilityRuleset(); 55 UsabilityResult result = UsabilityEvaluator.evaluate(task Tree.get()).using(ruleset);55 UsabilityResult result = UsabilityEvaluator.evaluate(taskModel.get()).using(ruleset); 56 56 String evaluationResultParameterName = getEvaluationResultParameter(parameters); 57 57 storeUsabilityResultInDataContainer(evaluationResultParameterName, result); … … 99 99 * @return 100 100 */ 101 private Optional<ITask Tree> getTaskTreeFromDataContainer(String nameOfTaskTree) {101 private Optional<ITaskModel> getTaskModelFromDataContainer(String nameOfTaskTree) { 102 102 Object dataObject = GlobalDataContainer.getInstance().getData(nameOfTaskTree); 103 103 if(dataObject != null) { 104 if(dataObject instanceof ITask Tree) {105 ITask Tree taskTree = (ITaskTree) dataObject;104 if(dataObject instanceof ITaskModel) { 105 ITaskModel taskTree = (ITaskModel) dataObject; 106 106 return Optional.of(taskTree); 107 107 } else { 108 CommandHelpers.objectNotType(nameOfTaskTree, "ITask Tree");108 CommandHelpers.objectNotType(nameOfTaskTree, "ITaskModel"); 109 109 return Optional.absent(); 110 110 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluator.java
r1150 r1152 19 19 import com.google.common.base.Optional; 20 20 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 22 22 import de.ugoe.cs.autoquest.usability.result.UsabilityDefect; 23 23 import de.ugoe.cs.autoquest.usability.rules.UsabilityResult; … … 35 35 public class UsabilityEvaluator { 36 36 37 private ITask Tree taskTree;37 private ITaskModel taskModel; 38 38 39 private UsabilityEvaluator(ITask TreetaskTree) {40 this.task Tree= taskTree;39 private UsabilityEvaluator(ITaskModel taskTree) { 40 this.taskModel = taskTree; 41 41 } 42 42 … … 49 49 * @return 50 50 */ 51 public static UsabilityEvaluator evaluate(ITask TreetaskTree) {51 public static UsabilityEvaluator evaluate(ITaskModel taskTree) { 52 52 return new UsabilityEvaluator(taskTree); 53 53 } … … 62 62 */ 63 63 public UsabilityResult using(UsabilityRuleset ruleset) { 64 Console.traceln(Level.INFO, "evaluating usability of task tree " + this.task Tree);64 Console.traceln(Level.INFO, "evaluating usability of task tree " + this.taskModel); 65 65 EvaluationMethodCaller evaluationMethodCaller = new EvaluationMethodCaller(); 66 66 UsabilityResult result = new UsabilityResult(); -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/UsabilityMetricsRuleset.java
r1138 r1152 19 19 import com.google.common.collect.Lists; 20 20 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 22 22 import de.ugoe.cs.autoquest.usability.rules.metrics.NoLetterOrDigitRatioMetric; 23 23 import de.ugoe.cs.autoquest.usability.rules.metrics.TextInputEntryRepetitionsMetric; … … 41 41 * 42 42 */ 43 private UsabilityMetricsRuleset(ITask Tree taskTree) {43 private UsabilityMetricsRuleset(ITaskModel taskModel) { 44 44 this.metrics = Lists.newArrayList(); 45 metrics.add(new NoLetterOrDigitRatioMetric(task Tree));46 metrics.add(new TextInputEntryRepetitionsMetric(task Tree));47 metrics.add(new TextInputRatioMetric(task Tree));45 metrics.add(new NoLetterOrDigitRatioMetric(taskModel)); 46 metrics.add(new TextInputEntryRepetitionsMetric(taskModel)); 47 metrics.add(new TextInputRatioMetric(taskModel)); 48 48 } 49 49 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/UsabilityRule.java
r1150 r1152 17 17 import com.google.common.base.Optional; 18 18 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 20 20 import de.ugoe.cs.autoquest.usability.EvaluationMethodCaller; 21 21 import de.ugoe.cs.autoquest.usability.result.UsabilityDefect; … … 30 30 public abstract class UsabilityRule { 31 31 32 protected final ITask Tree taskTree;32 protected final ITaskModel taskModel; 33 33 34 34 protected String name; … … 42 42 * 43 43 */ 44 public UsabilityRule(ITask Tree taskTree) {45 this.task Tree = taskTree;44 public UsabilityRule(ITaskModel taskModel) { 45 this.taskModel = taskModel; 46 46 } 47 47 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/NoLetterOrDigitRatioMetric.java
r1150 r1152 25 25 import com.google.common.collect.Multiset; 26 26 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 29 29 import de.ugoe.cs.autoquest.usability.EvaluationMethodCaller; 30 30 import de.ugoe.cs.autoquest.usability.result.DefectDescriptionResolver; … … 34 34 import de.ugoe.cs.autoquest.usability.tasktree.FilterResult; 35 35 import de.ugoe.cs.autoquest.usability.tasktree.IterativeDFSFilterStrategy; 36 import de.ugoe.cs.autoquest.usability.tasktree.filters.Task TreeFilter;36 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskModelFilter; 37 37 38 38 /** … … 52 52 * @param taskTree 53 53 */ 54 public NoLetterOrDigitRatioMetric(ITask Tree taskTree) {55 super(task Tree);54 public NoLetterOrDigitRatioMetric(ITaskModel taskModel) { 55 super(taskModel); 56 56 this.name = "NoLetterOrDigitRatio"; 57 57 this.defect = new DefectDescriptionResolver().descriptionFor(this.getClass().getSimpleName()); … … 64 64 public Optional<UsabilityDefect> calculate() { 65 65 FilterResult textInputEvents = extractNodesFromTaskTree(); 66 float evaluationMetric = calculateEvaluationMetric(textInputEvents. nodesMatchedFilter());66 float evaluationMetric = calculateEvaluationMetric(textInputEvents.tasksMatchedFilter()); 67 67 return this.defect.isPresent(evaluationMetric); 68 68 } 69 69 70 70 private FilterResult extractNodesFromTaskTree() { 71 return new Task TreeFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT)72 .from(this.task Tree);71 return new TaskModelFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT) 72 .from(this.taskModel); 73 73 } 74 74 75 private float calculateEvaluationMetric(List<ITask TreeNode> textInputEvents) {75 private float calculateEvaluationMetric(List<ITask> textInputEvents) { 76 76 Multiset<String> enteredTextFragments = 77 77 aggregateEnteredTextFromTextInputs(textInputEvents); -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputEntryRepetitionsMetric.java
r1150 r1152 25 25 import com.google.common.collect.Multisets; 26 26 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 29 29 import de.ugoe.cs.autoquest.usability.EvaluationMethodCaller; 30 30 import de.ugoe.cs.autoquest.usability.result.DefectDescriptionResolver; … … 34 34 import de.ugoe.cs.autoquest.usability.tasktree.FilterResult; 35 35 import de.ugoe.cs.autoquest.usability.tasktree.IterativeDFSFilterStrategy; 36 import de.ugoe.cs.autoquest.usability.tasktree.filters.Task TreeFilter;36 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskModelFilter; 37 37 38 38 /** … … 52 52 * @param taskTree 53 53 */ 54 public TextInputEntryRepetitionsMetric(ITask Tree taskTree) {55 super(task Tree);54 public TextInputEntryRepetitionsMetric(ITaskModel taskModel) { 55 super(taskModel); 56 56 this.name = "TextInputEntryRepetitions"; 57 57 this.defect = new DefectDescriptionResolver().descriptionFor(this.getClass().getSimpleName()); … … 64 64 public Optional<UsabilityDefect> calculate() { 65 65 FilterResult textInputEvents = extractNodesFromTaskTree(); 66 float evaluationMetric = calculateEvaluationMetric(textInputEvents. nodesMatchedFilter());66 float evaluationMetric = calculateEvaluationMetric(textInputEvents.tasksMatchedFilter()); 67 67 return this.defect.isPresent(evaluationMetric); 68 68 } 69 69 70 70 private FilterResult extractNodesFromTaskTree() { 71 return new Task TreeFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT)72 .from(this.task Tree);71 return new TaskModelFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT) 72 .from(this.taskModel); 73 73 } 74 74 75 private float calculateEvaluationMetric(List<ITask TreeNode> textInputEvents) {75 private float calculateEvaluationMetric(List<ITask> textInputEvents) { 76 76 Multiset<String> enteredTextFragments = 77 77 aggregateEnteredTextFromTextInputs(textInputEvents); -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputRatioMetric.java
r1150 r1152 23 23 import com.google.common.collect.Iterables; 24 24 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 27 28 import de.ugoe.cs.autoquest.usability.EvaluationMethodCaller; 28 29 import de.ugoe.cs.autoquest.usability.result.DefectDescriptionResolver; … … 32 33 import de.ugoe.cs.autoquest.usability.tasktree.FilterResult; 33 34 import de.ugoe.cs.autoquest.usability.tasktree.IterativeDFSFilterStrategy; 34 import de.ugoe.cs.autoquest.usability.tasktree.filters.Task TreeFilter;35 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskModelFilter; 35 36 36 37 /** … … 50 51 * @param taskTree 51 52 */ 52 public TextInputRatioMetric(ITask Tree taskTree) {53 super(task Tree);53 public TextInputRatioMetric(ITaskModel taskModel) { 54 super(taskModel); 54 55 this.name = "TextInputRatio"; 55 56 this.defect = new DefectDescriptionResolver().descriptionFor(this.getClass().getSimpleName()); … … 62 63 public Optional<UsabilityDefect> calculate() { 63 64 FilterResult textInputEvents = extractNodesFromTaskTree(); 64 float evaluationMetric = calculateEvaluationMetric(textInputEvents. nodesMatchedFilter(), textInputEvents.nodesNotMatchedFilter());65 float evaluationMetric = calculateEvaluationMetric(textInputEvents.tasksMatchedFilter(), textInputEvents.tasksNotMatchedFilter()); 65 66 return this.defect.isPresent(evaluationMetric); 66 67 } 67 68 68 69 private FilterResult extractNodesFromTaskTree() { 69 return new Task TreeFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT)70 .from(this.task Tree);70 return new TaskModelFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT) 71 .from(this.taskModel); 71 72 } 72 73 73 private float calculateEvaluationMetric(List<ITask TreeNode> textInputEvents, List<ITaskTreeNode> nonTextInputEvents) {74 private float calculateEvaluationMetric(List<ITask> textInputEvents, List<ITask> nonTextInputEvents) { 74 75 float numberOfTextInputEvents = textInputEvents.size(); 75 float numberOfNonTextInputEvents = nrOfEvent NodesNotMatchedFilter(nonTextInputEvents);76 float numberOfNonTextInputEvents = nrOfEventTasksNotMatchedFilter(nonTextInputEvents); 76 77 return numberOfTextInputEvents / (numberOfTextInputEvents + numberOfNonTextInputEvents); 77 78 } 78 79 79 private int nrOfEvent NodesNotMatchedFilter(List<ITaskTreeNode> nonTextInputEvents) {80 private int nrOfEventTasksNotMatchedFilter(List<ITask> nonTextInputEvents) { 80 81 return Iterables.size(Iterables.filter(nonTextInputEvents, 81 new Predicate<ITask TreeNode>() {82 new Predicate<ITask>() { 82 83 83 84 @Override 84 public boolean apply(ITaskTreeNode node) { 85 return (node.getChildren() == null) || 86 (node.getChildren().size() == 0); 85 public boolean apply(ITask task) { 86 return task instanceof IEventTask; 87 87 } 88 88 })); -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/LongFormUsageDefect.java
r1150 r1152 18 18 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.SCROLL; 19 19 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT; 20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.ITERATION;21 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter.SEQUENCE;20 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION; 21 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE; 22 22 23 23 import com.google.common.base.Optional; 24 24 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 26 26 import de.ugoe.cs.autoquest.usability.EvaluationMethodCaller; 27 27 import de.ugoe.cs.autoquest.usability.result.DefectDescriptionResolver; … … 48 48 * @param taskTree 49 49 */ 50 public LongFormUsageDefect(ITask Tree taskTree) {51 super(task Tree);50 public LongFormUsageDefect(ITaskModel taskModel) { 51 super(taskModel); 52 52 this.name = "LongFormUsagePattern"; 53 53 this.defect = new DefectDescriptionResolver().descriptionFor(this.getClass().getSimpleName()); … … 73 73 public Optional<UsabilityDefect> check() { 74 74 Optional<UsabilityDefect> present = Optional.absent(); 75 if(this.longFormUsagePattern.containedIn(task Tree)) {75 if(this.longFormUsagePattern.containedIn(taskModel)) { 76 76 present = Optional.of(this.defect); 77 77 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/UsagePattern.java
r1150 r1152 22 22 import com.google.common.collect.Iterables; 23 23 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 26 26 import de.ugoe.cs.autoquest.usability.tasktree.IterativeDFSFilterStrategy; 27 import de.ugoe.cs.autoquest.usability.tasktree.filters.Task TreeFilter;28 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter;27 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskModelFilter; 28 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 29 29 30 30 /** … … 37 37 public class UsagePattern { 38 38 39 private Task TreeFilter taskTreeFilter = new TaskTreeFilter(new IterativeDFSFilterStrategy());39 private TaskModelFilter taskTreeFilter = new TaskModelFilter(new IterativeDFSFilterStrategy()); 40 40 41 private TaskT reeNodeTypeFilter concernedNode;41 private TaskTypeFilter concernedTask; 42 42 43 43 private List<UsagePatternVisitor> patternVisitors; … … 53 53 * @param eventType 54 54 */ 55 public UsagePattern(TaskT reeNodeTypeFilter concernedNode,55 public UsagePattern(TaskTypeFilter concernedNode, 56 56 UsagePatternVisitor... patternVisitor) 57 57 { 58 58 this.patternVisitors = Arrays.asList(patternVisitor); 59 this.concerned Node= concernedNode;59 this.concernedTask = concernedNode; 60 60 } 61 61 62 public boolean containedIn(ITask Tree taskTree) {63 List<ITask TreeNode> allConcernedNodes = filterAllConcernedNodeFrom(taskTree);64 for(ITask TreeNode concernedNode : allConcernedNodes) {65 applyAllVisitors(concerned Node);62 public boolean containedIn(ITaskModel taskModel) { 63 List<ITask> allConcernedTasks = filterAllConcernedTasksFrom(taskModel); 64 for(ITask concernedTask : allConcernedTasks) { 65 applyAllVisitors(concernedTask); 66 66 if(allVisitorsArePresent()) { 67 67 this.present = true; … … 75 75 } 76 76 77 private void applyAllVisitors(ITask TreeNode concernedNode) {77 private void applyAllVisitors(ITask concernedTask) { 78 78 Optional<UsagePatternVisitor> previousVisitor = Optional.absent(); 79 79 for(UsagePatternVisitor visitor : patternVisitors) { 80 80 if(appliedOnSelectionNode(previousVisitor)) { 81 for(ITask TreeNode selectionNode: previousVisitor.get().getRetainedSelectionNodes()) {82 selection Node.accept(visitor);81 for(ITask selection : previousVisitor.get().getRetainedSelectionNodes()) { 82 selection.accept(visitor); 83 83 } 84 84 } else { 85 85 previousVisitor = Optional.of(visitor); 86 concerned Node.accept(visitor);86 concernedTask.accept(visitor); 87 87 } 88 88 } … … 101 101 * @return 102 102 */ 103 private List<ITask TreeNode> filterAllConcernedNodeFrom(ITaskTree taskTree) {104 return this.taskTreeFilter.filterByNodeType(this.concerned Node).from(taskTree).nodesMatchedFilter();103 private List<ITask> filterAllConcernedTasksFrom(ITaskModel taskModel) { 104 return this.taskTreeFilter.filterByNodeType(this.concernedTask).from(taskModel).tasksMatchedFilter(); 105 105 } 106 106 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/UsagePatternBuilder.java
r1150 r1152 22 22 import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.StartsWithPatternVisitor; 23 23 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 24 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter;24 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 25 25 26 26 /** … … 33 33 public class UsagePatternBuilder { 34 34 35 protected TaskT reeNodeTypeFilter concernedNode;35 protected TaskTypeFilter concernedNode; 36 36 37 37 protected EventTypeFilter startsWithEvent; … … 55 55 * @return 56 56 */ 57 public SpecifyPatternStep concernedNode(TaskT reeNodeTypeFilter concernedNode) {57 public SpecifyPatternStep concernedNode(TaskTypeFilter concernedNode) { 58 58 this.concernedNode = concernedNode; 59 59 return new SpecifyPatternStep(); -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/UsagePatternVisitor.java
r1150 r1152 26 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 27 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.NodeVisitor; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 31 30 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 32 31 import de.ugoe.cs.autoquest.usability.util.PatternsVisitorUtil; … … 47 46 protected boolean present = false; 48 47 49 protected List<ITask TreeNode> retainedChildrenNodesFromSelectionNodes = Lists.newArrayList();48 protected List<ITask> retainedChildrenTasksFromSelections = Lists.newArrayList(); 50 49 51 50 /* (non-Javadoc) … … 85 84 this.present = patternIsPresent(); 86 85 } else { 87 ITask Tree taskTree = PatternsVisitorUtil.createTaskTreeFromNode(selection);88 this.present = containedPattern.containedIn(task Tree);86 ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(selection); 87 this.present = containedPattern.containedIn(taskModel); 89 88 } 90 89 } 91 90 92 protected void retainNodesWherePatternIsPresent(List<ITask TreeNode> children) {93 for(ITask TreeNode node: children) {91 protected void retainNodesWherePatternIsPresent(List<ITask> children) { 92 for(ITask task : children) { 94 93 this.present = false; 95 node.accept(this);94 task.accept(this); 96 95 if(this.present) { 97 this.retainedChildren NodesFromSelectionNodes.add(node);96 this.retainedChildrenTasksFromSelections.add(task); 98 97 } 99 98 } … … 101 100 102 101 private boolean patternIsPresent() { 103 return !this.retainedChildren NodesFromSelectionNodes.isEmpty();102 return !this.retainedChildrenTasksFromSelections.isEmpty(); 104 103 } 105 104 … … 122 121 */ 123 122 public void reset() { 124 this.retainedChildren NodesFromSelectionNodes.clear();123 this.retainedChildrenTasksFromSelections.clear(); 125 124 this.present = false; 126 125 } … … 144 143 * @return 145 144 */ 146 public List<ITask TreeNode> getRetainedSelectionNodes() {147 return this.retainedChildren NodesFromSelectionNodes;145 public List<ITask> getRetainedSelectionNodes() { 146 return this.retainedChildrenTasksFromSelections; 148 147 } 149 148 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/ContainsEventVisitor.java
r1150 r1152 19 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 20 20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 22 22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 23 23 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; … … 47 47 */ 48 48 public void visit(IIteration iteration) { 49 check AllChildrenAndReturnIfPatternIsPresent(iteration.getChildren());49 checkTaskAndReturnIfPatternIsPresent(iteration.getMarkedTask()); 50 50 } 51 51 … … 57 57 } 58 58 59 private void checkAllChildrenAndReturnIfPatternIsPresent(List<ITaskTreeNode> children) { 60 for(ITaskTreeNode node : children) { 61 node.accept(this); 62 if(this.present) { 59 private void checkAllChildrenAndReturnIfPatternIsPresent(List<ITask> children) { 60 for (ITask task : children) { 61 if (checkTaskAndReturnIfPatternIsPresent(task)) { 63 62 break; 64 63 } … … 66 65 } 67 66 67 /** 68 * 69 */ 70 private boolean checkTaskAndReturnIfPatternIsPresent(ITask task) { 71 task.accept(this); 72 return this.present; 73 } 68 74 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/ContainsPatternVisitor.java
r1150 r1152 15 15 package de.ugoe.cs.autoquest.usability.rules.patterns.visitors; 16 16 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 17 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 18 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 21 22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 22 23 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; … … 47 48 */ 48 49 public void visit(IIteration iteration) { 49 check AllChildrenAndReturnIfPatternIsPresent(iteration);50 checkTaskAndReturnIfPatternIsPresent(iteration.getMarkedTask()); 50 51 51 52 } … … 59 60 } 60 61 61 private void checkAllChildrenAndReturnIfPatternIsPresent(ITaskTreeNode node) { 62 for(ITaskTreeNode child : node.getChildren()) { 63 ITaskTree taskTree; 64 if(isEvent(child)) { 65 taskTree = PatternsVisitorUtil.createTaskTreeFromNode(node); 66 } else { 67 taskTree = PatternsVisitorUtil.createTaskTreeFromNode(child); 68 } 69 this.present = containedPattern.containedIn(taskTree); 70 if(this.present) { 62 private void checkAllChildrenAndReturnIfPatternIsPresent(ISequence sequence) { 63 for (ITask child : sequence.getChildren()) { 64 if(checkTaskAndReturnIfPatternIsPresent(child)) { 71 65 break; 72 66 } … … 74 68 } 75 69 76 private boolean isEvent(ITaskTreeNode firstNode) { 77 return firstNode.getChildren().isEmpty(); 70 private boolean checkTaskAndReturnIfPatternIsPresent(ITask task) { 71 ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(task); 72 this.present = containedPattern.containedIn(taskModel); 73 } 74 75 private boolean isEvent(ITask task) { 76 return task instanceof IEventTask; 78 77 } 79 78 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/EndsWithEventVisitor.java
r1150 r1152 45 45 */ 46 46 public void visit(IIteration iteration) { 47 PatternsVisitorUtil.lastNodeOf(iteration.getChildren()).accept(this);47 iteration.getMarkedTask().accept(this); 48 48 } 49 49 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/EndsWithPatternVisitor.java
r1150 r1152 15 15 package de.ugoe.cs.autoquest.usability.rules.patterns.visitors; 16 16 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 17 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 18 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 21 22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 22 23 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; … … 47 48 */ 48 49 public void visit(IIteration iteration) { 49 ITask Tree taskTree = PatternsVisitorUtil.createTaskTreeFromNode(iteration);50 this.present = containedPattern.containedIn(task Tree);50 ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(iteration); 51 this.present = containedPattern.containedIn(taskModel); 51 52 52 53 } … … 56 57 */ 57 58 public void visit(ISequence sequence) { 58 ITask TreeNode lastNode= PatternsVisitorUtil.lastNodeOf(sequence.getChildren());59 ITask Tree taskTree;60 if(isEvent(last Node)) {61 task Tree = PatternsVisitorUtil.createTaskTreeFromNode(sequence);59 ITask lastTask = PatternsVisitorUtil.lastNodeOf(sequence.getChildren()); 60 ITaskModel taskModel; 61 if(isEvent(lastTask)) { 62 taskModel = PatternsVisitorUtil.createTaskModelFromNode(sequence); 62 63 } else { 63 task Tree = PatternsVisitorUtil.createTaskTreeFromNode(lastNode);64 taskModel = PatternsVisitorUtil.createTaskModelFromNode(lastTask); 64 65 } 65 this.present = containedPattern.containedIn(task Tree);66 this.present = containedPattern.containedIn(taskModel); 66 67 } 67 68 68 private boolean isEvent(ITask TreeNode firstNode) {69 return firstNode.getChildren().isEmpty();69 private boolean isEvent(ITask lastTask) { 70 return lastTask instanceof IEventTask; 70 71 } 71 72 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/StartsWithEventVisitor.java
r1150 r1152 45 45 */ 46 46 public void visit(IIteration iteration) { 47 PatternsVisitorUtil.firstNodeOf(iteration.getChildren()).accept(this);47 iteration.getMarkedTask().accept(this); 48 48 } 49 49 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/StartsWithPatternVisitor.java
r1150 r1152 15 15 package de.ugoe.cs.autoquest.usability.rules.patterns.visitors; 16 16 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 17 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 18 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 21 22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 22 23 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; … … 47 48 */ 48 49 public void visit(IIteration iteration) { 49 ITask Tree taskTree = PatternsVisitorUtil.createTaskTreeFromNode(iteration);50 this.present = containedPattern.containedIn(task Tree);50 ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(iteration); 51 this.present = containedPattern.containedIn(taskModel); 51 52 } 52 53 … … 55 56 */ 56 57 public void visit(ISequence sequence) { 57 ITask TreeNode firstNode= PatternsVisitorUtil.firstNodeOf(sequence.getChildren());58 ITask Tree taskTree;59 if(isEvent(first Node)) {60 task Tree = PatternsVisitorUtil.createTaskTreeFromNode(sequence);58 ITask firstTask = PatternsVisitorUtil.firstNodeOf(sequence.getChildren()); 59 ITaskModel taskModel; 60 if(isEvent(firstTask)) { 61 taskModel = PatternsVisitorUtil.createTaskModelFromNode(sequence); 61 62 } else { 62 task Tree = PatternsVisitorUtil.createTaskTreeFromNode(firstNode);63 taskModel = PatternsVisitorUtil.createTaskModelFromNode(firstTask); 63 64 } 64 this.present = containedPattern.containedIn(task Tree);65 this.present = containedPattern.containedIn(taskModel); 65 66 } 66 67 67 private boolean isEvent(ITask TreeNode firstNode) {68 return first Node.getChildren().isEmpty();68 private boolean isEvent(ITask firstTask) { 69 return firstTask instanceof IEventTask; 69 70 } 70 71 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/FilterResult.java
r1135 r1152 20 20 import com.google.common.collect.Lists; 21 21 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 23 23 24 24 /** … … 34 34 private final Predicate filterPredicate; 35 35 36 private List<ITask TreeNode> filteredNodes = Lists.newArrayList();36 private List<ITask> filteredTasks = Lists.newArrayList(); 37 37 38 private List<ITask TreeNode> nodesNotMatchedFilter = Lists.newArrayList();38 private List<ITask> tasksNotMatchedFilter = Lists.newArrayList(); 39 39 40 40 @SuppressWarnings("rawtypes") … … 44 44 45 45 @SuppressWarnings("unchecked") 46 public void add Node(ITaskTreeNode node) {47 if (filterPredicate.apply( node)) {48 filtered Nodes.add(node);46 public void addTask(ITask task) { 47 if (filterPredicate.apply(task)) { 48 filteredTasks.add(task); 49 49 } 50 50 else { 51 nodesNotMatchedFilter.add(node);51 tasksNotMatchedFilter.add(task); 52 52 } 53 53 } 54 54 55 public List<ITask TreeNode> nodesMatchedFilter() {56 return this.filtered Nodes;55 public List<ITask> tasksMatchedFilter() { 56 return this.filteredTasks; 57 57 } 58 58 59 public int nrOf NodesMatchedFilter() {60 return this.filtered Nodes.size();59 public int nrOfTasksMatchedFilter() { 60 return this.filteredTasks.size(); 61 61 } 62 62 63 public List<ITask TreeNode> nodesNotMatchedFilter() {64 return this. nodesNotMatchedFilter;63 public List<ITask> tasksNotMatchedFilter() { 64 return this.tasksNotMatchedFilter; 65 65 } 66 66 67 public int nrOf NodesNotMatchedFilter() {68 return this. nodesNotMatchedFilter.size();67 public int nrOfTasksNotMatchedFilter() { 68 return this.tasksNotMatchedFilter.size(); 69 69 } 70 70 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/IterativeDFSFilterStrategy.java
r1135 r1152 22 22 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 23 23 import de.ugoe.cs.autoquest.eventcore.IEventType; 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship; 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship; 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 26 28 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTargetFilter; 27 29 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 28 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter;30 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 29 31 30 32 /** … … 35 37 * @author Alexander Deicke 36 38 */ 37 public class IterativeDFSFilterStrategy implements Task TreeFilterStrategy {39 public class IterativeDFSFilterStrategy implements TaskModelFilterStrategy { 38 40 39 41 private FilterResult filterStatistic; … … 41 43 @SuppressWarnings("unchecked") 42 44 @Override 43 public FilterResult filter(ITask Tree taskTree, EventTargetFilter eventTarget) {45 public FilterResult filter(ITaskModel taskModel, EventTargetFilter eventTarget) { 44 46 Predicate<IEventTarget> filterPredicate = eventTarget.filterPredicate(); 45 47 this.filterStatistic = new FilterResult(filterPredicate); 46 traverse(task Tree);48 traverse(taskModel); 47 49 return this.filterStatistic; 48 50 } … … 50 52 @SuppressWarnings("unchecked") 51 53 @Override 52 public FilterResult filter(ITask Tree taskTree, EventTypeFilter eventType) {54 public FilterResult filter(ITaskModel taskModel, EventTypeFilter eventType) { 53 55 Predicate<IEventType> filterPredicate = eventType.filterPredicate(); 54 56 this.filterStatistic = new FilterResult(filterPredicate); 55 traverse(task Tree);57 traverse(taskModel); 56 58 return this.filterStatistic; 57 59 } … … 59 61 @SuppressWarnings("unchecked") 60 62 @Override 61 public FilterResult filter(ITask Tree taskTree, TaskTreeNodeTypeFilter nodeType) {62 Predicate<ITask TreeNode> filterPredicate = nodeType.filterPredicate();63 public FilterResult filter(ITaskModel taskModel, TaskTypeFilter nodeType) { 64 Predicate<ITask> filterPredicate = nodeType.filterPredicate(); 63 65 this.filterStatistic = new FilterResult(filterPredicate); 64 traverse(task Tree);66 traverse(taskModel); 65 67 return this.filterStatistic; 66 68 } 67 69 68 private void traverse(ITask Tree taskTree) {69 Queue<ITask TreeNode> unvisitedNodes = new LinkedList<ITaskTreeNode>();70 unvisited Nodes.add(taskTree.getRoot());71 while (stillUnvisited Nodes(unvisitedNodes)) {72 ITask TreeNode node = unvisitedNodes.poll();73 processCurrent Node(node);74 processChildrenOfCurrent Node(unvisitedNodes, node);70 private void traverse(ITaskModel taskModel) { 71 Queue<ITask> unvisitedTasks = new LinkedList<ITask>(); 72 unvisitedTasks.addAll(taskModel.getTasks()); 73 while (stillUnvisitedTasks(unvisitedTasks)) { 74 ITask task = unvisitedTasks.poll(); 75 processCurrentTask(task); 76 processChildrenOfCurrentTask(unvisitedTasks, task); 75 77 } 76 78 } 77 79 78 private boolean stillUnvisited Nodes(Queue<ITaskTreeNode> unvisitedNodes) {79 return !unvisited Nodes.isEmpty();80 private boolean stillUnvisitedTasks(Queue<ITask> unvisitedTasks) { 81 return !unvisitedTasks.isEmpty(); 80 82 } 81 83 82 private void processCurrent Node(ITaskTreeNode node) {83 this.filterStatistic.add Node(node);84 private void processCurrentTask(ITask task) { 85 this.filterStatistic.addTask(task); 84 86 } 85 87 86 private void processChildrenOfCurrent Node(Queue<ITaskTreeNode> unvisitedNodes,87 ITask TreeNode node)88 private void processChildrenOfCurrentTask(Queue<ITask> unvisitedTasks, 89 ITask task) 88 90 { 89 for (ITaskTreeNode child : node.getChildren()) { 90 unvisitedNodes.add(child); 91 if (task instanceof IStructuringTemporalRelationship) { 92 for (ITask child : ((IStructuringTemporalRelationship) task).getChildren()) { 93 unvisitedTasks.add(child); 94 } 95 } 96 else if (task instanceof IMarkingTemporalRelationship) { 97 unvisitedTasks.add(((IMarkingTemporalRelationship) task).getMarkedTask()); 91 98 } 92 99 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/TaskModelFilterStrategy.java
r1150 r1152 15 15 package de.ugoe.cs.autoquest.usability.tasktree; 16 16 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;17 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 18 18 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTargetFilter; 19 19 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 20 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskT reeNodeTypeFilter;20 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 21 21 22 22 /** … … 27 27 * @author Alexander Deicke 28 28 */ 29 public interface Task TreeFilterStrategy {29 public interface TaskModelFilterStrategy { 30 30 31 public FilterResult filter(ITask Tree taskTree, EventTargetFilter eventTarget);31 public FilterResult filter(ITaskModel taskModel, EventTargetFilter eventTarget); 32 32 33 public FilterResult filter(ITask Tree taskTree, EventTypeFilter eventType);33 public FilterResult filter(ITaskModel taskModel, EventTypeFilter eventType); 34 34 35 public FilterResult filter(ITask Tree taskTree, TaskTreeNodeTypeFilter nodeType);35 public FilterResult filter(ITaskModel taskModel, TaskTypeFilter nodeType); 36 36 37 37 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/EventTargetFilter.java
r1135 r1152 23 23 import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField; 24 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 26 26 27 27 /** … … 32 32 * @author Alexander Deicke 33 33 */ 34 public enum EventTargetFilter implements Task TreeNodeFilter<IEventTarget> {34 public enum EventTargetFilter implements TaskFilter<IEventTarget> { 35 35 36 36 TEXT_FIELD(ITextField.class), … … 54 54 public Predicate filterPredicate() { 55 55 Predicate<Object> instanceOfIEventTaskPredicate = Predicates.instanceOf(IEventTask.class); 56 Predicate<ITask TreeNode> nodeHoldsInstanceOfFilterArgument =57 Predicates.compose(Predicates.instanceOf(eventTargetClazz), nodeExtractionFunction());58 return Predicates.and(instanceOfIEventTaskPredicate, nodeHoldsInstanceOfFilterArgument);56 Predicate<ITask> taskHoldsInstanceOfFilterArgument = 57 Predicates.compose(Predicates.instanceOf(eventTargetClazz), taskExtractionFunction()); 58 return Predicates.and(instanceOfIEventTaskPredicate, taskHoldsInstanceOfFilterArgument); 59 59 } 60 60 61 private Function<ITask TreeNode, IEventTarget> nodeExtractionFunction() {62 return new Function<ITask TreeNode, IEventTarget>() {61 private Function<ITask, IEventTarget> taskExtractionFunction() { 62 return new Function<ITask, IEventTarget>() { 63 63 64 64 @Override 65 public IEventTarget apply(ITask TreeNode treeNode) {66 return ((IEventTask) t reeNode).getEventTarget();65 public IEventTarget apply(ITask task) { 66 return ((IEventTask) task).getEventTarget(); 67 67 } 68 68 }; -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/EventTypeFilter.java
r1150 r1152 27 27 import de.ugoe.cs.autoquest.eventcore.gui.TextInput; 28 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 30 31 31 /** … … 36 36 * @author Alexander Deicke 37 37 */ 38 public enum EventTypeFilter implements Task TreeNodeFilter<IEventType> {38 public enum EventTypeFilter implements TaskFilter<IEventType> { 39 39 40 40 MOUSE_BUTTON_INTERACTION(MouseButtonInteraction.class), … … 66 66 public Predicate filterPredicate() { 67 67 Predicate<Object> instanceOfIEventTaskPredicate = Predicates.instanceOf(IEventTask.class); 68 Predicate<ITask TreeNode> nodeHoldsInstanceOfFilterArgument =69 Predicates.compose(Predicates.instanceOf(eventTypeClazz), nodeExtractionFunction());70 return Predicates.and(instanceOfIEventTaskPredicate, nodeHoldsInstanceOfFilterArgument);68 Predicate<ITask> taskHoldsInstanceOfFilterArgument = 69 Predicates.compose(Predicates.instanceOf(eventTypeClazz), taskExtractionFunction()); 70 return Predicates.and(instanceOfIEventTaskPredicate, taskHoldsInstanceOfFilterArgument); 71 71 } 72 72 73 private Function<ITask TreeNode, IEventType> nodeExtractionFunction() {74 return new Function<ITask TreeNode, IEventType>() {73 private Function<ITask, IEventType> taskExtractionFunction() { 74 return new Function<ITask, IEventType>() { 75 75 76 76 @Override 77 public IEventType apply(ITask TreeNode treeNode) {78 return ((IEventTask) t reeNode).getEventType();77 public IEventType apply(ITask task) { 78 return ((IEventTask) task).getEventType(); 79 79 } 80 80 }; -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/TaskFilter.java
r1150 r1152 24 24 * @author Alexander Deicke 25 25 */ 26 public interface Task TreeNodeFilter<T> {26 public interface TaskFilter<T> { 27 27 28 28 public Class<T> clazz(); -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/TaskModelFilter.java
r1150 r1152 17 17 import com.google.common.base.Preconditions; 18 18 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 20 20 import de.ugoe.cs.autoquest.usability.tasktree.FilterResult; 21 import de.ugoe.cs.autoquest.usability.tasktree.Task TreeFilterStrategy;21 import de.ugoe.cs.autoquest.usability.tasktree.TaskModelFilterStrategy; 22 22 23 23 /** … … 28 28 * @author Alexander Deicke 29 29 */ 30 public class Task TreeFilter {30 public class TaskModelFilter { 31 31 32 private final Task TreeFilterStrategy taskTreeFilterStrategy;32 private final TaskModelFilterStrategy taskModelFilterStrategy; 33 33 34 public Task TreeFilter(TaskTreeFilterStrategy treeTraversalStrategy) {34 public TaskModelFilter(TaskModelFilterStrategy treeTraversalStrategy) { 35 35 Preconditions.checkNotNull(treeTraversalStrategy); 36 this.task TreeFilterStrategy = treeTraversalStrategy;36 this.taskModelFilterStrategy = treeTraversalStrategy; 37 37 } 38 38 … … 45 45 } 46 46 47 public FilterNodeTypeStep filterByNodeType(TaskT reeNodeTypeFilter nodeType) {47 public FilterNodeTypeStep filterByNodeType(TaskTypeFilter nodeType) { 48 48 return new FilterNodeTypeStep(nodeType); 49 49 } … … 57 57 } 58 58 59 public FilterResult from(ITask Tree taskTree) {60 return task TreeFilterStrategy.filter(taskTree, eventTarget);59 public FilterResult from(ITaskModel taskModel) { 60 return taskModelFilterStrategy.filter(taskModel, eventTarget); 61 61 } 62 62 … … 71 71 } 72 72 73 public FilterResult from(ITask Tree taskTree) {74 return task TreeFilterStrategy.filter(taskTree, eventType);73 public FilterResult from(ITaskModel taskModel) { 74 return taskModelFilterStrategy.filter(taskModel, eventType); 75 75 } 76 76 … … 79 79 public class FilterNodeTypeStep { 80 80 81 private final TaskT reeNodeTypeFilter nodeType;81 private final TaskTypeFilter nodeType; 82 82 83 public FilterNodeTypeStep(TaskT reeNodeTypeFilter nodeType) {83 public FilterNodeTypeStep(TaskTypeFilter nodeType) { 84 84 this.nodeType = nodeType; 85 85 } 86 86 87 public FilterResult from(ITask Tree taskTree) {88 return task TreeFilterStrategy.filter(taskTree, nodeType);87 public FilterResult from(ITaskModel taskModel) { 88 return taskModelFilterStrategy.filter(taskModel, nodeType); 89 89 } 90 90 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/TaskTypeFilter.java
r1150 r1152 22 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 23 23 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 25 25 26 26 /** … … 31 31 * @author Alexander Deicke 32 32 */ 33 public enum TaskT reeNodeTypeFilter implements TaskTreeNodeFilter<ITaskTreeNode> {33 public enum TaskTypeFilter implements TaskFilter<ITask> { 34 34 35 35 EVENT_TASK_NODE(IEventTask.class), … … 41 41 SELECTION(ISelection.class),; 42 42 43 private Class<? extends ITask TreeNode> nodeTypeClazz;43 private Class<? extends ITask> taskTypeClazz; 44 44 45 private TaskT reeNodeTypeFilter(Class<? extends ITaskTreeNode> nodeTypeClazz) {46 this. nodeTypeClazz = nodeTypeClazz;45 private TaskTypeFilter(Class<? extends ITask> taskTypeClazz) { 46 this.taskTypeClazz = taskTypeClazz; 47 47 } 48 48 49 49 @SuppressWarnings("unchecked") 50 50 @Override 51 public Class<ITask TreeNode> clazz() {52 return (Class<ITask TreeNode>) this.nodeTypeClazz;51 public Class<ITask> clazz() { 52 return (Class<ITask>) this.taskTypeClazz; 53 53 } 54 54 … … 56 56 @Override 57 57 public Predicate filterPredicate() { 58 return Predicates.instanceOf( nodeTypeClazz);58 return Predicates.instanceOf(taskTypeClazz); 59 59 } 60 60 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/NullNode.java
r1150 r1152 20 20 import org.apache.commons.lang.StringUtils; 21 21 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 23 import de.ugoe.cs.autoquest.tasktrees.treeifc.NodeVisitor; 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 24 23 25 24 /** … … 30 29 * @author Alexander Deicke 31 30 */ 32 public class NullNode implements ITask TreeNode{31 public class NullNode implements ITask { 33 32 34 33 /* (non-Javadoc) … … 47 46 48 47 /* (non-Javadoc) 49 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#getChildren()50 */51 public List<ITaskTreeNode> getChildren() {52 return Collections.emptyList();53 }54 55 /* (non-Javadoc)56 48 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#equals(de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode) 57 49 */ 58 public boolean equals(ITask TreeNode taskTreeNode) {50 public boolean equals(ITask task) { 59 51 return false; 60 52 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/PatternsVisitorUtil.java
r1150 r1152 19 19 import com.google.common.collect.Iterables; 20 20 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;23 import de.ugoe.cs.autoquest.tasktrees.treeimpl.Task TreeNodeFactory;21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 23 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory; 24 24 25 25 /** … … 44 44 * @return 45 45 */ 46 public static ITask Tree createTaskTreeFromNode(ITaskTreeNode taskTreeNode) {47 return new Task TreeNodeFactory().createTaskTree(taskTreeNode);46 public static ITaskModel createTaskModelFromNode(ITask task) { 47 return new TaskFactory().createTaskTree(task); 48 48 } 49 49 … … 56 56 * @return 57 57 */ 58 public static ITask TreeNode firstNodeOf(List<ITaskTreeNode> taskTreeNodes) {59 return Iterables.getFirst(task TreeNodes, new NullNode());58 public static ITask firstNodeOf(List<ITask> tasks) { 59 return Iterables.getFirst(tasks, new NullNode()); 60 60 } 61 61 … … 68 68 * @return 69 69 */ 70 public static ITask TreeNode lastNodeOf(List<ITaskTreeNode> taskTreeNodes) {71 return Iterables.getLast(task TreeNodes, new NullNode());70 public static ITask lastNodeOf(List<ITask> tasks) { 71 return Iterables.getLast(tasks, new NullNode()); 72 72 } 73 73 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/TextInputUtil.java
r1040 r1152 27 27 import de.ugoe.cs.autoquest.eventcore.gui.TextInput; 28 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask TreeNode;29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 30 31 31 /** … … 42 42 } 43 43 44 public static Multiset<String> aggregateEnteredTextFromTextInputs(List<ITask TreeNode> nodesWithTextInputEvents)44 public static Multiset<String> aggregateEnteredTextFromTextInputs(List<ITask> tasksWithTextInputEvents) 45 45 { 46 46 List<Iterable<String>> allTextInputs = Lists.newArrayList(); 47 for (ITask TreeNode nodeWithTextInput : nodesWithTextInputEvents) {48 TextInput textInput = (TextInput) ((IEventTask) nodeWithTextInput).getEventType();47 for (ITask taskWithTextInput : tasksWithTextInputEvents) { 48 TextInput textInput = (TextInput) ((IEventTask) taskWithTextInput).getEventType(); 49 49 allTextInputs.add(splitTextIntoWordsAndSigns(textInput.getEnteredText())); 50 50 }
Note: See TracChangeset
for help on using the changeset viewer.