de.enough.polish.ui.backgrounds
Class Web20RoundRectBackground

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

public class Web20RoundRectBackground
extends Background

Paints a rectangle with round corners as a background.

Copyright Enough Software 2006 - 2009

Author:
Robert Virkus, robert@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.Background
borderWidth, parent
 
Constructor Summary
Web20RoundRectBackground(Color colorObj, int arcWidth, int arcHeight, Color circleColorObj, int circleAnchor, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom)
          Creates a new round rectangle background.
Web20RoundRectBackground(int color, int arcWidth, int arcHeight, int circleColor, int circleAnchor, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom)
          Creates a new round rectangle 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

Web20RoundRectBackground

public Web20RoundRectBackground(int color,
                                int arcWidth,
                                int arcHeight,
                                int circleColor,
                                int circleAnchor,
                                int paddingLeft,
                                int paddingRight,
                                int paddingTop,
                                int paddingBottom)
Creates a new round rectangle background.

Parameters:
color - the color of the background
arcWidth - the horizontal diameter of the arc at the four corners
arcHeight - the vertical diameter of the arc at the four corners
circleColor - the color of the circle arc blended over the rounded background
circleAnchor - the anchor of the circle, either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHT
paddingLeft - the padding between the round edges and the background's left boundary
paddingRight - the padding between the round edges and the background's right boundary
paddingTop - the padding between the round edges and the background's top boundary
paddingBottom - the padding between the round edges and the background's bottom boundary

Web20RoundRectBackground

public Web20RoundRectBackground(Color colorObj,
                                int arcWidth,
                                int arcHeight,
                                Color circleColorObj,
                                int circleAnchor,
                                int paddingLeft,
                                int paddingRight,
                                int paddingTop,
                                int paddingBottom)
Creates a new round rectangle background.

Parameters:
colorObj - the color of the background
arcWidth - the horizontal diameter of the arc at the four corners
arcHeight - the vertical diameter of the arc at the four corners
circleColorObj - the color of the circle arc blended over the rounded background
circleAnchor - the anchor of the circle, either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT or Graphics.RIGHT
paddingLeft - the padding between the round edges and the background's left boundary
paddingRight - the padding between the round edges and the background's right boundary
paddingTop - the padding between the round edges and the background's top boundary
paddingBottom - the padding between the round edges and the background's bottom boundary
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