Ignore:
Timestamp:
04/19/13 19:51:55 (12 years ago)
Author:
adeicke
Message:
File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/GenerateTaskModelUtil.java

    r1152 r1165  
    1515package de.ugoe.cs.autoquest.usability.testutil; 
    1616 
     17import java.util.List; 
    1718import java.util.logging.Level; 
     19 
     20import com.google.common.collect.Lists; 
    1821 
    1922import de.ugoe.cs.autoquest.commands.sequences.CMDcondenseGuiModel; 
     
    2528import de.ugoe.cs.autoquest.plugin.jfc.commands.CMDparseJFC; 
    2629import de.ugoe.cs.autoquest.tasktrees.TaskTreeDecoder; 
    27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
    28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    29 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeBuilder; 
    30 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeNodeFactory; 
     30import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; 
     31import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceList; 
     32import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 
     33import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession; 
     34import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder; 
     35import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory; 
    3136import de.ugoe.cs.autoquest.test.CommandRunner; 
    3237import de.ugoe.cs.util.console.GlobalDataContainer; 
     
    4045 * @author Alexander Deicke 
    4146 */ 
    42 public class GenerateTaskTreeUtil { 
     47public class GenerateTaskModelUtil { 
    4348 
    4449    private static final String seqName = "sequences"; 
     
    4651    private static final String taskTreeName = "taskTree"; 
    4752     
    48     public static ITaskTree getTaskTreeFromSpec(String spec) { 
    49         TaskTreeNodeFactory factory = new TaskTreeNodeFactory(); 
    50         ITaskTreeNode taskTree = new TaskTreeDecoder(new TaskTreeNodeFactory(), new TaskTreeBuilder()).instantiateTaskTree(spec); 
    51         return factory.createTaskTree(taskTree); 
     53    public static ITaskModel getTaskModelFromSpec(String spec) { 
     54        ITaskFactory factory = new TaskFactory(); 
     55        ITaskInstanceList taskInstances = new TaskTreeDecoder(factory, new TaskBuilder()).decode(spec); 
     56        List<IUserSession> userSessions = Lists.newArrayList(); 
     57        userSessions.add((IUserSession) taskInstances); 
     58        return factory.createTaskModel(userSessions); 
    5259    } 
    5360     
    54     public static ITaskTree getTaskTreeFromFile(String filename) { 
     61    public static ITaskModel getTaskTreeFromFile(String filename) { 
    5562        new TextConsole(Level.OFF); 
    5663        parseTraceFile(filename); 
     
    6067        detectTextInputEvents(); 
    6168        condenseMouseClicks(); 
    62         return generateTaskTree(); 
     69        return generateTaskModel(); 
    6370    } 
    6471 
     
    8895    } 
    8996 
    90     private static ITaskTree generateTaskTree() { 
     97    private static ITaskModel generateTaskModel() { 
    9198        CommandRunner.runCommand(CMDgenerateTaskTree.class, seqName, taskTreeName); 
    9299        GlobalDataContainer dataContainer = GlobalDataContainer.getInstance(); 
    93         return (ITaskTree) dataContainer.getData(taskTreeName); 
     100        return (ITaskModel) dataContainer.getData(taskTreeName); 
    94101    } 
    95102 
Note: See TracChangeset for help on using the changeset viewer.