Changeset 1686 for trunk/autoquest-plugin-jfc/src/main/java/de
- Timestamp:
- 08/18/14 15:29:50 (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
r1685 r1686 47 47 48 48 private int nextRef; 49 private JFCGUIElement currentFocus; 49 50 50 51 /* … … 148 149 writeItemActionEvent(writer, structure, event); 149 150 } 151 /* 152 else if (event.getType() instanceof KeyboardFocusChange) { 153 writeFocusChangeEvent(writer, structure, event); 154 } 155 */ 150 156 } 151 157 } … … 261 267 } 262 268 269 private void writeFocusChangeEvent(BufferedWriter writer, 270 ArrayList<String> structure, 271 Event event) throws IOException 272 { 273 KeyboardFocusChange info = (KeyboardFocusChange) event.getType(); 274 JFCGUIElement target = (JFCGUIElement) event.getTarget(); 275 276 if (currentFocus != null) { 277 // focus lost on old target 278 writeFocusEvent(writer, structure, info, currentFocus, 1005); 279 // focus gained on new target 280 writeFocusEvent(writer, structure, info, target, 1004); 281 } 282 else { 283 // TODO: it seems like Jacareto wants a window activation before 284 // the first focus event but that is not the case in autoquest, 285 // skip for now 286 } 287 288 currentFocus = target; 289 } 290 291 private void writeFocusEvent(BufferedWriter writer, 292 ArrayList<String> structure, 293 KeyboardFocusChange info, 294 JFCGUIElement target, 295 int jacId) throws IOException 296 { 297 //@formatter:off 298 writeLine(writer, 299 "<FocusEvent " 300 + "procTime=\"0\" " 301 + "duration=\"0\" " 302 + "source=\"" + target.getJacaretoHierarchy() + "\" " 303 + "class=\"" + target.getSpecification().getType() + "\" " 304 + "uuid=\"" + UUID.randomUUID() + "\" " 305 + "ID=\"" + jacId + "\" " 306 + "component=\"null\" " 307 + "root=\"" + target.getJacaretoRoot() + "\" " 308 + "xPos=\"0\" " 309 + "yPos=\"0\" " 310 + "width=\"0\" " 311 + "height=\"0\" " 312 + "isTemporary=\"false\" />" 313 ); 314 //@formatter:on 315 } 316 263 317 private void writeMouseClickEvent(BufferedWriter writer, 264 318 ArrayList<String> structure, … … 291 345 writeLine(writer, 292 346 "<MouseInfo " 293 + "xPosition=\"" + info.getX() + "\" "294 + "yPosition=\"" + info.getY() + "\" "347 + "xPosition=\"" + info.getX() + "\" " 348 + "yPosition=\"" + info.getY() + "\" " 295 349 + "rootX=\"0\" " 296 350 + "rootY=\"0\" "
Note: See TracChangeset
for help on using the changeset viewer.