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 | |
---|
15 | package de.ugoe.cs.autoquest.usability; |
---|
16 | |
---|
17 | import de.ugoe.cs.autoquest.eventcore.Event; |
---|
18 | import de.ugoe.cs.autoquest.eventcore.gui.Scroll; |
---|
19 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; |
---|
20 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; |
---|
21 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; |
---|
22 | |
---|
23 | /** |
---|
24 | * <p> |
---|
25 | * TODO comment |
---|
26 | * </p> |
---|
27 | * |
---|
28 | * @author Patrick Harms |
---|
29 | */ |
---|
30 | public 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 | } |
---|