From 1ee385ddd9b62751473708cb494b652b17d56e7e Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 15 Nov 2005 11:13:10 +0000 Subject: [PATCH] No radio buttons in applet --- src/MCview/AppletPDBCanvas.java | 19 ++++++++++++++++++- src/MCview/AppletPDBViewer.java | 28 +++++++++++++--------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index 478dd45..1ee0828 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -34,7 +34,19 @@ import java.util.*; public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotionListener { - MCMatrix idmat = new MCMatrix(3, 3); + public AppletPDBCanvas() + { + try + { + jbInit(); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + } + + MCMatrix idmat = new MCMatrix(3, 3); MCMatrix objmat = new MCMatrix(3, 3); boolean redrawneeded = true; int omx = 0; @@ -779,4 +791,9 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion { paint(g); } + + private void jbInit() + throws Exception + { + } } diff --git a/src/MCview/AppletPDBViewer.java b/src/MCview/AppletPDBViewer.java index e704f15..77bbd8c 100755 --- a/src/MCview/AppletPDBViewer.java +++ b/src/MCview/AppletPDBViewer.java @@ -87,35 +87,33 @@ public class AppletPDBViewer extends Frame } }); charge.setLabel("Charge & Cysteine"); - charge.addItemListener(new ItemListener() + charge.addActionListener(new ActionListener() { - public void itemStateChanged(ItemEvent e) + public void actionPerformed(ActionEvent e) { charge_actionPerformed(); } }); hydro.setLabel("Hydrophobicity"); - hydro.addItemListener(new ItemListener() + hydro.addActionListener(new ActionListener() { - public void itemStateChanged(ItemEvent e) + public void actionPerformed(ActionEvent e) { hydro_actionPerformed(); } }); chain.setLabel("By Chain"); - chain.addItemListener(new ItemListener() + chain.addActionListener(new ActionListener() { - public void itemStateChanged(ItemEvent e) + public void actionPerformed(ActionEvent e) { chain_actionPerformed(); } }); - seqButton.setState(true); seqButton.setLabel("By Sequence"); - seqButton.addItemListener(new ItemListener() + seqButton.addActionListener(new ActionListener() { - public void itemStateChanged(ItemEvent e) - { + public void actionPerformed(ActionEvent e){ seqButton_actionPerformed(); } }); @@ -151,12 +149,12 @@ public class AppletPDBViewer extends Frame CheckboxMenuItem wire = new CheckboxMenuItem(); CheckboxMenuItem depth = new CheckboxMenuItem(); CheckboxMenuItem zbuffer = new CheckboxMenuItem(); - CheckboxMenuItem charge = new CheckboxMenuItem(); + MenuItem charge = new MenuItem(); + MenuItem hydro = new MenuItem(); + MenuItem chain = new MenuItem(); + MenuItem seqButton = new MenuItem(); - CheckboxMenuItem hydro = new CheckboxMenuItem(); - CheckboxMenuItem chain = new CheckboxMenuItem(); - CheckboxMenuItem seqButton = new CheckboxMenuItem(); CheckboxMenuItem molecule = new CheckboxMenuItem(); public void charge_actionPerformed() @@ -214,7 +212,7 @@ public class AppletPDBViewer extends Frame public void seqButton_actionPerformed() { clearButtonGroup(); - pdbcanvas.bysequence = seqButton.getState(); + pdbcanvas.bysequence = true; pdbcanvas.updateSeqColours(); } -- 1.7.10.2