Merge branch 'develop' into features/JAL-518_justify_seqs_in_region
[jalview.git] / src / jalview / io / SequenceAnnotationReport.java
index 95bd1cc..95d0bc6 100644 (file)
@@ -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;
     }