X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FSequenceAnnotationReport.java;h=6fba9c62ef64e28b902b8954f25b7d65d4d509c4;hb=refs%2Fheads%2Fbug%2FJAL-1644_Finder-logic-improvement;hp=86424465c2595c1c2aef13d627bcaef3009a1a4c;hpb=3eef76298c55f3def21eed2516b5ace4405bed0a;p=jalview.git
diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java
index 8642446..6fba9c6 100644
--- a/src/jalview/io/SequenceAnnotationReport.java
+++ b/src/jalview/io/SequenceAnnotationReport.java
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.io;
import java.util.ArrayList;
@@ -164,9 +184,15 @@ public class SequenceAnnotationReport
{
for (String[] urllink : createLinksFrom(null, urlstring))
{
- tooltipText2.append("
"
- + (urllink[0].toLowerCase().equals(urllink[1].toLowerCase()) ? urllink[0] : (urllink[0]+ ":" + urllink[1])) + "");
+ tooltipText2.append("
"
+ + (urllink[0].toLowerCase().equals(
+ urllink[1].toLowerCase()) ? urllink[0]
+ : (urllink[0] + ":" + urllink[1]))
+ + "");
}
} catch (Exception x)
{
@@ -192,7 +218,7 @@ public class SequenceAnnotationReport
public String[][] createLinksFrom(SequenceI seq, String link)
{
ArrayList urlSets = new ArrayList();
- ArrayList uniques=new ArrayList();
+ ArrayList uniques = new ArrayList();
UrlLink urlLink = new UrlLink(link);
if (!urlLink.isValid())
{
@@ -232,11 +258,11 @@ public class SequenceAnnotationReport
{
for (int u = 0; u < urls.length; u += 2)
{
- String unq=urls[u]+"|"+urls[u+1];
+ String unq = urls[u] + "|" + urls[u + 1];
if (!uniques.contains(unq))
{
urlSets.add(new String[]
- { target, label, urls[u], urls[u + 1] });
+ { target, label, urls[u], urls[u + 1] });
uniques.add(unq);
}
}
@@ -251,11 +277,11 @@ public class SequenceAnnotationReport
{
for (int u = 0; u < urls.length; u += 2)
{
- String unq=urls[u]+"|"+urls[u+1];
+ String unq = urls[u] + "|" + urls[u + 1];
if (!uniques.contains(unq))
{
urlSets.add(new String[]
- { target, label, urls[u], urls[u + 1] });
+ { target, label, urls[u], urls[u + 1] });
uniques.add(unq);
}
}
@@ -269,23 +295,27 @@ public class SequenceAnnotationReport
{
for (int u = 0; u < urls.length; u += 2)
{
- String unq=urls[u]+"|"+urls[u+1];
+ String unq = urls[u] + "|" + urls[u + 1];
if (!uniques.contains(unq))
{
urlSets.add(new String[]
- { target, label, urls[u], urls[u + 1] });
+ { target, label, urls[u], urls[u + 1] });
uniques.add(unq);
}
}
}
}
- } else {
- String unq=label + "|" + urlLink.getUrl_prefix();
- if (!uniques.contains(unq)){
+ }
+ else
+ {
+ String unq = label + "|" + urlLink.getUrl_prefix();
+ if (!uniques.contains(unq))
+ {
uniques.add(unq);
// Add a non-dynamic link
- urlSets.add(new String[] {target, label, null, urlLink.getUrl_prefix()});
+ urlSets.add(new String[]
+ { target, label, null, urlLink.getUrl_prefix() });
}
}
@@ -293,17 +323,17 @@ public class SequenceAnnotationReport
{});
}
-
public void createSequenceAnnotationReport(final StringBuffer tip,
SequenceI sequence, boolean showDbRefs, boolean showNpFeats,
Hashtable minmax)
{
- createSequenceAnnotationReport(tip, sequence, showDbRefs, showNpFeats, true, minmax);
+ createSequenceAnnotationReport(tip, sequence, showDbRefs, showNpFeats,
+ true, minmax);
}
public void createSequenceAnnotationReport(final StringBuffer tip,
- SequenceI sequence, boolean showDbRefs, boolean showNpFeats, boolean tableWrap,
- Hashtable minmax)
+ SequenceI sequence, boolean showDbRefs, boolean showNpFeats,
+ boolean tableWrap, Hashtable minmax)
{
String tmp;
tip.append("");
@@ -315,8 +345,12 @@ public class SequenceAnnotationReport
tip.append("
" + tmp);
maxWidth = Math.max(maxWidth, tmp.length());
}
-
- DBRefEntry[] dbrefs = sequence.getDatasetSequence().getDBRef();
+ SequenceI ds = sequence;
+ while (ds.getDatasetSequence() != null)
+ {
+ ds = ds.getDatasetSequence();
+ }
+ DBRefEntry[] dbrefs = ds.getDBRef();
if (showDbRefs && dbrefs != null)
{
for (int i = 0; i < dbrefs.length; i++)
@@ -329,8 +363,7 @@ public class SequenceAnnotationReport
}
// ADD NON POSITIONAL SEQUENCE INFO
- SequenceFeature[] features = sequence.getDatasetSequence()
- .getSequenceFeatures();
+ SequenceFeature[] features = ds.getSequenceFeatures();
SequenceFeature[] tfeat = new SequenceFeature[1];
if (showNpFeats && features != null)
{