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(); |