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

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

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

revision 1.12.2.3 by gnu_andrew, Sun Jan 16 15:15:13 2005 UTC revision 1.12.2.4 by gnu_andrew, Thu Jan 27 09:45:34 2005 UTC
# Line 1  Line 1 
1  /* JLabel.java --  /* JLabel.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 92  public class JLabel extends JComponent i Line 92  public class JLabel extends JComponent i
92    private transient int iconTextGap = 4;    private transient int iconTextGap = 4;
93    
94    /**    /**
    * Fired in a PropertyChangeEvent when the "disabledIcon" property changes.  
    */  
   public static final String DISABLED_ICON_CHANGED_PROPERTY = "disabledIcon";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "displayedMnemonic" property  
    * changes.  
    */  
   public static final String DISPLAYED_MNEMONIC_CHANGED_PROPERTY = "displayedMnemonic";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "displayedMnemonicIndex" property  
    * changes.  
    */  
   public static final String DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY = "displayedMnemonicIndex";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "horizontalAlignment" property  
    * changes.  
    */  
   public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY = "horizontalAlignment";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "horizontalTextPosition" property  
    * changes.  
    */  
   public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY = "horizontalTextPosition";  
   
   /** Fired in a PropertyChangeEvent when the "icon" property changes. */  
   public static final String ICON_CHANGED_PROPERTY = "icon";  
   
   /** Fired in a PropertyChangeEvent when the "iconTextGap" property changes. */  
   public static final String ICON_TEXT_GAP_CHANGED_PROPERTY = "iconTextGap";  
   
   /** Fired in a PropertyChangeEvent when the "labelFor" property changes. */  
   public static final String LABEL_FOR_CHANGED_PROPERTY = "labelFor";  
   
   /** Fired in a PropertyChangeEvent when the "text" property changes. */  
   public static final String TEXT_CHANGED_PROPERTY = "text";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "verticalAlignment" property  
    * changes.  
    */  
   public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY = "verticalAlignment";  
   
   /**  
    * Fired in a PropertyChangeEvent when the "verticalTextPosition" property  
    * changes.  
    */  
   public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY = "verticalTextPosition";  
   
   /**  
95     * Creates a new horizontally and vertically centered JLabel object with no     * Creates a new horizontally and vertically centered JLabel object with no
96     * text and no icon.     * text and no icon.
97     */     */
# Line 289  public class JLabel extends JComponent i Line 236  public class JLabel extends JComponent i
236        {        {
237          String oldText = text;          String oldText = text;
238          text = newText;          text = newText;
239          firePropertyChange(TEXT_CHANGED_PROPERTY, oldText, newText);          firePropertyChange("text", oldText, newText);
240    
241          if (text != null && text.length() <= displayedMnemonicIndex)          if (text != null && text.length() <= displayedMnemonicIndex)
242            setDisplayedMnemonicIndex(text.length() - 1);            setDisplayedMnemonicIndex(text.length() - 1);
# Line 319  public class JLabel extends JComponent i Line 266  public class JLabel extends JComponent i
266        {        {
267          Icon oldIcon = icon;          Icon oldIcon = icon;
268          icon = newIcon;          icon = newIcon;
269          firePropertyChange(ICON_CHANGED_PROPERTY, oldIcon, newIcon);          firePropertyChange("icon", oldIcon, newIcon);
270        }        }
271    }    }
272    
# Line 352  public class JLabel extends JComponent i Line 299  public class JLabel extends JComponent i
299        {        {
300          Icon oldIcon = disabledIcon;          Icon oldIcon = disabledIcon;
301          disabledIcon = newIcon;          disabledIcon = newIcon;
302          firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldIcon, newIcon);          firePropertyChange("disabledIcon", oldIcon, newIcon);
303        }        }
304    }    }
305    
# Line 367  public class JLabel extends JComponent i Line 314  public class JLabel extends JComponent i
314    {    {
315      if (displayedMnemonic != mnemonic)      if (displayedMnemonic != mnemonic)
316        {        {
317          firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY,          firePropertyChange("displayedMnemonic",
318                             displayedMnemonic, mnemonic);                             displayedMnemonic, mnemonic);
319          displayedMnemonic = mnemonic;          displayedMnemonic = mnemonic;
320    
# Line 424  public class JLabel extends JComponent i Line 371  public class JLabel extends JComponent i
371        {        {
372          int oldIndex = displayedMnemonicIndex;          int oldIndex = displayedMnemonicIndex;
373          displayedMnemonicIndex = newIndex;          displayedMnemonicIndex = newIndex;
374          firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY,          firePropertyChange("displayedMnemonicIndex",
375                             oldIndex, newIndex);                             oldIndex, newIndex);
376        }        }
377    }    }
# Line 501  public class JLabel extends JComponent i Line 448  public class JLabel extends JComponent i
448    {    {
449      if (iconTextGap != newGap)      if (iconTextGap != newGap)
450        {        {
451          firePropertyChange(ICON_TEXT_GAP_CHANGED_PROPERTY, iconTextGap, newGap);          firePropertyChange("iconTextGap", iconTextGap, newGap);
452          iconTextGap = newGap;          iconTextGap = newGap;
453        }        }
454    }    }
# Line 531  public class JLabel extends JComponent i Line 478  public class JLabel extends JComponent i
478    
479      int oldAlignment = verticalAlignment;      int oldAlignment = verticalAlignment;
480      verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");      verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
481      firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY,      firePropertyChange("verticalAlignment", oldAlignment, verticalAlignment);
                        oldAlignment, verticalAlignment);  
