- Timestamp:
- 01/09/15 16:04:45 (10 years ago)
- Location:
- trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java
r1856 r1857 342 342 StructureNode.nextRef = 0; 343 343 344 writeJacaretoXML(sequences, filename, classpath, basepath, classpathext); 344 int index = 1; 345 for( List<Event> sequence : sequences ) { 346 writeJacaretoXML(sequence, filename+"_"+index, classpath, basepath, classpathext); 347 index++; 348 } 345 349 } 346 350 … … 450 454 * 451 455 */ 452 private void writeJacaretoEvents(BufferedWriter writer, Collection<List<Event>> sequences)456 private void writeJacaretoEvents(BufferedWriter writer, List<Event> sequence) 453 457 throws IOException 454 458 { … … 461 465 structure.addRecordable(); // ApplicationStarter 462 466 463 for (List<Event> sequence : sequences) { 464 for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) { 465 Event event = eventIter.next(); 466 467 if (event.getType() instanceof MouseButtonDown) { 468 handleMouseButtonDown(writer, event); 467 for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) { 468 Event event = eventIter.next(); 469 470 if (event.getType() instanceof MouseButtonDown) { 471 handleMouseButtonDown(writer, event); 472 } 473 else if (event.getType() instanceof MouseButtonUp) { 474 handleMouseButtonUp(writer, event); 475 } 476 else if (event.getType() instanceof MouseDoubleClick) { 477 handleMouseDoubleClick(writer, event); 478 } 479 else if (event.getType() instanceof MouseClick) { 480 if (event.getTarget() instanceof JFCMenuButton) { 481 // if a menu file was provided, use the improved event 482 // generation 483 if (menuList != null) { 484 if (menuElements.isEmpty()) { 485 // parse the menu structure 486 GUIModel model = ((IGUIElement) event.getTarget()).getGUIModel(); 487 getMenuElements(model.getRootElements(), model); 488 } 489 490 Stack<JFCGUIElement> hierarchy = 491 findMenuItemHierarchy((JFCGUIElement) event.getTarget()); 492 493 while (!hierarchy.empty()) { 494 generateFullClick(writer, event, hierarchy.pop()); 495 } 496 continue; 497 } 469 498 } 470 else if (event.getType() instanceof MouseButtonUp) { 471 handleMouseButtonUp(writer, event); 472 } 473 else if (event.getType() instanceof MouseDoubleClick) { 474 handleMouseDoubleClick(writer, event); 475 } 476 else if (event.getType() instanceof MouseClick) { 477 if (event.getTarget() instanceof JFCMenuButton) { 478 // if a menu file was provided, use the improved event 479 // generation 480 if (menuList != null) { 481 if (menuElements.isEmpty()) { 482 // parse the menu structure 483 GUIModel model = ((IGUIElement) event.getTarget()).getGUIModel(); 484 getMenuElements(model.getRootElements(), model); 485 } 486 487 Stack<JFCGUIElement> hierarchy = 488 findMenuItemHierarchy((JFCGUIElement) event.getTarget()); 489 490 while (!hierarchy.empty()) { 491 generateFullClick(writer, event, hierarchy.pop()); 492 } 493 continue; 494 } 495 } 496 497 handleMouseClick(writer, event); 498 } 499 else if (event.getType() instanceof KeyboardFocusChange) { 500 handleKeyboardFocusChange(writer, event); 501 } 502 else if (event.getType() instanceof MouseDragAndDrop) { 503 handleMouseDragAndDrop(writer, event); 504 } 505 else if (event.getType() instanceof KeyPressed) { 506 handleKeyPressed(writer, event); 507 } 508 else if (event.getType() instanceof KeyReleased) { 509 handleKeyReleased(writer, event); 510 } 511 else if (event.getType() instanceof TextInput) { 512 handleTextInput(writer, event); 513 } 514 else { 515 Console.traceln(Level.WARNING, "No handler for event \"" + event + 516 "\". Skipped."); 517 } 499 500 handleMouseClick(writer, event); 501 } 502 else if (event.getType() instanceof KeyboardFocusChange) { 503 handleKeyboardFocusChange(writer, event); 504 } 505 else if (event.getType() instanceof MouseDragAndDrop) { 506 handleMouseDragAndDrop(writer, event); 507 } 508 else if (event.getType() instanceof KeyPressed) { 509 handleKeyPressed(writer, event); 510 } 511 else if (event.getType() instanceof KeyReleased) { 512 handleKeyReleased(writer, event); 513 } 514 else if (event.getType() instanceof TextInput) { 515 handleTextInput(writer, event); 516 } 517 else { 518 Console.traceln(Level.WARNING, "No handler for event \"" + event + 519 "\". Skipped."); 518 520 } 519 521 } … … 737 739 } 738 740 739 private void writeJacaretoXML( Collection<List<Event>> sequences,741 private void writeJacaretoXML(List<Event> sequence, 740 742 String filename, 741 743 String classpath, … … 747 749 try { 748 750 writeJacaretoHead(writer, classpath, basepath, classpathext); 749 writeJacaretoEvents(writer, sequence s);751 writeJacaretoEvents(writer, sequence); 750 752 writeJacaretoTail(writer); 751 753 writeLine(writer, "</JacaretoStructure>");
Note: See TracChangeset
for help on using the changeset viewer.