- if (feature.getType().equals("disulfide bond"))
- {
- if (feature.getBegin() == rpos || feature.getEnd() == rpos)
- {
- if (tooltipText2.length() > 6)
- {
- tooltipText2.append("<br>");
- }
- tooltipText2.append("disulfide bond " + feature.getBegin()
- + ":" + feature.getEnd());
- }
- }
- else
- {
- if (tooltipText2.length() > 6)
- {
- tooltipText2.append("<br>");
- }
- // TODO: remove this hack to display link only features
- boolean linkOnly = feature.getValue("linkonly") != null;
- if (!linkOnly)
- {
- tooltipText2.append(feature.getType() + " ");
- if (rpos != 0)
- {
- // we are marking a positional feature
- tooltipText2.append(feature.begin);
- }
- if (feature.begin != feature.end)
- {
- tooltipText2.append(" " + feature.end);
- }
-
- if (feature.getDescription() != null
- && !feature.description.equals(feature.getType()))
- {
- tmpString = feature.getDescription();
- String tmp2up = tmpString.toUpperCase();
- int startTag = tmp2up.indexOf("<HTML>");
- if (startTag > -1)
- {
- tmpString = tmpString.substring(startTag + 6);
- tmp2up = tmp2up.substring(startTag + 6);
- }
- int endTag = tmp2up.indexOf("</BODY>");
- if (endTag > -1)
- {
- tmpString = tmpString.substring(0, endTag);
- tmp2up = tmp2up.substring(0, endTag);
- }
- endTag = tmp2up.indexOf("</HTML>");
- if (endTag > -1)
- {
- tmpString = tmpString.substring(0, endTag);
- }
-
- if (startTag > -1)
- {
- tooltipText2.append("; " + tmpString);
- }
- else
- {
- if (tmpString.indexOf("<") > -1
- || tmpString.indexOf(">") > -1)
- {
- // The description does not specify html is to
- // be used, so we must remove < > symbols
- tmpString = tmpString.replaceAll("<", "<");
- tmpString = tmpString.replaceAll(">", ">");
-
- tooltipText2.append("; ");
- tooltipText2.append(tmpString);
-
- }
- else
- {
- tooltipText2.append("; " + tmpString);
- }
- }
- }
- // check score should be shown
- if (!Float.isNaN(feature.getScore()))
- {
- float[][] rng = (minmax == null) ? null : ((float[][]) minmax
- .get(feature.getType()));
- if (rng != null && rng[0] != null && rng[0][0] != rng[0][1])
- {
- tooltipText2.append(" Score=" + feature.getScore());
- }
- }
- if (feature.getValue("status") != null)
- {
- String status = feature.getValue("status").toString();
- if (status.length() > 0)
- {
- tooltipText2.append("; (" + feature.getValue("status")
- + ")");
- }
- }
- }
- }
- if (feature.links != null)
- {
- if (linkImageURL != null)
- {
- tooltipText2.append(" <img src=\"" + linkImageURL + "\">");
- }
- else
- {
- for (String urlstring : feature.links)
- {
- try
- {
- for (String[] urllink : createLinksFrom(null, urlstring))
- {
- tooltipText2.append("<br/> <a href=\""
- + urllink[3]
- + "\" target=\""
- + urllink[0]
- + "\">"
- + (urllink[0].toLowerCase().equals(
- urllink[1].toLowerCase()) ? urllink[0]
- : (urllink[0] + ":" + urllink[1]))
- + "</a></br>");
- }
- } catch (Exception x)
- {
- System.err.println("problem when creating links from "
- + urlstring);
- x.printStackTrace();
- }
- }
- }
-
- }