/[classpath]/classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4.2.6 by gnu_andrew, Wed Nov 2 00:43:56 2005 UTC revision 1.4.2.7 by gnu_andrew, Sun Nov 27 21:00:40 2005 UTC
# Line 273  public class BasicPopupMenuUI extends Po Line 273  public class BasicPopupMenuUI extends Po
273    
274        RootPaneContainer rootContainer = (RootPaneContainer) SwingUtilities        RootPaneContainer rootContainer = (RootPaneContainer) SwingUtilities
275                                          .getRoot(invoker);                                          .getRoot(invoker);
276        ((Container) rootContainer).removeComponentListener(topWindowListener);        if (rootContainer != null)
277            {
278              ((Container) rootContainer).removeComponentListener(topWindowListener);
279    
280        // If this popup menu is the last popup menu visible on the screen, then            // If this popup menu is the last popup menu visible on the screen,
281        // stop interrupting mouse events in the glass pane before hiding this            // then
282        // last popup menu.            // stop interrupting mouse events in the glass pane before hiding this
283        boolean topLevelMenu = (popupMenu.getInvoker() instanceof JMenu)            // last popup menu.
284                               && ((JMenu) popupMenu.getInvoker())            boolean topLevelMenu = (popupMenu.getInvoker() instanceof JMenu)
285                                  .isTopLevelMenu();                                   && ((JMenu) popupMenu.getInvoker()).isTopLevelMenu();
286    
287        if (topLevelMenu || ! (popupMenu.getInvoker() instanceof MenuElement))            if (topLevelMenu || !(popupMenu.getInvoker() instanceof MenuElement))
288          {              {
289            // set glass pane not to interrupt mouse events and remove                // set glass pane not to interrupt mouse events and remove
290            // mouseInputListener                // mouseInputListener
291            Container glassPane = (Container) rootContainer.getGlassPane();                Container glassPane = (Container) rootContainer.getGlassPane();
292            glassPane.setVisible(false);                glassPane.setVisible(false);
293            glassPane.removeMouseListener(mouseInputListener);                glassPane.removeMouseListener(mouseInputListener);
294            mouseInputListener = null;                mouseInputListener = null;
295                }
296          }          }
297      }      }
298    

Legend:
Removed from v.1.4.2.6  
changed lines
  Added in v.1.4.2.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26