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

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

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

revision 1.27 by langel, Thu Sep 29 16:37:29 2005 UTC revision 1.28 by langel, Fri Sep 30 16:39:30 2005 UTC
# Line 52  import java.beans.PropertyChangeEvent; Line 52  import java.beans.PropertyChangeEvent;
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;
# Line 538  public class BasicMenuItemUI extends Men Line 539  public class BasicMenuItemUI extends Men
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())
# Line 637  public class BasicMenuItemUI extends Men Line 640  public class BasicMenuItemUI extends Men
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

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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