Changeset 946
- Timestamp:
- 10/26/12 10:15:00 (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui/KeyInteractionCorrectorTest.java
r927 r946 389 389 // Check if mouse events stay where they are 390 390 input.add(new Event(new KeyPressed(VirtualKey.LETTER_A), guiElement)); 391 input.add(new Event(new MouseButtonDown(Button.LEFT ), guiElement));392 input.add(new Event(new MouseButtonUp(Button.LEFT ), guiElement));393 input.add(new Event(new MouseClick(Button.LEFT ), guiElement));394 input.add(new Event(new KeyReleased(VirtualKey.LETTER_A), guiElement)); 395 396 expected.add(new Event(new KeyTyped(VirtualKey.LETTER_A), guiElement)); 397 expected.add(new Event(new MouseButtonDown(Button.LEFT ), guiElement));398 expected.add(new Event(new MouseButtonUp(Button.LEFT ), guiElement));399 expected.add(new Event(new MouseClick(Button.LEFT ), guiElement));391 input.add(new Event(new MouseButtonDown(Button.LEFT, 0, 0), guiElement)); 392 input.add(new Event(new MouseButtonUp(Button.LEFT, 0, 0), guiElement)); 393 input.add(new Event(new MouseClick(Button.LEFT, 0, 0), guiElement)); 394 input.add(new Event(new KeyReleased(VirtualKey.LETTER_A), guiElement)); 395 396 expected.add(new Event(new KeyTyped(VirtualKey.LETTER_A), guiElement)); 397 expected.add(new Event(new MouseButtonDown(Button.LEFT, 0, 0), guiElement)); 398 expected.add(new Event(new MouseButtonUp(Button.LEFT, 0, 0), guiElement)); 399 expected.add(new Event(new MouseClick(Button.LEFT, 0, 0), guiElement)); 400 400 401 401 List<Event> output = sorter.sortKeyInteractions(input); -
trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClickCondenserTest.java
r927 r946 55 55 IGUIElement element2 = new DummyGUIElement("elem2"); 56 56 57 simulateEvent(new MouseButtonDown(leftBtn ), element1);58 simulateEvent(new MouseButtonUp(leftBtn ), element1);59 simulateEvent(new MouseClick(leftBtn ), element1);57 simulateEvent(new MouseButtonDown(leftBtn, 0, 0), element1); 58 simulateEvent(new MouseButtonUp(leftBtn, 0, 0), element1); 59 simulateEvent(new MouseClick(leftBtn, 0, 0), element1); 60 60 assertCondensedMouseClicks("elem1"); 61 61 62 62 simulateEvent(new DummyInteraction("bla", 1), element1); 63 63 simulateEvent(new DummyInteraction("bli", 1), element1); 64 simulateEvent(new MouseButtonDown(middleBtn ), element1);65 simulateEvent(new MouseButtonUp(middleBtn ), element1);66 simulateEvent(new MouseClick(middleBtn ), element1);64 simulateEvent(new MouseButtonDown(middleBtn, 0, 0), element1); 65 simulateEvent(new MouseButtonUp(middleBtn, 0, 0), element1); 66 simulateEvent(new MouseClick(middleBtn, 0, 0), element1); 67 67 simulateEvent(new DummyInteraction("blo", 1), element1); 68 68 simulateEvent(new DummyInteraction("blu", 1), element1); … … 71 71 simulateEvent(new DummyInteraction("bla", 1), element2); 72 72 simulateEvent(new DummyInteraction("bli", 1), element2); 73 simulateEvent(new MouseButtonDown(rightBtn ), element2);74 simulateEvent(new MouseButtonUp(rightBtn ), element2);75 simulateEvent(new MouseClick(rightBtn ), element2);73 simulateEvent(new MouseButtonDown(rightBtn, 0, 0), element2); 74 simulateEvent(new MouseButtonUp(rightBtn, 0, 0), element2); 75 simulateEvent(new MouseClick(rightBtn, 0, 0), element2); 76 76 simulateEvent(new DummyInteraction("blo", 1), element2); 77 77 simulateEvent(new DummyInteraction("blu", 1), element2); 78 78 assertCondensedMouseClicks("elem1", "", "", "elem1", "", "", "", "", "elem2", "", ""); 79 79 80 simulateEvent(new MouseButtonDown(leftBtn ), element1);81 simulateEvent(new MouseButtonUp(leftBtn ), element1);82 simulateEvent(new MouseClick(leftBtn ), element2);80 simulateEvent(new MouseButtonDown(leftBtn, 0, 0), element1); 81 simulateEvent(new MouseButtonUp(leftBtn, 0, 0), element1); 82 simulateEvent(new MouseClick(leftBtn, 0, 0), element2); 83 83 assertCondensedMouseClicks("elem1", "", "", "elem1", "", "", "", "", "elem2", "", "", 84 84 "", "", "elem2"); 85 85 86 simulateEvent(new MouseButtonDown(middleBtn ), element1);87 simulateEvent(new MouseButtonUp(middleBtn ), element1);88 simulateEvent(new MouseClick(rightBtn ), element1);86 simulateEvent(new MouseButtonDown(middleBtn, 0, 0), element1); 87 simulateEvent(new MouseButtonUp(middleBtn, 0, 0), element1); 88 simulateEvent(new MouseClick(rightBtn, 0, 0), element1); 89 89 simulateEvent(new DummyInteraction("bla", 1), element2); 90 90 assertCondensedMouseClicks("elem1", "", "", "elem1", "", "", "", "", "elem2", "", "", -
trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui/TextInputDetectorTest.java
r927 r946 164 164 IGUIElement element3 = new DummyGUIElement("elem3"); 165 165 166 simulateEvent(new MouseClick(MouseClick.Button.LEFT ), element2);166 simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element2); 167 167 simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 168 168 simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); … … 173 173 assertTextInput("", "abc"); 174 174 175 simulateEvent(new MouseClick(MouseClick.Button.LEFT ), element2);176 simulateEvent(new MouseClick(MouseClick.Button.LEFT ), element3);177 simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 178 simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 179 simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 180 simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 181 simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 182 simulateEvent(new KeyReleased(VirtualKey.LETTER_C), element1); 183 simulateEvent(new MouseClick(MouseClick.Button.LEFT ), element3);175 simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element2); 176 simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 177 simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 178 simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 179 simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 180 simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 181 simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 182 simulateEvent(new KeyReleased(VirtualKey.LETTER_C), element1); 183 simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 184 184 assertTextInput("", "abc", "", "", "abc", ""); 185 185 186 simulateEvent(new MouseClick(MouseClick.Button.LEFT ), element2);187 simulateEvent(new MouseClick(MouseClick.Button.LEFT ), element3);188 simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 189 simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 190 simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 191 simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 192 simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 193 simulateEvent(new MouseClick(MouseClick.Button.LEFT ), element3);186 simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element2); 187 simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 188 simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 189 simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 190 simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 191 simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 192 simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 193 simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 194 194 simulateEvent(new KeyReleased(VirtualKey.LETTER_C), element1); 195 195 -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCLogParser.java
r927 r946 533 533 if (JFCEventId.MOUSE_CLICKED == eventId) 534 534 { 535 return new MouseClick(button); 535 int x = Integer.parseInt(eventParameters.get("X")); 536 int y = Integer.parseInt(eventParameters.get("Y")); 537 return new MouseClick(button, x, y); 536 538 } 537 539 else if (JFCEventId.MOUSE_PRESSED == eventId) 538 540 { 539 return new MouseButtonDown(button); 541 int x = Integer.parseInt(eventParameters.get("X")); 542 int y = Integer.parseInt(eventParameters.get("Y")); 543 return new MouseButtonDown(button, x, y); 540 544 } 541 545 else if (JFCEventId.MOUSE_RELEASED == eventId) 542 546 { 543 return new MouseButtonUp(button); 547 int x = Integer.parseInt(eventParameters.get("X")); 548 int y = Integer.parseInt(eventParameters.get("Y")); 549 return new MouseButtonUp(button, x, y); 544 550 } 545 551 else -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/eventcore/MFCEventTypeFactory.java
r927 r946 75 75 */ 76 76 public IEventType getEventType(String eventName, Map<String, String> messageParameters) { 77 // TODO create scrolls were necessary and correct the coordinates of scrolls and mouse 78 // clicks 77 79 if ("LeftClickButton".equals(eventName)) { 78 return new MouseClick(MouseButtonInteraction.Button.LEFT );80 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 79 81 } 80 82 else if ("LeftClickListBox".equals(eventName)) { … … 82 84 } 83 85 else if ("TabChange".equals(eventName)) { 84 return new MouseClick(MouseButtonInteraction.Button.LEFT );86 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 85 87 } 86 88 else if ("LeftClickCommand".equals(eventName)) { 87 return new MouseClick(MouseButtonInteraction.Button.LEFT );89 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 88 90 } 89 91 else if ("LeftClickSysCommand".equals(eventName)) { 90 return new MouseClick(MouseButtonInteraction.Button.LEFT );92 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 91 93 } 92 94 else if ("NCLeftClickSysCommand".equals(eventName)) { 93 return new MouseClick(MouseButtonInteraction.Button.LEFT );95 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 94 96 } 95 97 else if ("LeftClickMenuItemCmd".equals(eventName)) { 96 return new MouseClick(MouseButtonInteraction.Button.LEFT );98 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 97 99 } 98 100 else if ("HScroll_TrackBar".equals(eventName)) { … … 103 105 } 104 106 else if ("HScroll_ScrollBar".equals(eventName)) { 105 return new MouseClick(MouseButtonInteraction.Button.LEFT );107 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 106 108 } 107 109 else if ("VScroll_ScrollBar".equals(eventName)) { 108 return new MouseClick(MouseButtonInteraction.Button.LEFT );110 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 109 111 } 110 112 else if ("VScrollNC".equals(eventName)) { 111 return new MouseClick(MouseButtonInteraction.Button.LEFT );113 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 112 114 } 113 115 else if ("LeftClickSetFocus".equals(eventName)) { … … 130 132 } 131 133 else if ("LeftClickCoordinates".equals(eventName)) { 132 return new MouseClick(MouseButtonInteraction.Button.LEFT );134 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 133 135 } 134 136 else if ("NCLeftClickCoordinates".equals(eventName)) { 135 return new MouseClick(MouseButtonInteraction.Button.LEFT );137 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 136 138 } 137 139 else if ("NCLeftClickCoordinates2".equals(eventName)) { 138 return new MouseClick(MouseButtonInteraction.Button.LEFT );140 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 139 141 } 140 142 else if ("LeftClickCoordinatesTargetChanged".equals(eventName)) { 141 return new MouseClick(MouseButtonInteraction.Button.LEFT );143 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 142 144 } 143 145 else if ("LeftClickCoordinatesTargetChanged2".equals(eventName)) { 144 return new MouseClick(MouseButtonInteraction.Button.LEFT );146 return new MouseClick(MouseButtonInteraction.Button.LEFT, -1, -1); 145 147 } 146 148 else {
Note: See TracChangeset
for help on using the changeset viewer.