FileDocCategorySizeDatePackage
AwtFactory.javaAPI DocAndroid 1.5 API1741Wed May 06 22:41:54 BST 2009com.android.internal.awt

AwtFactory

public class AwtFactory extends Object

Fields Summary
private static org.apache.harmony.awt.wtk.GraphicsFactory
gf
Constructors Summary
Methods Summary
public static java.awt.Graphics2DgetAwtGraphics(android.graphics.Canvas c, android.graphics.Paint p)
Use this method to get acces to AWT drawing primitives and to render into the surface area of a Android widget. Origin and clip of the returned graphics object are the same as in the corresponding Android widget.

param
c Canvas of the android widget to draw into
param
p The default drawing parameters such as font, stroke, foreground and background colors, etc.
return
The AWT Graphics object that makes all AWT drawing primitives available in the androind world.

        // AWT?? TODO: test it!
        if (null == gf) {
            Toolkit tk = Toolkit.getDefaultToolkit();
            gf = tk.getGraphicsFactory();
        }
        return gf.getGraphics2D(c, p);