/[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.78 by langel, Tue Sep 27 18:50:58 2005 UTC revision 1.79 by rabbit78, Tue Oct 4 14:05:56 2005 UTC
# Line 1074  public abstract class Component Line 1074  public abstract class Component
1074      Component p = parent;      Component p = parent;
1075      if (p != null)      if (p != null)
1076        return p.getFont();        return p.getFont();
1077        if (peer != null)
1078          return peer.getGraphics().getFont();
1079      return null;      return null;
1080    }    }
1081    
# Line 1734  public abstract class Component Line 1736  public abstract class Component
1736      if (peer != null)      if (peer != null)
1737        {        {
1738          Graphics gfx = peer.getGraphics();          Graphics gfx = peer.getGraphics();
1739          if (gfx != null)          // Create peer for lightweights.
1740            return gfx;          if (gfx == null && parent != null)
         // create graphics for lightweight:  
         Container parent = getParent();  
         if (parent != null)  
1741            {            {
1742              gfx = parent.getGraphics();              gfx = parent.getGraphics();
1743              Rectangle bounds = getBounds();              Rectangle bounds = getBounds();
# Line 1746  public abstract class Component Line 1745  public abstract class Component
1745              gfx.translate(bounds.x, bounds.y);              gfx.translate(bounds.x, bounds.y);
1746              return gfx;              return gfx;
1747            }            }
1748            gfx.setFont(font);
1749            return gfx;
1750        }        }
1751      return null;      return null;
1752    }    }

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79

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