source: trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/ActionClassifier.java @ 2162

Last change on this file since 2162 was 2162, checked in by pharms, 7 years ago
  • changes for first VR oriented usability evaluation
  • Property svn:mime-type set to text/plain
File size: 1.9 KB
Line 
1//   Copyright 2015 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.usability;
16
17import de.ugoe.cs.autoquest.eventcore.Event;
18import de.ugoe.cs.autoquest.eventcore.gui.Scroll;
19import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask;
20import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance;
21import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
22
23/**
24 * <p>
25 * TODO comment
26 * </p>
27 *
28 * @author Patrick Harms
29 */
30public class ActionClassifier {
31
32    /**
33     * convenience method to classify an action as inefficient
34     */
35    public static boolean isInefficient(Event event) {
36        return (event.getType() instanceof Scroll) ||
37               ("headMoved".equals(event.getType().toString())) ||
38               ("headRotated".equals(event.getType().toString()));
39    }
40
41    /**
42     * convenience method to classify an event task instance as inefficient
43     */
44    public static boolean isInefficient(IEventTaskInstance eventTaskInstance) {
45        return isInefficient(eventTaskInstance.getEvent());
46    }
47
48    /**
49     * convenience method to classify an event task as inefficient
50     */
51    public static boolean isInefficient(IEventTask eventTask) {
52        for (ITaskInstance instance : eventTask.getInstances()) {
53            if (isInefficient((IEventTaskInstance) instance)) {
54                return true;
55            }
56        }
57        return false;
58    }
59
60}
Note: See TracBrowser for help on using the repository browser.