org.apache.pivot.wtk
Class ColorChooserButton

java.lang.Object
  extended by org.apache.pivot.wtk.Component
      extended by org.apache.pivot.wtk.Button
          extended by org.apache.pivot.wtk.ColorChooserButton
All Implemented Interfaces:
ConstrainedVisual, Visual

public class ColorChooserButton
extends Button

A component that allows a user to select a color. The color chooser is hidden until the user pushes the button.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Button
Button.DataRenderer, Button.State
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Constructor Summary
ColorChooserButton()
           
ColorChooserButton(Object buttonData)
           
 
Method Summary
 void clear()
          If a bind key is set, clears the selected color.
 ListenerList<ColorChooserButtonListener> getColorChooserButtonListeners()
          Returns the color chooser button listener list.
 ListenerList<ColorChooserButtonSelectionListener> getColorChooserButtonSelectionListeners()
          Returns the color chooser button selection listener list.
 Color getSelectedColor()
          Returns the currently selected color.
 String getSelectedColorKey()
          Gets the data binding key that is set on this color chooser button.
 void load(Dictionary<String,?> context)
          Loads the selected color from the specified bind context using this color picker button's bind key, if one is set.
 void setSelectedColor(Color selectedColor)
          Sets the selected color.
 void setSelectedColor(String selectedColor)
          Sets the selected color to the color represented by the specified color string.
 void setSelectedColorKey(String selectedColorKey)
          Sets this color chooser button's data binding key.
 void setToggleButton(boolean toggleButton)
          Sets the button's toggle state.
 void store(Dictionary<String,?> context)
          Stores the selected color into the specified bind context using this color picker button's bind key, if one is set.
 
Methods inherited from class org.apache.pivot.wtk.Button
getAction, getButtonData, getButtonGroup, getButtonListeners, getButtonPressListeners, getButtonStateListeners, getDataRenderer, getSelectedKey, getState, getStateKey, isSelected, isToggleButton, isTriState, press, setAction, setAction, setButtonData, setButtonGroup, setDataRenderer, setEnabled, setSelected, setSelectedKey, setState, setState, setStateKey, setTriState
 
Methods inherited from class org.apache.pivot.wtk.Component
clearFocus, getAttributes, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getGraphics, getHeight, getLocation, getMaximumPreferredHeight, getMaximumPreferredWidth, getMenuHandler, getMinimumPreferredHeight, getMinimumPreferredWidth, getParent, getPreferredHeight, getPreferredHeight, getPreferredHeightLimits, getPreferredSize, getPreferredWidth, getPreferredWidth, getPreferredWidthLimits, getSize, getSkin, getStyles, getTooltipText, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWindow, getX, getY, installThemeSkin, invalidate, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, layout, load, mapPointFromAncestor, mapPointToAncestor, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, paint, reenterMouse, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttributes, setAutomationID, setCursor, setCursor, setDragSource, setDropTarget, setHeight, setLocation, setLocation, setMaximumPreferredHeight, setMaximumPreferredWidth, setMenuHandler, setMinimumPreferredHeight, setMinimumPreferredWidth, setParent, setPreferredHeight, setPreferredHeightLimits, setPreferredHeightLimits, setPreferredSize, setPreferredSize, setPreferredWidth, setPreferredWidthLimits, setPreferredWidthLimits, setSize, setSize, setSkin, setStyles, setStyles, setStyles, setTooltipText, setVisible, setWidth, setX, setY, store, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorChooserButton

public ColorChooserButton()

ColorChooserButton

public ColorChooserButton(Object buttonData)
Method Detail

setToggleButton

public void setToggleButton(boolean toggleButton)
Description copied from class: Button
Sets the button's toggle state.

Overrides:
setToggleButton in class Button
Throws:
UnsupportedOperationException - This method is not supported by ColorChooserButton.

getSelectedColor

public Color getSelectedColor()
Returns the currently selected color.

Returns:
The currently selected color, or null if nothing is selected.

setSelectedColor

public void setSelectedColor(Color selectedColor)
Sets the selected color.

Parameters:
selectedColor - The color to select, or null to clear the selection.

setSelectedColor

public final void setSelectedColor(String selectedColor)
Sets the selected color to the color represented by the specified color string.

Parameters:
selectedColor - A string representing a color

getSelectedColorKey

public String getSelectedColorKey()
Gets the data binding key that is set on this color chooser button.


setSelectedColorKey

public void setSelectedColorKey(String selectedColorKey)
Sets this color chooser button's data binding key.


load

public void load(Dictionary<String,?> context)
Loads the selected color from the specified bind context using this color picker button's bind key, if one is set.

Overrides:
load in class Button

store

public void store(Dictionary<String,?> context)
Stores the selected color into the specified bind context using this color picker button's bind key, if one is set.

Overrides:
store in class Button

clear

public void clear()
If a bind key is set, clears the selected color.

Overrides:
clear in class Button

getColorChooserButtonListeners

public ListenerList<ColorChooserButtonListener> getColorChooserButtonListeners()
Returns the color chooser button listener list.


getColorChooserButtonSelectionListeners

public ListenerList<ColorChooserButtonSelectionListener> getColorChooserButtonSelectionListeners()
Returns the color chooser button selection listener list.