1.1 compat
[jalview.git] / src / jalview / bin / JalviewLite.java
index 5c5e3df..501ad6b 100755 (executable)
@@ -573,7 +573,7 @@ public class JalviewLite extends Applet
     }
     jalview.javascript.MouseOverListener mol = new jalview.javascript.MouseOverListener(
             this, af, listener);
-    mouseoverListeners.add(mol);
+    mouseoverListeners.addElement(mol);
     StructureSelectionManager.getStructureSelectionManager()
             .addStructureViewerListener(mol);
     if (debug)
@@ -605,7 +605,7 @@ public class JalviewLite extends Applet
     }
     jalview.javascript.JsSelectionSender mol = new jalview.javascript.JsSelectionSender(
             this, af, listener);
-    mouseoverListeners.add(mol);
+    mouseoverListeners.addElement(mol);
     StructureSelectionManager.getStructureSelectionManager()
             .addSelectionListener(mol);
     if (debug)
@@ -638,14 +638,16 @@ public class JalviewLite extends Applet
       }
     }
     boolean rprt = false;
-    for (Object lstn : mouseoverListeners)
+    for (int ms=0,msSize=mouseoverListeners.size();ms<msSize;)
     {
+      Object lstn = mouseoverListeners.elementAt(ms);
       JsCallBack lstner = (JsCallBack) lstn;
       if ((af == null || lstner.getAlignFrame() == af)
               && (listener == null || lstner.getListenerFunction().equals(
                       listener)))
       {
-        mouseoverListeners.remove(lstner);
+        mouseoverListeners.removeElement(lstner);
+        msSize--;
         if (lstner instanceof SelectionListener)
         {
           StructureSelectionManager.getStructureSelectionManager()
@@ -661,6 +663,8 @@ public class JalviewLite extends Applet
         {
           System.err.println("Removed listener '" + listener + "'");
         }
+      } else {
+        ms++;
       }
     }
     if (rprt)
@@ -676,8 +680,8 @@ public class JalviewLite extends Applet
     {
       while (mouseoverListeners.size()>0)
       {
-        Object mol =         mouseoverListeners.remove(0);
-// mouseoverListeners.elementAt(0);
+        Object mol =         mouseoverListeners.elementAt(0);
+        mouseoverListeners.removeElement(mol);
         if (mol instanceof SelectionListener)
         {
           StructureSelectionManager.getStructureSelectionManager().removeSelectionListener((SelectionListener)mol);