- SequenceFeature[] features = findFeaturesAtRes(
- sequence.getDatasetSequence(), sequence.findPosition(res));
-
- if (features != null)
- {
- for (int i = 0; i < features.length; i++)
- {
- if (features[i].getType().equals("disulfide bond"))
- {
- if (features[i].getBegin() == sequence.findPosition(res)
- || features[i].getEnd() == sequence.findPosition(res))
- {
- if (tooltipText.length() > 6)
- {
- tooltipText.append("<br>");
- }
- tooltipText.append("disulfide bond " + features[i].getBegin() +
- ":" +
- features[i].getEnd());
- if (features[i].links != null)
- {
- tooltipText.append(" <img src=\"" + linkImageURL + "\">");
- }
- }
- }
- else
- {
- if (tooltipText.length() > 6)
- {
- tooltipText.append("<br>");
- }
-
- tooltipText.append(features[i].getType() + " " +
- features[i].begin);
- if (features[i].begin != features[i].end)
- {
- tooltipText.append(" " + features[i].end);
- }
-
- if (features[i].getDescription() != null
- && !features[i].description.equals(features[i].getType()))
- {
- tmpString = features[i].getDescription();
- int startTag = tmpString.toUpperCase().indexOf("<HTML>");
- if (startTag > -1)
- {
- tmpString = tmpString.substring(startTag + 6);
- }
- int endTag = tmpString.toUpperCase().indexOf("</BODY>");
- if (endTag > -1)
- {
- tmpString = tmpString.substring(0, endTag);
- }
- endTag = tmpString.toUpperCase().indexOf("</HTML>");
- if (endTag > -1)
- {
- tmpString = tmpString.substring(0, endTag);
- }
-
- if (startTag > -1)
- {
- tooltipText.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(">", ">");
-
- tooltipText.append("; ");
- tooltipText.append(tmpString);
-
- }
- else
- {
- tooltipText.append("; " + tmpString);
- }
- }
- }
- if (features[i].getValue("status") != null)
- {
- String status = features[i].getValue("status").toString();
- if (status.length() > 0)
- {
- tooltipText.append("; (" + features[i].getValue("status") + ")");
- }
- }
-
- if (features[i].links != null)
- {
- tooltipText.append(" <img src=\"" + linkImageURL + "\">");
- }
-
- }
- }
- }