de.enough.polish.ui.backgrounds
Class SimpleBackground

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

public class SimpleBackground
extends Background

Paints a filled rectangle as a background in a specific color.

Copyright Enough Software 2004 - 2009

Author:
Robert Virkus, robert@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.Background
borderWidth
 
Constructor Summary
SimpleBackground(Color color)
          Creates a new simple background.
SimpleBackground(int color)
          Creates a new simple background.
 
Method Summary
 int getColor()
           
 void paint(int x, int y, int width, int height, Graphics g)
          Paints this background.
 void setStyle(Style style)
          Allows backgrounds to be animated using CSS attribute animations.
 
Methods inherited from class de.enough.polish.ui.Background
addRelativeToBackgroundRegion, animate, animate, hideNotify, releaseResources, showNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBackground

public SimpleBackground(int color)
Creates a new simple background.

Parameters:
color - the color of the background in RGB, e.g. 0xFFDD11

SimpleBackground

public SimpleBackground(Color color)
Creates a new simple background.

Parameters:
color - the color of the background in RGB, e.g. 0xFFDD11 or a dynamic color
Method Detail

paint

public void paint(int x,
                  int y,
                  int width,
                  int height,
                  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.

getColor

public int getColor()
Returns:
the associated color of this background

setStyle

public void setStyle(Style style)
Description copied from class: Background
Allows backgrounds to be animated using CSS attribute animations.

Overrides:
setStyle in class Background
Parameters:
style - the style containing typically only one element