X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;fp=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;h=6012c1ad5529d9caa8b5bcb80df00358dc000b52;hb=71d6099d5246bdaf7b667e02620f403937582780;hp=ee8c9ca8c43eff6b80701cbde59c09aa99cf539f;hpb=b73ee7116faf97c00125fc8db7292ccde378d08e;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index ee8c9ca..6012c1a 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -25,6 +25,7 @@ import jalview.datamodel.Annotation; import jalview.datamodel.SequenceI; import jalview.renderer.AnnotationRenderer; import jalview.renderer.AwtRenderPanelI; +import jalview.schemes.ResidueProperties; import jalview.util.Comparison; import jalview.util.MessageManager; import jalview.util.Platform; @@ -162,12 +163,12 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, if (evt.getActionCommand().equals(REMOVE)) { - for (int sel : av.getColumnSelection().getSelected()) + for (int index : av.getColumnSelection().getSelected()) { - // TODO: JAL-2001 check if applet has faulty 'REMOVE' selected columns - // of - // annotation if selection includes hidden columns - anot[sel] = null; + if (av.getColumnSelection().isVisible(index)) + { + anot[index] = null; + } } } else if (evt.getActionCommand().equals(LABEL)) @@ -474,9 +475,10 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, StringBuilder text = new StringBuilder(); text.append(MessageManager.getString("label.column")).append(" ") .append(column + 1); - if (aa[row].annotations[column].description != null) + String description = aa[row].annotations[column].description; + if (description != null && description.length() > 0) { - text.append(" ").append(aa[row].annotations[column].description); + text.append(" ").append(description); } /* @@ -495,9 +497,28 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, char residue = seqref.getCharAt(column); if (!Comparison.isGap(residue)) { + text.append(" "); + String name; + if (av.getAlignment().isNucleotide()) + { + name = ResidueProperties.nucleotideName.get(String + .valueOf(residue)); + text.append(" Nucleotide: ").append( + name != null ? name : residue); + } + else + { + name = 'X' == residue ? "X" : ('*' == residue ? "STOP" + : ResidueProperties.aa2Triplet.get(String + .valueOf(residue))); + text.append(" Residue: ").append( + name != null ? name : residue); + } int residuePos = seqref.findPosition(column); - text.append(": ").append(residue).append(" (") - .append(residuePos).append(")"); + text.append(" (").append(residuePos).append(")"); + // int residuePos = seqref.findPosition(column); + // text.append(residue).append(" (") + // .append(residuePos).append(")"); } } }