X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColourChooser.java;h=2b7d6782b814e72f666d7de9b227520c5b38ec31;hb=c56d96f3544cd3b4e0a7d36a8eba04f767eaf57a;hp=b29a1dd15723e88ebdb5a69c140e44266c4b66cd;hpb=067038905ed3a04bbdb7e8f96dfc738d1735b41b;p=jalview.git diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index b29a1dd..2b7d678 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -63,7 +63,9 @@ public class AnnotationColourChooser extends AnnotationRowFilter private Map oldgroupColours; - private Map oldThresholds; + private Map oldGraphLines; + + private Map oldThresholds; private JCheckBox useOriginalColours = new JCheckBox(); @@ -183,6 +185,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter * 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) @@ -190,8 +193,11 @@ public class AnnotationColourChooser extends AnnotationRowFilter 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); + } } } } @@ -364,10 +370,15 @@ public class AnnotationColourChooser extends AnnotationRowFilter sg.setColourScheme(oldgroupColours.get(sg)); } } - for (Entry entry : oldThresholds + for (Entry 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(); + } } }