TreePathId pathId = new TreePathId(selectionPath);
// check if was selected before
if (!selectedPaths.containsKey(pathId)) {
// start fading in
StateTransitionTracker tracker = getTracker(pathId,
(currRolloverPathId != null)
&& pathId.equals(currRolloverPathId),
false);
tracker.getModel().setSelected(true);
selectedPaths.put(pathId, selectionPath
.getLastPathComponent());
}
}
}
for (Iterator<Map.Entry<TreePathId, Object>> it = selectedPaths
.entrySet().iterator(); it.hasNext();) {
Map.Entry<TreePathId, Object> entry = it.next();
if (tree.getSelectionModel()
.isPathSelected(entry.getKey().path))
continue;
// fade out for deselected path
TreePathId pathId = entry.getKey();
StateTransitionTracker tracker = getTracker(pathId,
(currRolloverPathId != null)
&& pathId.equals(currRolloverPathId), true);
tracker.getModel().setSelected(false);
it.remove();
}
}