X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=2f6e3e401d534283f9a6a9e0562f54945a1a9657;hb=fcb68d2ebaf7ebdde2bf6e857de856dc7f46a8da;hp=885d79d9e666ac4228dd0daa67380d087c590220;hpb=3c75c089a56859ec8e7f674d7054e82af41e4b77;p=jalview.git
diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java
index 885d79d..2f6e3e4 100644
--- a/src/jalview/gui/AlignmentPanel.java
+++ b/src/jalview/gui/AlignmentPanel.java
@@ -34,6 +34,7 @@ import jalview.jbgui.GAlignmentPanel;
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;
@@ -1495,11 +1496,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
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())
{
@@ -1517,7 +1517,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
continue;
}
- int alIndex = seq.findPosition(res);
+ int seqPos = seq.findPosition(res);
gSize = groups.length;
for (g = 0; g < gSize; g++)
{
@@ -1529,7 +1529,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
.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
@@ -1540,61 +1540,51 @@ public class AlignmentPanel extends GAlignmentPanel implements
}
}
- if (features != null)
+ if (text.length() < 1)
{
- if (text.length() < 1)
- {
- text.append(" features = seq.getFeatures()
+ .findFeatures(seqPos, seqPos);
+ for (SequenceFeature sf : features)
{
-
- if ((features[f].getBegin() <= seq.findPosition(res))
- && (features[f].getEnd() >= seq.findPosition(res)))
+ if (sf.isContactFeature())
{
- if (features[f].isContactFeature())
- {
- if (features[f].getBegin() == seq.findPosition(res)
- || features[f].getEnd() == seq
- .findPosition(res))
- {
- text.append("
").append(features[f].getType())
- .append(" ").append(features[f].getBegin())
- .append(":").append(features[f].getEnd());
- }
- }
- else
+ text.append("
").append(sf.getType()).append(" ")
+ .append(sf.getBegin()).append(":")
+ .append(sf.getEnd());
+ }
+ else
+ {
+ text.append("
");
+ text.append(sf.getType());
+ String description = sf.getDescription();
+ if (description != null
+ && !sf.getType().equals(description))
{
- text.append("
");
- text.append(features[f].getType());
- if (features[f].getDescription() != null
- && !features[f].getType().equals(
- features[f].getDescription()))
- {
- text.append(" ").append(features[f].getDescription());
- }
-
- if (features[f].getValue("status") != null)
- {
- text.append(" (").append(features[f].getValue("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());
}
}
}