de.enough.polish.ui.backgrounds
Class TriangleBackground

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

public class TriangleBackground
extends Background

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

Copyright Enough Software 2007 - 2009

Author:
Robert Virkus, robert@enough.de

Field Summary
static int BOTTOM
          Orientation for pointing the triangle downwards
static int LEFT
          Orientation for pointing the triangle to the left
static int RIGHT
          Orientation for pointing the triangle to the right
static int TOP
          Orientation for pointing the triangle upwards
 
Fields inherited from class de.enough.polish.ui.Background
borderWidth
 
Constructor Summary
TriangleBackground(int color, int orientation)
          Creates a new triangle 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

TOP

public static final int TOP
Orientation for pointing the triangle upwards

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Orientation for pointing the triangle downwards

See Also:
Constant Field Values

LEFT

public static final int LEFT
Orientation for pointing the triangle to the left

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Orientation for pointing the triangle to the right

See Also:
Constant Field Values
Constructor Detail

TriangleBackground

public TriangleBackground(int color,
                          int orientation)
Creates a new triangle background.

Parameters:
color - the color of the background in RGB, e.g. 0xFFDD11
orientation - the orientation, either TOP, BOTTOM, LEFT, RIGHT
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