org.inclou.Palette
Class RGBform

java.lang.Object
  extended byjavax.microedition.lcdui.Displayable
      extended byjavax.microedition.lcdui.Screen
          extended byjavax.microedition.lcdui.Form
              extended byorg.inclou.Palette.RGBform
All Implemented Interfaces:
CommandListener

public class RGBform
extends Form
implements CommandListener

This is a Form subclass which prompts user to select a color by introducing manually the R, G and B values in decimal format (they must be between 0 and 255). It communicates with a main application through the ChoserInterface interface. It also allows you to preselect a color.

Version:
Version 1.0 of package org.inclou.Palette
This package is MIDP 1.0 compliant.
This package has been compiled under 1.4.2 JDK.
Author:
Joel Samper. This code is published in www.inclou.org/freeware where you will find more php/java libraries. Please refer to this web for use conditions and other documentation.
See Also:
MIDmanualSelector, ChoserInterface

Constructor Summary
RGBform(ChoserInterface ch, Display d)
          Creates a new instance of RGBform
 
Method Summary
 void commandAction(Command c, Displayable d)
           
 void setSelected(int c)
          It sets specific RGB values in TextFields.
 void setSelected(int R, int G, int B)
          It sets specific RGB values in TextFields.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RGBform

public RGBform(ChoserInterface ch,
               Display d)
Creates a new instance of RGBform

Parameters:
ch - An application implementing ChoserInterface interface for requesting action after selection is made.
d - Display object of this MIDlet appliaction (needed for displaying Alerts).
Method Detail

setSelected

public void setSelected(int c)
It sets specific RGB values in TextFields. Generally, an application might wish to set specific RGB values in this RGB selector before this Form is showed.

Parameters:
c - Desired color to be set, in RGB format. Filtered like currentcolor&0xFFFFFF so left bits are ignored. If it is less than 0 no action is performed.

setSelected

public void setSelected(int R,
                        int G,
                        int B)
It sets specific RGB values in TextFields. Generally, an application might wish to set specific RGB values in this RGB selector before this Form is showed. If R, G or B is less than 0 nothing is done.

Parameters:
R - Desired R component color to be set. If it is out of boundaries, R value will not be set.
G - Desired G component color to be set. If it is out of boundaries, G value will not be set.
B - Desired B component color to be set. If it is out of boundaries, B value will not be set.

commandAction

public void commandAction(Command c,
                          Displayable d)
Specified by:
commandAction in interface CommandListener