Changeset 1161
- Timestamp:
- 04/19/13 19:34:09 (12 years ago)
- Location:
- trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/ContainsPatternVisitor.java
r1152 r1161 19 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 20 20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;22 21 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 23 22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 24 import de.ugoe.cs.autoquest.usability.util.PatternsVisitorUtil;25 23 26 24 /** … … 49 47 public void visit(IIteration iteration) { 50 48 checkTaskAndReturnIfPatternIsPresent(iteration.getMarkedTask()); 51 52 49 } 53 50 … … 57 54 public void visit(ISequence sequence) { 58 55 checkAllChildrenAndReturnIfPatternIsPresent(sequence); 59 60 56 } 61 57 … … 63 59 for (ITask child : sequence.getChildren()) { 64 60 if(checkTaskAndReturnIfPatternIsPresent(child)) { 61 this.present = true; 65 62 break; 66 63 } … … 69 66 70 67 private boolean checkTaskAndReturnIfPatternIsPresent(ITask task) { 71 ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(task);72 this.present = containedPattern.containedIn(taskModel);68 if(isEvent(task)) return false; 69 return this.containedPattern.containedIn(task); 73 70 } 74 71 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/EndsWithPatternVisitor.java
r1152 r1161 19 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 20 20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;22 21 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 23 22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; … … 48 47 */ 49 48 public void visit(IIteration iteration) { 50 ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(iteration); 51 this.present = containedPattern.containedIn(taskModel); 52 49 this.present = containedPattern.containedIn(iteration); 53 50 } 54 51 … … 58 55 public void visit(ISequence sequence) { 59 56 ITask lastTask = PatternsVisitorUtil.lastNodeOf(sequence.getChildren()); 60 ITaskModel taskModel;61 57 if(isEvent(lastTask)) { 62 t askModel = PatternsVisitorUtil.createTaskModelFromNode(sequence);58 this.present = containedPattern.containedIn(sequence); 63 59 } else { 64 taskModel = PatternsVisitorUtil.createTaskModelFromNode(lastTask); 65 } 66 this.present = containedPattern.containedIn(taskModel); 60 this.present = containedPattern.containedIn(lastTask); 61 } 67 62 } 68 63 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/StartsWithPatternVisitor.java
r1152 r1161 19 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 20 20 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;22 21 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 23 22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; … … 48 47 */ 49 48 public void visit(IIteration iteration) { 50 ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(iteration); 51 this.present = containedPattern.containedIn(taskModel); 49 this.present = containedPattern.containedIn(iteration); 52 50 } 53 51 … … 57 55 public void visit(ISequence sequence) { 58 56 ITask firstTask = PatternsVisitorUtil.firstNodeOf(sequence.getChildren()); 59 ITaskModel taskModel;60 57 if(isEvent(firstTask)) { 61 t askModel = PatternsVisitorUtil.createTaskModelFromNode(sequence);58 this.present = containedPattern.containedIn(sequence); 62 59 } else { 63 taskModel = PatternsVisitorUtil.createTaskModelFromNode(firstTask); 64 } 65 this.present = containedPattern.containedIn(taskModel); 60 this.present = containedPattern.containedIn(firstTask); 61 } 66 62 } 67 63
Note: See TracChangeset
for help on using the changeset viewer.