FileDocCategorySizeDatePackage
ToolkitImpl.javaAPI DocAndroid 1.5 API6787Wed May 06 22:41:54 BST 2009java.awt

ToolkitImpl

public class ToolkitImpl extends Toolkit

Fields Summary
static final Hashtable
imageCache
Constructors Summary
Methods Summary
public voidbeep()

        lockAWT();
        try {
        	// ???AWT: is there nothing to be implemented here?
        } finally {
            unlockAWT();
        }
    
public intcheckImage(java.awt.Image image, int width, int height, java.awt.image.ImageObserver observer)

        lockAWT();
        try {
            if (width == 0 || height == 0) {
                return ImageObserver.ALLBITS;
            }
            if (!(image instanceof OffscreenImage)) {
                return ImageObserver.ALLBITS;
            }
            OffscreenImage oi = (OffscreenImage) image;
            return oi.checkImage(observer);
        } finally {
            unlockAWT();
        }
    
public java.awt.ImagecreateImage(java.awt.image.ImageProducer producer)

        lockAWT();
        try {
            return new OffscreenImage(producer);
        } finally {
            unlockAWT();
        }
    
public java.awt.ImagecreateImage(byte[] imagedata, int imageoffset, int imagelength)

        lockAWT();
        try {
            return new OffscreenImage(new ByteArrayDecodingImageSource(imagedata, imageoffset,
                    imagelength));
        } finally {
            unlockAWT();
        }
    
public java.awt.ImagecreateImage(java.net.URL url)

        lockAWT();
        try {
            return new OffscreenImage(new URLDecodingImageSource(url));
        } finally {
            unlockAWT();
        }
    
public java.awt.ImagecreateImage(java.lang.String filename)

        lockAWT();
        try {
            return new OffscreenImage(new FileDecodingImageSource(filename));
        } finally {
            unlockAWT();
        }
    
public java.awt.image.ColorModelgetColorModel()

        lockAWT();
        try {
            return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
                    .getDefaultConfiguration().getColorModel();
        } finally {
            unlockAWT();
        }
    
public java.lang.String[]getFontList()

        lockAWT();
        try {
        } finally {
            unlockAWT();
        }
        return null;
    
public java.awt.FontMetricsgetFontMetrics(java.awt.Font font)

        lockAWT();
        try {
        	GraphicsFactory gf = getGraphicsFactory();
            return gf.getFontMetrics(font);
        } finally {
            unlockAWT();
        }
    
protected java.awt.peer.FontPeergetFontPeer(java.lang.String a0, int a1)

        lockAWT();
        try {
            return null;
        } finally {
            unlockAWT();
        }
    
public java.awt.ImagegetImage(java.lang.String filename)

        return getImage(filename, this);
    
static java.awt.ImagegetImage(java.lang.String filename, java.awt.Toolkit toolkit)

        synchronized (imageCache) {
            Image im = (filename == null ? null : imageCache.get(filename));

            if (im == null) {
                try {
                    im = toolkit.createImage(filename);
                    imageCache.put(filename, im);
                } catch (Exception e) {
                }
            }

            return im;
        }
    
public java.awt.ImagegetImage(java.net.URL url)

        return getImage(url, this);
    
static java.awt.ImagegetImage(java.net.URL url, java.awt.Toolkit toolkit)

        synchronized (imageCache) {
            Image im = imageCache.get(url);
            if (im == null) {
                try {
                    im = toolkit.createImage(url);
                    imageCache.put(url, im);
                } catch (Exception e) {
                }
            }
            return im;
        }
    
public intgetScreenResolution()

        lockAWT();
        try {
        	return 62;
        } finally {
            unlockAWT();
        }
    
public java.awt.DimensiongetScreenSize()

        lockAWT();
        try {
            DisplayMode dm = GraphicsEnvironment.getLocalGraphicsEnvironment()
                    .getDefaultScreenDevice().getDisplayMode();
            return new Dimension(dm.getWidth(), dm.getHeight());
        } finally {
            unlockAWT();
        }
    
protected java.awt.EventQueuegetSystemEventQueueImpl()

        return getSystemEventQueueCore().getActiveEventQueue();
    
public java.util.MapmapInputMethodHighlight(java.awt.im.InputMethodHighlight highlight)

        lockAWT();
        try {
            return mapInputMethodHighlightImpl(highlight);
        } finally {
            unlockAWT();
        }
    
public booleanprepareImage(java.awt.Image image, int width, int height, java.awt.image.ImageObserver observer)

        lockAWT();
        try {
            if (width == 0 || height == 0) {
                return true;
            }
            if (!(image instanceof OffscreenImage)) {
                return true;
            }
            OffscreenImage oi = (OffscreenImage) image;
            return oi.prepareImage(observer);
        } finally {
            unlockAWT();
        }
    
public voidsync()


    
       
        lockAWT();
        try {
        } finally {
            unlockAWT();
        }