de.enough.polish.ui.backgrounds
Class PulsatingCirclesBackground

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

public class PulsatingCirclesBackground
extends Background

Paints an animated background filled with several ever-growing circles.

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
PulsatingCirclesBackground(int firstColor, int secondColor, int minDiameter, int maxDiameter, int numberOfCircles, int step)
          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

PulsatingCirclesBackground

public PulsatingCirclesBackground(int firstColor,
                                  int secondColor,
                                  int minDiameter,
                                  int maxDiameter,
                                  int numberOfCircles,
                                  int step)
Creates a new pulsating-circle background.

Parameters:
firstColor - the first color of circles
secondColor - the second color of circles
minDiameter - the minimum diameter
maxDiameter - the maximum diameter
numberOfCircles - the number of circles
step - the number of pixels which should be added in each round to each circle
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