From 0af39ffc83a804e0f3f0d7618fcdc9e5073c0a0b Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 22 Apr 2011 11:37:55 +0000 Subject: [PATCH] option for enabling Jmol colouring mode JAL-824 --- src/jalview/appletgui/AppletJmol.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index 619d522..9efe17e 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -52,6 +52,8 @@ public class AppletJmol extends EmbmenuFrame implements CheckboxMenuItem seqColour = new CheckboxMenuItem("By Sequence", true); + CheckboxMenuItem jmolColour = new CheckboxMenuItem("Using Jmol", false); + MenuItem chain = new MenuItem("By Chain"); MenuItem charge = new MenuItem("Charge & Cysteine"); @@ -185,7 +187,8 @@ public class AppletJmol extends EmbmenuFrame implements turn.addActionListener(this); buried.addActionListener(this); user.addActionListener(this); - + jmolColour.addActionListener(this); + jmolHelp.addActionListener(this); coloursMenu.add(seqColour); @@ -199,7 +202,7 @@ public class AppletJmol extends EmbmenuFrame implements coloursMenu.add(turn); coloursMenu.add(buried); coloursMenu.add(user); - + coloursMenu.add(jmolColour); helpMenu.add(jmolHelp); this.setLayout(new BorderLayout()); @@ -474,19 +477,25 @@ public class AppletJmol extends EmbmenuFrame implements } /** - * tick or untick the seqColour menu entry depending upon if it was selected + * tick or untick the seqColour menu entry or jmoColour entry depending upon if it was selected * or not. * * @param itm */ private void setEnabled(MenuItem itm) { + jmolColour.setState(itm == jmolColour); seqColour.setState(itm == seqColour); jmb.setColourBySequence(itm == seqColour); } public void itemStateChanged(ItemEvent evt) { + if (evt.getSource() == jmolColour) + { + setEnabled(jmolColour); + jmb.setColourBySequence(false); + } else if (evt.getSource() == seqColour) { setEnabled(seqColour); -- 1.7.10.2