Merge branch 'develop' into patch/JAL-4281_idwidthandannotHeight_in_project
[jalview.git] / src / jalview / io / SequenceAnnotationReport.java
index 721cd47..0a1172c 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;