506 |
br.width += insets.right + insets.left; |
br.width += insets.right + insets.left; |
507 |
br.height += insets.top + insets.bottom; |
br.height += insets.top + insets.bottom; |
508 |
|
|
509 |
/* Menu item is considered to be highlighted when it is selected. |
// Menu item is considered to be highlighted when it is selected. |
510 |
It is considered to be selected if menu item is inside some menu |
if (m.isSelected()) |
|
and is armed or if it is both armed and pressed */ |
|
|
if (m.getModel().isArmed() |
|
|
&& (m.getParent() instanceof MenuElement || m.getModel().isPressed())) |
|
511 |
{ |
{ |
512 |
if (m.isContentAreaFilled()) |
if (m.isContentAreaFilled()) |
513 |
{ |
{ |
603 |
{ |
{ |
604 |
if (menuItem.isEnabled()) |
if (menuItem.isEnabled()) |
605 |
{ |
{ |
606 |
/* Menu item is considered to be highlighted when it is selected. |
// Menu item is considered to be highlighted when it is selected. |
607 |
It is considered to be selected if menu item is inside some menu |
if (menuItem.isSelected()) |
|
and is armed or if it is both armed and pressed */ |
|
|
if (menuItem.getModel().isArmed() |
|
|
&& (menuItem.getParent() instanceof MenuElement |
|
|
|| menuItem.getModel().isPressed())) |
|
608 |
g.setColor(selectionForeground); |
g.setColor(selectionForeground); |
609 |
else |
else |
610 |
g.setColor(menuItem.getForeground()); |
g.setColor(menuItem.getForeground()); |
612 |
else |
else |
613 |
// FIXME: should fix this to use 'disabledForeground', but its |
// FIXME: should fix this to use 'disabledForeground', but its |
614 |
// default value in BasicLookAndFeel is null. |
// default value in BasicLookAndFeel is null. |
615 |
g.setColor(Color.gray); |
|
616 |
|
// FIXME: should there be different foreground colours for selected |
617 |
|
// or deselected, when disabled? |
618 |
|
g.setColor(Color.gray); |
619 |
|
|
620 |
int mnemonicIndex = menuItem.getDisplayedMnemonicIndex(); |
int mnemonicIndex = menuItem.getDisplayedMnemonicIndex(); |
621 |
|
|