52 |
import java.beans.PropertyChangeListener; |
import java.beans.PropertyChangeListener; |
53 |
import java.util.ArrayList; |
import java.util.ArrayList; |
54 |
|
|
55 |
|
import javax.swing.ButtonModel; |
56 |
import javax.swing.Icon; |
import javax.swing.Icon; |
57 |
import javax.swing.JComponent; |
import javax.swing.JComponent; |
58 |
import javax.swing.JMenu; |
import javax.swing.JMenu; |
539 |
|
|
540 |
// Menu item is considered to be highlighted when it is selected. |
// Menu item is considered to be highlighted when it is selected. |
541 |
// But we don't want to paint the background of JCheckBoxMenuItems |
// But we don't want to paint the background of JCheckBoxMenuItems |
542 |
if ((m.isSelected() && checkIcon == null) || m.getModel().isArmed() |
ButtonModel mod = m.getModel(); |
543 |
|
if ((m.isSelected() && checkIcon == null) || (mod != null && |
544 |
|
mod.isArmed()) |
545 |
&& (m.getParent() instanceof MenuElement)) |
&& (m.getParent() instanceof MenuElement)) |
546 |
{ |
{ |
547 |
if (m.isContentAreaFilled()) |
if (m.isContentAreaFilled()) |
640 |
{ |
{ |
641 |
// Menu item is considered to be highlighted when it is selected. |
// Menu item is considered to be highlighted when it is selected. |
642 |
// But not if it's a JCheckBoxMenuItem |
// But not if it's a JCheckBoxMenuItem |
643 |
|
ButtonModel mod = menuItem.getModel(); |
644 |
if ((menuItem.isSelected() && checkIcon == null) |
if ((menuItem.isSelected() && checkIcon == null) |
645 |
|| menuItem.getModel().isArmed() |
|| (mod != null && mod.isArmed()) |
646 |
&& (menuItem.getParent() instanceof MenuElement)) |
&& (menuItem.getParent() instanceof MenuElement)) |
647 |
g.setColor(selectionForeground); |
g.setColor(selectionForeground); |
648 |
else |
else |