System.out.println("FadeInBg - drawing with currentColor=" + Integer.toHexString(this.currentColor)); dg.fillPolygon( this.xCoords, 0, this.yCoords, 0, 4, this.currentColor );
dg.fillPolygon( this.xCoords, 0, this.yCoords, 0, 4, this.currentColor );
	public void paint(int x, int y, int width, int height, Graphics g) {		// System.out.println("FadeInBackround: currentColor=" + Integer.toHexString(this.currentColor));		if ( this.restartOnTime ) {			long updateTime = System.currentTimeMillis();			if (!this.animationRunning) {				boolean restart = (updateTime - this.lastUpdateTime) > 5 * 1000; // restart after 5 seconds				this.lastUpdateTime = updateTime;				if (restart) {					this.currentColor = 0x00FFFFFF & this.targetArgbColor;					this.animationRunning = true;					return;				}			}			this.lastUpdateTime = updateTime;		}		//#ifdef polish.api.nokia-ui			if ( this.lastX != x) {				this.lastX = x;				this.xCoords[0] = x;				this.xCoords[1] = x + width;				this.xCoords[2] = x + width;				this.xCoords[3] = x;				if (this.restartOnPositionChange) {					this.animationRunning = true;					this.currentColor = 0x00FFFFFF & this.targetArgbColor;					return;				}			}			if ( this.lastY != y) {				this.lastY = y;				this.yCoords[0] = y;				this.yCoords[1] = y;				this.yCoords[2] = y + height;				this.yCoords[3] = y + height;				if (this.restartOnPositionChange) {					this.animationRunning = true;					this.currentColor = 0x00FFFFFF & this.targetArgbColor;					return;				}			}			DirectGraphics dg = DirectUtils.getDirectGraphics(g);			System.out.println("FadeInBg - drawing with currentColor=" + Integer.toHexString(this.currentColor));			dg.fillPolygon( this.xCoords, 0, this.yCoords, 0, 4, this.currentColor );		//#elifdef polish.midp2			// on the SE K700 for example the translated origin of the graphics 			// does not seem to used. Instead the real origin is used:			//#ifdef polish.Bugs.drawRgbOrigin				x += g.getTranslateX();				y += g.getTranslateY();			//#endif							// check if the buffer needs to be re-created:						//#if polish.Bugs.drawRgbNeedsFullBuffer				if (width != this.lastWidth || height != this.lastHeight) {					this.lastWidth = width;					this.lastHeight = height;					int[] newBuffer = new int[ width * height ];					for (int i = newBuffer.length; --i >= 0; ) {						newBuffer[i] = this.currentColor;					}					this.buffer = newBuffer;					if (this.restartOnPositionChange) {						this.animationRunning = true;						this.currentColor = 0x00FFFFFF & this.targetArgbColor;						return;					}				}			//#else				if (width != this.lastWidth) {					this.lastWidth = width;					int[] newBuffer = new int[ width ];					for (int i = width; --i >= 0;) {						newBuffer[i] = this.currentColor;					}					this.buffer = newBuffer;					if (this.restartOnPositionChange) {						this.animationRunning = true;						this.currentColor = 0x00FFFFFF & this.targetArgbColor;						return;					}				}			//#endif			if (x != this.lastX || y != this.lastY ) {				this.lastX = x;				this.lastY = y;				if (this.restartOnPositionChange) {					this.animationRunning = true;					this.currentColor = 0x00FFFFFF & this.targetArgbColor;					return;				}			}			if (x < 0) {				width += x;				if (width < 0) {					return;				}				x = 0;			}			if (y < 0) {				height += y;				if (height < 0) {					return;				}				y = 0;			}			//#if polish.Bugs.drawRgbNeedsFullBuffer				g.drawRGB(this.buffer, 0, width, x, y, width, height, true);			//#else				g.drawRGB(this.buffer, 0, 0, x, y, width, height, true);			//#endif		//#else			// ignore alpha-value			g.setColor( this.currentColor );			g.fillRect(x, y, width, height);		//#endif		this.lastX = x;		this.lastY = y;	}