Changeset 1838 for trunk/autoquest-plugin-jfc
- Timestamp:
- 11/27/14 22:07:25 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java
r1836 r1838 267 267 268 268 if (event.getType() instanceof MouseButtonDown) { 269 commitFocusEvent(); 270 lastKeySequenceEvent = null; 271 272 lastMouseClickEvent = new StructureNode("MouseClick"); 273 lastMouseDownTarget = event.getTarget(); 274 writeMouseClickEvent(writer, event, (JFCGUIElement) event.getTarget(), 275 EVENT_DURATION, 501); 269 handleMouseDown(writer, event, "MouseClick"); 276 270 } 277 271 else if (event.getType() instanceof MouseButtonUp) { 278 lastKeySequenceEvent = null; 279 280 writeMouseClickEvent(writer, event, (JFCGUIElement) event.getTarget(), 281 EVENT_DURATION, 502); 272 handleMouseUp(writer, event); 282 273 } 283 274 else if (event.getType() instanceof MouseDoubleClick) { … … 379 370 writeFocusChangeEvent(writer, event); 380 371 } 372 else if (event.getType() instanceof MouseDragAndDrop) { 373 handleMouseDragAndDrop(writer, event); 374 } 381 375 else if (event.getType() instanceof KeyPressed) { 382 376 handleKeyPressed(writer, event); … … 388 382 handleTextInput(writer, event); 389 383 } 390 } 391 } 384 else { 385 Console.traceln(Level.WARNING, "No handler for event \"" + event + 386 "\". Skipped."); 387 } 388 } 389 } 390 } 391 392 private void handleMouseDown(BufferedWriter writer, Event event, String structureName) 393 throws IOException 394 { 395 commitFocusEvent(); 396 lastKeySequenceEvent = null; 397 398 lastMouseClickEvent = new StructureNode(structureName); 399 lastMouseDownTarget = event.getTarget(); 400 writeMouseClickEvent(writer, event, (JFCGUIElement) event.getTarget(), EVENT_DURATION, 501); 401 } 402 403 private void handleMouseUp(BufferedWriter writer, Event event) throws IOException { 404 lastKeySequenceEvent = null; 405 406 writeMouseClickEvent(writer, event, (JFCGUIElement) event.getTarget(), EVENT_DURATION, 502); 407 } 408 409 private void handleMouseDragAndDrop(BufferedWriter writer, Event event) throws IOException { 410 commitFocusEvent(); 411 412 MouseDragAndDrop dragEvent = (MouseDragAndDrop) event.getType(); 413 lastMouseClickEvent = new StructureNode("MouseDrag"); 414 lastMouseDownTarget = null; 415 416 writeMouseClickEvent(writer, event, (JFCGUIElement) event.getTarget(), EVENT_DURATION, 417 dragEvent.getXStart(), dragEvent.getYStart(), 501); 418 writeMouseClickEvent(writer, event, (JFCGUIElement) event.getTarget(), EVENT_DURATION, 419 dragEvent.getX(), dragEvent.getY(), 506); 420 421 structure.children.add(lastMouseClickEvent); 392 422 } 393 423 … … 642 672 { 643 673 MouseButtonInteraction info = (MouseButtonInteraction) event.getType(); 674 writeMouseClickEvent(writer, event, target, duration, info.getX(), info.getY(), jacId); 675 } 676 677 private void writeMouseClickEvent(BufferedWriter writer, 678 Event event, 679 JFCGUIElement target, 680 int duration, 681 int x, 682 int y, 683 int jacId) throws IOException 684 { 685 MouseButtonInteraction info = (MouseButtonInteraction) event.getType(); 644 686 int clickCount = event.getType() instanceof MouseDoubleClick ? 2 : 1; 645 687 … … 664 706 writeLine(writer, 665 707 "<MouseInfo " 666 + "xPosition=\"" + info.getX()+ "\" "667 + "yPosition=\"" + info.getY()+ "\" "708 + "xPosition=\"" + x + "\" " 709 + "yPosition=\"" + y + "\" " 668 710 + "rootX=\"0\" " 669 711 + "rootY=\"0\" "
Note: See TracChangeset
for help on using the changeset viewer.