X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FSequenceAnnotationReport.java;h=95d0bc6a8b7e463653f7c569a1b1c1fcc42918ca;hb=85299bc2db43c8b108169661ebc1c4d9b2d3d2e5;hp=b0b0deeb6a578030f27377129aa588ba9d376ed3;hpb=3352c2b216fc2c4051410efe7a564b790c79ebd9;p=jalview.git diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index b0b0dee..95d0bc6 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -20,12 +20,12 @@ */ package jalview.io; -import java.util.Locale; - +import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import jalview.api.FeatureColourI; @@ -55,7 +55,7 @@ public class SequenceAnnotationReport private static final int MAX_REFS_PER_SOURCE = 4; - private static final int MAX_SOURCES = 40; + private static final int MAX_SOURCES = 5; private static String linkImageURL; @@ -79,10 +79,19 @@ public class SequenceAnnotationReport { return 1; } + String s1 = ref1.getSource(); String s2 = ref2.getSource(); boolean s1Primary = DBRefSource.isPrimarySource(s1); boolean s2Primary = DBRefSource.isPrimarySource(s2); + if (ref1.isCanonical() && !ref2.isCanonical()) + { + return -1; + } + if (!ref1.isCanonical() && ref2.isCanonical()) + { + return 1; + } if (s1Primary && !s2Primary) { return -1; @@ -423,7 +432,7 @@ public class SequenceAnnotationReport } } catch (Exception x) { - System.err.println( + jalview.bin.Console.errPrintln( "problem when creating links from " + urlstring); x.printStackTrace(); } @@ -446,7 +455,7 @@ public class SequenceAnnotationReport UrlLink urlLink = new UrlLink(link); if (!urlLink.isValid()) { - System.err.println(urlLink.getInvalidMessage()); + jalview.bin.Console.errPrintln(urlLink.getInvalidMessage()); return null; } @@ -536,12 +545,19 @@ public class SequenceAnnotationReport protected int appendDbRefs(final StringBuilder sb, SequenceI ds, boolean summary) { - List dbrefs = ds.getDBRefs(); - if (dbrefs == null) + List dbrefs, dbrefset = ds.getDBRefs(); + + if (dbrefset == null) { return 0; } + // PATCH for JAL-3980 defensive copy + + dbrefs = new ArrayList(); + + dbrefs.addAll(dbrefset); + // note this sorts the refs held on the sequence! dbrefs.sort(comparator); boolean ellipsis = false;