/[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.15 by ericb, Mon May 6 02:43:17 2002 UTC revision 1.16 by ericb, Wed May 8 03:07:24 2002 UTC
# Line 2153  public abstract class Component Line 2153  public abstract class Component
2153    }    }
2154    
2155    /**    /**
2156     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2157     * the listener was not previously registered.     * the listener was not previously registered.
2158     *     *
2159     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2201  public abstract class Component Line 2201  public abstract class Component
2201    }    }
2202    
2203    /**    /**
2204     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2205     * the listener was not previously registered.     * the listener was not previously registered.
2206     *     *
2207     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2248  public abstract class Component Line 2248  public abstract class Component
2248    }    }
2249    
2250    /**    /**
2251     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2252     * the listener was not previously registered.     * the listener was not previously registered.
2253     *     *
2254     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2298  public abstract class Component Line 2298  public abstract class Component
2298    }    }
2299    
2300    /**    /**
2301     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2302     * the listener was not previously registered.     * the listener was not previously registered.
2303     *     *
2304     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2348  public abstract class Component Line 2348  public abstract class Component
2348    }    }
2349    
2350    /**    /**
2351     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2352     * the listener was not previously registered.     * the listener was not previously registered.
2353     *     *
2354     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2395  public abstract class Component Line 2395  public abstract class Component
2395    }    }
2396    
2397    /**    /**
2398     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2399     * the listener was not previously registered.     * the listener was not previously registered.
2400     *     *
2401     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2442  public abstract class Component Line 2442  public abstract class Component
2442    }    }
2443    
2444    /**    /**
2445     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2446     * the listener was not previously registered.     * the listener was not previously registered.
2447     *     *
2448     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2491  public abstract class Component Line 2491  public abstract class Component
2491    }    }
2492    
2493    /**    /**
2494     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2495     * the listener was not previously registered.     * the listener was not previously registered.
2496     *     *
2497     * @param listener the listener to remove     * @param listener the listener to remove
# Line 2541  public abstract class Component Line 2541  public abstract class Component
2541    }    }
2542    
2543    /**    /**
2544     * Removes the specified listener from the component. This is harmless is     * Removes the specified listener from the component. This is harmless if
2545     * the listener was not previously registered.     * the listener was not previously registered.
2546     *     *
2547     * @param listener the listener to remove     * @param listener the listener to remove
# Line 3429  public abstract class Component Line 3429  public abstract class Component
3429    }    }
3430    
3431    /**    /**
3432     * Requests that this component be given focus. The <code>gotFocus()</code>     * Requests that this component be given focus. A <code>FOCUS_GAINED</code>
3433     * method on this event will be called when and if this request was     * event will be fired if and only if this request is successful. To be
3434     * successful. To be successful, the component must be displayable, visible,     * successful, the component must be displayable, visible, and focusable,
3435     * and focusable, and the top-level Window must be able to receive focus.     * and the top-level Window must be able to receive focus. Thus, this
3436     * Thus, this request may fail, or be delayed until the window receives     * request may fail, or be delayed until the window receives focus. It is
3437     * focus. It is recommended that <code>requestFocusInWindow</code> be used     * recommended that <code>requestFocusInWindow</code> be used where
3438     * where possible to be more platform-independent.     * possible to be more platform-independent.
3439     *     *
3440     * @see #requestFocusInWindow()     * @see #requestFocusInWindow()
3441     * @see FocusEvent     * @see FocusEvent
# Line 3452  public abstract class Component Line 3452  public abstract class Component
3452        peer.requestFocus();        peer.requestFocus();
3453    }    }
3454    
   //XXX Below here, I have not yet had time to document things --EBB  
3455    /**    /**
3456       * Requests that this component be given focus. A <code>FOCUS_GAINED</code>
3457       * event will be fired if and only if this request is successful. To be
3458       * successful, the component must be displayable, visible, and focusable,
3459       * and the top-level Window must be able to receive focus. Thus, this
3460       * request may fail, or be delayed until the window receives focus. It is
3461       * recommended that <code>requestFocusInWindow</code> be used where
3462       * possible to be more platform-independent.
3463       *
3464       * <p>If the return value is false, the request is guaranteed to fail. If
3465       * it is true, it will likely succeed unless the action is vetoed or
3466       * something in the native windowing system intervenes. The temporary flag,
3467       * and thus this method in general, is not designed for public use; rather
3468       * it is a hook for lightweight components to notify their container in
3469       * an attempt to reduce the amount of repainting necessary.
3470       *
3471       * @param temporary true if the focus request is temporary
3472       * @return true if the request has a chance of success
3473       * @see #requestFocusInWindow()
3474       * @see FocusEvent
3475       * @see #addFocusListener(FocusListener)
3476       * @see #isFocusable()
3477       * @see #isDisplayable()
3478       * @see KeyboardFocusManager#clearGlobalFocusOwner()
3479     * @since 1.4     * @since 1.4
3480     */     */
3481    protected boolean requestFocus(boolean temporary)    protected boolean requestFocus(boolean temporary)
# Line 3464  public abstract class Component Line 3486  public abstract class Component
3486    }    }
3487    
3488    /**    /**
3489       * Requests that this component be given focus, if it resides in the
3490       * top-level window which already has focus. A <code>FOCUS_GAINED</code>
3491       * event will be fired if and only if this request is successful. To be
3492       * successful, the component must be displayable, visible, and focusable,
3493       * and the top-level Window must be focused.
3494       *
3495       * <p>If the return value is false, the request is guaranteed to fail. If
3496       * it is true, it will likely succeed unless the action is vetoed or
3497       * something in the native windowing system intervenes. The temporary flag,
3498       * and thus this method in general, is not designed for public use; rather
3499       * it is a hook for lightweight components to notify their container in
3500       * an attempt to reduce the amount of repainting necessary.
3501       *
3502       * @return true if the request has a chance of success
3503       * @see #requestFocus()
3504       * @see FocusEvent
3505       * @see #addFocusListener(FocusListener)
3506       * @see #isFocusable()
3507       * @see #isDisplayable()
3508       * @see KeyboardFocusManager#clearGlobalFocusOwner()
3509     * @since 1.4     * @since 1.4
3510     */     */
3511    public boolean requestFocusInWindow()    public boolean requestFocusInWindow()
# Line 3474  public abstract class Component Line 3516  public abstract class Component
3516    }    }
3517    
3518    /**    /**
3519       * Requests that this component be given focus, if it resides in the
3520       * top-level window which already has focus. A <code>FOCUS_GAINED</code>
3521       * event will be fired if and only if this request is successful. To be
3522       * successful, the component must be displayable, visible, and focusable,
3523       * and the top-level Window must be focused.
3524       *
3525       * <p>If the return value is false, the request is guaranteed to fail. If
3526       * it is true, it will likely succeed unless the action is vetoed or
3527       * something in the native windowing system intervenes. The temporary flag,
3528       * and thus this method in general, is not designed for public use; rather
3529       * it is a hook for lightweight components to notify their container in
3530       * an attempt to reduce the amount of repainting necessary.
3531       *
3532       * @param temporary true if the focus request is temporary
3533       * @return true if the request has a chance of success
3534       * @see #requestFocus()
3535       * @see FocusEvent
3536       * @see #addFocusListener(FocusListener)
3537       * @see #isFocusable()
3538       * @see #isDisplayable()
3539       * @see KeyboardFocusManager#clearGlobalFocusOwner()
3540     * @since 1.4     * @since 1.4
3541     */     */
3542    protected boolean requestFocusInWindow(boolean temporary)    protected boolean requestFocusInWindow(boolean temporary)
# Line 3484  public abstract class Component Line 3547  public abstract class Component
3547    }    }
3548    
3549    /**    /**
3550     * Transfers focus to the next component in the focus traversal order.     * Transfers focus to the next component in the focus traversal order, as
3551       * though this were the current focus owner.
3552       *
3553       * @see #requestFocus()
3554       * @since 1.1
3555     */     */
3556    public void transferFocus()    public void transferFocus()
3557    {    {
# Line 3498  public abstract class Component Line 3565  public abstract class Component
3565    }    }
3566    
3567    /**    /**
3568       * Returns the root container that owns the focus cycle where this component
3569       * resides. A focus cycle root is in two cycles, one as the ancestor, and
3570       * one as the focusable element; this call always returns the ancestor.
3571       *
3572       * @return the ancestor container that owns the focus cycle
3573     * @since 1.4     * @since 1.4
3574     */     */
3575    public Container getFocusCycleRootAncestor()    public Container getFocusCycleRootAncestor()
# Line 3507  public abstract class Component Line 3579  public abstract class Component
3579    }    }
3580    
3581    /**    /**
3582       * Tests if the container is the ancestor of the focus cycle that this
3583       * component belongs to.
3584       *
3585       * @param c the container to test
3586       * @return true if c is the focus cycle root
3587     * @since 1.4     * @since 1.4
3588     */     */
3589    public boolean isFocusCycleRoot()    public boolean isFocusCycleRoot(Container c)
3590    {    {
3591      // XXX Implement.      return c == getFocusCycleRootAncestor();
     throw new Error("not implemented");  
3592    }    }
3593    
3594    /**    /**
3595     * AWT 1.0 focus event processor.     * AWT 1.0 focus event processor.
3596     *     *
3597     * @deprecated Deprecated in favor of <code>transferFocus()</code>.     * @deprecated use {@link #transferFocus()} instead
3598     */     */
3599    public void nextFocus()    public void nextFocus()
3600    {    {
# Line 3526  public abstract class Component Line 3602  public abstract class Component
3602    }    }
3603    
3604    /**    /**
3605       * Transfers focus to the previous component in the focus traversal order, as
3606       * though this were the current focus owner.
3607       *
3608       * @see #requestFocus()
3609     * @since 1.4     * @since 1.4
3610     */     */
3611    public void transferFocusBackward()    public void transferFocusBackward()
# Line 3535  public abstract class Component Line 3615  public abstract class Component
3615    }    }
3616    
3617    /**    /**
3618       * Transfers focus to the focus cycle root of this component. However, if
3619       * this is a Window, the default focus owner in the window in the current
3620       * focus cycle is focused instead.
3621       *
3622       * @see #requestFocus()
3623       * @see #isFocusCycleRoot()
3624     * @since 1.4     * @since 1.4
3625     */     */
3626    public void transferFocusUpCycle()    public void transferFocusUpCycle()
# Line 3543  public abstract class Component Line 3629  public abstract class Component
3629      throw new Error("not implemented");      throw new Error("not implemented");
3630    }    }
3631    
3632    /** @since 1.2 */    /**
3633       * Tests if this component is the focus owner. Use {@link #isFocusOwner()}
3634       * instead.
3635       *
3636       * @return true if this component owns focus
3637       * @since 1.2
3638       */
3639    public boolean hasFocus()    public boolean hasFocus()
3640    {    {
3641      return isFocusOwner();      return isFocusOwner();
3642    }    }
3643    
3644    /**    /**
3645       * Tests if this component is the focus owner.
3646       *
3647       * @return true if this component owns focus
3648     * @since 1.4     * @since 1.4
3649     */     */
3650    public boolean isFocusOwner()    public boolean isFocusOwner()
# Line 3561  public abstract class Component Line 3656  public abstract class Component
3656    /**    /**
3657     * Adds the specified popup menu to this component.     * Adds the specified popup menu to this component.
3658     *     *
3659     * @param menu The popup menu to be added.     * @param menu the popup menu to be added
3660       * @see #remove(MenuComponent)
3661       * @since 1.1
3662     */     */
3663    public synchronized void add(PopupMenu popup)    public synchronized void add(PopupMenu popup)
3664    {    {
# Line 3573  public abstract class Component Line 3670  public abstract class Component
3670    /**    /**
3671     * Removes the specified popup menu from this component.     * Removes the specified popup menu from this component.
3672     *     *
3673     * @param menu The popup menu to remove.     * @param menu the popup menu to remove
3674       * @see #add(PopupMenu)
3675       * @since 1.1
3676     */     */
3677    public synchronized void remove(MenuComponent popup)    public synchronized void remove(MenuComponent popup)
3678    {    {
# Line 3582  public abstract class Component Line 3681  public abstract class Component
3681    }    }
3682    
3683    /**    /**
3684     * Returns a debugging string representing this component.     * Returns a debugging string representing this component. The string may
3685       * be empty but not null.
3686     *     *
3687     * @return A string representing this component.     * @return a string representing this component
3688     */     */
3689    protected String paramString()    protected String paramString()
3690    {    {
3691      StringBuffer param = new StringBuffer();      StringBuffer param = new StringBuffer();
3692      String name = getName();      String name = getName();
3693      if (name != null)      if (name != null)
3694        {        param.append(name).append(",");
         param.append(name);  
         param.append(",");  
       }  
3695      param.append(width).append("x").append(height).append("+").append(x)      param.append(width).append("x").append(height).append("+").append(x)
3696        .append("+").append(y);        .append("+").append(y);
3697      if (! isValid())      if (! isValid())
# Line 3611  public abstract class Component Line 3708  public abstract class Component
3708    }    }
3709    
3710    /**    /**
3711     * Returns a string representation of this component.     * Returns a string representation of this component. This is implemented
3712       * as <code>getClass().getName() + '[' + paramString() + ']'</code>.
3713     *     *
3714     * @return A string representation of this component     * @return a string representation of this component
3715     */     */
3716    public String toString()    public String toString()
3717    {    {
3718      return getClass().getName() + "[" + paramString() + "]";      return getClass().getName() + '[' + paramString() + ']';
3719    }    }
3720    
3721    /**    /**
3722     * Prints a listing of this component to the standard output.     * Prints a listing of this component to <code>System.out</code>.
3723       *
3724       * @see #list(PrintStream)
3725     */     */
3726    public void list()    public void list()
3727    {    {
# Line 3631  public abstract class Component Line 3731  public abstract class Component
3731    /**    /**
3732     * Prints a listing of this component to the specified print stream.     * Prints a listing of this component to the specified print stream.
3733     *     *
3734     * @param stream The <code>PrintStream</code> to print to.     * @param stream the <code>PrintStream</code> to print to
3735     */     */
3736    public void list(PrintStream out)    public void list(PrintStream out)
3737    {    {
# Line 3642  public abstract class Component Line 3742  public abstract class Component
3742     * Prints a listing of this component to the specified print stream,     * Prints a listing of this component to the specified print stream,
3743     * starting at the specified indentation point.     * starting at the specified indentation point.
3744     *     *
3745     * @param stream The <code>PrintStream</code> to print to.     * @param stream the <code>PrintStream</code> to print to
3746     * @param indent The indentation point.     * @param indent the indentation point
3747     */     */
3748    public void list(PrintStream out, int indent)    public void list(PrintStream out, int indent)
3749    {    {
# Line 3655  public abstract class Component Line 3755  public abstract class Component
3755    /**    /**
3756     * Prints a listing of this component to the specified print writer.     * Prints a listing of this component to the specified print writer.
3757     *     *
3758     * @param writer The <code>PrintWrinter</code> to print to.     * @param writer the <code>PrintWrinter</code> to print to
3759       * @since 1.1
3760     */     */
3761    public void list(PrintWriter out)    public void list(PrintWriter out)
3762    {    {
# Line 3666  public abstract class Component Line 3767  public abstract class Component
3767     * Prints a listing of this component to the specified print writer,     * Prints a listing of this component to the specified print writer,
3768     * starting at the specified indentation point.     * starting at the specified indentation point.
3769     *     *
3770     * @param writer The <code>PrintWriter</code> to print to.     * @param writer the <code>PrintWriter</code> to print to
3771     * @param indent The indentation point.     * @param indent the indentation point
3772       * @since 1.1
3773     */     */
3774    public void list(PrintWriter out, int indent)    public void list(PrintWriter out, int indent)
3775    {    {
# Line 3676  public abstract class Component Line 3778  public abstract class Component
3778      out.println(toString());      out.println(toString());
3779    }    }
3780    
3781      /**
3782       * Adds the specified property listener to this component. This is harmless
3783       * if the listener is null, but if the listener has already been registered,
3784       * it will now be registered twice. The property listener ignores inherited
3785       * properties. Recognized properties include:<br>
3786       * <ul>
3787       * <li>the font (<code>"font"</code>)</li>
3788       * <li>the background color (<code>"background"</code>)</li>
3789       * <li>the foreground color (<code>"foreground"</code>)</li>
3790       * <li>the focusability (<code>"focusable"</code>)</li>
3791       * <li>the focus key traversal enabled state
3792       *     (<code>"focusTraversalKeysEnabled"</code>)</li>
3793       * <li>the set of forward traversal keys
3794       *     (<code>"forwardFocusTraversalKeys"</code>)</li>
3795       * <li>the set of backward traversal keys
3796       *     (<code>"backwardFocusTraversalKeys"</code>)</li>
3797       * <li>the set of up-cycle traversal keys
3798       *     (<code>"upCycleFocusTraversalKeys"</code>)</li>
3799       * </ul>
3800       *
3801       * @param listener the new listener to add
3802       * @see #removePropertyChangeListener(PropertyChangeListener)
3803       * @see #getPropertyChangeListeners()
3804       * @see #addPropertyChangeListener(String, PropertyChangeListener)
3805       * @since 1.1
3806       */
3807    public void addPropertyChangeListener(PropertyChangeListener listener)    public void addPropertyChangeListener(PropertyChangeListener listener)
3808    {    {
3809      if (changeSupport == null)      if (changeSupport == null)
# Line 3683  public abstract class Component Line 3811  public abstract class Component
3811      changeSupport.addPropertyChangeListener(listener);      changeSupport.addPropertyChangeListener(listener);
3812    }    }
3813    
3814      /**
3815       * Removes the specified property listener from the component. This is
3816       * harmless if the listener was not previously registered.
3817       *
3818       * @param listener the listener to remove
3819       * @see #addPropertyChangeListener(PropertyChangeListener)
3820       * @see #getPropertyChangeListeners()
3821       * @see #removePropertyChangeListener(String, PropertyChangeListener)
3822       * @since 1.1
3823       */
3824    public void removePropertyChangeListener(PropertyChangeListener listener)    public void removePropertyChangeListener(PropertyChangeListener listener)
3825    {    {
3826      if (changeSupport != null)      if (changeSupport != null)
# Line 3690  public abstract class Component Line 3828  public abstract class Component
3828    }    }
3829    
3830    /**    /**
3831       * Returns an array of all specified listeners registered on this component.
3832       *
3833       * @return an array of listeners
3834       * @see #addPropertyChangeListener(PropertyChangeListener)
3835       * @see #removePropertyChangeListener(PropertyChangeListener)
3836       * @see #getPropertyChangeListeners(String)
3837     * @since 1.4     * @since 1.4
3838     */     */
3839    public PropertyChangeListener[] getPropertyChangeListeners()    public PropertyChangeListener[] getPropertyChangeListeners()
# Line 3698  public abstract class Component Line 3842  public abstract class Component
3842        : changeSupport.getPropertyChangeListeners();        : changeSupport.getPropertyChangeListeners();
3843    }    }
3844    
3845      /**
3846       * Adds the specified property listener to this component. This is harmless
3847       * if the listener is null, but if the listener has already been registered,
3848       * it will now be registered twice. The property listener ignores inherited
3849       * properties. The listener is keyed to a single property. Recognized
3850       * properties include:<br>
3851       * <ul>
3852       * <li>the font (<code>"font"</code>)</li>
3853       * <li>the background color (<code>"background"</code>)</li>
3854       * <li>the foreground color (<code>"foreground"</code>)</li>
3855       * <li>the focusability (<code>"focusable"</code>)</li>
3856       * <li>the focus key traversal enabled state
3857       *     (<code>"focusTraversalKeysEnabled"</code>)</li>
3858       * <li>the set of forward traversal keys
3859       *     (<code>"forwardFocusTraversalKeys"</code>)</li>
3860    p   * <li>the set of backward traversal keys
3861       *     (<code>"backwardFocusTraversalKeys"</code>)</li>
3862       * <li>the set of up-cycle traversal keys
3863       *     (<code>"upCycleFocusTraversalKeys"</code>)</li>
3864       * </ul>
3865       *
3866       * @param propertyName the property name to filter on
3867       * @param listener the new listener to add
3868       * @see #removePropertyChangeListener(String, PropertyChangeListener)
3869       * @see #getPropertyChangeListeners(String)
3870       * @see #addPropertyChangeListener(PropertyChangeListener)
3871       * @since 1.1
3872       */
3873    public void addPropertyChangeListener(String propertyName,    public void addPropertyChangeListener(String propertyName,
3874                                          PropertyChangeListener listener)                                          PropertyChangeListener listener)
3875    {    {
# Line 3706  public abstract class Component Line 3878  public abstract class Component
3878      changeSupport.addPropertyChangeListener(propertyName, listener);      changeSupport.addPropertyChangeListener(propertyName, listener);
3879    }    }
3880    
3881      /**
3882       * Removes the specified property listener on a particular property from
3883       * the component. This is harmless if the listener was not previously
3884       * registered.
3885       *
3886       * @param propertyName the property name to filter on
3887       * @param listener the listener to remove
3888       * @see #addPropertyChangeListener(String, PropertyChangeListener)
3889       * @see #getPropertyChangeListeners(String)
3890       * @see #removePropertyChangeListener(PropertyChangeListener)
3891       * @since 1.1
3892       */
3893    public void removePropertyChangeListener(String propertyName,    public void removePropertyChangeListener(String propertyName,
3894                                             PropertyChangeListener listener)                                             PropertyChangeListener listener)
3895    {    {
# Line 3714  public abstract class Component Line 3898  public abstract class Component
3898    }    }
3899    
3900    /**    /**
3901       * Returns an array of all specified listeners on the named property that
3902       * are registered on this component.
3903       *
3904       * @return an array of listeners
3905       * @see #addPropertyChangeListener(String, PropertyChangeListener)
3906       * @see #removePropertyChangeListener(String, PropertyChangeListener)
3907       * @see #getPropertyChangeListeners()
3908     * @since 1.4     * @since 1.4
3909     */     */
3910    public PropertyChangeListener[] getPropertyChangeListeners(String property)    public PropertyChangeListener[] getPropertyChangeListeners(String property)
# Line 3722  public abstract class Component Line 3913  public abstract class Component
3913        : changeSupport.getPropertyChangeListeners(property);        : changeSupport.getPropertyChangeListeners(property);
3914    }    }
3915    
3916      /**
3917       * Report a change in a bound property to any registered property listeners.
3918       *
3919       * @param propertyName the property that changed
3920       * @param oldValue the old property value
3921       * @param newValue the new property value
3922       */
3923    protected void firePropertyChange(String propertyName, Object oldValue,    protected void firePropertyChange(String propertyName, Object oldValue,
3924                                      Object newValue)                                      Object newValue)
3925    {    {
# Line 3729  public abstract class Component Line 3927  public abstract class Component
3927        changeSupport.firePropertyChange(propertyName, oldValue, newValue);        changeSupport.firePropertyChange(propertyName, oldValue, newValue);
3928    }    }
3929    
3930      /**
3931       * Report a change in a bound property to any registered property listeners.
3932       *
3933       * @param propertyName the property that changed
3934       * @param oldValue the old property value
3935       * @param newValue the new property value
3936       */
3937    protected void firePropertyChange(String propertyName, boolean oldValue,    protected void firePropertyChange(String propertyName, boolean oldValue,
3938                                      boolean newValue)                                      boolean newValue)
3939    {    {
# Line 3736  public abstract class Component Line 3941  public abstract class Component
3941        changeSupport.firePropertyChange(propertyName, oldValue, newValue);        changeSupport.firePropertyChange(propertyName, oldValue, newValue);
3942    }    }
3943    
3944      /**
3945       * Report a change in a bound property to any registered property listeners.
3946       *
3947       * @param propertyName the property that changed
3948       * @param oldValue the old property value
3949       * @param newValue the new property value
3950       */
3951    protected void firePropertyChange(String propertyName, int oldValue,    protected void firePropertyChange(String propertyName, int oldValue,
3952                                      int newValue)                                      int newValue)
3953    {    {
# Line 3743  public abstract class Component Line 3955  public abstract class Component
3955        changeSupport.firePropertyChange(propertyName, oldValue, newValue);        changeSupport.firePropertyChange(propertyName, oldValue, newValue);
3956    }    }
3957    
3958      /**
3959       * Sets the text layout orientation of this component. New components default
3960       * to UNKNOWN (which behaves like LEFT_TO_RIGHT). This method affects only
3961       * the current component, while
3962       * {@link #applyComponentOrientation(ComponentOrientation)} affects the
3963       * entire hierarchy.
3964       *
3965       * @param o the new orientation
3966       * @throws NullPointerException if o is null
3967       * @see #getComponentOrientation()
3968       */
3969    public void setComponentOrientation(ComponentOrientation o)    public void setComponentOrientation(ComponentOrientation o)
3970    {    {
3971        if (o == null)
3972          throw new NullPointerException();
3973      orientation = o;      orientation = o;
3974    }    }
3975    
3976      /**
3977       * Determines the text layout orientation used by this component.
3978       *
3979       * @return the component orientation
3980       * @see #setComponentOrientation(ComponentOrientation)
3981       */
3982    public ComponentOrientation getComponentOrientation()    public ComponentOrientation getComponentOrientation()
3983    {    {
3984      return orientation;      return orientation;
3985    }    }
3986    
3987      /**
3988       * Sets the text layout orientation of this component. New components default
3989       * to UNKNOWN (which behaves like LEFT_TO_RIGHT). This method affects the
3990       * entire hierarchy, while
3991       * {@link #setComponentOrientation(ComponentOrientation)} affects only the
3992       * current component.
3993       *
3994       * @param o the new orientation
3995       * @throws NullPointerException if o is null
3996       * @see #getComponentOrientation()
3997       * @since 1.4
3998       */
3999    public void applyComponentOrientation(ComponentOrientation o)    public void applyComponentOrientation(ComponentOrientation o)
4000    {    {
4001      setComponentOrientation(o);      setComponentOrientation(o);
4002    }    }
4003    
4004      /**
4005       * Returns the accessibility framework context of this class. Component is
4006       * not accessible, so the default implementation returns null. Subclasses
4007       * must override this behavior, and return an appropriate subclass of
4008       * {@link AccessibleAWTComponent}.
4009       *
4010       * @return the accessibility context
4011       */
4012    public AccessibleContext getAccessibleContext()    public AccessibleContext getAccessibleContext()
4013    {    {
4014      return null;      return null;
# Line 3778  public abstract class Component Line 4029  public abstract class Component
4029      return null;      return null;
4030    }    }
4031    
4032    // Sets the peer for this component.    /**
4033       * Sets the peer for this component.
4034       *
4035       * @param peer the new peer
4036       */
4037    final void setPeer(ComponentPeer peer)    final void setPeer(ComponentPeer peer)
4038    {    {
4039      this.peer = peer;      this.peer = peer;
4040    }    }
4041    
4042    /** Implementation method that allows classes such as Canvas and    /**
4043        Window to override the graphics configuration without violating     * Implementation method that allows classes such as Canvas and Window to
4044        the published API. */     * override the graphics configuration without violating the published API.
4045       *
4046       * @return the graphics configuration
4047       */
4048    GraphicsConfiguration getGraphicsConfigurationImpl()    GraphicsConfiguration getGraphicsConfigurationImpl()
4049    {    {
4050      if (peer != null)      if (peer != null)
# Line 3802  public abstract class Component Line 4060  public abstract class Component
4060      return null;      return null;
4061    }    }
4062    
4063      /**
4064       * Implementation of dispatchEvent. Allows trusted package classes to
4065       * dispatch additional events first.
4066       *
4067       * @param e the event to dispatch
4068       */
4069    void dispatchEventImpl(AWTEvent e)    void dispatchEventImpl(AWTEvent e)
4070    {    {
4071      // Make use of event id's in order to avoid multiple instanceof tests.      // Make use of event id's in order to avoid multiple instanceof tests.
# Line 3867  public abstract class Component Line 4131  public abstract class Component
4131     *                 |  |     *                 |  |
4132     *                 +--+     *                 +--+
4133     * </pre>     * </pre>
4134       *
4135       * @param queuedEvent the first paint event
4136       * @param newEvent the second paint event
4137       * @return the combined paint event, or null
4138     */     */
4139    private PaintEvent coalescePaintEvents(PaintEvent queuedEvent,    private PaintEvent coalescePaintEvents(PaintEvent queuedEvent,
4140                                           PaintEvent newEvent)                                           PaintEvent newEvent)
# Line 3888  public abstract class Component Line 4156  public abstract class Component
4156      return newEvent;      return newEvent;
4157    }    }
4158    
4159      /**
4160       * Does the work for a paint event.
4161       *
4162       * @param event the event to process
4163       */
4164    private void processPaintEvent(PaintEvent event)    private void processPaintEvent(PaintEvent event)
4165    {    {
4166      // Can't do graphics without peer      // Can't do graphics without peer
# Line 3911  public abstract class Component Line 4184  public abstract class Component
4184        }        }
4185    }    }
4186    
4187    // This method is used to implement transferFocus().    /**
4188    // CHILD is the child making the request.     * This method is used to implement transferFocus(). CHILD is the child
4189    // This is overridden by Container; when called for an ordinary     * making the request. This is overridden by Container; when called for an
4190    // component there is no child and so we always return null.     * ordinary component there is no child and so we always return null.
4191       *
4192       * @param child the component making the request
4193       * @return the next component to focus on
4194       */
4195    Component findNextFocusComponent(Component child)    Component findNextFocusComponent(Component child)
4196    {    {
4197      return null;      return null;
4198    }    }
4199    
4200      /**
4201       * Deserializes this component. This regenerates all serializable listeners
4202       * which were registered originally.
4203       *
4204       * @param s the stream to read from
4205       * @throws ClassNotFoundException if deserialization fails
4206       * @throws IOException if the stream fails
4207       */
4208    private void readObject(ObjectInputStream s)    private void readObject(ObjectInputStream s)
4209      throws ClassNotFoundException, IOException      throws ClassNotFoundException, IOException
4210    {    {
# Line 3950  public abstract class Component Line 4235  public abstract class Component
4235        }        }
4236    }    }
4237    
4238      /**
4239       * Serializes this component. This ignores all listeners which do not
4240       * implement Serializable, but includes those that do.
4241       *
4242       * @param s the stream to write to
4243       * @throws IOException if the stream fails
4244       */
4245    private void writeObject(ObjectOutputStream s) throws IOException    private void writeObject(ObjectOutputStream s) throws IOException
4246    {    {
4247      s.defaultWriteObject();      s.defaultWriteObject();

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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