de.enough.polish.ui.backgrounds
Class MaskBackground

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

public class MaskBackground
extends Background

Copyright Enough Software 2007 - 2008

 history
        Nov 21, 2007 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.Background
borderWidth
 
Constructor Summary
MaskBackground(Background mask, int maskColor, Background background, int opacity)
          Creates a new combiend background.
 
Method Summary
 boolean animate()
          Animates this background.
 void hideNotify()
          Informs the background that it is being hidden shortly.
 void paint(int x, int y, int width, int height, javax.microedition.lcdui.Graphics g)
          Paints this background.
 void releaseResources()
          Releases all (memory intensive) resources such as images or RGB arrays of this background.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaskBackground

public MaskBackground(Background mask,
                      int maskColor,
                      Background background,
                      int opacity)
Creates a new combiend background.

Parameters:
mask - the background used for masking the actual background
maskColor - the color of the mask
background - the background painted in the background
opacity - the overall maximum opacity between 0 (invisible) to 255 (fully opaque)
Method Detail

paint

public void paint(int x,
                  int y,
                  int width,
                  int height,
                  javax.microedition.lcdui.Graphics g)
Description copied from class: Background
Paints this background.

Specified by:
paint in class Background
Parameters:
x - the horizontal start point
y - the vertical start point
width - the width of the background
height - the height of the background
g - the Graphics on which the background should be painted.

animate

public boolean animate()
Description copied from class: Background
Animates this background. Subclasses can override this method to create animations.

Overrides:
animate in class Background
Returns:
true when this background has been animated.
See Also:
Background.animate(Screen, Item, long, ClippingRegion)

hideNotify

public void hideNotify()
Description copied from class: Background
Informs the background that it is being hidden shortly. The default implementation is empty.

Overrides:
hideNotify in class Background

releaseResources

public void releaseResources()
Description copied from class: Background
Releases all (memory intensive) resources such as images or RGB arrays of this background. The default implementation does not do anything.

Overrides:
releaseResources in class Background

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