FileDocCategorySizeDatePackage
GameMap.javaAPI DocJ2ME MIDP 2.01605Thu Nov 07 12:02:22 GMT 2002com.sun.midp.lcdui

GameMap

public class GameMap extends Object
A class that maps between DisplayAccess objects and Displayable, GameCanvas. In future versions of the MIDP spec, GameCanvas may have been moved to lcdui package, in which case this class isn't needed.

Fields Summary
private static javax.microedition.lcdui.Displayable
displayable
The Displayable associated with the DisplayAccess
private static DisplayAccess
displayAccess
The DisplayAccess associated with the GameCanvas
private static final Object
lock
Constructors Summary
Methods Summary
public static DisplayAccessget(javax.microedition.lcdui.Displayable c)
Get the DisplayAccess object for this Displayable.

param
c The Displayable to get the DisplayAccess for
return
DisplayAccess The DisplayAccess associated with the MIDlet

        synchronized (lock) {
  	    if (c == displayable) {
                return displayAccess;
  	    } else {
                return null;
	    }
        }
    
public static voidregister(javax.microedition.lcdui.Displayable c, DisplayAccess d)
Associate the given Displayable and DisplayAccess. This is a one-way association.

param
c The GameCanvas to store
param
d The DisplayAccess associated with the GameCanvas

                                   
           
        synchronized (lock) {
	    displayable = c;
	    displayAccess = d;
	}