Changeset 1678 for trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands
- Timestamp:
- 08/14/14 17:07:17 (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
r1673 r1678 24 24 import java.util.Iterator; 25 25 import java.util.List; 26 import java.util.UUID; 26 27 import java.util.logging.Level; 27 28 … … 30 31 import de.ugoe.cs.util.console.Command; 31 32 import de.ugoe.cs.autoquest.eventcore.Event; 33 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 32 34 import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCGUIElement; 33 35 import de.ugoe.cs.util.console.Console; … … 43 45 */ 44 46 public class CMDgenerateJacaretoReplay implements Command { 47 48 private int nextRef; 45 49 46 50 /* … … 108 112 writeLine(writer, 109 113 "<KeyboardState procTime=\"0\" duration=\"0\" isNumLockOn=\"false\" isScrollLockOn=\"false\" isCapsLockOn=\"false\" applyIsNumLockOn=\"true\" applyIsScrollLockOn=\"true\" applyIsCapsLockOn=\"true\" uuid=\"28146f79-9fc7-49f9-b4a8-5866a7625683\" />"); 110 writeLine(writer, " ComponentMode numberPopupMenues=\"true\" />");114 writeLine(writer, "<ComponentMode numberPopupMenues=\"true\" />"); 111 115 writeLine(writer, 112 116 "<ApplicationStarter procTime=\"5\" duration=\"5\" 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\" />"); … … 120 124 structure.add("<StructureElement class=\"jacareto.struct.RootElement\">"); 121 125 // reference the elements that we included in the header 122 structure.add("<Recordable ref=\"1\" />"); // Calendar 123 structure.add("<Recordable ref=\"2\" />"); // SystemInfo 124 structure.add("<Recordable ref=\"3\" />"); // KeyboardState 126 structure.add("<Recordable ref=\"0\" />"); // Calendar 127 structure.add("<Recordable ref=\"1\" />"); // SystemInfo 128 structure.add("<Recordable ref=\"2\" />"); // KeyboardState 129 structure.add("<Recordable ref=\"3\" />"); // ComponentMode 125 130 structure.add("<Recordable ref=\"4\" />"); // ApplicationStarter 131 nextRef = 5; 126 132 127 133 for (List<Event> sequence : sequences) { … … 131 137 // TODO: do a mapping file or something to map 132 138 // from autoquest events to jacareto events 133 if (event.getType().getName().equals("KeyboardFocusChange")) { 134 /* 135 writeLine( 136 "<FocusEvent procTime=\"0\" duration=\"0\" source="JFrame_(1).JRootPane_(1).JLayeredPane_(1).JPanel_(1).JPanel_(1).JCheckBox_(1)" +" + 137 " class="javax.swing.JCheckBox" uuid="061bee8f-d8a3-477f-ab8d-bab02f614916" ID="1004" component="null" root="JFrame_(1)" xPos="0" yPos="0" width="0" height="0" isTemporary="false" />"); 138 */ 139 System.out.println(((JFCGUIElement)event.getTarget()).getJacaretoHierarchy()); 140 } 141 else { 142 System.out.println(event.getType()); 143 System.out.println(event.getTarget()); 139 if (event.getType().getName().equals("LeftMouseClick")) { 140 JFCGUIElement target = (JFCGUIElement) event.getTarget(); 141 142 // FIXME: assume that the target is a checkbox for now =) 143 // this is an item event and an action event in jacareto 144 //@formatter:off 145 writeLine(writer, 146 "<ItemEvent " 147 + "procTime=\"1\" " 148 + "duration=\"8\" " 149 + "source=\"" + target.getJacaretoHierarchy() + "\" " 150 + "class=\"" + target.getSpecification().getType() + "\" " 151 + "uuid=\"" + UUID.randomUUID() + "\" " 152 + "ID=\"701\" " 153 + "item=\"\" " 154 + "stateChange=\"1\" />" 155 ); 156 writeLine(writer, 157 "<ActionEvent " 158 + "procTime=\"1\" " 159 + "duration=\"0\" " 160 + "source=\"" + target.getJacaretoHierarchy() + "\" " 161 + "class=\"" + target.getSpecification().getType() + "\" " 162 + "uuid=\"" + UUID.randomUUID() + "\" " 163 + "ID=\"1001\" " 164 + "command=" + target.getName() + " " 165 + "modifiers=\"16\" />" 166 ); 167 //@formatter:on 168 structure.add("<StructureElement class=\"jacareto.struct.ItemStateChange\">"); 169 structure.add("<Recordable ref=\"" + (nextRef++) + "\" />"); 170 structure.add("<Recordable ref=\"" + (nextRef++) + "\" />"); 171 structure.add("</StructureElement>"); 144 172 } 145 173 } … … 159 187 writeLine(writer, element); 160 188 } 189 // close root element 190 writeLine(writer, "</StructureElement>"); 161 191 writeLine(writer, "</Structure>"); 162 192 } … … 169 199 ArrayList<String> structure = writeJacaretoEvents(writer, sequences); 170 200 writeJacaretoTail(writer, structure); 171 writeLine(writer, "< JacaretoStructure>");201 writeLine(writer, "</JacaretoStructure>"); 172 202 173 203 writer.flush();
Note: See TracChangeset
for help on using the changeset viewer.