org.apache.pivot.wtk
Class ColorChooser

java.lang.Object
  extended by org.apache.pivot.wtk.Component
      extended by org.apache.pivot.wtk.Container
          extended by org.apache.pivot.wtk.ColorChooser
All Implemented Interfaces:
Iterable<Component>, Sequence<Component>, ConstrainedVisual, Visual

public class ColorChooser
extends Container

Component that allows the user to select a color.


Nested Class Summary
static interface ColorChooser.SelectedColorBindMapping
          Translates between color and context data during data binding.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container
Container.EDT_Checker
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
Sequence.Tree<T>
 
Constructor Summary
ColorChooser()
           
 
Method Summary
 void clear()
          If a bind key is set, clears the selected color.
 ListenerList<ColorChooserBindingListener> getColorChooserBindingListeners()
          Returns the color chooser binding listener list.
 ListenerList<ColorChooserSelectionListener> getColorChooserSelectionListeners()
          Returns the color chooser selection listener list.
 Color getSelectedColor()
          Gets the currently selected color, or null if no color is selected.
 ColorChooser.SelectedColorBindMapping getSelectedColorBindMapping()
           
 BindType getSelectedColorBindType()
           
 String getSelectedColorKey()
          Gets the data binding key that is set on this color chooser.
 void load(Object context)
          Loads the selected color from the specified bind context using this color chooser's bind key, if one is set.
 void setSelectedColor(Color selectedColor)
          Sets the selected color.
 void setSelectedColor(String selectedColor)
          Sets the selected color.
 void setSelectedColorBindMapping(ColorChooser.SelectedColorBindMapping selectedColorBindMapping)
           
 void setSelectedColorBindType(BindType selectedColorBindType)
           
 void setSelectedColorKey(String selectedColorKey)
          Sets this color chooser's data binding key.
 void store(Object context)
          Stores the selected color into the specified bind context using this color chooser's bind key, if one is set.
 
Methods inherited from class org.apache.pivot.wtk.Container
add, assertEventDispatchThread, assertEventDispatchThread, containsFocus, descendantAdded, descendantGainedFocus, descendantLostFocus, descendantRemoved, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getDescendantAt, getFocusTraversalPolicy, getGraphics, getLength, getNamedComponent, indexOf, insert, invalidate, isAncestor, isDoubleBuffered, iterator, layout, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, remove, removeAll, repaint, requestFocus, setDoubleBuffered, setEventDispatchThreadChecker, setFocusTraversalPolicy, setParent, setVisible, transferFocus, update
 
Methods inherited from class org.apache.pivot.wtk.Component
clearFocus, contains, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getSize, getSkin, getStyles, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseOver, reenterMouse, repaint, repaint, repaint, repaint, repaint, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setCursor, setDragSource, setDropTarget, setEnabled, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setSkin, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorChooser

public ColorChooser()
Method Detail

getSelectedColor

public Color getSelectedColor()
Gets the currently selected color, or null if no color 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 void setSelectedColor(String selectedColor)
Sets the selected color.

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

getSelectedColorKey

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


setSelectedColorKey

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


getSelectedColorBindType

public BindType getSelectedColorBindType()

setSelectedColorBindType

public void setSelectedColorBindType(BindType selectedColorBindType)

getSelectedColorBindMapping

public ColorChooser.SelectedColorBindMapping getSelectedColorBindMapping()

setSelectedColorBindMapping

public void setSelectedColorBindMapping(ColorChooser.SelectedColorBindMapping selectedColorBindMapping)

load

public void load(Object context)
Loads the selected color from the specified bind context using this color chooser's bind key, if one is set.

Overrides:
load in class Container

store

public void store(Object context)
Stores the selected color into the specified bind context using this color chooser's bind key, if one is set.

Overrides:
store in class Container

clear

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

Overrides:
clear in class Container

getColorChooserSelectionListeners

public ListenerList<ColorChooserSelectionListener> getColorChooserSelectionListeners()
Returns the color chooser selection listener list.


getColorChooserBindingListeners

public ListenerList<ColorChooserBindingListener> getColorChooserBindingListeners()
Returns the color chooser binding listener list.