Changeset 1712 for trunk/autoquest-plugin-jfc/src/main/java
- Timestamp:
- 09/02/14 14:53:55 (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
r1704 r1712 98 98 99 99 private HashMap<VirtualKey, Integer> modifiers; 100 100 101 101 private StructureNode lastMouseClickEvent; 102 102 private StructureNode lastFocusChangeEvent; … … 110 110 @Override 111 111 public String help() { 112 return "generateJacaretoReplay <filename> <sequences> ";112 return "generateJacaretoReplay <filename> <sequences> <class> <basepath> <classpathext> {<initclass>}"; 113 113 } 114 114 … … 123 123 String filename; 124 124 String sequencesName; 125 String classpath; 126 String basepath; 127 String classpathext; 128 String initclass = ""; 125 129 try { 126 130 filename = (String) parameters.get(0); 127 131 sequencesName = (String) parameters.get(1); 132 classpath = (String) parameters.get(2); 133 basepath = (String) parameters.get(3); 134 classpathext = (String) parameters.get(4); 128 135 } 129 136 catch (Exception e) { 130 137 throw new IllegalArgumentException(); 138 } 139 140 if (parameters.size() > 5) { 141 initclass = (String) parameters.get(5); 131 142 } 132 143 … … 151 162 modifiers.put(VirtualKey.ALT_GRAPH, 32); 152 163 currentKeyModifiers = 0; 153 154 writeJacaretoXML(sequences, filename );164 165 writeJacaretoXML(sequences, filename, classpath, initclass, basepath, classpathext); 155 166 } 156 167 … … 160 171 } 161 172 162 private void writeJacaretoHead(BufferedWriter writer) throws IOException { 173 private void writeJacaretoHead(BufferedWriter writer, 174 String classname, 175 String initclass, 176 String basepath, 177 String classpathext) throws IOException 178 { 163 179 writeLine(writer, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"); 164 180 writeLine(writer, "<JacaretoStructure>"); … … 170 186 // application starter details need to be changed for general cases. 171 187 writeLine(writer, 172 "<Calendar procTime=\"0\" duration=\"0\" year=\"20 14\" month=\"8\" date=\"11\" hour=\"14\" min=\"43\" sec=\"41\" uuid=\"06831ba1-f28a-4e05-b46e-ce9d8f9ffa0f\" />");188 "<Calendar procTime=\"0\" duration=\"0\" year=\"2000\" month=\"1\" date=\"11\" hour=\"1\" min=\"1\" sec=\"1\" uuid=\"06831ba1-f28a-4e05-b46e-ce9d8f9ffa0f\" />"); 173 189 writeLine(writer, 174 190 "<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\" />"); … … 176 192 "<KeyboardState procTime=\"0\" duration=\"0\" isNumLockOn=\"false\" isScrollLockOn=\"false\" isCapsLockOn=\"false\" applyIsNumLockOn=\"true\" applyIsScrollLockOn=\"true\" applyIsCapsLockOn=\"true\" uuid=\"28146f79-9fc7-49f9-b4a8-5866a7625683\" />"); 177 193 writeLine(writer, "<ComponentMode numberPopupMenues=\"true\" />"); 178 writeLine(writer, 179 "<ApplicationStarter procTime=\"0\" duration=\"0\" name=\"HelloWorldSwing\" class=\"HelloWorldSwing\" initclass=\"\" basepath=\"/home/daniel/project/autoquest-jfcmonitor\" classpathext=\"${basepath}/helloswing.jar;${basepath}/.;\" detectDuration=\"false\" captureparams=\"\" replayparams=\"\" uuid=\"a7b7d7b9-caa9-4d6d-b052-cf74d353275e\" />"); 194 //@formatter:off 195 writeLine(writer, "<ApplicationStarter " 196 + "procTime=\"0\" " 197 + "duration=\"0\" " 198 + "name=\"Autoquest Replay\" " 199 + "class=\"" + classname + "\" " 200 + "initclass=\"" + initclass + "\" " 201 + "basepath=\"" + basepath + "\" " 202 + "classpathext=\"" + classpathext + "\" " 203 + "detectDuration=\"false\" " 204 + "captureparams=\"\" " 205 + "replayparams=\"\" " 206 + "uuid=\"a7b7d7b9-caa9-4d6d-b052-cf74d353275e\" />" 207 ); 208 //@formatter:on 180 209 } 181 210 … … 257 286 } 258 287 259 private void writeJacaretoXML(Collection<List<Event>> sequences, String filename) { 288 private void writeJacaretoXML(Collection<List<Event>> sequences, 289 String filename, 290 String classpath, 291 String initclass, 292 String basepath, 293 String classpathext) 294 { 260 295 BufferedWriter writer = new BufferedWriter(openReplayFile(filename + ".xml")); 261 296 262 297 try { 263 writeJacaretoHead(writer );298 writeJacaretoHead(writer, classpath, initclass, basepath, classpathext); 264 299 writeJacaretoEvents(writer, sequences); 265 300 writeJacaretoTail(writer); … … 455 490 456 491 applyKeyModifier(info.getKey(), jacId == 401); 457 492 458 493 //@formatter:off 459 494 writeLine(writer, … … 490 525 return String.valueOf((char)keyCode); 491 526 } 492 else { 493 return "_NO_LEGAL_XML_CHAR"; 494 } 527 528 return "_NO_LEGAL_XML_CHAR"; 495 529 } 496 530
Note: See TracChangeset
for help on using the changeset viewer.