X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=2f6e3e401d534283f9a6a9e0562f54945a1a9657;hb=fcb68d2ebaf7ebdde2bf6e857de856dc7f46a8da;hp=0c052d90906941890fba414e898928c3ad837a12;hpb=c1c1eaac282c848b02704e819400396fcc685ef5;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 0c052d9..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,63 +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) { - - 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("
").append(sf.getType()) - .append(" ").append(sf.getBegin()) - .append(":").append(sf.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(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()); } } }