private Map<SequenceGroup, ColourSchemeI> oldgroupColours;
- private Map<AlignmentAnnotation, GraphLine> oldThresholds;
+ private Map<AlignmentAnnotation, GraphLine> oldGraphLines;
+
+ private Map<GraphLine, Float> oldThresholds;
private JCheckBox useOriginalColours = new JCheckBox();
* save any existing annotation threshold settings; note we make a copy
* of each in case the current threshold value gets amended
*/
+ oldGraphLines = new HashMap<>();
oldThresholds = new HashMap<>();
AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation();
if (anns != null)
for (AlignmentAnnotation ann : anns)
{
GraphLine thresh = ann.getThreshold();
- oldThresholds.put(ann,
- thresh == null ? null : new GraphLine(thresh));
+ oldGraphLines.put(ann, thresh);
+ if (thresh != null)
+ {
+ oldThresholds.put(thresh, thresh.value);
+ }
}
}
}
sg.setColourScheme(oldgroupColours.get(sg));
}
}
- for (Entry<AlignmentAnnotation, GraphLine> entry : oldThresholds
+ for (Entry<AlignmentAnnotation, GraphLine> entry : oldGraphLines
.entrySet())
{
- entry.getKey().setThreshold(entry.getValue());
+ GraphLine graphLine = entry.getValue();
+ entry.getKey().setThreshold(graphLine);
+ if (graphLine != null)
+ {
+ graphLine.value = oldThresholds.get(graphLine).floatValue();
+ }
}
}