/[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.68 by rabbit78, Tue Aug 2 20:36:37 2005 UTC revision 1.69 by rabbit78, Fri Aug 5 15:26:08 2005 UTC
# Line 1848  public abstract class Component Line 1848  public abstract class Component
1848     *     *
1849     * @see #paint(Graphics)     * @see #paint(Graphics)
1850     * @see #repaint()     * @see #repaint()
1851       *
1852       * @specnote In contrast to what the spec says, tests show that the exact
1853       *           behaviour is to clear the background on lightweight and
1854       *           top-level components only. Heavyweight components are not
1855       *           affected by this method and only call paint().
1856     */     */
1857    public void update(Graphics g)    public void update(Graphics g)
1858    {    {
1859      if (!isLightweight())      // Tests show that the clearing of the background is only done in
1860        // two cases:
1861        // - If the component is lightwight (yes this is in contrast to the spec).
1862        // - If the component is a toplevel container.
1863        if (isLightweight() || getParent() == null)
1864        {        {
1865          Rectangle clip = g.getClipBounds();          Rectangle clip = g.getClipBounds();
1866          if (clip == null)          if (clip == null)
# Line 1859  public abstract class Component Line 1868  public abstract class Component
1868          else          else
1869            g.clearRect(clip.x, clip.y, clip.width, clip.height);            g.clearRect(clip.x, clip.y, clip.width, clip.height);
1870        }        }
   
1871      paint(g);      paint(g);
1872    }    }
1873    

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69

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