FileDocCategorySizeDatePackage
EGLSurfaceImpl.javaAPI DocphoneME MR2 API (J2ME)3338Wed May 02 18:00:48 BST 2007javax.microedition.khronos.egl

EGLSurfaceImpl

public final class EGLSurfaceImpl extends EGLSurface
A class encapsulating an EGL surface.

Fields Summary
static final Hashtable
byId
private int
nativeId
private int
width
private int
height
private int
pixmapPointer
A native pointer (cast to int) to the JSR239_Pixmap object backing the surface, or 0 for null.
private javax.microedition.lcdui.Graphics
target
An LCDUI Graphics object referencing the surface.
Constructors Summary
public EGLSurfaceImpl(int nativeId, int width, int height)


           
        synchronized (byId) {
            this.nativeId = nativeId;
            this.width = width;
            this.height = height;
            byId.put(new Integer(nativeId), new WeakReference(this));
        }
    
Methods Summary
public voiddispose()

	synchronized (byId) {
	    byId.remove(new Integer(nativeId));
	    this.nativeId = 0;
	}
    
private native voidfinalize()

public intgetHeight()

        return this.height;
    
public static javax.microedition.khronos.egl.EGLSurfaceImplgetInstance(int nativeId, int width, int height)

        synchronized (byId) {
            WeakReference ref = (WeakReference)byId.get(new Integer(nativeId));
            EGLSurfaceImpl surface = ref != null ?
                    (EGLSurfaceImpl)ref.get() : null;
            if (surface == null) {
                return new EGLSurfaceImpl(nativeId, width, height);
            } else {
                return surface;
            }
        }
    
public static javax.microedition.khronos.egl.EGLSurfaceImplgetInstance(int nativeId)

        return getInstance(nativeId, -1, -1);
    
public intgetPixmapPointer()

	return this.pixmapPointer;
    
public javax.microedition.lcdui.GraphicsgetTarget()

	return this.target;
    
public intgetWidth()

        return this.width;
    
public intnativeId()

	return nativeId;
    
public voidsetPixmapPointer(int pixmapPointer)

	this.pixmapPointer = pixmapPointer;
    
public voidsetTarget(javax.microedition.lcdui.Graphics target)

	this.target = target;
    
public java.lang.StringtoString()

  	return "EGLSurfaceImpl[" + nativeId + "]";