/[classpath]/classpath/java/awt/Component.java
ViewVC logotype

Diff of /classpath/java/awt/Component.java

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

revision 1.47 by mkoch, Wed Nov 17 08:04:00 2004 UTC revision 1.48 by mkoch, Tue Nov 23 13:15:37 2004 UTC
# Line 1046  public abstract class Component Line 1046  public abstract class Component
1046     * Sets the font for this component to the specified font. This is a bound     * Sets the font for this component to the specified font. This is a bound
1047     * property.     * property.
1048     *     *
1049     * @param font the new font for this component     * @param newFont the new font for this component
1050       *
1051     * @see #getFont()     * @see #getFont()
1052     */     */
1053    public void setFont(Font f)    public void setFont(Font newFont)
1054    {    {
1055      firePropertyChange("font", font, f);      if (font == newFont)
1056          return;
1057        
1058        Font oldFont = font;
1059        font = newFont;
1060      if (peer != null)      if (peer != null)
1061        peer.setFont(f);        peer.setFont(font);
1062        firePropertyChange("font", oldFont, newFont);
1063      invalidate();      invalidate();
     font = f;  
1064    }    }
1065    
1066    /**    /**
# Line 1092  public abstract class Component Line 1097  public abstract class Component
1097     * Sets the locale for this component to the specified locale. This is a     * Sets the locale for this component to the specified locale. This is a
1098     * bound property.     * bound property.
1099     *     *
1100     * @param locale the new locale for this component     * @param newLocale the new locale for this component
1101     */     */
1102    public void setLocale(Locale l)    public void setLocale(Locale newLocale)
1103    {    {
1104      firePropertyChange("locale", locale, l);      if (locale == newLocale)
1105      locale = l;        return;
1106    
1107        Locale oldLocale = locale;
1108        locale = newLocale;
1109        firePropertyChange("locale", oldLocale, newLocale);
1110      // New writing/layout direction or more/less room for localized labels.      // New writing/layout direction or more/less room for localized labels.
1111      invalidate();      invalidate();
1112    }    }
# Line 2298  public abstract class Component Line 2307  public abstract class Component
2307     * @see #getComponentListeners()     * @see #getComponentListeners()
2308     * @since 1.1     * @since 1.1
2309     */     */
2310    public synchronized void addComponentListener(ComponentListener l)    public synchronized void addComponentListener(ComponentListener listener)
2311    {    {
2312      componentListener = AWTEventMulticaster.add(componentListener, l);      componentListener = AWTEventMulticaster.add(componentListener, listener);
2313      if (componentListener != null)      if (componentListener != null)
2314        enableEvents(AWTEvent.COMPONENT_EVENT_MASK);        enableEvents(AWTEvent.COMPONENT_EVENT_MASK);
2315    }    }
# Line 2315  public abstract class Component Line 2324  public abstract class Component
2324     * @see #getComponentListeners()     * @see #getComponentListeners()
2325     * @since 1.1     * @since 1.1
2326     */     */
2327    public synchronized void removeComponentListener(ComponentListener l)    public synchronized void removeComponentListener(ComponentListener listener)
2328    {    {
2329      componentListener = AWTEventMulticaster.remove(componentListener, l);      componentListener = AWTEventMulticaster.remove(componentListener, listener);
2330    }    }
2331    
2332    /**    /**
# Line 2346  public abstract class Component Line 2355  public abstract class Component
2355     * @see #getFocusListeners()     * @see #getFocusListeners()
2356     * @since 1.1     * @since 1.1
2357     */     */
2358    public synchronized void addFocusListener(FocusListener l)    public synchronized void addFocusListener(FocusListener listener)
2359    {    {
2360      focusListener = AWTEventMulticaster.add(focusListener, l);      focusListener = AWTEventMulticaster.add(focusListener, listener);
2361      if (focusListener != null)      if (focusListener != null)
2362        enableEvents(AWTEvent.FOCUS_EVENT_MASK);        enableEvents(AWTEvent.FOCUS_EVENT_MASK);
2363    }    }
# Line 2363  public abstract class Component Line 2372  public abstract class Component
2372     * @see #getFocusListeners()     * @see #getFocusListeners()
2373     * @since 1.1     * @since 1.1
2374     */     */
2375    public synchronized void removeFocusListener(FocusListener l)    public synchronized void removeFocusListener(FocusListener listener)
2376    {    {
2377      focusListener = AWTEventMulticaster.remove(focusListener, l);      focusListener = AWTEventMulticaster.remove(focusListener, listener);
2378    }    }
2379    
2380    /**    /**
# Line 2393  public abstract class Component Line 2402  public abstract class Component
2402     * @see #getHierarchyListeners()     * @see #getHierarchyListeners()
2403     * @since 1.3     * @since 1.3
2404     */     */
2405    public synchronized void addHierarchyListener(HierarchyListener l)    public synchronized void addHierarchyListener(HierarchyListener listener)
2406    {    {
2407      hierarchyListener = AWTEventMulticaster.add(hierarchyListener, l);      hierarchyListener = AWTEventMulticaster.add(hierarchyListener, listener);
2408      if (hierarchyListener != null)      if (hierarchyListener != null)
2409        enableEvents(AWTEvent.HIERARCHY_EVENT_MASK);        enableEvents(AWTEvent.HIERARCHY_EVENT_MASK);
2410    }    }
# Line 2410  public abstract class Component Line 2419  public abstract class Component
2419     * @see #getHierarchyListeners()     * @see #getHierarchyListeners()
2420     * @since 1.3     * @since 1.3
2421     */     */
2422    public synchronized void removeHierarchyListener(HierarchyListener l)    public synchronized void removeHierarchyListener(HierarchyListener listener)
2423    {    {
2424      hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l);      hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, listener);
2425    }    }
2426    
2427    /**    /**
# Line 2442  public abstract class Component Line 2451  public abstract class Component
2451     * @since 1.3     * @since 1.3
2452     */     */
2453    public synchronized void    public synchronized void
2454      addHierarchyBoundsListener(HierarchyBoundsListener l)      addHierarchyBoundsListener(HierarchyBoundsListener listener)
2455    {    {
2456      hierarchyBoundsListener =      hierarchyBoundsListener =
2457        AWTEventMulticaster.add(hierarchyBoundsListener, l);        AWTEventMulticaster.add(hierarchyBoundsListener, listener);
2458      if (hierarchyBoundsListener != null)      if (hierarchyBoundsListener != null)
2459        enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);        enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
2460    }    }
# Line 2461  public abstract class Component Line 2470  public abstract class Component
2470     * @since 1.3     * @since 1.3
2471     */     */
2472    public synchronized void    public synchronized void
2473      removeHierarchyBoundsListener(HierarchyBoundsListener l)      removeHierarchyBoundsListener(HierarchyBoundsListener listener)
2474    {    {
2475      hierarchyBoundsListener =      hierarchyBoundsListener =
2476        AWTEventMulticaster.remove(hierarchyBoundsListener, l);        AWTEventMulticaster.remove(hierarchyBoundsListener, listener);
2477    }    }
2478    
2479    /**    /**
# Line 2493  public abstract class Component Line 2502  public abstract class Component
2502     * @see #getKeyListeners()     * @see #getKeyListeners()
2503     * @since 1.1     * @since 1.1
2504     */     */
2505    public synchronized void addKeyListener(KeyListener l)    public synchronized void addKeyListener(KeyListener listener)
2506    {    {
2507      keyListener = AWTEventMulticaster.add(keyListener, l);      keyListener = AWTEventMulticaster.add(keyListener, listener);
2508      if (keyListener != null)      if (keyListener != null)
2509        enableEvents(AWTEvent.KEY_EVENT_MASK);        enableEvents(AWTEvent.KEY_EVENT_MASK);
2510    }    }
# Line 2510  public abstract class Component Line 2519  public abstract class Component
2519     * @see #getKeyListeners()     * @see #getKeyListeners()
2520     * @since 1.1     * @since 1.1
2521     */     */
2522    public synchronized void removeKeyListener(KeyListener l)    public synchronized void removeKeyListener(KeyListener listener)
2523    {    {
2524      keyListener = AWTEventMulticaster.remove(keyListener, l);      keyListener = AWTEventMulticaster.remove(keyListener, listener);
2525    }    }
2526    
2527    /**    /**
# Line 2540  public abstract class Component Line 2549  public abstract class Component
2549     * @see #getMouseListeners()     * @see #getMouseListeners()
2550     * @since 1.1     * @since 1.1
2551     */     */
2552    public synchronized void addMouseListener(MouseListener l)    public synchronized void addMouseListener(MouseListener listener)
2553    {    {
2554      mouseListener = AWTEventMulticaster.add(mouseListener, l);      mouseListener = AWTEventMulticaster.add(mouseListener, listener);
2555      if (mouseListener != null)      if (mouseListener != null)
2556        enableEvents(AWTEvent.MOUSE_EVENT_MASK);        enableEvents(AWTEvent.MOUSE_EVENT_MASK);
2557    }    }
# Line 2557  public abstract class Component Line 2566  public abstract class Component
2566     * @see #getMouseListeners()     * @see #getMouseListeners()
2567     * @since 1.1     * @since 1.1
2568     */     */
2569    public synchronized void removeMouseListener(MouseListener l)    public synchronized void removeMouseListener(MouseListener listener)
2570    {    {
2571      mouseListener = AWTEventMulticaster.remove(mouseListener, l);      mouseListener = AWTEventMulticaster.remove(mouseListener, listener);
2572    }    }
2573    
2574    /**    /**
# Line 2587  public abstract class Component Line 2596  public abstract class Component
2596     * @see #getMouseMotionListeners()     * @see #getMouseMotionListeners()
2597     * @since 1.1     * @since 1.1
2598     */     */
2599    public synchronized void addMouseMotionListener(MouseMotionListener l)    public synchronized void addMouseMotionListener(MouseMotionListener listener)
2600    {    {
2601      mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l);      mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener);
2602      if (mouseMotionListener != null)      if (mouseMotionListener != null)
2603        enableEvents(AWTEvent.MOUSE_EVENT_MASK);        enableEvents(AWTEvent.MOUSE_EVENT_MASK);
2604    }    }
# Line 2604  public abstract class Component Line 2613  public abstract class Component
2613     * @see #getMouseMotionListeners()     * @see #getMouseMotionListeners()
2614     * @since 1.1     * @since 1.1
2615     */     */
2616    public synchronized void removeMouseMotionListener(MouseMotionListener l)    public synchronized void removeMouseMotionListener(MouseMotionListener listener)
2617    {    {
2618      mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l);      mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, listener);
2619    }    }
2620    
2621    /**    /**
# Line 2636  public abstract class Component Line 2645  public abstract class Component
2645     * @see #getMouseWheelListeners()     * @see #getMouseWheelListeners()
2646     * @since 1.4     * @since 1.4
2647     */     */
2648    public synchronized void addMouseWheelListener(MouseWheelListener l)    public synchronized void addMouseWheelListener(MouseWheelListener listener)
2649    {    {
2650      mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, l);      mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, listener);
2651      if (mouseWheelListener != null)      if (mouseWheelListener != null)
2652        enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK);        enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
2653    }    }
# Line 2654  public abstract class Component Line 2663  public abstract class Component
2663     * @see #getMouseWheelListeners()     * @see #getMouseWheelListeners()
2664     * @since 1.4     * @since 1.4
2665     */     */
2666    public synchronized void removeMouseWheelListener(MouseWheelListener l)    public synchronized void removeMouseWheelListener(MouseWheelListener listener)
2667    {    {
2668      mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l);      mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, listener);
2669    }    }
2670    
2671    /**    /**
# Line 2686  public abstract class Component Line 2695  public abstract class Component
2695     * @see #getInputMethodRequests()     * @see #getInputMethodRequests()
2696     * @since 1.2     * @since 1.2
2697     */     */
2698    public synchronized void addInputMethodListener(InputMethodListener l)    public synchronized void addInputMethodListener(InputMethodListener listener)
2699    {    {
2700      inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l);      inputMethodListener = AWTEventMulticaster.add(inputMethodListener, listener);
2701      if (inputMethodListener != null)      if (inputMethodListener != null)
2702        enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK);        enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK);
2703    }    }
# Line 2703  public abstract class Component Line 2712  public abstract class Component
2712     * @see #getInputMethodRequests()     * @see #getInputMethodRequests()
2713     * @since 1.2     * @since 1.2
2714     */     */
2715    public synchronized void removeInputMethodListener(InputMethodListener l)    public synchronized void removeInputMethodListener(InputMethodListener listener)
2716    {    {
2717      inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l);      inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, listener);
2718    }    }
2719    
2720    /**    /**

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

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