/[classpath]/classpath/javax/swing/JPopupMenu.java
ViewVC logotype

Diff of /classpath/javax/swing/JPopupMenu.java

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

revision 1.11 by mkoch, Wed Dec 1 21:23:00 2004 UTC revision 1.12 by mkoch, Wed Jan 26 23:32:51 2005 UTC
# Line 1  Line 1 
1  /* JPopupMenu.java  /* JPopupMenu.java --
2     Copyright (C) 2002, 2004 Free Software Foundation, Inc.     Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 95  public class JPopupMenu extends JCompone Line 95  public class JPopupMenu extends JCompone
95    /** name for the UI delegate for this menuItem. */    /** name for the UI delegate for this menuItem. */
96    private static final String uiClassID = "PopupMenuUI";    private static final String uiClassID = "PopupMenuUI";
97    
   /** Fire a PropertyChangeEvent when the "borderPainted" property changes. */  
   public static final String LABEL_CHANGED_PROPERTY = "label";  
   
98    /* indicates if popup's menu border should be painted*/    /* indicates if popup's menu border should be painted*/
99    private boolean borderPainted = true;    private boolean borderPainted = true;
100    
# Line 142  public class JPopupMenu extends JCompone Line 139  public class JPopupMenu extends JCompone
139    /* Field indicating if popup menu is visible or not */    /* Field indicating if popup menu is visible or not */
140    private boolean visible = false;    private boolean visible = false;
141        
   /* Bound Property indicating visibility of the popup menu*/  
   public static final String VISIBLE_CHANGED_PROPERTY = "visible";  
   
142    /**    /**
143     * Creates a new JPopupMenu object.     * Creates a new JPopupMenu object.
144     */     */
# Line 291  public class JPopupMenu extends JCompone Line 285  public class JPopupMenu extends JCompone
285    }    }
286    
287    /**    /**
    * Paints popup menu's border if borderPainted is true  
    *  
    * @param graphics graphics context used to paint this popup's menu border.  
    */  
   protected void borderPainted(Graphics graphics)  
   {  
     if (borderPainted)  
       getBorder().paintBorder(this, graphics, 0, 0, getSize(null).width,  
                               getSize(null).height);  
   }  
   
   /**  
288     * Returns flag indicating if newly created JPopupMenu will use     * Returns flag indicating if newly created JPopupMenu will use
289     * heavyweight or lightweight container to display its menu items     * heavyweight or lightweight container to display its menu items
290     *     *
# Line 449  public class JPopupMenu extends JCompone Line 431  public class JPopupMenu extends JCompone
431    /**    /**
432     * Sets label for this popup menu. This method fires PropertyChangeEvent     * Sets label for this popup menu. This method fires PropertyChangeEvent
433     * when the label property is changed. Please note that most     * when the label property is changed. Please note that most
434     * of the Look & Feel will ignore this property.     * of the Look & Feel will ignore this property.
435     *     *
436     * @param label label for this popup menu     * @param label label for this popup menu
437     */     */
# Line 459  public class JPopupMenu extends JCompone Line 441  public class JPopupMenu extends JCompone
441        {        {
442          String oldLabel = this.label;          String oldLabel = this.label;
443          this.label = label;          this.label = label;
444          firePropertyChange(LABEL_CHANGED_PROPERTY, oldLabel, label);          firePropertyChange("label", oldLabel, label);
445        }        }
446    }    }
447    
# Line 571  public class JPopupMenu extends JCompone Line 553  public class JPopupMenu extends JCompone
553     */     */
554    public void setVisible(boolean visible)    public void setVisible(boolean visible)
555    {    {
556        if (visible == isVisible())
557          return;
558    
559      boolean old = isVisible();      boolean old = isVisible();
560      this.visible = visible;      this.visible = visible;
561      if (old != isVisible())      if (old != isVisible())
562        {        {
563          firePropertyChange(VISIBLE_CHANGED_PROPERTY, old, (boolean) isVisible());          firePropertyChange("visible", old, isVisible());
564          if (visible)          if (visible)
565            {            {
566              firePopupMenuWillBecomeVisible();              firePopupMenuWillBecomeVisible();

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

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