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");
turn.addActionListener(this);
buried.addActionListener(this);
user.addActionListener(this);
-
+ jmolColour.addActionListener(this);
+
jmolHelp.addActionListener(this);
coloursMenu.add(seqColour);
coloursMenu.add(turn);
coloursMenu.add(buried);
coloursMenu.add(user);
-
+ coloursMenu.add(jmolColour);
helpMenu.add(jmolHelp);
this.setLayout(new BorderLayout());
}
/**
- * 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);