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, ImageBorder, LeftBorder, MultiImageBorder, RightBorder, RoundRectBorder, SimpleBorder, SquareSonarBorder, TopBorder, TopBottomLeftRightBorder, TranslucentRoundRectBorder

public abstract class Border
extends java.lang.Object
implements Serializable

Provides an abstract border.

copyright Enough Software 2004 - 2008

Author:
Robert Virkus, robert@enough.de

Field Summary
 int borderWidth
          general width of the border
 
Constructor Summary
Border()
          Creates a new border.
 
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, javax.microedition.lcdui.Graphics g)
          Paints this border.
 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

borderWidth

public int borderWidth
general width of the border

Constructor Detail

Border

public Border()
Creates a new border. The width of this border is set to the default value 1 here.

Method Detail

paint

public abstract void paint(int x,
                           int y,
                           int width,
                           int height,
                           javax.microedition.lcdui.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.