Changeset 1836 for trunk/autoquest-plugin-jfc/src/main/java
- Timestamp:
- 11/27/14 15:37:58 (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
r1834 r1836 32 32 import java.util.UUID; 33 33 import java.util.logging.Level; 34 35 import javax.swing.UIManager; 34 36 35 37 import de.ugoe.cs.autoquest.CommandHelpers; … … 227 229 ); 228 230 writeLine(writer, 229 "<SystemInfo procTime=\"0\" duration=\"0\" screenWidth=\"2646\" screenHeight=\"1024\" javaVersion=\"1.7.0_65\" lookAndFeel=\"javax.swing.plaf.metal.MetalLookAndFeel\" uuid=\"720f430f-52cf-4d8b-9fbe-58434f766efe\" />"); 231 "<SystemInfo procTime=\"0\" duration=\"0\" screenWidth=\"2646\" screenHeight=\"1024\" javaVersion=\"1.7.0_65\" " 232 + "lookAndFeel=\"" + UIManager.getLookAndFeel().getClass().getName() + "\" " 233 + "uuid=\"720f430f-52cf-4d8b-9fbe-58434f766efe\" />"); 230 234 writeLine(writer, 231 235 "<KeyboardState procTime=\"0\" duration=\"0\" isNumLockOn=\"false\" isScrollLockOn=\"false\" isCapsLockOn=\"false\" applyIsNumLockOn=\"true\" applyIsScrollLockOn=\"true\" applyIsCapsLockOn=\"true\" uuid=\"28146f79-9fc7-49f9-b4a8-5866a7625683\" />"); … … 300 304 } 301 305 else if (event.getType() instanceof MouseClick) { 302 // if a menu file was provided, use the improved event 303 // generation 304 // TODO: check how much of this is still necessary with 305 // the new menu index system 306 if (menuList != null) { 307 if (event.getTarget() instanceof JFCMenuButton) { 306 if (event.getTarget() instanceof JFCMenuButton) { 307 // if a menu file was provided, use the improved event 308 // generation 309 if (menuList != null) { 308 310 if (menuElements.isEmpty()) { 309 311 // parse the menu structure … … 378 380 } 379 381 else if (event.getType() instanceof KeyPressed) { 380 commitFocusEvent(); 381 382 if (lastKeySequenceEvent == null) { 383 lastKeySequenceEvent = structure.add("KeySequence"); 384 } 385 lastKeyTypedEvent = lastKeySequenceEvent.add("KeyTyped"); 386 writeKeyEvent(writer, event, 401); 382 handleKeyPressed(writer, event); 387 383 } 388 384 else if (event.getType() instanceof KeyReleased) { 389 commitFocusEvent(); 390 391 writeKeyEvent(writer, event, 402); 385 handleKeyReleased(writer, event); 392 386 } 387 else if (event.getType() instanceof TextInput) { 388 handleTextInput(writer, event); 389 } 390 } 391 } 392 } 393 394 private void handleKeyPressed(BufferedWriter writer, Event event) throws IOException { 395 commitFocusEvent(); 396 397 if (lastKeySequenceEvent == null) { 398 lastKeySequenceEvent = structure.add("KeySequence"); 399 } 400 lastKeyTypedEvent = lastKeySequenceEvent.add("KeyTyped"); 401 402 writeKeyEvent(writer, event, 401); 403 } 404 405 private void handleKeyReleased(BufferedWriter writer, Event event) throws IOException { 406 commitFocusEvent(); 407 408 writeKeyEvent(writer, event, 402); 409 } 410 411 private void handleTextInput(BufferedWriter writer, Event event) throws IOException { 412 List<Event> textEvents = ((TextInput) event.getType()).getTextInputEvents(); 413 414 // just split the text event into its key events again 415 for (Event textEvent : textEvents) { 416 if (textEvent.getType() instanceof KeyPressed) { 417 handleKeyPressed(writer, textEvent); 418 } 419 else if (textEvent.getType() instanceof KeyReleased) { 420 handleKeyReleased(writer, textEvent); 393 421 } 394 422 }
Note: See TracChangeset
for help on using the changeset viewer.