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

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

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

revision 1.10 by trebligd, Fri Jul 8 15:24:08 2005 UTC revision 1.11 by abalkiss, Mon Jul 11 18:07:15 2005 UTC
# Line 297  public class BasicMenuUI extends BasicMe Line 297  public class BasicMenuUI extends BasicMe
297        /* When mouse enters menu item, it should be considered selected        /* When mouse enters menu item, it should be considered selected
298    
299         if (i) if this menu is a submenu in some other menu         if (i) if this menu is a submenu in some other menu
300            (ii) or if this menu is in a menu bar and some other menu in a menu bar was just            (ii) or if this menu is in a menu bar and some other menu in a
301                 selected. (If nothing was selected, menu should be pressed before            menu bar was just selected and has its popup menu visible.
302                   (If nothing was selected, menu should be pressed before
303                 it will be selected)                 it will be selected)
304        */        */
305        JMenu menu = (JMenu) menuItem;        JMenu menu = (JMenu) menuItem;
306          JMenuBar mb = (JMenuBar) menu.getParent();
307        if (! menu.isTopLevelMenu()        if (! menu.isTopLevelMenu()
308            || (menu.isTopLevelMenu()            || (mb.isSelected() && (((JMenu)(mb.getComponent            
309            && (((JMenuBar) menu.getParent()).isSelected() && ! menu.isArmed())))                                             (mb.getSelectionModel().
310                                                getSelectedIndex()))).
311                                      isPopupMenuVisible()) && ! menu.isArmed()))
312          {          {
313            // set new selection and forward this event to MenuSelectionManager            // set new selection and forward this event to MenuSelectionManager
314            MenuSelectionManager manager = MenuSelectionManager.defaultManager();            MenuSelectionManager manager = MenuSelectionManager.defaultManager();

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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