Changeset 1025 for trunk/autoquest-core-events/src/main
- Timestamp:
- 12/31/12 17:06:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIElementTree.java
r1005 r1025 173 173 * <p> 174 174 * Searches the tree for a GUI element with the specified id and returns its 175 * {@link IGUIElement Spec} .175 * {@link IGUIElement} . 176 176 * </p> 177 177 * … … 181 181 */ 182 182 public IGUIElement find(long id) { 183 IGUIElement guiElement = guiElements.get(id); 184 if (guiElement == null) { 185 List<IGUIElementSpec> guiElementPath = new ArrayList<IGUIElementSpec>(); 186 187 IGUIElementSpec elementSpec = guiElementSpecs.get(id); 188 189 if (elementSpec == null) { 190 throw new RuntimeException("no GUI element found with hash " + id); 191 } 192 193 Long currentElementID = id; 194 while (elementSpec != null) { 195 guiElementPath.add(0, elementSpec); 196 currentElementID = parentRelations.get(currentElementID); 197 elementSpec = guiElementSpecs.get(currentElementID); 198 } 199 200 try { 201 guiElement = guiModel.integratePath(guiElementPath, guiElementFactory); 202 } 203 catch (GUIModelException e) { 204 throw new RuntimeException("could not instantiate GUI element with id " + id, e); 205 } 206 guiElements.put(id, guiElement); 207 } 208 return guiElement; 183 return guiElements.get(id); 209 184 } 210 185
Note: See TracChangeset
for help on using the changeset viewer.