import jalview.math.AlignmentDimension;
import jalview.schemes.ResidueProperties;
import jalview.structure.StructureSelectionManager;
+import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.viewmodel.ViewportRanges;
sy = s * av.getCharHeight() + scaleHeight;
SequenceI seq = av.getAlignment().getSequenceAt(s);
- SequenceFeature[] features = seq.getSequenceFeatures();
SequenceGroup[] groups = av.getAlignment().findAllGroups(seq);
for (res = 0; res < alwidth; res++)
{
- StringBuilder text = new StringBuilder();
+ StringBuilder text = new StringBuilder(512);
String triplet = null;
if (av.getAlignment().isNucleotide())
{
continue;
}
- int alIndex = seq.findPosition(res);
+ int seqPos = seq.findPosition(res);
gSize = groups.length;
for (g = 0; g < gSize; g++)
{
.append((idWidth + (res + 1) * av.getCharWidth()))
.append(",").append((av.getCharHeight() + sy))
.append("\"").append(" onMouseOver=\"toolTip('")
- .append(alIndex).append(" ").append(triplet);
+ .append(seqPos).append(" ").append(triplet);
}
if (groups[g].getStartRes() < res
}
}
- if (features != null)
+ if (text.length() < 1)
{
- if (text.length() < 1)
- {
- text.append("<area shape=\"rect\" coords=\"")
- .append((idWidth + res * av.getCharWidth()))
- .append(",").append(sy).append(",")
- .append((idWidth + (res + 1) * av.getCharWidth()))
- .append(",").append((av.getCharHeight() + sy))
- .append("\"").append(" onMouseOver=\"toolTip('")
- .append(alIndex).append(" ").append(triplet);
- }
- fSize = features.length;
- for (f = 0; f < fSize; f++)
+ text.append("<area shape=\"rect\" coords=\"")
+ .append((idWidth + res * av.getCharWidth()))
+ .append(",").append(sy).append(",")
+ .append((idWidth + (res + 1) * av.getCharWidth()))
+ .append(",").append((av.getCharHeight() + sy))
+ .append("\"").append(" onMouseOver=\"toolTip('")
+ .append(seqPos).append(" ").append(triplet);
+ }
+ if (!Comparison.isGap(seq.getCharAt(res)))
+ {
+ List<SequenceFeature> features = seq.getFeatures()
+ .findFeatures(seqPos, seqPos);
+ for (SequenceFeature sf : features)
{
-
- SequenceFeature sf = features[f];
- if ((sf.getBegin() <= seq.findPosition(res))
- && (sf.getEnd() >= seq.findPosition(res)))
+ if (sf.isContactFeature())
{
- if (sf.isContactFeature())
- {
- if (sf.getBegin() == seq.findPosition(res)
- || sf.getEnd() == seq
- .findPosition(res))
- {
- text.append("<br>").append(sf.getType())
- .append(" ").append(sf.getBegin())
- .append(":").append(sf.getEnd());
- }
- }
- else
+ text.append("<br>").append(sf.getType()).append(" ")
+ .append(sf.getBegin()).append(":")
+ .append(sf.getEnd());
+ }
+ else
+ {
+ text.append("<br>");
+ text.append(sf.getType());
+ String description = sf.getDescription();
+ if (description != null
+ && !sf.getType().equals(description))
{
- text.append("<br>");
- text.append(sf.getType());
- String description = sf.getDescription();
- if (description != null
- && !sf.getType().equals(description))
- {
- description = description.replace("\"", """);
- text.append(" ").append(description);
- }
-
- String status = sf.getStatus();
- if (status != null && !"".equals(status))
- {
- text.append(" (").append(status).append(")");
- }
+ description = description.replace("\"", """);
+ text.append(" ").append(description);
}
}
-
+ String status = sf.getStatus();
+ if (status != null && !"".equals(status))
+ {
+ text.append(" (").append(status).append(")");
+ }
+ }
+ if (text.length() > 1)
+ {
+ text.append("')\"; onMouseOut=\"toolTip()\"; href=\"#\">");
+ out.println(text.toString());
}
- }
- if (text.length() > 1)
- {
- text.append("')\"; onMouseOut=\"toolTip()\"; href=\"#\">");
- out.println(text.toString());
}
}
}