org.netbeans.microedition.lcdui.laf
Class ColorSchema

java.lang.Object
  extended by org.netbeans.microedition.lcdui.laf.ColorSchema
Direct Known Subclasses:
DefaultColorSchema, SystemColorSchema, UserColorSchema

public abstract class ColorSchema
extends java.lang.Object

ColorSchema holds information about colors and background images to be used when drawing custom components based on Canvas and CustomItem, which support this ColorSchema mechanism.


Constructor Summary
ColorSchema()
           
 
Method Summary
abstract  javax.microedition.lcdui.Image getBackgroundImage()
          Returns image which should be used as a background.
abstract  int getBackgroundImageAnchorPoint()
          Gets anchor of the background image.
abstract  int getColor(int aColorSpecifier)
          Gets color based on color specifier.
abstract  boolean isBackgroundImageTiled()
          If true, background image should be drawn in tiled.
abstract  boolean isBackgroundTransparent()
          If true the background is transparent.
 void paintBackground(javax.microedition.lcdui.Graphics g, boolean includeImage)
          Utility method for painting background do given Graphics object (using current clipping area).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorSchema

public ColorSchema()
Method Detail

getColor

public abstract int getColor(int aColorSpecifier)
Gets color based on color specifier. The color specifer corresponds to values listed in Display class.

Parameters:
aColorSpecifier - - color specifier from Display.COLOR* constnants
Returns:
color to be used for given specifier
See Also:
Display

getBackgroundImage

public abstract javax.microedition.lcdui.Image getBackgroundImage()
Returns image which should be used as a background.

Returns:
Image to be drawn. If null is returned, no image will be drawn on background

getBackgroundImageAnchorPoint

public abstract int getBackgroundImageAnchorPoint()
Gets anchor of the background image. See Graphics class for details

Returns:
anchor where the image should be drawn. Might retun 0 if no image is used or if the image is going to be tiled.
See Also:
Graphics

isBackgroundImageTiled

public abstract boolean isBackgroundImageTiled()
If true, background image should be drawn in tiled. Usefull when using simple patterns to draw background.

Returns:
true when the background image should be tiled, false if just one image should be drawn based on suggestion of position by getBackgroundImageAnchorPoint() method

isBackgroundTransparent

public abstract boolean isBackgroundTransparent()
If true the background is transparent. This is helpful for some devices, for example when drawing custom items on Nokia Seris 40 feature pack 1, the background does not have to be erased and the custom item looks much better when transparent

Returns:
true when the background should be transparent, false otherwise

paintBackground

public void paintBackground(javax.microedition.lcdui.Graphics g,
                            boolean includeImage)
Utility method for painting background do given Graphics object (using current clipping area). This method is able to paint background, including image and including tiling the image.

Parameters:
g - - Graphics to be used to draw background.
includeImage - - when true, the implementation also draws a background image if specified, when false, the background image is ignored.