*/
package jalview.io;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.LinkedHashMap;
private static String linkImageURL;
- private static final String[][] PRIMARY_SOURCES = new String[][] {
- DBRefSource.CODINGDBS, DBRefSource.DNACODINGDBS,
- DBRefSource.PROTEINDBS };
+ // public static final String[][] PRIMARY_SOURCES moved to DBRefSource.java
/*
* Comparator to order DBRefEntry by Source + accession id (case-insensitive),
}
String s1 = ref1.getSource();
String s2 = ref2.getSource();
- boolean s1Primary = isPrimarySource(s1);
- boolean s2Primary = isPrimarySource(s2);
+ boolean s1Primary = DBRefSource.isPrimarySource(s1);
+ boolean s2Primary = DBRefSource.isPrimarySource(s2);
if (s1Primary && !s2Primary)
{
return -1;
return comp;
}
- private boolean isPrimarySource(String source)
- {
- for (String[] primary : PRIMARY_SOURCES)
- {
- for (String s : primary)
- {
- if (source.equals(s))
- {
- return true;
- }
- }
- }
- return false;
- }
+// private boolean isPrimarySource(String source)
+// {
+// for (String[] primary : DBRefSource.PRIMARY_SOURCES)
+// {
+// for (String s : primary)
+// {
+// if (source.equals(s))
+// {
+// return true;
+// }
+// }
+// }
+// return false;
+// }
};
private boolean forTooltip;
{
beginRange = mf.getMappedPositions(begin, begin);
endRange = mf.getMappedPositions(end, end);
+ if (beginRange == null || endRange == null)
+ {
+ // something went wrong
+ return false;
+ }
begin = beginRange[0];
end = endRange[endRange.length - 1];
}
{
if (sb0.length() > 6)
{
- sb.append("<br/>");
+ sb.append("<br>");
}
sb.append(feature.getType()).append(" ").append(begin).append(":")
.append(end);
if (sb0.length() > 6)
{
- sb.append("<br/>");
+ sb.append("<br>");
}
// TODO: remove this hack to display link only features
boolean linkOnly = feature.getValue("linkonly") != null;
int linkindex = description.toLowerCase().indexOf("<a ");
boolean hasLink = linkindex > -1
&& linkindex < MAX_DESCRIPTION_LENGTH;
- if (description.length() > MAX_DESCRIPTION_LENGTH && !hasLink)
+ if (
+ // BH suggestion maxlength == 0 &&
+ description.length() > MAX_DESCRIPTION_LENGTH && !hasLink)
{
description = description.substring(0, MAX_DESCRIPTION_LENGTH)
+ ELLIPSIS;
{
for (List<String> urllink : createLinksFrom(null, urlstring))
{
- sb.append("<br/> <a href=\""
+ sb.append("<br> <a href=\""
+ urllink.get(3)
+ "\" target=\""
+ urllink.get(0)
.equals(urllink.get(1).toLowerCase()) ? urllink
.get(0) : (urllink.get(0) + ":" + urllink
.get(1)))
- + "</a><br/>");
+ + "</a><br>");
}
} catch (Exception x)
{
protected int appendDbRefs(final StringBuilder sb, SequenceI ds,
boolean summary)
{
- DBRefEntry[] dbrefs = ds.getDBRefs();
+ List<DBRefEntry> dbrefs = ds.getDBRefs();
if (dbrefs == null)
{
return 0;
}
// note this sorts the refs held on the sequence!
- Arrays.sort(dbrefs, comparator);
+ dbrefs.sort(comparator);
boolean ellipsis = false;
String source = null;
String lastSource = null;
countForSource++;
if (countForSource == 1 || !summary)
{
- sb.append("<br/>");
+ sb.append("<br>");
}
if (countForSource <= MAX_REFS_PER_SOURCE || !summary)
{
}
if (moreSources)
{
- sb.append("<br/>").append(source).append(COMMA).append(ELLIPSIS);
+ sb.append("<br>").append(source).append(COMMA).append(ELLIPSIS);
}
if (ellipsis)
{
- sb.append("<br/>(");
+ sb.append("<br>(");
sb.append(MessageManager.getString("label.output_seq_details"));
sb.append(")");
}