From 209d11e9f68d26ae195e48627a9364aca9e0ee27 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 28 Oct 2011 15:54:09 +0100 Subject: [PATCH] (JAL-970) interactive editing of RNA helix annotation in applet --- src/jalview/appletgui/AnnotationPanel.java | 49 ++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 2b67500..a941ef2 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -41,19 +41,24 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen Vector activeRes; - static String HELIX = "Helix"; + final String HELIX = "Helix"; - static String SHEET = "Sheet"; + final String SHEET = "Sheet"; + + /** + * For RNA secondary structure "stems" aka helices + */ + final String STEM = "RNA Helix"; - static String LABEL = "Label"; + final String LABEL = "Label"; - static String REMOVE = "Remove Annotation"; + final String REMOVE = "Remove Annotation"; - static String COLOUR = "Colour"; + final String COLOUR = "Colour"; - static Color HELIX_COLOUR = Color.red.darker(); + final Color HELIX_COLOUR = Color.red.darker(); - static Color SHEET_COLOUR = Color.green.darker().darker(); + final Color SHEET_COLOUR = Color.green.darker().darker(); Image image; @@ -207,6 +212,13 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen symbol = "\u03B2"; } + // Added by LML to color stems + else if (evt.getActionCommand().equals(STEM)) + { + type = 'S'; + symbol = "\u03C3"; + } + if (!aa[activeRow].hasIcons) { aa[activeRow].hasIcons = true; @@ -304,12 +316,23 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen } PopupMenu pop = new PopupMenu("Structure type"); - MenuItem item = new MenuItem(HELIX); - item.addActionListener(this); - pop.add(item); - item = new MenuItem(SHEET); - item.addActionListener(this); - pop.add(item); + MenuItem item; + /* + * Just display the needed structure options + */ + if (av.getAlignment().isNucleotide() == true) + { + item = new MenuItem(STEM); + item.addActionListener(this); + pop.add(item); + } else { + item = new MenuItem(HELIX); + item.addActionListener(this); + pop.add(item); + item = new MenuItem(SHEET); + item.addActionListener(this); + pop.add(item); + } item = new MenuItem(LABEL); item.addActionListener(this); pop.add(item); -- 1.7.10.2