de.enough.polish.ui.backgrounds
Class PartialGradientBackground

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

public class PartialGradientBackground
extends Background

Provides a partial gradient - this background will be usually used within a combined background.

 backgrounds {
        partialTop {
                type: partial-gradient;
                start: 10%;
                end: 20%;
                top-color: white;
                bottom-color: blue;
  }
        partialBottom {
                type: partial-gradient;
                start: 20%;
                end: 40%;
                top-color: blue;
                bottom-color: white;
  }
  formFg {
        type: combined;
        foreground: partialTop;
        background: partialBottom;
  }
  formBg {
        color: white;
  }
 }
 .myForm {
        background {
    type: combined;
    foreground: formFg;
    background: formBg;
  }
 }
 

Copyright Enough Software 2007 - 2010

 history
        Dec 28, 2007 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.Background
borderWidth, parent
 
Constructor Summary
PartialGradientBackground(int topColor, int bottomColor, int stroke, Dimension start, Dimension end)
          Creates a new partial gradient background
PartialGradientBackground(int topColor, int bottomColor, int stroke, int start, int end)
          Creates a new partial gradient background
 
Method Summary
 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, setParentItem, showNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartialGradientBackground

public PartialGradientBackground(int topColor,
                                 int bottomColor,
                                 int stroke,
                                 int start,
                                 int end)
Creates a new partial gradient background

Parameters:
topColor - the color at the top of the gradient
bottomColor - the color at the bottom of the gradient
stroke - the line stroke style
start - the line counted from the top at which the gradient starts in percent
end - the line counted from the top at which the gradient ends in percent

PartialGradientBackground

public PartialGradientBackground(int topColor,
                                 int bottomColor,
                                 int stroke,
                                 Dimension start,
                                 Dimension end)
Creates a new partial gradient background

Parameters:
topColor - the color at the top of the gradient
bottomColor - the color at the bottom of the gradient
stroke - the line stroke style
start - the line counted from the top at which the gradient starts in percent
end - the line counted from the top at which the gradient ends in percent
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.

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