*/
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;
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;
{
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;
}
} catch (Exception x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"problem when creating links from " + urlstring);
x.printStackTrace();
}
UrlLink urlLink = new UrlLink(link);
if (!urlLink.isValid())
{
- System.err.println(urlLink.getInvalidMessage());
+ jalview.bin.Console.errPrintln(urlLink.getInvalidMessage());
return null;
}
sb.append(tmp);
maxWidth = Math.max(maxWidth, tmp.length());
}
+ sb.append("\n");
SequenceI ds = sequence;
while (ds.getDatasetSequence() != null)
{
{
maxWidth = Math.max(maxWidth, appendDbRefs(sb, ds, summary));
}
+ sb.append("\n");
/*
* add non-positional features if wanted
protected int appendDbRefs(final StringBuilder sb, SequenceI ds,
boolean summary)
{
- List<DBRefEntry> dbrefs = ds.getDBRefs();
- if (dbrefs == null)
+ List<DBRefEntry> dbrefs, dbrefset = ds.getDBRefs();
+
+ if (dbrefset == null)
{
return 0;
}
+ // PATCH for JAL-3980 defensive copy
+
+ dbrefs = new ArrayList<DBRefEntry>();
+
+ dbrefs.addAll(dbrefset);
+
// note this sorts the refs held on the sequence!
dbrefs.sort(comparator);
boolean ellipsis = false;
countForSource++;
if (countForSource == 1 || !summary)
{
- sb.append("<br/>");
+ sb.append("<br/>\n");
}
if (countForSource <= MAX_REFS_PER_SOURCE || !summary)
{
lineLength += accessionId.length() + 1;
if (countForSource > 1 && summary)
{
- sb.append(", ").append(accessionId);
+ sb.append(",\n ").append(accessionId);
lineLength++;
}
else
}
if (moreSources)
{
- sb.append("<br/>").append(source).append(COMMA).append(ELLIPSIS);
+ sb.append("<br/>\n").append(source).append(COMMA).append(ELLIPSIS);
}
if (ellipsis)
{
- sb.append("<br/>(");
+ sb.append("<br/>\n(");
sb.append(MessageManager.getString("label.output_seq_details"));
sb.append(")");
}