m3g06
Class Image2DTypesSample

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Screen
          extended by javax.microedition.lcdui.Form
              extended by m3g06.Image2DTypesSample
All Implemented Interfaces:
Sample

public class Image2DTypesSample
extends javax.microedition.lcdui.Form
implements Sample

Loads PNG images with different color types and transparency combinations by using Loader.load() and displays the resulting Image2D pixel format.

Author:
Claus Hoefele

Field Summary
private static java.lang.String IMAGE_NAME_BASE
          Prefix for image names.
private static java.lang.String IMAGE_NAME_END
          Postfix for image names.
private static java.util.Hashtable IMAGE2D_TYPES
          Maps Image2D types to a string representation.
private static java.lang.String[][] PNG_TYPES
          List of PNG test images and their string representation.
 
Constructor Summary
Image2DTypesSample()
          Initializes sample and loads images.
 
Method Summary
 void destroy()
          Destroys the sample.
 void init()
          Initializes the sample.
private  java.lang.String testImage(java.lang.String imageName)
          Fetches an image with Loader.load() and returns the Image2D type as a string representation.
 
Methods inherited from class javax.microedition.lcdui.Form
append, append, append, delete, deleteAll, get, getHeight, getWidth, insert, set, setItemStateListener, size
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getTicker, getTitle, isShown, removeCommand, setCommandListener, setTicker, setTitle, sizeChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_NAME_BASE

private static final java.lang.String IMAGE_NAME_BASE
Prefix for image names.

See Also:
Constant Field Values

PNG_TYPES

private static final java.lang.String[][] PNG_TYPES
List of PNG test images and their string representation.


IMAGE_NAME_END

private static final java.lang.String IMAGE_NAME_END
Postfix for image names.

See Also:
Constant Field Values

IMAGE2D_TYPES

private static final java.util.Hashtable IMAGE2D_TYPES
Maps Image2D types to a string representation.

Constructor Detail

Image2DTypesSample

public Image2DTypesSample()
Initializes sample and loads images.

Method Detail

init

public void init()
Initializes the sample.

Specified by:
init in interface Sample

testImage

private java.lang.String testImage(java.lang.String imageName)
Fetches an image with Loader.load() and returns the Image2D type as a string representation.

Parameters:
imageName - name and path of the image to load.
Returns:
Image2D type as string.

destroy

public void destroy()
Destroys the sample.

Specified by:
destroy in interface Sample