Changeset 1294 for trunk/autoquest-test-utils/src/main/java/de/ugoe/cs/autoquest/tasktrees/TaskTreeEncoder.java
- Timestamp:
- 08/14/13 17:04:42 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-test-utils/src/main/java/de/ugoe/cs/autoquest/tasktrees/TaskTreeEncoder.java
r1146 r1294 24 24 import java.util.Map; 25 25 26 import de.ugoe.cs.autoquest.eventcore.Event; 26 27 import de.ugoe.cs.autoquest.eventcore.gui.TextInput; 27 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 28 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 29 31 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 32 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptionalInstance; 30 33 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 34 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance; 31 35 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 32 36 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; … … 141 145 else if (task instanceof IEventTask) { 142 146 out.print(indent); 143 out.print(((IEventTask) task).getEventType()); 144 out.print(" "); 145 out.print(((IEventTask) task).getEventTarget().getStringIdentifier()); 146 // if (((IEventTask) node).getEventTarget() instanceof IGUIElement) { 147 // out.print(" "); 148 // out.print(((IGUIElement) ((IEventTask) node).getEventTarget()).getSpecification()); 149 // } 147 out.print(task); 150 148 } 151 149 else { … … 154 152 155 153 int i = 0; 156 for (ITaskInstance child : taskInstance.getChildren()) { 157 encode(child, out, indent + " ", i++); 154 155 if (taskInstance instanceof ITaskInstanceList) { 156 for (ITaskInstance child : (ITaskInstanceList) taskInstance) { 157 encode(child, out, indent + " ", i++); 158 } 159 } 160 else if (taskInstance instanceof ISelectionInstance) { 161 encode(((ISelectionInstance) taskInstance).getChild(), out, indent + " ", i++); 162 } 163 else if (taskInstance instanceof IOptionalInstance) { 164 encode(((IOptionalInstance) taskInstance).getChild(), out, indent + " ", i++); 158 165 } 159 166 … … 221 228 } 222 229 else if (task instanceof IEventTask) { 223 if (((IEventTask) task).getEventType() instanceof TextInput) { 230 Event event = ((IEventTaskInstance) taskInstance).getEvent(); 231 if (event.getType() instanceof TextInput) { 224 232 if (id == null) { 225 233 id = "textInput" + typeCounters[3]++; … … 229 237 System.out.print(id); 230 238 System.out.print(" \""); 231 System.out.print(((TextInput) ((IEventTask) task).getEventType()).getEnteredText());239 System.out.print(((TextInput) event.getType()).getEnteredText()); 232 240 System.out.print("\""); 233 241 } … … 240 248 System.out.print(id); 241 249 System.out.print(' '); 242 System.out.print( ((IEventTask) task).getEventType().getName());250 System.out.print(event.getType().getName()); 243 251 } 244 252 System.out.print(" {}\" +"); … … 250 258 taskIds.put(task, id); 251 259 252 for (ITaskInstance child : taskInstance.getChildren()) { 253 dumpTaskInstanceAsCheckString(child, typeCounters, taskIds, indent + " "); 260 if (taskInstance instanceof ITaskInstanceList) { 261 for (ITaskInstance child : (ITaskInstanceList) taskInstance) { 262 dumpTaskInstanceAsCheckString(child, typeCounters, taskIds, indent + " "); 263 } 264 } 265 else if (taskInstance instanceof ISelectionInstance) { 266 dumpTaskInstanceAsCheckString 267 (((ISelectionInstance) taskInstance).getChild(), typeCounters, taskIds, indent + " "); 268 } 269 else if (taskInstance instanceof IOptionalInstance) { 270 dumpTaskInstanceAsCheckString 271 (((IOptionalInstance) taskInstance).getChild(), typeCounters, taskIds, indent + " "); 254 272 } 255 273
Note: See TracChangeset
for help on using the changeset viewer.