de.enough.polish.ui.backgrounds
Class RoundRectCorneredBackground

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

public class RoundRectCorneredBackground
extends Background

Paints a background with rounded and straight corners CSS-type is "round-rect-cornered"

Copyright (c) Enough Software 2008

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
static int CORNER_ALL
          Constant for using straight corners everywhere.
static int CORNER_LEFT_BOTTOM
          Constant for using a straight corner at the bottom left.
static int CORNER_LEFT_TOP
          Constant for using a straight corner at the top left.
static int CORNER_NONE
          Constant for using rounded corners everywhere.
static int CORNER_RIGHT_BOTTOM
          Constant for using a straight corner at the bottom right.
static int CORNER_RIGHT_TOP
          Constant for using a straight corner at the top right.
 
Fields inherited from class de.enough.polish.ui.Background
borderWidth
 
Constructor Summary
RoundRectCorneredBackground(int color, int arcWidth, int arcHeight, int straightCorners)
          Creates a new round tab 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, showNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORNER_NONE

public static final int CORNER_NONE
Constant for using rounded corners everywhere.

See Also:
Constant Field Values

CORNER_LEFT_TOP

public static final int CORNER_LEFT_TOP
Constant for using a straight corner at the top left.

See Also:
Constant Field Values

CORNER_RIGHT_TOP

public static final int CORNER_RIGHT_TOP
Constant for using a straight corner at the top right.

See Also:
Constant Field Values

CORNER_LEFT_BOTTOM

public static final int CORNER_LEFT_BOTTOM
Constant for using a straight corner at the bottom left.

See Also:
Constant Field Values

CORNER_RIGHT_BOTTOM

public static final int CORNER_RIGHT_BOTTOM
Constant for using a straight corner at the bottom right.

See Also:
Constant Field Values

CORNER_ALL

public static final int CORNER_ALL
Constant for using straight corners everywhere.

See Also:
Constant Field Values
Constructor Detail

RoundRectCorneredBackground

public RoundRectCorneredBackground(int color,
                                   int arcWidth,
                                   int arcHeight,
                                   int straightCorners)
Creates a new round tab background.

Parameters:
color - the color of the background
arcWidth - the horizontal diameter of the arc at the top corners
arcHeight - the vertical diameter of the arc at the top corners
straightCorners - a combination of CORNER constants that define the straight corners
See Also:
CORNER_NONE, CORNER_LEFT_TOP, CORNER_RIGHT_TOP, CORNER_LEFT_BOTTOM, CORNER_RIGHT_BOTTOM
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