From 3a35b4b1a2740fef3fc5f14a784b071a7af15b0a Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 28 Oct 2011 17:25:33 +0100 Subject: [PATCH] (JAL-885) RNA helix and purine pyrimidine colouring styles in applet --- src/jalview/appletgui/AlignFrame.java | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 3ebc083..ea5ead8 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -131,7 +131,20 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } } - + if (viewport.getAlignment().isNucleotide()) + { + viewport.updateStrucConsensus(alignPanel); + if (viewport.getAlignment().hasRNAStructure()) + { + RNAHelixColour.setEnabled(true); + } + else { + RNAHelixColour.setEnabled(false); + } + } else { + RNAHelixColour.setEnabled(false); + purinePyrimidineColour.setEnabled(false); + } // Some JVMS send keyevents to Top frame or lowest panel, // Havent worked out why yet. So add to both this frame and seqCanvas for // now @@ -919,6 +932,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { changeColour(new NucleotideColourScheme()); } + else if (source == purinePyrimidineColour) + { + changeColour(new PurinePyrimidineColourScheme()); + } + else if (source == RNAHelixColour) + { + new RNAHelicesColourChooser(viewport, alignPanel); + } else if (source == modifyPID) { modifyPID_actionPerformed(); @@ -2774,6 +2795,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, MenuItem buriedColour = new MenuItem(); + MenuItem purinePyrimidineColour = new MenuItem(); + MenuItem RNAHelixColour = new MenuItem(); + MenuItem userDefinedColour = new MenuItem(); MenuItem PIDColour = new MenuItem(); @@ -2962,6 +2986,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, turnColour.addActionListener(this); buriedColour.setLabel("Buried Index"); buriedColour.addActionListener(this); + purinePyrimidineColour.setLabel("Purine/Pyrimidine"); + purinePyrimidineColour.addActionListener(this); + RNAHelixColour.setLabel("by RNA Helices"); + RNAHelixColour.addActionListener(this); userDefinedColour.setLabel("User Defined..."); userDefinedColour.addActionListener(this); PIDColour.setLabel("Percentage Identity"); @@ -3175,6 +3203,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, colourMenu.add(turnColour); colourMenu.add(buriedColour); colourMenu.add(nucleotideColour); + colourMenu.add(purinePyrimidineColour); colourMenu.add(userDefinedColour); colourMenu.addSeparator(); colourMenu.add(conservationMenuItem); @@ -3182,6 +3211,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, colourMenu.add(abovePIDThreshold); colourMenu.add(modifyPID); colourMenu.add(annotationColour); + colourMenu.add(RNAHelixColour); calculateMenu.add(sort); calculateMenu.add(calculate); calculateMenu.addSeparator(); -- 1.7.10.2