Color KVM
The ColorKVM is our latest development project. We ported SUN's KVM
sources to PalmOS SDK 3.5 and added Color and Grayscale support.
Additionaly we use JavaCodeCompact to ROMize the kAWT directly to the
KVM. This feature reduces loading times of kAWT applications by factor
10. For example, loading the kAWT Sample running on a non ROMized KVM
takes up to 40 seconds loading time. ROMizing the kAWT classes
reduces these loading time to 4-5 secs. Furthermore we modified the
KVMuil, too. In KVMutil you have the possibility to force the ColorKVM
to use only one bit colordepth, and to get an overview about the
ROMized kAWT classes.
Using Color with kAWT
The simpliest way to use colors in the ColorKVM is to use the Graphics
method setColor(Color c) to set the actual color for drawing e.g. a
line. For this we added the standard color constants to
java.awt.Color.
An example on how to use color in the ColorKVM shows the new Color Tab
in the KawtSample. Now for all should be clear why there is a Color
Tab in the latest KawtSample, and why there are many new color
constants in java.awt.Color :-)
Using color with the com.sun.kjava classes
To support color in the KVM we not have added new native methods in
the KVM. We modified the drawing routines for lines, text and
rectangles. For colored or grayscale drawing, set the lowest byte of
the paint mode to 5, the highest byte to the red value, the second
highest byte to the green value, and the second lowest byte to the
blue value. The corresponding formula is:
(red << 24) + (green << 16) + (blue << 8) + 5
Example for drawing a colored line:
int red = 255;
int green = 0;
int blue = 0;
int mode = (red << 24) + (green << 16) + (blue << 8) + 5;
Graphics g = getGraphics ();
g.(drawLine(0, 0, 100, 100, mode);
Here is a small sample application which shows how to use the new color feature without kAWT:
Download the ColorKVM
Download the ColorKVM binaries...