- Timestamp:
- 08/17/14 17:38:57 (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
r1683 r1684 135 135 JFCGUIElement target = (JFCGUIElement) event.getTarget(); 136 136 137 if (event.getType().getName().equals("LeftMouseClick")) { 138 generateMouseClick(writer, structure, event.getTimestamp(), target); 139 140 // FIXME: assume that the target is a checkbox for now =) 141 // this is an item event and an action event in jacareto 142 //@formatter:off 143 writeLine(writer, 144 "<ItemEvent " 145 + "procTime=\"0\" " 146 + "duration=\"0\" " 147 + "source=\"" + target.getJacaretoHierarchy() + "\" " 148 + "class=\"" + target.getSpecification().getType() + "\" " 149 + "uuid=\"" + UUID.randomUUID() + "\" " 150 + "ID=\"701\" " 151 + "item=\"\" " 152 + "stateChange=\"1\" />" 153 ); 154 writeLine(writer, 155 "<ActionEvent " 156 + "procTime=\"0\" " 157 + "duration=\"0\" " 158 + "source=\"" + target.getJacaretoHierarchy() + "\" " 159 + "class=\"" + target.getSpecification().getType() + "\" " 160 + "uuid=\"" + UUID.randomUUID() + "\" " 161 + "ID=\"1001\" " 162 + "command=" + target.getName() + " " 163 + "modifiers=\"16\" />" 164 ); 165 //@formatter:on 166 structure.add("<StructureElement class=\"jacareto.struct.ItemStateChange\">"); 167 structure.add("<Recordable ref=\"" + (nextRef++) + "\" />"); 168 structure.add("<Recordable ref=\"" + (nextRef++) + "\" />"); 169 structure.add("</StructureElement>"); 137 switch (event.getType().getName()) 138 { 139 case "LeftMouseButtonDown": 140 structure.add("<StructureElement class=\"jacareto.struct.MouseClick\">"); 141 writeMouseClickEvent(writer, structure, event.getTimestamp(), target, 501); 142 break; 143 case "LeftMouseButtonUp": 144 writeMouseClickEvent(writer, structure, event.getTimestamp(), target, 502); 145 break; 146 case "LeftMouseClick": 147 writeMouseClickEvent(writer, structure, event.getTimestamp(), target, 500); 148 structure.add("</StructureElement>"); 149 // FIXME: don't always write an item action 150 writeItemActionEvent(writer, structure, target); 151 break; 170 152 } 153 171 154 } 172 155 } … … 245 228 } 246 229 230 private void writeItemActionEvent(BufferedWriter writer, 231 ArrayList<String> structure, 232 JFCGUIElement target) throws IOException 233 { 234 //@formatter:off 235 writeLine(writer, 236 "<ItemEvent " 237 + "procTime=\"0\" " 238 + "duration=\"0\" " 239 + "source=\"" + target.getJacaretoHierarchy() + "\" " 240 + "class=\"" + target.getSpecification().getType() + "\" " 241 + "uuid=\"" + UUID.randomUUID() + "\" " 242 + "ID=\"701\" " 243 + "item=\"\" " 244 + "stateChange=\"1\" />" 245 ); 246 writeLine(writer, 247 "<ActionEvent " 248 + "procTime=\"0\" " 249 + "duration=\"0\" " 250 + "source=\"" + target.getJacaretoHierarchy() + "\" " 251 + "class=\"" + target.getSpecification().getType() + "\" " 252 + "uuid=\"" + UUID.randomUUID() + "\" " 253 + "ID=\"1001\" " 254 + "command=" + target.getName() + " " 255 + "modifiers=\"16\" />" 256 ); 257 //@formatter:on 258 structure.add("<StructureElement class=\"jacareto.struct.ItemStateChange\">"); 259 structure.add("<Recordable ref=\"" + (nextRef++) + "\" />"); 260 structure.add("<Recordable ref=\"" + (nextRef++) + "\" />"); 261 structure.add("</StructureElement>"); 262 } 263 247 264 private void writeMouseClickEvent(BufferedWriter writer, 248 265 ArrayList<String> structure, … … 287 304 structure.add("<Recordable ref=\"" + (nextRef++) + "\" />"); 288 305 } 289 290 private void generateMouseClick(BufferedWriter writer,291 ArrayList<String> structure,292 long timestamp,293 JFCGUIElement target) throws IOException294 {295 structure.add("<StructureElement class=\"jacareto.struct.MouseClick\">");296 297 writeMouseClickEvent(writer, structure, timestamp, target, 501);298 writeMouseClickEvent(writer, structure, timestamp, target, 502);299 writeMouseClickEvent(writer, structure, timestamp, target, 500);300 301 structure.add("</StructureElement>");302 }303 306 }
Note: See TracChangeset
for help on using the changeset viewer.