de.enough.polish.ui
Class Border

java.lang.Object
  extended by de.enough.polish.ui.Border
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BottomBorder, BottomRightShadowBorder, CircleBorder, DropShadowBorder, DropShadowRoundRectBorder, ImageBorder, LeftBorder, MultiImageBorder, RightBorder, RoundRectBorder, SimpleBorder, SquareSonarBorder, TopBorder, TopBottomLeftRightBorder, TranslucentRoundRectBorder

public abstract class Border
extends Object
implements Serializable

Provides an abstract border.

copyright Enough Software 2004 - 2009

Author:
Robert Virkus, robert@enough.de

Field Summary
protected  int borderWidthBottom
          width of the border at the bottom
protected  int borderWidthLeft
          width of the border at the left side
protected  int borderWidthRight
          width of the border at the right side
protected  int borderWidthTop
          width of the border at the top
 
Constructor Summary
Border(int left, int right, int top, int bottom)
          Creates a new border with the specified border widths.
 
Method Summary
 boolean animate()
          Animates this border.
 void animate(Screen screen, Item parent, long currentTime, ClippingRegion repaintRegion)
          Animates this background.
 void hideNotify()
          Informs the border that it is being hidden shortly.
abstract  void paint(int x, int y, int width, int height, Graphics g)
          Paints this border.
 void setStyle(Style style)
          Allows borders to be animated using CSS attribute animations.
 void showNotify()
          Informs the border that it is being shown shortly or that it is now applied to a new visible item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

borderWidthTop

protected int borderWidthTop
width of the border at the top


borderWidthBottom

protected int borderWidthBottom
width of the border at the bottom


borderWidthLeft

protected int borderWidthLeft
width of the border at the left side


borderWidthRight

protected int borderWidthRight
width of the border at the right side

Constructor Detail

Border

public Border(int left,
              int right,
              int top,
              int bottom)
Creates a new border with the specified border widths.

Parameters:
left - the border width on the left side
right - the border width on the right side
top - the border width at the top
bottom - the border width at the bottom
Method Detail

paint

public abstract void paint(int x,
                           int y,
                           int width,
                           int height,
                           Graphics g)
Paints this border.

Parameters:
x - the horizontal start point
y - the vertical start point
width - the width of the border
height - the height of the border
g - the Graphics on which the border should be painted.

animate

public void animate(Screen screen,
                    Item parent,
                    long currentTime,
                    ClippingRegion repaintRegion)
Animates this background. Subclasses can override this method to create animations. The default implementation calls the animate() method and adds the full content area to the repaint region.

Parameters:
screen - the parent screen
parent - the parent item, can be null when the background belongs to a screen
currentTime - the current time in milliseconds
repaintRegion - the repaint area that needs to be updated when this item is animated
See Also:
Item.addRelativeToContentRegion(ClippingRegion, int, int, int, int)

animate

public boolean animate()
Animates this border. Subclasses can override this method to create animations.

Returns:
true when this border has been animated and needs a repaint.
See Also:
animate(Screen, Item, long, ClippingRegion)

hideNotify

public void hideNotify()
Informs the border that it is being hidden shortly. The default implementation is empty.


showNotify

public void showNotify()
Informs the border that it is being shown shortly or that it is now applied to a new visible item. The default implementation is empty.


setStyle

public void setStyle(Style style)
Allows borders to be animated using CSS attribute animations.

Parameters:
style - the style containing typically only one element