private void restoreManuallySetColors() {
if (pathColors != null) {
VennFilteredDataModel[] models = dataSplitter.getModels();
for (int i = 0; i < models.length; i++) {
VennFilteredDataModel model = models[i];
final BitSet groups = model.getGroups();
final BitSet ggroups = filteredModel.localToGlobalGroupID(groups);
Map<BitSet, Color> pathColorsForModel = new HashMap<BitSet, Color>();
//search color
for (Map.Entry<BitSet, Color> entr : pathColors.entrySet()) {
BitSet path = entr.getKey();
Color color = entr.getValue();
BitSet ggroupsAndColorPath = (BitSet) ggroups.clone();
ggroupsAndColorPath.and(path);
if (path.cardinality() == ggroupsAndColorPath.cardinality()) {
//color found for this model (color path has no groups which don't exist in model)
assert color != null;
BitSet gcolorPath = filteredModel.globalToLocalGroupID(path);
pathColorsForModel.put(model.globalToLocalGroupID(gcolorPath), color);
entr.setValue(null);
}
}
((VennDiagramView) views[i]).setColors(pathColorsForModel);
}