482    }    }
483    
484    /**    /**
# Line 558  public class JLabel extends JComponent i Line 504  public class JLabel extends JComponent i
504            
505      int oldAlignment = horizontalAlignment;      int oldAlignment = horizontalAlignment;
506      horizontalAlignment = checkHorizontalKey(alignment, "horizontalAlignment");      horizontalAlignment = checkHorizontalKey(alignment, "horizontalAlignment");
507      firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, oldAlignment,      firePropertyChange("horizontalAlignment", oldAlignment,
508                         horizontalAlignment);                         horizontalAlignment);
509    }    }
510    
# Line 586  public class JLabel extends JComponent i Line 532  public class JLabel extends JComponent i
532          int oldPos = verticalTextPosition;          int oldPos = verticalTextPosition;
533          verticalTextPosition = checkVerticalKey(textPosition,          verticalTextPosition = checkVerticalKey(textPosition,
534                                                  "verticalTextPosition");                                                  "verticalTextPosition");
535          firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos,          firePropertyChange("verticalTextPosition", oldPos,
536                             verticalTextPosition);                             verticalTextPosition);
537        }        }
538    }    }
# Line 615  public class JLabel extends JComponent i Line 561  public class JLabel extends JComponent i
561          int oldPos = horizontalTextPosition;          int oldPos = horizontalTextPosition;
562          horizontalTextPosition = checkHorizontalKey(textPosition,          horizontalTextPosition = checkHorizontalKey(textPosition,
563                                                      "horizontalTextPosition");                                                      "horizontalTextPosition");
564          firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos,          firePropertyChange("horizontalTextPosition", oldPos,
565                             horizontalTextPosition);                             horizontalTextPosition);
566        }        }
567    }    }
# Line 671  public class JLabel extends JComponent i Line 617  public class JLabel extends JComponent i
617    {    {
618      if (c != labelFor)      if (c != labelFor)
619        {        {
620          firePropertyChange(LABEL_FOR_CHANGED_PROPERTY, labelFor, c);          Component oldLabelFor = labelFor;
621          labelFor = c;          labelFor = c;
622            firePropertyChange("labelFor", oldLabelFor, labelFor);
623        }        }
624    }    }
625    

Legend:
Removed from v.1.12.2.3  
changed lines
  Added in v.1.12.2.4

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