|
ColorChartThe ColorChart can be used as a simple color chart
in the selection of colors for a NetCharts chart. As the mouse moves over each box in the color grid, the name or value
of the color is displayed in a popup label. If you click the mouse inside
a cell, the entire applet will be drawn with that color for as long
as the mouse button is depressed. This allows users to see how the color
will look when it is used to fill a large area.
ColorTable<param name=ColorTable value="color1, color2, ..."> The ColorTable applet parameter can be used to define the list of colors to be displayed in the color chart. It accepts a comma delimited list of NetCharts color values (in the form "xRRGGBB") or color names (e.g. "white").
NumColumns<param name=NumColumns value=number> The NumColumns applet parameter can be used to define the total number of columns desired. The number of rows will be automatically computed to show all colors.
Applet ExampleThe following applet tag defines a small color chart:
<applet name=colorchart code=NFColorChartApp width=400 height=400> <param name=NumColumns value=4> <param name=ColorTable value=' white, black, red, green, xEFEFEF, x808080, purple, orange '> </applet>
Embedded Applet SupportThe Color Chart applet also includes functionality for developers that wish to embed the color applet within their applications. The addObserver() method allows them to be notified when an item has been selected. Parameters like "showFillWhenSelected" and "numColumns" are public, allowing for easy modification. Popup labels and regions can also be defined. See NFColorChartApp for more details.
Embedded Examplepublic class AColorApp extends Applet { NFColorChartApp colorapp; public void init() { colorapp = new NFColorChartApp(); colorapp.numColumns = 4; colorapp.setColorTable ("red, white, blue, green"); colorapp.init((Component)this); setLayout(new BorderLayout()); add("Center", colorapp); ) )
Known BugsWhen running under Netscape3.x/Win95, with only 256 colors set, this applet may not always display the proper color in the full screen when a color cell is selected. This problem does not exist for any other JVM or browser on Windows 95 or 98. |
|