borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.control
java.lang.Object +----java.awt.Component +----java.awt.Container +----java.awt.Panel +----borland.jbcl.control.BevelPanel +----borland.jbcl.control.ColorChooserPanel
Variables Constructors Properties Methods Event Listeners
Implements MenuContainer, AdjustmentListener, ItemListener, KeyListener, ImageObserver, Serializable, EventListener
Allows graphical selection of color values. You get the selected color by calling the getColorValue method. This component is a panel that contains controls for specifying a color. This component is the same as the ColorChooserDialog component, but ColorChooserDialog is used in the UI Designer, whereas this component is designed to be added to your own custom dialog or frame.
The Standard Colors list, number fields, and scroll bars are all interlocked; changing the setting of any type of control automatically updates the settings of the other types of controls.
After dropping a ColorChooserPanel onto the Component Tree or UI Designer, you generally need to set the frame property to "this". Otherwise, the dialog will not appear.
Relationship of the JBCL color chooser classes:
public static final String CUSTOM_TAG = Res.getString(Res.CustomColorTag)Enables you to add an item to the Standard Colors list.
public ColorChooserPanel()Creates a new color chooser panel with no color selected. Uses GridBagLayout.
public ColorChooserPanel(java.awt.Color value)Creates a new color chooser panel with the specified color selected. Uses GridBagLayout.
Parameters:
public boolean isChanged()The changed property keeps track of whether the selected color is different than the color that was initially selected when the dialog was opened.
public Color getColorValue() public void setColorValue(java.awt.Color value)The colorValue property stores the value of the color. See Color.
public void setHsbMode(boolean hsbMode)The hsbMode property stores whether the color chooser dialog is in HSB mode. The property stores boolean true or false. If false, the dialog is in RGB mode. Labels the scrollbars "Hue, Saturation, Brightness" or "Red, Green, Blue", and makes their max value 100 (for HSB mode) or 255 (for RGB mode). Changes the displayed numerical color values between the equivalent HSB and RGB values.
public Dimension getPreferredSize()The PreferredSize property is the preferred size of the color chooser dialog box. The preferred size is used by layout managers to stretch out the scrollbars to a usable size.
protected void changeColor(java.awt.Color value)Calculates the new HSB and RGB values. Updates the number entry text fields with the new HSB and RGB values. Updates the positions of the scroll bar sliders. Changes the background color for the color sample.
Parameters:
protected void changeColor(java.awt.Color value, boolean suppressText, boolean suppressScroll)Calculates the new HSB and RGB values. Updates the number entry text fields with the new HSB and RGB values if requested. Updates the positions of the scroll bar sliders if requested. Changes the background color for the color sample.
Parameters:
protected void colorChanged(java.awt.Color newColor)Causes the changed property to be set to true. This property indicates whether a color different than the initial color has been selected. The initial color is the color that was selected upon opening the color chooser panel.
Parameters:
public static Color textToValue(java.lang.String text, boolean localized)Updates the RGB or HSB values automatically when a standard named color is selected in the Standard Colors list.
Parameters:
public static String valueToText(java.awt.Color c, boolean localized)Updates the Standard Colors list automatically when you change the RGB or HSB values in the Custom Color Settings group box to a combination. For example, if you manually enter Red = 255, Blue = 175, and Green = 175, the Standard Colors list will automatically show Pink as the selected item.
Parameters:
public synchronized void addComponentListener(java.awt.event.ComponentListener l) public synchronized void removeComponentListener(java.awt.event.ComponentListener l)
public synchronized void addContainerListener(java.awt.event.ContainerListener l) public void removeContainerListener(java.awt.event.ContainerListener l)
public synchronized void addFocusListener(java.awt.event.FocusListener l) public synchronized void removeFocusListener(java.awt.event.FocusListener l)
public synchronized void addKeyListener(java.awt.event.KeyListener l) public synchronized void removeKeyListener(java.awt.event.KeyListener l)
public synchronized void addMouseListener(java.awt.event.MouseListener l) public synchronized void removeMouseListener(java.awt.event.MouseListener l)
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener l) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener l)