Ignore:
Timestamp:
04/19/13 19:34:09 (12 years ago)
Author:
adeicke
Message:

Adjustments due to change from TaskTree? to TaskModel?.

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  
    1919import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2020import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    2221import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 
    2322import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
    24 import de.ugoe.cs.autoquest.usability.util.PatternsVisitorUtil; 
    2523 
    2624/** 
     
    4947    public void visit(IIteration iteration) { 
    5048        checkTaskAndReturnIfPatternIsPresent(iteration.getMarkedTask()); 
    51  
    5249    } 
    5350 
     
    5754    public void visit(ISequence sequence) { 
    5855        checkAllChildrenAndReturnIfPatternIsPresent(sequence); 
    59  
    6056    } 
    6157     
     
    6359        for (ITask child : sequence.getChildren()) { 
    6460            if(checkTaskAndReturnIfPatternIsPresent(child)) { 
     61                this.present = true; 
    6562                break; 
    6663            } 
     
    6966     
    7067    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); 
    7370    } 
    7471     
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/EndsWithPatternVisitor.java

    r1152 r1161  
    1919import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2020import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    2221import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 
    2322import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     
    4847     */ 
    4948    public void visit(IIteration iteration) { 
    50         ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(iteration); 
    51         this.present = containedPattern.containedIn(taskModel);  
    52  
     49        this.present = containedPattern.containedIn(iteration);  
    5350    } 
    5451 
     
    5855    public void visit(ISequence sequence) { 
    5956        ITask lastTask = PatternsVisitorUtil.lastNodeOf(sequence.getChildren()); 
    60         ITaskModel taskModel; 
    6157        if(isEvent(lastTask)) { 
    62             taskModel = PatternsVisitorUtil.createTaskModelFromNode(sequence); 
     58            this.present = containedPattern.containedIn(sequence); 
    6359        } else { 
    64             taskModel = PatternsVisitorUtil.createTaskModelFromNode(lastTask); 
    65         } 
    66         this.present = containedPattern.containedIn(taskModel);       
     60            this.present = containedPattern.containedIn(lastTask); 
     61        }     
    6762    } 
    6863 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/StartsWithPatternVisitor.java

    r1152 r1161  
    1919import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2020import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    2221import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 
    2322import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     
    4847     */ 
    4948    public void visit(IIteration iteration) { 
    50         ITaskModel taskModel = PatternsVisitorUtil.createTaskModelFromNode(iteration); 
    51         this.present = containedPattern.containedIn(taskModel);   
     49        this.present = containedPattern.containedIn(iteration);   
    5250    } 
    5351 
     
    5755    public void visit(ISequence sequence) { 
    5856        ITask firstTask = PatternsVisitorUtil.firstNodeOf(sequence.getChildren()); 
    59         ITaskModel taskModel; 
    6057        if(isEvent(firstTask)) { 
    61             taskModel = PatternsVisitorUtil.createTaskModelFromNode(sequence); 
     58            this.present = containedPattern.containedIn(sequence); 
    6259        } else { 
    63             taskModel = PatternsVisitorUtil.createTaskModelFromNode(firstTask); 
    64         } 
    65         this.present = containedPattern.containedIn(taskModel);       
     60            this.present = containedPattern.containedIn(firstTask); 
     61        }     
    6662    } 
    6763 
Note: See TracChangeset for help on using the changeset viewer.