de.enough.polish.ui.texteffects
Class VerticalGradientTextEffect

java.lang.Object
  extended by de.enough.polish.ui.TextEffect
      extended by de.enough.polish.ui.texteffects.VerticalGradientTextEffect
All Implemented Interfaces:
Serializable

public class VerticalGradientTextEffect
extends TextEffect

Paints a gradient font where the color changes from top to bottom.

Activate the shadow text effect by specifying text-effect: vertical-gradient; in your polish.css file. You can finetune the effect with following attributes:

Author:
robertvirkus

Field Summary
 
Fields inherited from class de.enough.polish.ui.TextEffect
style
 
Constructor Summary
VerticalGradientTextEffect()
          Creates a new gradient text effect.
VerticalGradientTextEffect(int startColor, int endColor, int steps)
          Creates a new gradient text effect.
 
Method Summary
 void drawString(java.lang.String text, int textColor, int x, int y, int orientation, javax.microedition.lcdui.Graphics g)
          Paints the text and applies the text effect.
 void setStyle(Style style)
          Sets the style of this item.
 
Methods inherited from class de.enough.polish.ui.TextEffect
animate, animate, drawStrings, getFont, getFontHeight, getLeftX, getRgbData, getRgbData, getRgbData, getTopY, getTopY, hideNotify, releaseResources, showNotify, stringWidth, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerticalGradientTextEffect

public VerticalGradientTextEffect()
Creates a new gradient text effect.


VerticalGradientTextEffect

public VerticalGradientTextEffect(int startColor,
                                  int endColor,
                                  int steps)
Creates a new gradient text effect.

Parameters:
startColor - the top color
endColor - the bottom color
steps - the number of steps after which the gradient is repeated
Method Detail

drawString

public void drawString(java.lang.String text,
                       int textColor,
                       int x,
                       int y,
                       int orientation,
                       javax.microedition.lcdui.Graphics g)
Description copied from class: TextEffect
Paints the text and applies the text effect.

Specified by:
drawString in class TextEffect
Parameters:
text - the text
textColor - the color of the text
x - x coordinate
y - y coordinate
orientation - the orientation, e.g. Graphics.TOP | Graphics.LEFT or Graphics.TOP | Graphics.HCENTER
g - the graphics context

setStyle

public void setStyle(Style style)
Description copied from class: TextEffect
Sets the style of this item. Subclasses can override this method for getting specific settings.

Overrides:
setStyle in class TextEffect
Parameters:
style - the new style for this item.