Changeset 1149
- Timestamp:
- 04/04/13 16:35:51 (12 years ago)
- 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 17 17 import java.text.DecimalFormat; 18 18 import java.util.ArrayList; 19 import java.util.Collection; 19 20 import java.util.HashMap; 20 21 import java.util.List; … … 25 26 import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField; 26 27 import 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; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 31 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 29 32 30 33 /** … … 42 45 */ 43 46 @Override 44 public UsabilityEvaluationResult evaluate(ITask Tree taskTree) {47 public UsabilityEvaluationResult evaluate(ITaskModel taskModel) { 45 48 TextInputStatistics statistics = new TextInputStatistics(); 46 calculateStatistics(task Tree.getRoot(), statistics);49 calculateStatistics(taskModel.getTasks(), statistics); 47 50 48 51 UsabilityEvaluationResult results = new UsabilityEvaluationResult(); … … 230 233 * @param statistics 231 234 */ 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)) 235 251 { 236 calculateStatistics((IEventTask) node, statistics);252 calculateStatistics((IEventTask) task, statistics); 237 253 } 238 254 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()) { 244 257 calculateStatistics(child, statistics); 245 258 } 259 } 260 else if (task instanceof IMarkingTemporalRelationship) { 261 calculateStatistics 262 (((IMarkingTemporalRelationship) task).getMarkedTask(), statistics); 263 } 264 else { 265 statistics.incrementNoOfOtherEventTasks(); 246 266 } 247 267 } -
trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationManager.java
r1148 r1149 19 19 import java.util.logging.Level; 20 20 21 import de.ugoe.cs.autoquest.tasktrees.query.TaskTreeQueryProcessor;22 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 23 22 import de.ugoe.cs.util.console.Console; … … 56 55 * @param taskTree 57 56 */ 58 public UsabilityEvaluationResult evaluateUsability(ITaskModel task Tree) {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); 60 59 61 60 List<UsabilityEvaluationResult> results = new ArrayList<UsabilityEvaluationResult>(); 62 TaskTreeQueryProcessor queryProcessor = new TaskTreeQueryProcessor(taskTree);63 61 64 62 for (UsabilityEvaluationRule rule : rules) { 65 63 Console.traceln(Level.INFO, "applying rule " + rule.getClass().getSimpleName()); 66 UsabilityEvaluationResult result = rule.evaluate( queryProcessor);64 UsabilityEvaluationResult result = rule.evaluate(taskModel); 67 65 results.add(result); 68 66 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 15 15 package de.ugoe.cs.autoquest.usability; 16 16 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Tree;17 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 18 18 19 19 /** … … 31 31 * @return 32 32 */ 33 UsabilityEvaluationResult evaluate(ITask Tree taskTree);33 UsabilityEvaluationResult evaluate(ITaskModel taskModel); 34 34 35 35 }
Note: See TracChangeset
for help on using the changeset viewer.