Changeset 229 for trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows
- Timestamp:
- 10/03/11 23:06:06 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDparseXML.java
r203 r229 4 4 import java.util.Collection; 5 5 import java.util.List; 6 import java.util.SortedSet; 6 7 7 8 import de.ugoe.cs.eventbench.data.GlobalDataContainer; 8 9 import de.ugoe.cs.eventbench.windows.LogParser; 10 import de.ugoe.cs.eventbench.windows.data.WindowTree; 9 11 import de.ugoe.cs.eventbench.windows.data.WindowsEvent; 10 12 import de.ugoe.cs.util.console.Command; … … 60 62 61 63 Collection<List<WindowsEvent>> sequences = parser.getSequences(); 64 SortedSet<String> targets = WindowTree.getInstance().getTargets(); 62 65 63 66 if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) { 64 67 Console.traceln("Old data \"" + sequencesName + "\" overwritten"); 65 68 } 69 if( GlobalDataContainer.getInstance().addData(sequencesName+"_targets", targets)) { 70 Console.traceln("Old data \"" + sequencesName+"_targets" + "\" overwritten"); 71 } 66 72 } 67 73 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/data/WindowTree.java
r228 r229 5 5 import java.util.Map; 6 6 import java.util.SortedSet; 7 import java.util.TreeSet;8 9 import de.ugoe.cs.eventbench.data.GlobalDataContainer;10 import de.ugoe.cs.util.console.Console;11 7 12 8 /** … … 39 35 */ 40 36 private static WindowTree theInstance = null; 37 38 /** 39 * <p> 40 * Maintains a set of all the target strings of all widgets that were at 41 * some point part of the window tree. 42 * </p> 43 */ 44 private SortedSet<String> targets; 41 45 42 46 /** … … 112 116 } 113 117 nodes.put(childHwnd, child); 118 targets.add(child.xmlRepresentation()); 114 119 } 115 116 storeTarget(childHwnd);117 120 } 118 121 … … 172 175 /** 173 176 * <p> 174 * Stores a target in GlobalDataContainer to be able to work on with it in175 * DlgInsert177 * Returns a sorted set of all targets that existed any time in the window 178 * tree. 176 179 * </p> 177 180 * 178 * @param hwnd 179 * hwnd of the window to be stored 181 * @return set of targets 180 182 */ 181 @SuppressWarnings("unchecked") 182 private void storeTarget(int hwnd) { 183 SortedSet<String> targets = new TreeSet<String>(); 184 185 if (GlobalDataContainer.getInstance().getData("ListTargets") == null) { 186 GlobalDataContainer.getInstance().addData("ListTargets", targets); 187 } 188 189 try { 190 targets = (SortedSet<String>) GlobalDataContainer.getInstance().getData("ListTargets"); 191 targets.add(nodes.get(hwnd).xmlRepresentation()); 192 } catch (ClassCastException e) { 193 Console.println("Not able to cast data in GlobalDataContainer to SortedSet of Strings"); 194 } 183 public SortedSet<String> getTargets() { 184 return targets; 195 185 } 196 186 }
Note: See TracChangeset
for help on using the changeset viewer.