de.enough.polish.ui.backgrounds
Class PulsatingCircleBackground

java.lang.Object
  extended by de.enough.polish.ui.Background
      extended by de.enough.polish.ui.backgrounds.PulsatingCircleBackground
All Implemented Interfaces:
Serializable

public class PulsatingCircleBackground
extends Background

Paints an animated circular background.

Following CSS-attributes are supported:

Copyright Enough Software 2004 - 2008

 history
        17-Jul-2004 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.Background
borderWidth
 
Constructor Summary
PulsatingCircleBackground(int color, int minDiameter, int maxDiameter, int speed)
          Creates a new pulsating-circle background.
 
Method Summary
 void animate(Screen screen, Item parent, long currentTime, ClippingRegion repaintRegion)
          Animates this background.
 void paint(int x, int y, int width, int height, javax.microedition.lcdui.Graphics g)
          Renders the background to the screen.
 void showNotify()
          Informs the background that it is being shown shortly or that it is now applied to a new visible item.
 
Methods inherited from class de.enough.polish.ui.Background
addRelativeToBackgroundRegion, animate, hideNotify, releaseResources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PulsatingCircleBackground

public PulsatingCircleBackground(int color,
                                 int minDiameter,
                                 int maxDiameter,
                                 int speed)
Creates a new pulsating-circle background.

Parameters:
color - the color of this background
minDiameter - the minimum diameter
maxDiameter - the maximum diameter, -1 when this should be dynamic
speed - the constant speed or -1
Method Detail

paint

public void paint(int x,
                  int y,
                  int width,
                  int height,
                  javax.microedition.lcdui.Graphics g)
Renders the background to the screen.

Specified by:
paint in class Background
Parameters:
x - the x position of the background
y - the y position of the background
width - the width of the background
height - the height of the background
g - the Graphics instance for rendering this background

animate

public void animate(Screen screen,
                    Item parent,
                    long currentTime,
                    ClippingRegion repaintRegion)
Description copied from class: Background
Animates this background. Subclasses can override this method to create animations. The default implementation calls the animate() method and adds the full content area to the repaint region.

Overrides:
animate in class Background
Parameters:
screen - the parent screen
parent - the parent item, can be null when the background belongs to a screen
currentTime - the current time in milliseconds
repaintRegion - the repaint area that needs to be updated when this item is animated
See Also:
Item.addRelativeToContentRegion(ClippingRegion, int, int, int, int)

showNotify

public void showNotify()
Description copied from class: Background
Informs the background that it is being shown shortly or that it is now applied to a new visible item. The default implementation is empty.

Overrides:
showNotify in class Background