From: amwaterhouse Date: Thu, 22 Sep 2005 15:49:05 +0000 (+0000) Subject: Display nucleotides X-Git-Tag: Release_2_06~22 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bf22060aa91d40c9d6f7e3c7f518b6bd0457921e;p=jalview.git Display nucleotides --- diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index fb11579..9c3a1e8 100755 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -244,19 +244,32 @@ public class SeqPanel return; } - Object obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) + ""); - String aa = ""; - if (obj != null) + StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " + + sequence.getName()); + + Object obj = null; + if (av.alignment.isNucleotide()) + { + obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res) + + ""); + if(obj!=null) + text.append(" Nucleotide: "); + } + else { - aa = obj.toString(); + obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) + ""); + if(obj!=null) + text.append(" Residue: "); } - StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " + - sequence.getName()); - if (aa != "") + if (obj != null) { - text.append(" Residue: " + aa + " (" + - av.getAlignment().getSequenceAt(seq).findPosition(res) + ")"); + + if (obj != "") + { + text.append(obj + " (" + + av.getAlignment().getSequenceAt(seq).findPosition(res) + ")"); + } } ap.alignFrame.statusBar.setText(text.toString()); diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 8486ac1..ab5ed30 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -342,25 +342,35 @@ public class SeqPanel extends JPanel if (res > sequence.getLength()) { - return; - } + return; + } - Object obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) + - ""); - String aa = ""; + StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " + + sequence.getName()); - if (obj != null) + Object obj = null; + if (av.alignment.isNucleotide()) { - aa = obj.toString(); + obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res) + + ""); + if(obj!=null) + text.append(" Nucleotide: "); + } + else + { + obj = ResidueProperties.aa2Triplet.get(sequence.getCharAt(res) + ""); + if(obj!=null) + text.append(" Residue: "); } - StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: " + - sequence.getName()); - - if (aa != "") + if (obj != null) { - text.append(" Residue: " + aa + " (" + - av.getAlignment().getSequenceAt(seq).findPosition(res) + ")"); + + if (obj != "") + { + text.append( obj + " (" + + av.getAlignment().getSequenceAt(seq).findPosition(res) + ")"); + } } ap.alignFrame.statusBar.setText(text.toString());