de.enough.polish.ui.borders
Class SquareSonarBorder

java.lang.Object
  extended by de.enough.polish.ui.Border
      extended by de.enough.polish.ui.borders.SquareSonarBorder
All Implemented Interfaces:
Serializable

public class SquareSonarBorder
extends Border

Sends out square rectangles from around the item to the outside.

Copyright Enough Software 2008

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
protected  boolean[] activeSignals
           
protected  int[] colors
           
protected  int distance
           
protected  int[] distances
           
protected  int emittedSignals
           
protected  boolean hasTranslucentColor
           
protected  int innerColor
           
protected  boolean isAnimationStopped
           
protected  boolean isOutbound
           
protected  long lastEmittingTime
           
protected  int numSignals
           
protected  int outerColor
           
protected  int pause
           
protected  int speed
           
protected  int steps
           
 
Fields inherited from class de.enough.polish.ui.Border
borderWidth
 
Constructor Summary
SquareSonarBorder(int innerColor, int outerColor, int steps, int distance, int pause, int numSignals, int speed)
          Creates a new SquareSonarBorder
 
Method Summary
 void animate(Screen screen, Item parent, long currentTime, ClippingRegion repaintRegion)
          Animates this background.
 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 de.enough.polish.ui.Border
animate, hideNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

innerColor

protected final int innerColor

outerColor

protected final int outerColor

steps

protected final int steps

distance

protected final int distance

pause

protected final int pause

numSignals

protected final int numSignals

speed

protected final int speed

hasTranslucentColor

protected final boolean hasTranslucentColor

distances

protected final int[] distances

colors

protected final int[] colors

activeSignals

protected final boolean[] activeSignals

lastEmittingTime

protected long lastEmittingTime

emittedSignals

protected int emittedSignals

isOutbound

protected boolean isOutbound

isAnimationStopped

protected boolean isAnimationStopped
Constructor Detail

SquareSonarBorder

public SquareSonarBorder(int innerColor,
                         int outerColor,
                         int steps,
                         int distance,
                         int pause,
                         int numSignals,
                         int speed)
Creates a new SquareSonarBorder

Parameters:
innerColor - the color at the inner starting point.
outerColor - the color at the outer end point.
steps - the number of animation steps required for moving from the inner point to the outer point
distance - the distance from the inner point to the outer point in pixels
pause - the pause in ms between different sonar signals
numSignals - the number of signals that are send out. Use -1 for not limiting the number.
speed - the constant speed by which signals move from the inner to the outer point - use -1 for moving fast in the beginning and then slowing down.
Method Detail

showNotify

public void showNotify()
Description copied from class: Border
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.

Overrides:
showNotify in class Border

animate

public void animate(Screen screen,
                    Item parent,
                    long currentTime,
                    ClippingRegion repaintRegion)
Description copied from class: Border
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.

Overrides:
animate in class Border
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)

paint

public void paint(int x,
                  int y,
                  int width,
                  int height,
                  javax.microedition.lcdui.Graphics g)
Description copied from class: Border
Paints this border.

Specified by:
paint in class 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.