X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAnnotationFile.java;h=9a4071d1060170dc67a42f695949377de4958aa1;hb=d559b47886de6427219011e6e355320a0babd757;hp=10976176c3bb1bba539f8ce0205be95d6401b78b;hpb=b0cee3aaf7d8873910939f97b6acb217d518968d;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 1097617..9a4071d 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -32,7 +32,6 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.schemes.ColourSchemeI; import jalview.schemes.ColourSchemeProperty; -import jalview.schemes.UserColourScheme; import jalview.util.ColorUtils; import java.awt.Color; @@ -1430,7 +1429,7 @@ public class AnnotationFile value = Float.valueOf(nextToken); } catch (NumberFormatException e) { - System.err.println("Threshold '" + nextToken + System.err.println("line " + nlinesread + ": Threshold '" + nextToken + "' invalid, setting to zero"); } String label = st.hasMoreTokens() ? st.nextToken() : null; @@ -1610,8 +1609,7 @@ public class AnnotationFile if (sg != null) { String keyValue, key, value; - ColourSchemeI def = sg.cs; - sg.cs = null; + ColourSchemeI def = sg.getColourScheme(); while (st.hasMoreTokens()) { keyValue = st.nextToken(); @@ -1624,7 +1622,8 @@ public class AnnotationFile } else if (key.equalsIgnoreCase("colour")) { - sg.cs = ColourSchemeProperty.getColour(al, value); + sg.cs.setColourScheme(ColourSchemeProperty + .getColourScheme(al, value)); } else if (key.equalsIgnoreCase("pidThreshold")) { @@ -1677,9 +1676,8 @@ public class AnnotationFile } else if (key.equalsIgnoreCase("idColour")) { - // consider warning if colour doesn't resolve to a real colour - def = new UserColourScheme(value); - sg.setIdColour(def.findColour()); + Color idColour = ColorUtils.parseColourString(value); + sg.setIdColour(idColour == null ? Color.black : idColour); } else if (key.equalsIgnoreCase("hide")) { @@ -1693,9 +1691,9 @@ public class AnnotationFile } sg.recalcConservation(); } - if (sg.cs == null) + if (sg.getColourScheme() == null) { - sg.cs = def; + sg.setColourScheme(def); } } }