import jalview.datamodel.features.FeatureSources;
import jalview.util.StringUtils;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
return featureGroup;
}
+ /**
+ * Adds a hyperlink for the feature. This should have the format label|url.
+ *
+ * @param labelLink
+ */
public void addLink(String labelLink)
{
if (links == null)
/**
* Answers an html-formatted report of feature details
*
+ * @param seqName
+ *
* @return
*/
- public String getDetailsReport()
+ public String getDetailsReport(String seqName)
{
FeatureSourceI metadata = FeatureSources.getInstance()
.getSource(source);
StringBuilder sb = new StringBuilder(128);
sb.append("<br>");
sb.append("<table>");
+ sb.append(String.format(ROW_DATA, "Location", seqName,
+ begin == end ? begin
+ : begin + (isContactFeature() ? ":" : "-") + end));
sb.append(String.format(ROW_DATA, "Type", type, ""));
- sb.append(String.format(ROW_DATA, "Start/end", begin == end ? begin
- : begin + (isContactFeature() ? ":" : "-") + end, ""));
String desc = StringUtils.stripHtmlTags(description);
sb.append(String.format(ROW_DATA, "Description", desc, ""));
if (!Float.isNaN(score) && score != 0f)
source = theSource;
}
}
+
+class SFSortByEnd implements Comparator<SequenceFeature>
+{
+ @Override
+ public int compare(SequenceFeature a, SequenceFeature b)
+ {
+ return a.getEnd() - b.getEnd();
+ }
+}
+
+class SFSortByBegin implements Comparator<SequenceFeature>
+{
+ @Override
+ public int compare(SequenceFeature a, SequenceFeature b)
+ {
+ return a.getBegin() - b.getBegin();
+ }
+}