|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
example.chooser.ColorChooser
public class ColorChooser
A Color chooser. This screen can be used to display and choose colors. The current color is always available via the getColor and getGrayScale methods. It can be set with setColor. A palette provides some reuse of colors, the current index in the palette can get set and retrieved. When the chooser is active the user may set the index in the palette, and change the red, green, and blue components. The application using the chooser must add commands to the chooser as appropriate to terminate selection and to change to other screens. The chooser adapts to the available screen size and font sizes.
Field Summary | |
---|---|
(package private) static int |
BORDER
|
Fields inherited from class javax.microedition.lcdui.Canvas |
---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
Constructor Summary | |
---|---|
ColorChooser(boolean isColor,
int numColors)
|
Method Summary | |
---|---|
int |
getBlueComponent()
Gets the blue component of the current color. |
int |
getColor()
Gets the current color. |
int |
getDelta()
Get the delta used to increment/decrement. |
int |
getGrayScale()
|
int |
getGreenComponent()
Gets the green component of the current color. |
int |
getPaletteIndex()
Get the current palette index. |
int |
getRadix()
Get the radix used to display numbers. |
int |
getRedComponent()
Gets the red component of the current color. |
protected void |
keyPressed(int key)
|
void |
keyRepeated(int key)
|
protected void |
paint(javax.microedition.lcdui.Graphics g)
|
void |
setColor(int RGB)
Sets the current color to the specified RGB values. |
void |
setColor(int red,
int green,
int blue)
Sets the current color to the specified RGB values. |
void |
setDelta(int delta)
Set the delta used to increment/decrement. |
void |
setGrayScale(int value)
Sets the current grayscale. |
boolean |
setPaletteIndex(int index)
Select which entry in the Palette to use for the current color. |
void |
setRadix(int rad)
Set the radix used to display numbers. |
protected void |
showNotify()
The canvas is being displayed. |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyReleased, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, sizeChanged |
Methods inherited from class javax.microedition.lcdui.Displayable |
---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int BORDER
Constructor Detail |
---|
public ColorChooser(boolean isColor, int numColors)
Method Detail |
---|
public boolean setPaletteIndex(int index)
index
- index into the palette; 0..10.public int getPaletteIndex()
public void setColor(int red, int green, int blue)
red
- The red component of the color being set in range 0-255.green
- The green component of the color being set in range 0-255.blue
- The blue component of the color being set in range 0-255.public void setColor(int RGB)
RGB
- The color being set.public int getColor()
setColor(int, int, int)
public int getRedComponent()
setColor(int, int, int)
public int getGreenComponent()
setColor(int, int, int)
public int getBlueComponent()
setColor(int, int, int)
public int getGrayScale()
public void setGrayScale(int value)
value
- - the value in range 0-255protected void showNotify()
showNotify
in class javax.microedition.lcdui.Canvas
protected void paint(javax.microedition.lcdui.Graphics g)
paint
in class javax.microedition.lcdui.Canvas
public void setRadix(int rad)
public int getRadix()
public void setDelta(int delta)
public int getDelta()
public void keyRepeated(int key)
keyRepeated
in class javax.microedition.lcdui.Canvas
protected void keyPressed(int key)
keyPressed
in class javax.microedition.lcdui.Canvas
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |