No radio buttons in applet
authoramwaterhouse <Andrew Waterhouse>
Tue, 15 Nov 2005 11:13:10 +0000 (11:13 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 15 Nov 2005 11:13:10 +0000 (11:13 +0000)
src/MCview/AppletPDBCanvas.java
src/MCview/AppletPDBViewer.java

index 478dd45..1ee0828 100755 (executable)
@@ -34,7 +34,19 @@ import java.util.*;
 \r
 public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotionListener\r
 {\r
-    MCMatrix idmat = new MCMatrix(3, 3);\r
+  public AppletPDBCanvas()\r
+  {\r
+    try\r
+    {\r
+      jbInit();\r
+    }\r
+    catch (Exception ex)\r
+    {\r
+      ex.printStackTrace();\r
+    }\r
+  }\r
+\r
+  MCMatrix idmat = new MCMatrix(3, 3);\r
     MCMatrix objmat = new MCMatrix(3, 3);\r
     boolean redrawneeded = true;\r
     int omx = 0;\r
@@ -779,4 +791,9 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion
     {\r
       paint(g);\r
     }\r
+\r
+  private void jbInit()\r
+      throws Exception\r
+  {\r
+  }\r
 }\r
index e704f15..77bbd8c 100755 (executable)
@@ -87,35 +87,33 @@ public class AppletPDBViewer extends Frame
           }\r
         });\r
         charge.setLabel("Charge & Cysteine");\r
-        charge.addItemListener(new ItemListener()\r
+        charge.addActionListener(new ActionListener()\r
         {\r
-          public void itemStateChanged(ItemEvent e)\r
+          public void actionPerformed(ActionEvent e)\r
           {\r
             charge_actionPerformed();\r
           }\r
         });\r
         hydro.setLabel("Hydrophobicity");\r
-        hydro.addItemListener(new ItemListener()\r
+        hydro.addActionListener(new ActionListener()\r
         {\r
-          public void itemStateChanged(ItemEvent e)\r
+          public void actionPerformed(ActionEvent e)\r
           {\r
             hydro_actionPerformed();\r
           }\r
         });\r
         chain.setLabel("By Chain");\r
-        chain.addItemListener(new ItemListener()\r
+        chain.addActionListener(new ActionListener()\r
         {\r
-          public void itemStateChanged(ItemEvent e)\r
+          public void actionPerformed(ActionEvent e)\r
           {\r
             chain_actionPerformed();\r
           }\r
         });\r
-        seqButton.setState(true);\r
         seqButton.setLabel("By Sequence");\r
-        seqButton.addItemListener(new ItemListener()\r
+        seqButton.addActionListener(new ActionListener()\r
         {\r
-          public void itemStateChanged(ItemEvent e)\r
-          {\r
+          public void actionPerformed(ActionEvent e){\r
             seqButton_actionPerformed();\r
           }\r
         });\r
@@ -151,12 +149,12 @@ public class AppletPDBViewer extends Frame
       CheckboxMenuItem wire = new CheckboxMenuItem();\r
       CheckboxMenuItem depth = new CheckboxMenuItem();\r
       CheckboxMenuItem zbuffer = new CheckboxMenuItem();\r
-      CheckboxMenuItem charge = new CheckboxMenuItem();\r
 \r
+      MenuItem charge = new MenuItem();\r
+      MenuItem hydro = new MenuItem();\r
+      MenuItem chain = new MenuItem();\r
+      MenuItem seqButton = new MenuItem();\r
 \r
-      CheckboxMenuItem hydro = new CheckboxMenuItem();\r
-      CheckboxMenuItem chain = new CheckboxMenuItem();\r
-      CheckboxMenuItem seqButton = new CheckboxMenuItem();\r
       CheckboxMenuItem molecule = new CheckboxMenuItem();\r
 \r
        public void charge_actionPerformed()\r
@@ -214,7 +212,7 @@ public class AppletPDBViewer extends Frame
       public void seqButton_actionPerformed()\r
       {\r
         clearButtonGroup();\r
-        pdbcanvas.bysequence = seqButton.getState();\r
+        pdbcanvas.bysequence = true;\r
         pdbcanvas.updateSeqColours();\r
       }\r
 \r