X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FEmbmenuFrame.java;h=7b489eab0b12e67a4c0bbac048fb366990a1f943;hb=ca8504cf9d10874dce9f07cf7a9d933853fe0dd0;hp=f61077ac40349d49e8d070ec45951dc33a4595af;hpb=37de9310bec3501cbc6381e0c3dcb282fcaad812;p=jalview.git diff --git a/src/jalview/appletgui/EmbmenuFrame.java b/src/jalview/appletgui/EmbmenuFrame.java index f61077a..7b489ea 100644 --- a/src/jalview/appletgui/EmbmenuFrame.java +++ b/src/jalview/appletgui/EmbmenuFrame.java @@ -49,7 +49,8 @@ import java.util.Map; * @author Jim Procter and Andrew Waterhouse * */ -public class EmbmenuFrame extends Frame implements MouseListener +public class EmbmenuFrame extends Frame + implements MouseListener, AutoCloseable { protected static final Font FONT_ARIAL_PLAIN_11 = new Font("Arial", Font.PLAIN, 11); @@ -59,7 +60,7 @@ public class EmbmenuFrame extends Frame implements MouseListener /** * map from labels to popup menus for the embedded menubar */ - protected Map embeddedPopup = new HashMap(); + protected Map embeddedPopup = new HashMap<>(); /** * the embedded menu is built on this and should be added to the frame at the @@ -199,6 +200,7 @@ public class EmbmenuFrame extends Frame implements MouseListener return embeddedMenu; } + @Override public void mousePressed(MouseEvent evt) { PopupMenu popup = null; @@ -207,8 +209,8 @@ public class EmbmenuFrame extends Frame implements MouseListener if (popup != null) { embeddedMenu.add(popup); - popup.show(embeddedMenu, source.getBounds().x, source.getBounds().y - + source.getBounds().getSize().height); + popup.show(embeddedMenu, source.getBounds().x, + source.getBounds().y + source.getBounds().getSize().height); } } @@ -223,18 +225,22 @@ public class EmbmenuFrame extends Frame implements MouseListener 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) { } @@ -262,11 +268,13 @@ public class EmbmenuFrame extends Frame implements MouseListener /** * calls destroyMenus() */ - public void finalize() throws Throwable + @Override + public void close() { destroyMenus(); embeddedPopup = null; embeddedMenu = null; - super.finalize(); + // no close for Frame + // super.finalize(); } }