temp push
[jalview.git] / src / jalview / appletgui / EmbmenuFrame.java
index 7b489ea..b6b81fa 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.appletgui;
 
+import jalview.util.Platform;
+
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.FlowLayout;
@@ -49,8 +51,8 @@ import java.util.Map;
  * @author Jim Procter and Andrew Waterhouse
  * 
  */
-public class EmbmenuFrame extends Frame
-        implements MouseListener, AutoCloseable
+@SuppressWarnings("serial")
+public class EmbmenuFrame extends Frame implements MouseListener
 {
   protected static final Font FONT_ARIAL_PLAIN_11 = new Font("Arial",
           Font.PLAIN, 11);
@@ -60,7 +62,7 @@ public class EmbmenuFrame extends Frame
   /**
    * map from labels to popup menus for the embedded menubar
    */
-  protected Map<Label, PopupMenu> embeddedPopup = new HashMap<>();
+  protected Map<Label, PopupMenu> embeddedPopup = new HashMap<Label, PopupMenu>();
 
   /**
    * the embedded menu is built on this and should be added to the frame at the
@@ -96,7 +98,7 @@ public class EmbmenuFrame extends Frame
       return false;
     }
     // DEBUG Hint: can test embedded menus by inserting true here.
-    if (new jalview.util.Platform().isAMac())
+    if (Platform.isAMacAndNotJS())
     {
       // Build the embedded menu panel, allowing override with system font
       embeddedMenu = makeEmbeddedPopupMenu(topMenuBar, true, false);
@@ -200,7 +202,6 @@ public class EmbmenuFrame extends Frame
     return embeddedMenu;
   }
 
-  @Override
   public void mousePressed(MouseEvent evt)
   {
     PopupMenu popup = null;
@@ -225,22 +226,18 @@ public class EmbmenuFrame extends Frame
     return embeddedPopup.get(source);
   }
 
-  @Override
   public void mouseClicked(MouseEvent evt)
   {
   }
 
-  @Override
   public void mouseReleased(MouseEvent evt)
   {
   }
 
-  @Override
   public void mouseEntered(MouseEvent evt)
   {
   }
 
-  @Override
   public void mouseExited(MouseEvent evt)
   {
   }
@@ -268,13 +265,11 @@ public class EmbmenuFrame extends Frame
   /**
    * calls destroyMenus()
    */
-  @Override
-  public void close()
+  public void finalize() throws Throwable
   {
     destroyMenus();
     embeddedPopup = null;
     embeddedMenu = null;
-    // no close for Frame
-    // super.finalize();
+    super.finalize();
   }
 }