+
+ private String getToolTipTextFromPDBEntries(List<PDBEntry> pdbEntries)
+ {
+ String tooltip = "";
+ if (pdbEntries.isEmpty())
+ {
+ return tooltip;
+ }
+ if (pdbEntries.size() > 1)
+ {
+ int x = 0;
+ PDBEntry bestRanked = null;
+ for (PDBEntry pdb : pdbEntries)
+ {
+ if (pdb.getProperty("DYNAMIC_DATA_PHYRE2") != null)
+ {
+ x++;
+ }
+ // best ranked entry must be from a Phyre
+ if (x > 0 && bestRanked == null)
+ {
+ bestRanked = pdb;
+ }
+ }
+ tooltip = (x > 0) ? "<table border=\"1\" width=100%><tr><td>Contains <b>"
+ + x
+ + "</b> Phyre2 model structure(s)</td></tr>"
+ + "<tr><td>Best ranked Phyre2 model is <b>"
+ + bestRanked.getId() + "</b></td></tr></table>"
+ : "";
+ }
+ else
+ {
+ PDBEntry pdb = pdbEntries.iterator().next();
+ if (pdb.getProperty("DYNAMIC_DATA_PHYRE2") != null)
+ {
+ tooltip = getPhyreToolTipFromDynamicData((List<DynamicData>) pdb
+ .getProperty("DYNAMIC_DATA_PHYRE2"));
+ }
+ }
+ return tooltip;
+ }
+
+ private String getPhyreToolTipFromDynamicData(
+ List<DynamicData> dynamicDataList)
+ {
+ StringBuilder phyre2InfoBuilder = new StringBuilder();
+ phyre2InfoBuilder
+ .append("<html><table border=\"1\" width=100%>")
+ .append("<tr><td colspan=\"2\"><strong>Phyre2 Template Info</strong></td></tr>");
+ for (DynamicData data : dynamicDataList)
+ {
+ if (data.isDisplay())
+ {
+ phyre2InfoBuilder.append("<tr><td>").append(data.getFieldTitle())
+ .append("</td><td>").append(data.getFieldValue())
+ .append("</td></tr>");
+ }
+ }
+ phyre2InfoBuilder.append("</table></html>");
+ return phyre2InfoBuilder.toString();
+ }
+
+ public void createTooltipAnnotationReport(final StringBuilder tip,
+ SequenceI sequence, boolean showDbRefs, boolean showNpFeats,
+ Map<String, float[][]> minmax)
+ {
+ int maxWidth = createSequenceAnnotationReport(tip, sequence,
+ showDbRefs, showNpFeats, minmax, true);
+
+ if (maxWidth > 60)
+ {
+ // ? not sure this serves any useful purpose
+ // tip.insert(0, "<table width=350 border=0><tr><td>");
+ // tip.append("</td></tr></table>");
+ }
+ }