Changeset 1149 for trunk


Ignore:
Timestamp:
04/04/13 16:35:51 (12 years ago)
Author:
pharms
Message:
  • make ui-core at least compilable
Location:
trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/TextInputStatisticsRule.java

    r927 r1149  
    1717import java.text.DecimalFormat; 
    1818import java.util.ArrayList; 
     19import java.util.Collection; 
    1920import java.util.HashMap; 
    2021import java.util.List; 
     
    2526import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField; 
    2627import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
    27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
    28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
     28import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship; 
     29import de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship; 
     30import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
     31import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    2932 
    3033/** 
     
    4245     */ 
    4346    @Override 
    44     public UsabilityEvaluationResult evaluate(ITaskTree taskTree) { 
     47    public UsabilityEvaluationResult evaluate(ITaskModel taskModel) { 
    4548        TextInputStatistics statistics = new TextInputStatistics(); 
    46         calculateStatistics(taskTree.getRoot(), statistics); 
     49        calculateStatistics(taskModel.getTasks(), statistics); 
    4750 
    4851        UsabilityEvaluationResult results = new UsabilityEvaluationResult(); 
     
    230233     * @param statistics 
    231234     */ 
    232     private void calculateStatistics(ITaskTreeNode node, TextInputStatistics statistics) { 
    233         if ((node instanceof IEventTask) && 
    234             (((IEventTask) node).getEventType() instanceof TextInput)) 
     235    private void calculateStatistics(Collection<ITask> tasks, TextInputStatistics statistics) { 
     236        for (ITask task : tasks) { 
     237            calculateStatistics(task, statistics); 
     238        } 
     239    } 
     240 
     241    /** 
     242     * TODO: comment 
     243     *  
     244     * @param taskTree 
     245     * @param statistics 
     246     */ 
     247    private void calculateStatistics(ITask task, TextInputStatistics statistics) { 
     248         
     249        if ((task instanceof IEventTask) && 
     250            (((IEventTask) task).getEventType() instanceof TextInput)) 
    235251        { 
    236             calculateStatistics((IEventTask) node, statistics); 
     252            calculateStatistics((IEventTask) task, statistics); 
    237253        } 
    238254        else { 
    239             if ((node.getChildren() == null) || (node.getChildren().size() == 0)) { 
    240                 statistics.incrementNoOfOtherEventTasks(); 
    241             } 
    242             else { 
    243                 for (ITaskTreeNode child : node.getChildren()) { 
     255            if (task instanceof IStructuringTemporalRelationship) { 
     256                for (ITask child : ((IStructuringTemporalRelationship) task).getChildren()) { 
    244257                    calculateStatistics(child, statistics); 
    245258                } 
     259            } 
     260            else if (task instanceof IMarkingTemporalRelationship) { 
     261                calculateStatistics 
     262                    (((IMarkingTemporalRelationship) task).getMarkedTask(), statistics); 
     263            } 
     264            else { 
     265                statistics.incrementNoOfOtherEventTasks(); 
    246266            } 
    247267        } 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationManager.java

    r1148 r1149  
    1919import java.util.logging.Level; 
    2020 
    21 import de.ugoe.cs.autoquest.tasktrees.query.TaskTreeQueryProcessor; 
    2221import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    2322import de.ugoe.cs.util.console.Console; 
     
    5655     * @param taskTree 
    5756     */ 
    58     public UsabilityEvaluationResult evaluateUsability(ITaskModel taskTree) { 
    59         Console.traceln(Level.INFO, "evaluating usability of task tree " + taskTree); 
     57    public UsabilityEvaluationResult evaluateUsability(ITaskModel taskModel) { 
     58        Console.traceln(Level.INFO, "evaluating usability of task model " + taskModel); 
    6059 
    6160        List<UsabilityEvaluationResult> results = new ArrayList<UsabilityEvaluationResult>(); 
    62         TaskTreeQueryProcessor queryProcessor = new TaskTreeQueryProcessor(taskTree); 
    6361 
    6462        for (UsabilityEvaluationRule rule : rules) { 
    6563            Console.traceln(Level.INFO, "applying rule " + rule.getClass().getSimpleName()); 
    66             UsabilityEvaluationResult result = rule.evaluate(queryProcessor); 
     64            UsabilityEvaluationResult result = rule.evaluate(taskModel); 
    6765            results.add(result); 
    6866            Console.traceln(Level.INFO, "the rule found " + result.getAllDefects().size() + 
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationRule.java

    r927 r1149  
    1515package de.ugoe.cs.autoquest.usability; 
    1616 
    17 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
     17import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
    1818 
    1919/** 
     
    3131     * @return 
    3232     */ 
    33     UsabilityEvaluationResult evaluate(ITaskTree taskTree); 
     33    UsabilityEvaluationResult evaluate(ITaskModel taskModel); 
    3434 
    3535} 
Note: See TracChangeset for help on using the changeset viewer.