List<Map<String, String>> elements =
Lists.newArrayListWithCapacity(candidateElements.size());
for (CandidateElementPosition element : candidateElements) {
Eventable eventable = getEventableByCandidateElementInState(state, element);
StateVertex toState = null;
Map<String, String> elementMap = new HashMap<String, String>();
elementMap.put("xpath", element.getXpath());
elementMap
.put("left", "" + (element.getLeft() - 3 + state.getScreenshotOffsetLeft()));
elementMap.put("top", "" + (element.getTop() - 3 + state.getScreenshotOffsetTop()));
elementMap.put("width", "" + (element.getWidth() + 2));
elementMap.put("height", "" + (element.getHeight() + 2));
LOG.debug("State {} has offset {} {} for element {}", new Object[] { state.getName(),
state.getScreenshotOffsetLeft(), state.getScreenshotOffsetTop(), element });
if (eventable != null) {
toState = sfg.getTargetState(eventable);
}
if (toState != null) {
elementMap.put("targetname", toState.getName());
if (getStateNumber(toState.getName()) < getStateNumber(state.getName())) {
// state already found
elementMap.put("color", COLOR_A_PREVIOUS_STATE);
} else {
// new state
elementMap.put("color", COLOR_NEW_STATE);