boolean switchHeightAndWidth = false; int refX = 0; int refY = 0; switch (transform ) { case TRANS_NONE:  System.out.println("TRANS_NONE"); refX = this.refPixelX; refY = this.refPixelY;  this.nokiaTransform = 0;  break; case TRANS_MIRROR_ROT180:  System.out.println("TRANS_MIRROR_ROT180"); refX = this.refPixelX; refY = (this.frameHeight - 1) - this.refPixelY;  this.nokiaTransform = DirectGraphics.FLIP_VERTICAL;  break; case TRANS_MIRROR:  System.out.println("TRANS_MIRROR"); refX = (this.frameWidth - 1) - this.refPixelX; refY = this.refPixelY;  this.nokiaTransform = DirectGraphics.FLIP_HORIZONTAL;  break; case TRANS_ROT180:  System.out.println("TRANS_ROT180"); refX = (this.frameWidth - 1) - this.refPixelX; refY = (this.frameHeight - 1) - this.refPixelY;  this.nokiaTransform = DirectGraphics.ROTATE_180;  break; case TRANS_MIRROR_ROT270:  System.out.println("TRANS_MIRROR_ROT270"); refX = this.refPixelY; refY = this.refPixelX;  this.nokiaTransform = DirectGraphics.ROTATE_270 | DirectGraphics.FLIP_HORIZONTAL;  switchHeightAndWidth = true; break; case TRANS_ROT90:  System.out.println("TRANS_ROT90"); refX = (this.frameHeight - 1) - this.refPixelY; refY = this.refPixelX;  this.nokiaTransform = DirectGraphics.ROTATE_270;  switchHeightAndWidth = true; break; case TRANS_ROT270:  System.out.println("TRANS_ROT270"); refX = this.refPixelY; refY = (this.frameWidth - 1 ) - this.refPixelX;  this.nokiaTransform = DirectGraphics.ROTATE_90;  switchHeightAndWidth = true; break; case TRANS_MIRROR_ROT90:  System.out.println("TRANS_MIRROR_ROT90"); refX = (this.frameHeight - 1) - this.refPixelY; refY = (this.frameWidth - 1) - this.refPixelX;  this.nokiaTransform = DirectGraphics.ROTATE_90 | DirectGraphics.FLIP_HORIZONTAL;  switchHeightAndWidth = true; break; default:  throw new IllegalArgumentException("Invalid sprite transformation: " + transform );    } int xDiff = this.transformedRefX - refX; int yDiff = this.transformedRefY - refY;
this.transform = transform;
	public void setTransform(int transform)	{		boolean switchHeightAndWidth = false;		int refX = 0;		int refY = 0;		switch (transform ) {			case TRANS_NONE:				//#debug				System.out.println("TRANS_NONE");				refX = this.refPixelX;				refY = this.refPixelY;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = 0;				//#endif				break;			case TRANS_MIRROR_ROT180:				//#debug				System.out.println("TRANS_MIRROR_ROT180");				refX = this.refPixelX;				refY = (this.frameHeight - 1) - this.refPixelY;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = DirectGraphics.FLIP_VERTICAL;				//#endif				break;			case TRANS_MIRROR:				//#debug				System.out.println("TRANS_MIRROR");				refX = (this.frameWidth - 1) - this.refPixelX;				refY = this.refPixelY;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = DirectGraphics.FLIP_HORIZONTAL;				//#endif				break;			case TRANS_ROT180:				//#debug				System.out.println("TRANS_ROT180");				refX = (this.frameWidth - 1) - this.refPixelX;				refY = (this.frameHeight - 1) - this.refPixelY;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = DirectGraphics.ROTATE_180;				//#endif				break;			case TRANS_MIRROR_ROT270:				//#debug				System.out.println("TRANS_MIRROR_ROT270");				refX = this.refPixelY;				refY = this.refPixelX;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = DirectGraphics.ROTATE_270 | DirectGraphics.FLIP_HORIZONTAL;				//#endif				switchHeightAndWidth = true;				break;			case TRANS_ROT90:				//#debug				System.out.println("TRANS_ROT90");				refX = (this.frameHeight - 1) - this.refPixelY;				refY = this.refPixelX;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = DirectGraphics.ROTATE_270;				//#endif				switchHeightAndWidth = true;				break;			case TRANS_ROT270:				//#debug				System.out.println("TRANS_ROT270");				refX = this.refPixelY; //(this.frameHeight - 1 ) - this.refPixelY;				refY = (this.frameWidth - 1 ) - this.refPixelX;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = DirectGraphics.ROTATE_90;				//#endif				switchHeightAndWidth = true;				break;			case TRANS_MIRROR_ROT90:				//#debug				System.out.println("TRANS_MIRROR_ROT90");				refX = (this.frameHeight - 1) - this.refPixelY;				refY = (this.frameWidth - 1) - this.refPixelX;				//#ifdef polish.api.nokia-ui					this.nokiaTransform = DirectGraphics.ROTATE_90 | DirectGraphics.FLIP_HORIZONTAL;				//#endif				switchHeightAndWidth = true;				break;			default:				//#ifdef polish.debugVerbose					throw new IllegalArgumentException("Invalid sprite transformation: " + transform );				//#else					//# throw new IllegalArgumentException();					//#endif		}		int xDiff = this.transformedRefX - refX;		int yDiff = this.transformedRefY - refY;		this.transformedRefX = refX;		this.transformedRefY = refY;		this.xPosition += xDiff;		this.yPosition += yDiff;				this.transformedCollisionX += xDiff;		this.transformedCollisionY += yDiff;				if (switchHeightAndWidth) {			this.width = this.frameHeight;			this.height = this.frameWidth;			this.transformedCollisionWidth = this.collisionHeight;			this.transformedCollisionHeight = this.collisionWidth;		} else {			this.width = this.frameWidth;			this.height = this.frameHeight;			this.transformedCollisionWidth = this.collisionWidth;			this.transformedCollisionHeight = this.collisionHeight;		}				this.transform = transform;		//#ifndef polish.api.nokia-ui			// when the nokia-ui is used the frame-dimensions do not need to be changed:			if (this.rawFrameCount > 1) {				updateFrame();			}		//#endif	}