Changeset 1006 for trunk/autoquest-plugin-mfc/src/main
- Timestamp:
- 12/05/12 12:54:01 (12 years ago)
- Location:
- trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/EventGenerator.java
r940 r1006 34 34 import de.ugoe.cs.autoquest.eventcore.Event; 35 35 import de.ugoe.cs.autoquest.eventcore.IEventType; 36 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree; 36 37 import de.ugoe.cs.autoquest.plugin.mfc.EventGenerationRule.Term; 37 38 import de.ugoe.cs.autoquest.plugin.mfc.eventcore.MFCEventTypeFactory; … … 40 41 import de.ugoe.cs.autoquest.plugin.mfc.eventcore.WindowsMessageType; 41 42 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCGUIElement; 42 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCWindowTree;43 43 import de.ugoe.cs.util.console.Console; 44 44 … … 121 121 /** 122 122 * <p> 123 * reference to the windowtree created during parsing124 * </p> 125 */ 126 private MFCWindowTree windowTree;123 * reference to the gui element tree created during parsing 124 * </p> 125 */ 126 private GUIElementTree guiElementTree; 127 127 128 128 /** … … 131 131 * </p> 132 132 */ 133 public EventGenerator( MFCWindowTree windowTree) {133 public EventGenerator(GUIElementTree guiElementTree) { 134 134 rulesFile = "data/rules.xml"; 135 this. windowTree = windowTree;135 this.guiElementTree = guiElementTree; 136 136 } 137 137 … … 477 477 String storeParam = resolveElement.getStoreParameterName(); 478 478 long paramHwnd = (Long) currentMessage.getParameter(param); 479 MFCGUIElement guiElement = windowTree.find(paramHwnd);479 MFCGUIElement guiElement = (MFCGUIElement) guiElementTree.find(paramHwnd); 480 480 if (guiElement != null) { 481 481 currentMessage.addParameter(storeParam, "" + guiElement.toXML()); -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/HandlerCreate.java
r940 r1006 15 15 package de.ugoe.cs.autoquest.plugin.mfc; 16 16 17 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree; 18 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec; 19 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCGUIElementSpec; 17 20 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCWindowTree; 18 21 … … 32 35 * </p> 33 36 * 34 * @param windowTree the tree of GUI element specifications to be created and adapted during37 * @param guiElementTree the tree of GUI element specifications to be created and adapted during 35 38 * parsing 36 39 */ 37 public HandlerCreate( MFCWindowTree windowTree) {38 super( windowTree);40 public HandlerCreate(GUIElementTree guiElementTree) { 41 super(guiElementTree); 39 42 } 40 43 … … 89 92 public void onEndElement() { 90 93 if (hwnd != 0) { 91 super.getWindowTree().add(parentHwnd, hwnd, windowName, resourceId, className, isModal); 94 IGUIElementSpec spec = new MFCGUIElementSpec(hwnd, windowName, resourceId, className, isModal); 95 super.getGUIElementTree().add(hwnd, parentHwnd, spec); 92 96 } 93 97 } -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/HandlerDestroy.java
r940 r1006 15 15 package de.ugoe.cs.autoquest.plugin.mfc; 16 16 17 import de.ugoe.cs.autoquest. plugin.mfc.guimodel.MFCWindowTree;17 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree; 18 18 19 19 /** … … 23 23 * 24 24 * @author Steffen Herbold 25 * @author Fabian Glaser 25 26 * @version 1.0 26 27 */ … … 32 33 * </p> 33 34 * 34 * @param windowTree35 * @param guiElementTree 35 36 * the tree of GUI element specifications to be created and adapted during parsing 36 37 */ 37 public HandlerDestroy( MFCWindowTree windowTree) {38 super( windowTree);38 public HandlerDestroy(GUIElementTree guiElementTree) { 39 super(guiElementTree); 39 40 } 40 41 … … 54 55 public void onEndElement() { 55 56 if (hwnd != 0) { 56 super.get WindowTree().remove(hwnd);57 super.getGUIElementTree().remove(hwnd); 57 58 } 58 59 } -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/HandlerSetText.java
r940 r1006 15 15 package de.ugoe.cs.autoquest.plugin.mfc; 16 16 17 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree; 18 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCGUIElement; 19 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCGUIElementSpec; 17 20 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCWindowTree; 18 21 … … 23 26 * 24 27 * @author Steffen Herbold 28 * @author Fabian Glaser 25 29 * @version 1.0 26 30 */ … … 32 36 * </p> 33 37 * 34 * @param windowTree38 * @param guiElementTree 35 39 * the tree of GUI element specifications to be created and adapted during parsing 36 40 */ 37 public HandlerSetText( MFCWindowTree windowTree) {38 super( windowTree);41 public HandlerSetText(GUIElementTree guiElementTree) { 42 super(guiElementTree); 39 43 } 40 44 … … 61 65 public void onEndElement() { 62 66 if (hwnd != 0) { 63 super.getWindowTree().setName(hwnd, windowName); 67 MFCGUIElement element = (MFCGUIElement) super.getGUIElementTree().find(hwnd); 68 MFCGUIElementSpec spec = (MFCGUIElementSpec) element.getSpecification(); 69 spec.setName(windowName); 64 70 } 65 71 } -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/MFCLogParser.java
r940 r1006 41 41 42 42 import de.ugoe.cs.autoquest.eventcore.Event; 43 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree; 43 44 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel; 44 45 import de.ugoe.cs.autoquest.plugin.mfc.eventcore.WindowsMessage; 45 46 import de.ugoe.cs.autoquest.plugin.mfc.eventcore.WindowsMessageType; 46 47 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCGUIElement; 47 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCWindowTree;48 48 import de.ugoe.cs.util.StringTools; 49 49 import de.ugoe.cs.util.console.Console; … … 58 58 * 59 59 * @author Steffen Herbold 60 * @author Fabian Glaser 60 61 * @version 1.0 61 62 */ … … 72 73 /** 73 74 * <p> 74 * internal handle to the current windowtree75 * </p> 76 */ 77 private MFCWindowTree currentWindowTree;75 * internal handle to the gui element tree 76 * </p> 77 */ 78 private GUIElementTree guiElementTree; 78 79 79 80 /** … … 251 252 */ 252 253 public GUIModel getGuiModel() { 253 if( currentWindowTree!=null ) {254 return currentWindowTree.getGUIModel();254 if( guiElementTree!=null ) { 255 return guiElementTree.getGUIModel(); 255 256 } else { 256 257 return null; … … 272 273 // in some logs, the session end may be marked in between the log. This is because 273 274 // of thread problems. So instead of creating a new GUI model, preserve it. 274 if ( currentWindowTree == null) {275 currentWindowTree = new MFCWindowTree();276 } 277 sequenceSplitter = new SequenceSplitter( currentWindowTree);275 if (guiElementTree == null) { 276 guiElementTree = new GUIElementTree(); 277 } 278 sequenceSplitter = new SequenceSplitter(guiElementTree); 278 279 } 279 280 else if (qName.equals("msg")) { … … 291 292 292 293 if (currentMessageType == WindowsMessageType.WM_CREATE) { 293 currentHandler = new HandlerCreate( currentWindowTree);294 currentHandler = new HandlerCreate(guiElementTree); 294 295 currentHandler.onStartElement(); 295 296 } 296 297 else if (currentMessageType == WindowsMessageType.WM_DESTROY) { 297 currentHandler = new HandlerDestroy( currentWindowTree);298 currentHandler = new HandlerDestroy(guiElementTree); 298 299 currentHandler.onStartElement(); 299 300 } 300 301 else if (currentMessageType == WindowsMessageType.WM_SETTEXT) { 301 currentHandler = new HandlerSetText( currentWindowTree);302 currentHandler = new HandlerSetText(guiElementTree); 302 303 currentHandler.onStartElement(); 303 304 } … … 343 344 try { 344 345 long hwnd = (Long) currentMessageParameters.get("window.hwnd"); 345 MFCGUIElement target = currentWindowTree.find(hwnd);346 MFCGUIElement target = (MFCGUIElement) guiElementTree.find(hwnd); 346 347 347 348 WindowsMessage message = new WindowsMessage -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/MessageHandler.java
r940 r1006 15 15 package de.ugoe.cs.autoquest.plugin.mfc; 16 16 17 import de.ugoe.cs.autoquest. plugin.mfc.guimodel.MFCWindowTree;17 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree; 18 18 19 19 /** … … 25 25 * 26 26 * @author Steffen Herbold 27 * @author Fabian Glaser 27 28 * @version 1.0 28 29 */ … … 35 36 * </p> 36 37 */ 37 private MFCWindowTree windowTree;38 private GUIElementTree guiElementTree; 38 39 39 40 /** … … 42 43 * </p> 43 44 * 44 * @param windowTree the tree of GUI element specifications to be created and adapted during45 * @param guiElementTree the tree of GUI element specifications to be created and adapted during 45 46 * parsing 46 47 */ 47 protected MessageHandler( MFCWindowTree windowTree) {48 this. windowTree = windowTree;48 protected MessageHandler(GUIElementTree guiElementTree) { 49 this.guiElementTree = guiElementTree; 49 50 } 50 51 … … 76 77 77 78 /** 78 * @return the windowtree created and adapted during parsing79 * @return the gui element tree created and adapted during parsing 79 80 */ 80 protected MFCWindowTree getWindowTree() {81 return windowTree;81 protected GUIElementTree getGUIElementTree() { 82 return guiElementTree; 82 83 } 83 84 -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/SequenceSplitter.java
r940 r1006 20 20 21 21 import de.ugoe.cs.autoquest.eventcore.Event; 22 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree; 22 23 import de.ugoe.cs.autoquest.plugin.mfc.eventcore.WindowsMessage; 23 24 import de.ugoe.cs.autoquest.plugin.mfc.eventcore.WindowsMessageType; 24 import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCWindowTree;25 25 import de.ugoe.cs.util.console.Console; 26 26 … … 85 85 * </p> 86 86 */ 87 public SequenceSplitter( MFCWindowTree windowTree) {87 public SequenceSplitter(GUIElementTree guiElementTree) { 88 88 currentSequence = new LinkedList<WindowsMessage>(); 89 89 openDowns = 0; 90 90 initMessages = true; 91 tokenGenerator = new EventGenerator( windowTree);91 tokenGenerator = new EventGenerator(guiElementTree); 92 92 actionSequence = new LinkedList<Event>(); 93 93 prevMsg = null; -
trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/guimodel/MFCGUIElementSpec.java
r990 r1006 94 94 /** 95 95 * <p> 96 * Creates a new WindowTreeNode. 97 * </p> 98 * <p> 99 * The constructor is protected WindowTreeNode may only be created from the MFCWindowTree. 96 * Creates a new MFCGUIElementSpec. 100 97 * </p> 101 98 * 102 99 * @param hwnd 103 100 * hwnd of the window 104 * @param parent105 * reference to the parent's WindowTreeNode106 101 * @param name 107 102 * name of the window … … 113 108 * modality of the window 114 109 */ 115 p rotectedMFCGUIElementSpec(long hwnd, String name, int resourceId, String type, boolean isModal)110 public MFCGUIElementSpec(long hwnd, String name, int resourceId, String type, boolean isModal) 116 111 { 117 112 this.hwnd = hwnd;
Note: See TracChangeset
for help on using the changeset viewer.