Skip to content

Updated color chooser in JHotDraw, Part II

by werner on August 4th, 2010

In an earlier post, I discussed the design of ┬áthe “Swatches” color chooser of JHotDraw.

For JHotDraw 7.5.1, I have implemented additional panels for the color chooser. We have got now also a color wheel, and a set of color sliders.

The color chooser is implemented as an UI delegate of the PaletteLookAndFeel. The panels are located in the colorchooser sub-package. The PaletteLookAndFeel is a special Swing look and feel, which can be used to selectively override the look of individual GUI components. I am using it in the JHotDraw SVG sample application for the toolbar.

The color wheel and the gradients in the color sliders are done using ImageProducer classes, which generate new pixels each time a slider has been moved. Reusable classes dealing with colors are located in the color package.

Comments are closed.