/[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.38.2.19 by gnu_andrew, Wed Nov 2 21:44:46 2005 UTC revision 1.38.2.20 by gnu_andrew, Sun Nov 27 21:00:36 2005 UTC
# Line 1038  public abstract class Component Line 1038  public abstract class Component
1038      if ((c != null) && c.equals(background))      if ((c != null) && c.equals(background))
1039        return;        return;
1040    
     // If c is null, inherit from closest ancestor whose bg is set.  
     if (c == null && parent != null)  
       c = parent.getBackground();  
     if (peer != null && c != null)  
       peer.setBackground(c);  
       
1041      Color previous = background;      Color previous = background;
1042      background = c;      background = c;
1043        if (peer != null && c != null)
1044          peer.setBackground(c);
1045      firePropertyChange("background", previous, c);      firePropertyChange("background", previous, c);
1046    }    }
1047    
# Line 1409  public abstract class Component Line 1405  public abstract class Component
1405        {        {
1406          if (parent != null)          if (parent != null)
1407            {            {
             Rectangle parentBounds = parent.getBounds();  
1408              Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth,              Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth,
1409                                                  oldheight);                                                  oldheight);
1410              Rectangle newBounds = new Rectangle(x, y, width, height);              Rectangle newBounds = new Rectangle(x, y, width, height);
# Line 1720  public abstract class Component Line 1715  public abstract class Component
1715      valid = false;      valid = false;
1716      prefSize = null;      prefSize = null;
1717      minSize = null;      minSize = null;
1718      if (parent != null && parent.valid)      if (parent != null && parent.isValid())
1719        parent.invalidate();        parent.invalidate();
1720    }    }
1721    
# Line 1887  public abstract class Component Line 1882  public abstract class Component
1882     */     */
1883    public void repaint()    public void repaint()
1884    {      {  
1885      if(!isShowing())      if (isShowing())
       {  
         Component p = parent;  
         if (p != null)  
           p.repaint(0, getX(), getY(), width, height);  
       }  
     else  
1886        repaint(0, 0, 0, width, height);        repaint(0, 0, 0, width, height);
1887    }    }
1888    
# Line 1908  public abstract class Component Line 1897  public abstract class Component
1897     */     */
1898    public void repaint(long tm)    public void repaint(long tm)
1899    {    {
1900      if(!isShowing())      if (isShowing())
       {  
         Component p = parent;  
         if (p != null)  
           p.repaint(tm, getX(), getY(), width, height);  
       }  
     else  
1901        repaint(tm, 0, 0, width, height);        repaint(tm, 0, 0, width, height);
1902    }    }
1903    
# Line 1932  public abstract class Component Line 1915  public abstract class Component
1915     */     */
1916    public void repaint(int x, int y, int w, int h)    public void repaint(int x, int y, int w, int h)
1917    {    {
1918      if(!isShowing())      if (isShowing())
       {  
         Component p = parent;  
         if (p != null)  
           p.repaint(0, x + getX(), y + getY(), width, height);  
       }  
     else  
1919        repaint(0, x, y, w, h);        repaint(0, x, y, w, h);
1920    }    }
1921    
# Line 1957  public abstract class Component Line 1934  public abstract class Component
1934     */     */
1935    public void repaint(long tm, int x, int y, int width, int height)    public void repaint(long tm, int x, int y, int width, int height)
1936    {    {
1937      if(!isShowing())      if (isShowing())
       {  
         Component p = parent;  
         if (p != null)  
           p.repaint(tm, x + getX(), y + getY(), width, height);  
       }  
     else  
1938        {        {
1939          ComponentPeer p = peer;          ComponentPeer p = peer;
1940          if (p != null)          if (p != null)
# Line 2667  public abstract class Component Line 2638  public abstract class Component
2638    {    {
2639      mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener);      mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener);
2640      if (mouseMotionListener != null)      if (mouseMotionListener != null)
2641        enableEvents(AWTEvent.MOUSE_EVENT_MASK);        enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
2642    }    }
2643    
2644    /**    /**
# Line 2800  public abstract class Component Line 2771  public abstract class Component
2771    }    }
2772    
2773    /**    /**
2774     * Returns all registered EventListers of the given listenerType.     * Returns all registered {@link EventListener}s of the given
2775       * <code>listenerType</code>.
2776     *     *
2777     * @param listenerType the class of listeners to filter     * @param listenerType the class of listeners to filter (<code>null</code>
2778     * @return an array of registered listeners     *                     not permitted).
2779       *                    
2780       * @return An array of registered listeners.
2781       *
2782       * @throws ClassCastException if <code>listenerType</code> does not implement
2783       *                            the {@link EventListener} interface.
2784       * @throws NullPointerException if <code>listenerType</code> is
2785       *                              <code>null</code>.
2786       *                            
2787     * @see #getComponentListeners()     * @see #getComponentListeners()
2788     * @see #getFocusListeners()     * @see #getFocusListeners()
2789     * @see #getHierarchyListeners()     * @see #getHierarchyListeners()
# Line 4879  p   * <li>the set of backward traversal Line 4859  p   * <li>the set of backward traversal
4859        case MouseEvent.MOUSE_EXITED:        case MouseEvent.MOUSE_EXITED:
4860        case MouseEvent.MOUSE_PRESSED:        case MouseEvent.MOUSE_PRESSED:
4861        case MouseEvent.MOUSE_RELEASED:        case MouseEvent.MOUSE_RELEASED:
       case MouseEvent.MOUSE_MOVED:  
       case MouseEvent.MOUSE_DRAGGED:  
4862          return (mouseListener != null          return (mouseListener != null
                 || mouseMotionListener != null  
4863                  || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0);                  || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0);
4864          case MouseEvent.MOUSE_MOVED:
4865          case MouseEvent.MOUSE_DRAGGED:
4866            return (mouseMotionListener != null
4867                    || (eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0);
4868                    
4869        case FocusEvent.FOCUS_GAINED:        case FocusEvent.FOCUS_GAINED:
4870        case FocusEvent.FOCUS_LOST:        case FocusEvent.FOCUS_LOST:

Legend:
Removed from v.1.38.2.19  
changed lines
  Added in v.1.38.2.20

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