utils
Class DrawUtils

java.lang.Object
  extended by utils.DrawUtils

public class DrawUtils
extends java.lang.Object

A helper class for poping alerts, rescaling and blending images.

Author:
Peter Hlavac

Constructor Summary
DrawUtils()
           
 
Method Summary
static void blend(int[] raw, int alphaValue)
          Makes a given image transparent with a given alphaValue (255..maximum Transparency)
static void blend(int[] raw, int alphaValue, int maskColor, int dontmaskColor)
          Makes a given image transparent with a given alphaValue (255..maximum Transparency)
static int[] reescalaArray(int[] ini, int width, int height, int new_width, int new_height)
          Scales an Image with size (width, height) to a desired size (new_width, new_height).
static void showAlert(java.lang.String title, java.lang.String message, int duration, javax.microedition.lcdui.Display display)
          Shows an alert on screen.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawUtils

public DrawUtils()
Method Detail

showAlert

public static void showAlert(java.lang.String title,
                             java.lang.String message,
                             int duration,
                             javax.microedition.lcdui.Display display)
Shows an alert on screen.

Parameters:
title - the titel of the alert
message - a detailed message
duration - how long the alert should be displayed (in millisec or Alert.FOREVER)
display - the display on which the alert should occur

reescalaArray

public static int[] reescalaArray(int[] ini,
                                  int width,
                                  int height,
                                  int new_width,
                                  int new_height)
Scales an Image with size (width, height) to a desired size (new_width, new_height). The color of a point(x,y) in an array holding a 2-dim image is accessed by c = scaledInt[x+width*y]

Parameters:
ini - an array, holding the image which will be rescaled
width - the width of the original image
height - the height of the original image
new_width - the new width of the scaled image
new_height - the new height of the scaled image
Returns:
the scaled image

blend

public static void blend(int[] raw,
                         int alphaValue,
                         int maskColor,
                         int dontmaskColor)
Makes a given image transparent with a given alphaValue (255..maximum Transparency)

Parameters:
maskColor - -
dontmaskColor - -
raw - is the image array
alphaValue - the intensity of transparency

blend

public static void blend(int[] raw,
                         int alphaValue)
Makes a given image transparent with a given alphaValue (255..maximum Transparency)

Parameters:
raw - is the image array
alphaValue - the intensity of transparency