Ignore:
Timestamp:
05/01/13 14:31:59 (12 years ago)
Author:
adeicke
Message:

Renaming from UsagePattern? to InteractionPattern?.

Location:
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns
Files:
4 edited
6 moved

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/InteractionPattern.java

    r1179 r1204  
    3535 * @author Alexander Deicke 
    3636 */ 
    37 public class UsagePattern { 
     37public class InteractionPattern { 
    3838     
    3939    private TaskModelFilter taskTreeFilter = new TaskModelFilter(new IterativeDFSFilterStrategy()); 
     
    4141    private TaskTypeFilter concernedTask; 
    4242 
    43     private List<UsagePatternVisitor> patternVisitors; 
     43    private List<InteractionPatternVisitor> patternVisitors; 
    4444     
    4545    private boolean present = false; 
     
    5353     * @param eventType 
    5454     */ 
    55     public UsagePattern(TaskTypeFilter concernedNode, 
    56                         UsagePatternVisitor... patternVisitor) 
     55    public InteractionPattern(TaskTypeFilter concernedNode, 
     56                        InteractionPatternVisitor... patternVisitor) 
    5757    { 
    5858        this.patternVisitors = Arrays.asList(patternVisitor); 
     
    8484 
    8585    private void applyAllVisitors(ITask concernedTask) { 
    86         Optional<UsagePatternVisitor> previousVisitor = Optional.absent(); 
    87         for(UsagePatternVisitor visitor : patternVisitors) { 
    88             if(appliedOnSelectionNode(previousVisitor)) { 
    89                 for(ITask selection : previousVisitor.get().getRetainedSelectionNodes()) { 
    90                     selection.accept(visitor); 
    91                 } 
    92             } else { 
    93                 previousVisitor = Optional.of(visitor); 
    94                 concernedTask.accept(visitor); 
    95             } 
     86        Optional<InteractionPatternVisitor> previousVisitor = Optional.absent(); 
     87        for(InteractionPatternVisitor visitor : patternVisitors) { 
     88                        if (appliedOnSelectionNode(previousVisitor)) { 
     89                                for (ITask selection : previousVisitor.get().getRetainedSelectionNodes()) { 
     90                                        selection.accept(visitor); 
     91                                } 
     92                        } else { 
     93                                previousVisitor = Optional.of(visitor); 
     94                                concernedTask.accept(visitor); 
     95                        } 
    9696        } 
    9797    } 
    9898 
    99     private boolean appliedOnSelectionNode(Optional<UsagePatternVisitor> previousVisitor) { 
     99    private boolean appliedOnSelectionNode(Optional<InteractionPatternVisitor> previousVisitor) { 
    100100        return previousVisitor.isPresent() && previousVisitor.get().hasExcludedSelectionNodes(); 
    101101    } 
     
    121121     */ 
    122122    private boolean allVisitorsArePresent() { 
    123         Iterable<UsagePatternVisitor> allPresent = Iterables.filter(this.patternVisitors, new Predicate<UsagePatternVisitor>() { 
     123        Iterable<InteractionPatternVisitor> allPresent = Iterables.filter(this.patternVisitors, new Predicate<InteractionPatternVisitor>() { 
    124124             
    125             public boolean apply(UsagePatternVisitor visitor) { 
     125            public boolean apply(InteractionPatternVisitor visitor) { 
    126126                return visitor.isPresent(); 
    127127            } 
     
    138138     */ 
    139139    private void resetAllVisitors() { 
    140         for(UsagePatternVisitor visitor : this.patternVisitors) { 
     140        for(InteractionPatternVisitor visitor : this.patternVisitors) { 
    141141            visitor.reset(); 
    142142        } 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/InteractionPatternBuilder.java

    r1179 r1204  
    1616 
    1717import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.ContainsEventVisitor; 
    18 import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.ContainsPatternVisitor; 
     18import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.ContainsInteractionPatternVisitor; 
    1919import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.EndsWithEventVisitor; 
    20 import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.EndsWithPatternVisitor; 
     20import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.EndsWithInteractionPatternVisitor; 
    2121import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.StartsWithEventVisitor; 
    22 import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.StartsWithPatternVisitor; 
     22import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.StartsWithInteractionPatternVisitor; 
    2323import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 
    2424import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
     
    3131 * @author Alexander Deicke 
    3232 */ 
    33 public class UsagePatternBuilder { 
     33public class InteractionPatternBuilder { 
    3434 
    3535    protected TaskTypeFilter concernedNode; 
     
    3737    protected EventTypeFilter startsWithEvent; 
    3838     
    39     protected UsagePattern startsWithPattern; 
     39    protected InteractionPattern startsWithPattern; 
    4040     
    4141    protected EventTypeFilter endsWithEvent; 
    4242     
    43     protected UsagePattern endsWithPattern; 
     43    protected InteractionPattern endsWithPattern; 
    4444     
    4545    protected EventTypeFilter containsEvent; 
    4646     
    47     protected UsagePattern containsPattern; 
     47    protected InteractionPattern containsPattern; 
    4848     
    4949    /** 
     
    7171         */ 
    7272        public BuildStartsWithEventStep startsWith(EventTypeFilter startsWithType) { 
    73             UsagePatternBuilder.this.startsWithEvent = startsWithType; 
     73            InteractionPatternBuilder.this.startsWithEvent = startsWithType; 
    7474            return new BuildStartsWithEventStep(); 
    7575        } 
     
    8383         * @return 
    8484         */ 
    85         public BuildStartsWithPatternStep startsWith(UsagePattern startsWithPattern) { 
    86             UsagePatternBuilder.this.startsWithPattern = startsWithPattern; 
     85        public BuildStartsWithPatternStep startsWith(InteractionPattern startsWithPattern) { 
     86            InteractionPatternBuilder.this.startsWithPattern = startsWithPattern; 
    8787            return new BuildStartsWithPatternStep(); 
    8888        } 
     
    9797         */ 
    9898        public BuildEndsWithEventStep endsWith(EventTypeFilter endsWithType) { 
    99             UsagePatternBuilder.this.endsWithEvent = endsWithType; 
     99            InteractionPatternBuilder.this.endsWithEvent = endsWithType; 
    100100            return new BuildEndsWithEventStep(); 
    101101        } 
     
    109109         * @return 
    110110         */ 
    111         public BuildEndsWithPatternStep endsWith(UsagePattern endsWithPattern) { 
    112             UsagePatternBuilder.this.endsWithPattern = endsWithPattern; 
     111        public BuildEndsWithPatternStep endsWith(InteractionPattern endsWithPattern) { 
     112            InteractionPatternBuilder.this.endsWithPattern = endsWithPattern; 
    113113            return new BuildEndsWithPatternStep(); 
    114114        } 
     
    123123         */ 
    124124        public BuildContainsEventStep contains(EventTypeFilter containsType) { 
    125             UsagePatternBuilder.this.containsEvent = containsType; 
     125            InteractionPatternBuilder.this.containsEvent = containsType; 
    126126            return new BuildContainsEventStep(); 
    127127        } 
     
    135135         * @return 
    136136         */ 
    137         public BuildContainsPatternStep contains(UsagePattern containsPattern) { 
    138             UsagePatternBuilder.this.containsPattern = containsPattern; 
     137        public BuildContainsPatternStep contains(InteractionPattern containsPattern) { 
     138            InteractionPatternBuilder.this.containsPattern = containsPattern; 
    139139            return new BuildContainsPatternStep(); 
    140140        } 
     
    153153         */ 
    154154        public BuildStartsAndEndsWithEventStep endsWith(EventTypeFilter endsWithType) { 
    155             UsagePatternBuilder.this.endsWithEvent = endsWithType; 
     155            InteractionPatternBuilder.this.endsWithEvent = endsWithType; 
    156156            return new BuildStartsAndEndsWithEventStep(); 
    157157        } 
     
    165165         * @return 
    166166         */ 
    167         public BuildStartsWithEventAndEndsWithPattern endsWith(UsagePattern endsWithPattern) { 
    168             UsagePatternBuilder.this.endsWithPattern = endsWithPattern; 
     167        public BuildStartsWithEventAndEndsWithPattern endsWith(InteractionPattern endsWithPattern) { 
     168            InteractionPatternBuilder.this.endsWithPattern = endsWithPattern; 
    169169            return new BuildStartsWithEventAndEndsWithPattern(); 
    170170        } 
     
    179179         */ 
    180180        public BuildStartsWithEventAndContainsEventStep contains(EventTypeFilter containsType) { 
    181             UsagePatternBuilder.this.containsEvent = containsType; 
     181            InteractionPatternBuilder.this.containsEvent = containsType; 
    182182            return new BuildStartsWithEventAndContainsEventStep(); 
    183183        } 
     
    191191         * @return 
    192192         */ 
    193         public BuildStartsWithEventAndContainsPatternStep contains(UsagePattern containsPattern) { 
    194             UsagePatternBuilder.this.containsPattern = containsPattern; 
     193        public BuildStartsWithEventAndContainsPatternStep contains(InteractionPattern containsPattern) { 
     194            InteractionPatternBuilder.this.containsPattern = containsPattern; 
    195195            return new BuildStartsWithEventAndContainsPatternStep(); 
    196196        } 
     
    203203         * @return 
    204204         */ 
    205         public UsagePattern build() { 
    206             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent)); 
     205        public InteractionPattern build() { 
     206            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode)); 
    207207        } 
    208208         
     
    220220         */ 
    221221        public BuildStartsWithPatternAndContainsEventStep contains(EventTypeFilter containsEvent) { 
    222             UsagePatternBuilder.this.containsEvent = containsEvent; 
     222            InteractionPatternBuilder.this.containsEvent = containsEvent; 
    223223            return new BuildStartsWithPatternAndContainsEventStep(); 
    224224        } 
     
    232232         * @return 
    233233         */ 
    234         public BuildStartsWithPatternAndContainsPatternStep contains(UsagePattern containsPattern) { 
    235             UsagePatternBuilder.this.containsPattern = containsPattern; 
     234        public BuildStartsWithPatternAndContainsPatternStep contains(InteractionPattern containsPattern) { 
     235            InteractionPatternBuilder.this.containsPattern = containsPattern; 
    236236            return new BuildStartsWithPatternAndContainsPatternStep(); 
    237237        } 
     
    246246         */ 
    247247        public BuildStartsWithPatternAndEndsWithEventStep endsWith(EventTypeFilter endsWithEvent) { 
    248             UsagePatternBuilder.this.endsWithEvent = endsWithEvent; 
     248            InteractionPatternBuilder.this.endsWithEvent = endsWithEvent; 
    249249            return new BuildStartsWithPatternAndEndsWithEventStep(); 
    250250        } 
     
    258258         * @return 
    259259         */ 
    260         public BuildStartsAndEndsWithPatternStep endsWith(UsagePattern endsWithPattern) { 
    261             UsagePatternBuilder.this.endsWithPattern = endsWithPattern; 
     260        public BuildStartsAndEndsWithPatternStep endsWith(InteractionPattern endsWithPattern) { 
     261            InteractionPatternBuilder.this.endsWithPattern = endsWithPattern; 
    262262            return new BuildStartsAndEndsWithPatternStep(); 
    263263        } 
     
    270270         * @return 
    271271         */ 
    272         public UsagePattern build() { 
    273             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern)); 
     272        public InteractionPattern build() { 
     273            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode)); 
    274274        } 
    275275         
     
    285285         * @return 
    286286         */ 
    287         public UsagePattern build() { 
    288             return new UsagePattern(concernedNode, new EndsWithEventVisitor(endsWithEvent)); 
     287        public InteractionPattern build() { 
     288            return new InteractionPattern(concernedNode, new EndsWithEventVisitor(endsWithEvent, concernedNode)); 
    289289        } 
    290290         
     
    300300         * @return 
    301301         */ 
    302         public UsagePattern build() { 
    303             return new UsagePattern(concernedNode, new EndsWithPatternVisitor(endsWithPattern)); 
     302        public InteractionPattern build() { 
     303            return new InteractionPattern(concernedNode, new EndsWithInteractionPatternVisitor(endsWithPattern, concernedNode)); 
    304304        } 
    305305         
     
    317317         */ 
    318318        public BuildContainsAndEndsWithEventStep endsWith(EventTypeFilter endsWithType) { 
    319             UsagePatternBuilder.this.endsWithEvent = endsWithType; 
     319            InteractionPatternBuilder.this.endsWithEvent = endsWithType; 
    320320            return new BuildContainsAndEndsWithEventStep(); 
    321321        } 
     
    328328         * @return 
    329329         */ 
    330         public UsagePattern build() { 
    331             return new UsagePattern(concernedNode, new ContainsEventVisitor(containsEvent)); 
     330        public InteractionPattern build() { 
     331            return new InteractionPattern(concernedNode, new ContainsEventVisitor(containsEvent, concernedNode)); 
    332332        } 
    333333         
     
    343343         * @return 
    344344         */ 
    345         public UsagePattern build() { 
    346             return new UsagePattern(concernedNode, new ContainsPatternVisitor(containsPattern)); 
     345        public InteractionPattern build() { 
     346            return new InteractionPattern(concernedNode, new ContainsInteractionPatternVisitor(containsPattern, concernedNode)); 
    347347        } 
    348348         
     
    358358         * @return 
    359359         */ 
    360         public UsagePattern build() { 
    361             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new EndsWithEventVisitor(endsWithEvent)); 
     360        public InteractionPattern build() { 
     361            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new EndsWithEventVisitor(endsWithEvent, concernedNode)); 
    362362        } 
    363363         
     
    373373         * @return 
    374374         */ 
    375         public UsagePattern build() { 
    376             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new EndsWithPatternVisitor(endsWithPattern)); 
     375        public InteractionPattern build() { 
     376            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new EndsWithInteractionPatternVisitor(endsWithPattern, concernedNode)); 
    377377        } 
    378378         
     
    388388         * @return 
    389389         */ 
    390         public UsagePattern build() { 
    391             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new EndsWithEventVisitor(endsWithEvent)); 
     390        public InteractionPattern build() { 
     391            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new EndsWithEventVisitor(endsWithEvent, concernedNode)); 
    392392        } 
    393393         
     
    403403         * @return 
    404404         */ 
    405         public UsagePattern build() { 
    406             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new EndsWithPatternVisitor(endsWithPattern)); 
     405        public InteractionPattern build() { 
     406            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new EndsWithInteractionPatternVisitor(endsWithPattern, concernedNode)); 
    407407        } 
    408408         
     
    420420         */ 
    421421        public BuildStartsAndEndsWithEventAndContainsEventStep endsWith(EventTypeFilter endsWithEvent) { 
    422             UsagePatternBuilder.this.endsWithEvent = endsWithEvent; 
     422            InteractionPatternBuilder.this.endsWithEvent = endsWithEvent; 
    423423            return new BuildStartsAndEndsWithEventAndContainsEventStep(); 
    424424        } 
     
    432432         * @return 
    433433         */ 
    434         public BuildStartsWithEventContainsEventAndEndsWithPatternStep endsWith(UsagePattern endsWithPattern) { 
    435             UsagePatternBuilder.this.endsWithPattern = endsWithPattern; 
     434        public BuildStartsWithEventContainsEventAndEndsWithPatternStep endsWith(InteractionPattern endsWithPattern) { 
     435            InteractionPatternBuilder.this.endsWithPattern = endsWithPattern; 
    436436            return new BuildStartsWithEventContainsEventAndEndsWithPatternStep(); 
    437437        } 
     
    444444         * @return 
    445445         */ 
    446         public UsagePattern build() { 
    447             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new ContainsEventVisitor(containsEvent)); 
     446        public InteractionPattern build() { 
     447            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new ContainsEventVisitor(containsEvent, concernedNode)); 
    448448        } 
    449449         
     
    461461         */ 
    462462        public BuildStartsContainsPatternAndEndsWithEventStep endsWith(EventTypeFilter endsWithEvent) { 
    463             UsagePatternBuilder.this.endsWithEvent = endsWithEvent; 
     463            InteractionPatternBuilder.this.endsWithEvent = endsWithEvent; 
    464464            return new BuildStartsContainsPatternAndEndsWithEventStep(); 
    465465        } 
     
    473473         * @return 
    474474         */ 
    475         public BuildStartsAndEndsWithPatternAndContainsPatternStep endsWith(UsagePattern endsWithPattern) { 
    476             UsagePatternBuilder.this.endsWithPattern = endsWithPattern; 
     475        public BuildStartsAndEndsWithPatternAndContainsPatternStep endsWith(InteractionPattern endsWithPattern) { 
     476            InteractionPatternBuilder.this.endsWithPattern = endsWithPattern; 
    477477            return new BuildStartsAndEndsWithPatternAndContainsPatternStep(); 
    478478        } 
     
    485485         * @return 
    486486         */ 
    487         public UsagePattern build() { 
    488             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new ContainsPatternVisitor(containsPattern)); 
     487        public InteractionPattern build() { 
     488            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new ContainsInteractionPatternVisitor(containsPattern, concernedNode)); 
    489489        } 
    490490         
     
    502502         */ 
    503503        public BuildStartsWithEventContainsPatternAndEndsWithEventStep endsWith(EventTypeFilter endsWithEvent) { 
    504             UsagePatternBuilder.this.endsWithEvent = endsWithEvent; 
     504            InteractionPatternBuilder.this.endsWithEvent = endsWithEvent; 
    505505            return new BuildStartsWithEventContainsPatternAndEndsWithEventStep(); 
    506506        } 
     
    514514         * @return 
    515515         */ 
    516         public BuildStartsWithEventContainsPatternAndEndsWithPatternStep endsWith(UsagePattern endsWithPattern) { 
    517             UsagePatternBuilder.this.endsWithPattern = endsWithPattern; 
     516        public BuildStartsWithEventContainsPatternAndEndsWithPatternStep endsWith(InteractionPattern endsWithPattern) { 
     517            InteractionPatternBuilder.this.endsWithPattern = endsWithPattern; 
    518518            return new BuildStartsWithEventContainsPatternAndEndsWithPatternStep(); 
    519519        } 
     
    526526         * @return 
    527527         */ 
    528         public UsagePattern build() { 
    529             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new ContainsPatternVisitor(containsPattern)); 
     528        public InteractionPattern build() { 
     529            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new ContainsInteractionPatternVisitor(containsPattern, concernedNode)); 
    530530        } 
    531531         
     
    543543         */ 
    544544        public BuildStartsWithPatternContainsEventAndEndsWithEventStep endsWith(EventTypeFilter endsWithEvent) { 
    545             UsagePatternBuilder.this.endsWithEvent = endsWithEvent; 
     545            InteractionPatternBuilder.this.endsWithEvent = endsWithEvent; 
    546546            return new BuildStartsWithPatternContainsEventAndEndsWithEventStep(); 
    547547        } 
     
    555555         * @return 
    556556         */ 
    557         public BuildStartsWithPatternContainsEventAndEndsWithPatternStep endsWith(UsagePattern endsWithPattern) { 
    558             UsagePatternBuilder.this.endsWithPattern = endsWithPattern; 
     557        public BuildStartsWithPatternContainsEventAndEndsWithPatternStep endsWith(InteractionPattern endsWithPattern) { 
     558            InteractionPatternBuilder.this.endsWithPattern = endsWithPattern; 
    559559            return new BuildStartsWithPatternContainsEventAndEndsWithPatternStep(); 
    560560        } 
     
    567567         * @return 
    568568         */ 
    569         public UsagePattern build() { 
    570             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new ContainsEventVisitor(containsEvent)); 
     569        public InteractionPattern build() { 
     570            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new ContainsEventVisitor(containsEvent, concernedNode)); 
    571571        } 
    572572         
     
    582582         * @return 
    583583         */ 
    584         public UsagePattern build() { 
    585             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new EndsWithEventVisitor(endsWithEvent), new ContainsEventVisitor(containsEvent)); 
     584        public InteractionPattern build() { 
     585            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new EndsWithEventVisitor(endsWithEvent, concernedNode), new ContainsEventVisitor(containsEvent, concernedNode)); 
    586586        } 
    587587         
     
    597597         * @return 
    598598         */ 
    599         public UsagePattern build() { 
    600             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new ContainsPatternVisitor(containsPattern), new EndsWithEventVisitor(endsWithEvent)); 
     599        public InteractionPattern build() { 
     600            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new ContainsInteractionPatternVisitor(containsPattern, concernedNode), new EndsWithEventVisitor(endsWithEvent, concernedNode)); 
    601601        } 
    602602         
     
    612612         * @return 
    613613         */ 
    614         public UsagePattern build() { 
    615             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new EndsWithPatternVisitor(endsWithPattern), new ContainsPatternVisitor(containsPattern)); 
     614        public InteractionPattern build() { 
     615            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new EndsWithInteractionPatternVisitor(endsWithPattern, concernedNode), new ContainsInteractionPatternVisitor(containsPattern, concernedNode)); 
    616616        } 
    617617         
     
    627627         * @return 
    628628         */ 
    629         public UsagePattern build() { 
    630             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new ContainsEventVisitor(containsEvent), new EndsWithPatternVisitor(endsWithPattern)); 
     629        public InteractionPattern build() { 
     630            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new ContainsEventVisitor(containsEvent, concernedNode), new EndsWithInteractionPatternVisitor(endsWithPattern, concernedNode)); 
    631631        } 
    632632         
     
    642642         * @return 
    643643         */ 
    644         public UsagePattern build() { 
    645             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new ContainsPatternVisitor(containsPattern), new EndsWithEventVisitor(endsWithEvent)); 
     644        public InteractionPattern build() { 
     645            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new ContainsInteractionPatternVisitor(containsPattern, concernedNode), new EndsWithEventVisitor(endsWithEvent, concernedNode)); 
    646646        } 
    647647         
     
    657657         * @return 
    658658         */ 
    659         public UsagePattern build() { 
    660             return new UsagePattern(concernedNode, new StartsWithEventVisitor(startsWithEvent), new ContainsPatternVisitor(containsPattern), new EndsWithPatternVisitor(endsWithPattern)); 
     659        public InteractionPattern build() { 
     660            return new InteractionPattern(concernedNode, new StartsWithEventVisitor(startsWithEvent, concernedNode), new ContainsInteractionPatternVisitor(containsPattern, concernedNode), new EndsWithInteractionPatternVisitor(endsWithPattern, concernedNode)); 
    661661        } 
    662662         
     
    672672         * @return 
    673673         */ 
    674         public UsagePattern build() { 
    675             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new ContainsEventVisitor(containsEvent), new EndsWithEventVisitor(endsWithEvent)); 
     674        public InteractionPattern build() { 
     675            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new ContainsEventVisitor(containsEvent, concernedNode), new EndsWithEventVisitor(endsWithEvent, concernedNode)); 
    676676        } 
    677677         
     
    687687         * @return 
    688688         */ 
    689         public UsagePattern build() { 
    690             return new UsagePattern(concernedNode, new StartsWithPatternVisitor(startsWithPattern), new ContainsEventVisitor(containsEvent), new EndsWithPatternVisitor(endsWithPattern)); 
     689        public InteractionPattern build() { 
     690            return new InteractionPattern(concernedNode, new StartsWithInteractionPatternVisitor(startsWithPattern, concernedNode), new ContainsEventVisitor(containsEvent, concernedNode), new EndsWithInteractionPatternVisitor(endsWithPattern, concernedNode)); 
    691691        } 
    692692         
     
    702702         * @return 
    703703         */ 
    704         public UsagePattern build() { 
    705             return new UsagePattern(concernedNode, new ContainsEventVisitor(containsEvent), new EndsWithEventVisitor(endsWithEvent)); 
     704        public InteractionPattern build() { 
     705            return new InteractionPattern(concernedNode, new ContainsEventVisitor(containsEvent, concernedNode), new EndsWithEventVisitor(endsWithEvent, concernedNode)); 
    706706        } 
    707707         
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/InteractionPatternVisitor.java

    r1179 r1204  
    2929import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskVisitor; 
    3030import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 
     31import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
    3132 
    3233/** 
     
    3738 * @author Alexander Deicke 
    3839 */ 
    39 public abstract class UsagePatternVisitor implements ITaskVisitor { 
     40public abstract class InteractionPatternVisitor implements ITaskVisitor { 
    4041     
     42        protected TaskTypeFilter taskType; 
     43         
    4144    protected EventTypeFilter eventType; 
    4245     
    43     protected UsagePattern containedPattern; 
     46    protected InteractionPattern containedPattern; 
    4447     
    4548    protected boolean present = false; 
    4649     
    47     protected List<ITask> retainedChildrenTasksFromSelections = Lists.newArrayList(); 
     50    protected List<ITask> retainedSelectionTasks = Lists.newArrayList(); 
    4851     
    4952    /* (non-Javadoc) 
     
    8992    public void visit(ISelection selection) { 
    9093        if(isEventVisitor()) { 
    91             retainNodesWherePatternIsPresent(selection.getChildren()); 
     94            retainNodesWherePatternIsPresent(selection); 
    9295            this.present = patternIsPresent(); 
    9396        } else { 
     
    9699    } 
    97100 
    98     protected void retainNodesWherePatternIsPresent(List<ITask> children) { 
    99         for(ITask task : children) { 
     101    @SuppressWarnings("unchecked") 
     102        protected void retainNodesWherePatternIsPresent(ISelection selection) { 
     103        for(ITask task : selection.getChildren()) { 
    100104            this.present = false; 
    101105            task.accept(this); 
     106            if(this.present && this.taskType.filterPredicate().apply(selection)) { 
     107                this.retainedSelectionTasks.add(selection); 
     108            } 
    102109            if(this.present) { 
    103                 this.retainedChildrenTasksFromSelections.add(task); 
     110                break; 
    104111            } 
    105112        } 
     
    107114     
    108115    private boolean patternIsPresent() { 
    109         return !this.retainedChildrenTasksFromSelections.isEmpty(); 
     116        return !this.retainedSelectionTasks.isEmpty(); 
    110117    } 
    111118     
     
    128135     */ 
    129136    public void reset() { 
    130         this.retainedChildrenTasksFromSelections.clear(); 
     137        this.retainedSelectionTasks.clear(); 
    131138        this.present = false; 
    132139    } 
     
    151158     */ 
    152159    public List<ITask> getRetainedSelectionNodes() { 
    153         return this.retainedChildrenTasksFromSelections; 
     160        return this.retainedSelectionTasks; 
    154161    } 
    155162     
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/LongFormUsageDefect.java

    r1152 r1204  
    3939public class LongFormUsageDefect extends UsabilityRule implements UsabilityUsageDefect { 
    4040 
    41     private UsagePattern longFormUsagePattern; 
     41    private InteractionPattern longFormUsagePattern; 
    4242     
    4343    /** 
     
    6262     */ 
    6363    private void initUsagePattern() { 
    64         UsagePatternBuilder builder = new UsagePatternBuilder(); 
    65         UsagePattern fillFormPattern = builder.concernedNode(ITERATION).startsWith(TEXT_INPUT).endsWith(SCROLL).build(); 
     64        InteractionPatternBuilder builder = new InteractionPatternBuilder(); 
     65        InteractionPattern fillFormPattern = builder.concernedNode(ITERATION).startsWith(TEXT_INPUT).endsWith(SCROLL).build(); 
    6666        this.longFormUsagePattern = builder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).contains(fillFormPattern).endsWith(MOUSE_CLICK).build(); 
    6767    } 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/ContainsEventVisitor.java

    r1152 r1204  
    2020import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2121import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     22import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 
    2323import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 
     24import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
    2425 
    2526/** 
     
    3031 * @author Alexander Deicke 
    3132 */ 
    32 public class ContainsEventVisitor extends UsagePatternVisitor { 
     33public class ContainsEventVisitor extends InteractionPatternVisitor { 
    3334 
    3435    /** 
     
    3940     * @param containsType 
    4041     */ 
    41     public ContainsEventVisitor(EventTypeFilter containsType) { 
     42    public ContainsEventVisitor(EventTypeFilter containsType, TaskTypeFilter taskType) { 
    4243        this.eventType = containsType; 
     44        this.taskType = taskType; 
    4345    } 
    4446 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/ContainsInteractionPatternVisitor.java

    r1179 r1204  
    1919import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2020import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    21 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 
    22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     21import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPattern; 
     22import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 
     23import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
    2324 
    2425/** 
     
    2930 * @author Alexander Deicke 
    3031 */ 
    31 public class ContainsPatternVisitor extends UsagePatternVisitor { 
     32public class ContainsInteractionPatternVisitor extends InteractionPatternVisitor { 
    3233 
    3334    /** 
     
    3839     * @param containsPattern 
    3940     */ 
    40     public ContainsPatternVisitor(UsagePattern containsPattern) { 
     41    public ContainsInteractionPatternVisitor(InteractionPattern containsPattern, TaskTypeFilter taskType) { 
    4142        this.containedPattern = containsPattern; 
     43        this.taskType = taskType; 
    4244    } 
    4345 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/EndsWithEventVisitor.java

    r1152 r1204  
    1717import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
    1818import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    19 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     19import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 
    2020import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 
     21import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
    2122import de.ugoe.cs.autoquest.usability.util.PatternsVisitorUtil; 
    2223 
     
    2829 * @author Alexander Deicke 
    2930 */ 
    30 public class EndsWithEventVisitor extends UsagePatternVisitor { 
     31public class EndsWithEventVisitor extends InteractionPatternVisitor { 
    3132 
    3233    /** 
     
    3738     * @param eventType 
    3839     */ 
    39     public EndsWithEventVisitor(EventTypeFilter eventType) { 
     40    public EndsWithEventVisitor(EventTypeFilter eventType, TaskTypeFilter taskType) { 
    4041        this.eventType = eventType; 
     42        this.taskType = taskType; 
    4143    } 
    4244 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/EndsWithInteractionPatternVisitor.java

    r1179 r1204  
    1919import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2020import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    21 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 
    22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     21import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPattern; 
     22import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 
     23import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
    2324import de.ugoe.cs.autoquest.usability.util.PatternsVisitorUtil; 
    2425 
     
    3031 * @author Alexander Deicke 
    3132 */ 
    32 public class EndsWithPatternVisitor extends UsagePatternVisitor { 
     33public class EndsWithInteractionPatternVisitor extends InteractionPatternVisitor { 
    3334 
    3435    /** 
     
    3940     * @param endsWithPattern 
    4041     */ 
    41     public EndsWithPatternVisitor(UsagePattern endsWithPattern) { 
     42    public EndsWithInteractionPatternVisitor(InteractionPattern endsWithPattern, TaskTypeFilter taskType) { 
    4243        this.containedPattern = endsWithPattern; 
     44        this.taskType = taskType; 
    4345    } 
    4446 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/StartsWithEventVisitor.java

    r1152 r1204  
    1717import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
    1818import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    19 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     19import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 
    2020import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 
     21import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
    2122import de.ugoe.cs.autoquest.usability.util.PatternsVisitorUtil; 
    2223 
     
    2829 * @author Alexander Deicke 
    2930 */ 
    30 public class StartsWithEventVisitor extends UsagePatternVisitor { 
     31public class StartsWithEventVisitor extends InteractionPatternVisitor { 
    3132 
    3233    /** 
     
    3738     * @param eventType 
    3839     */ 
    39     public StartsWithEventVisitor(EventTypeFilter eventType) { 
     40    public StartsWithEventVisitor(EventTypeFilter eventType, TaskTypeFilter taskType) { 
    4041        this.eventType = eventType; 
     42        this.taskType = taskType; 
    4143    } 
    4244 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/StartsWithInteractionPatternVisitor.java

    r1179 r1204  
    1919import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2020import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    21 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern; 
    22 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternVisitor; 
     21import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPattern; 
     22import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 
     23import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter; 
    2324import de.ugoe.cs.autoquest.usability.util.PatternsVisitorUtil; 
    2425 
     
    3031 * @author Alexander Deicke 
    3132 */ 
    32 public class StartsWithPatternVisitor extends UsagePatternVisitor { 
     33public class StartsWithInteractionPatternVisitor extends InteractionPatternVisitor { 
    3334 
    3435    /** 
     
    3940     * @param startsWithPattern 
    4041     */ 
    41     public StartsWithPatternVisitor(UsagePattern startsWithPattern) { 
     42    public StartsWithInteractionPatternVisitor(InteractionPattern startsWithPattern, TaskTypeFilter taskType) { 
    4243        this.containedPattern = startsWithPattern; 
     44        this.taskType = taskType; 
    4345    } 
    4446 
Note: See TracChangeset for help on using the changeset viewer.