FileDocCategorySizeDatePackage
CommonGraphics2DFactory.javaAPI DocAndroid 1.5 API2458Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.gl

CommonGraphics2DFactory

public abstract class CommonGraphics2DFactory extends Object implements org.apache.harmony.awt.wtk.GraphicsFactory
Common GraphicsFactory implementation

Fields Summary
public static CommonGraphics2DFactory
inst
Constructors Summary
Methods Summary
public abstract java.awt.FontembedFont(java.lang.String fontFilePath)
Embeds font from gile with specified path into the system.

param
fontFilePath path to the font file
return
Font object that was created from the file.

public java.awt.FontMetricsgetFontMetrics(java.awt.Font font)
Returns FontMetrics object that keeps metrics of the specified font.

param
font specified Font
return
FontMetrics object corresponding to the specified Font object

        FontMetrics fm;
        for (FontMetrics element : cacheFM) {
            fm = element;
            if (fm == null){
                break;
            }

            if (fm.getFont().equals(font)){
                return fm;
            }
        }
        fm = new FontMetricsImpl(font);

        System.arraycopy(cacheFM, 0, cacheFM, 1, cacheFM.length -1);
        cacheFM[0] = fm;

        return fm;
    
public java.awt.peer.FontPeergetFontPeer(java.awt.Font font)

        return getFontManager().getFontPeer(font.getName(), font.getStyle(), font.getSize());