Package org.apache.pivot.wtk
Class ColorChooserButton
- java.lang.Object
-
- org.apache.pivot.wtk.Component
-
- org.apache.pivot.wtk.Button
-
- 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 Modifier and Type Class Description static interfaceColorChooserButton.SkinColorChooserButton skin interface.-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Button
Button.ButtonDataBindMapping, Button.DataRenderer, Button.SelectedBindMapping, Button.State, Button.StateBindMapping
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
-
-
Constructor Summary
Constructors Constructor Description ColorChooserButton()ColorChooserButton(java.lang.Object buttonData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()If a bind key is set, clears the selected color.ListenerList<ColorChooserButtonBindingListener>getColorChooserButtonBindingListeners()ListenerList<ColorChooserButtonSelectionListener>getColorChooserButtonSelectionListeners()WindowgetListPopup()java.awt.ColorgetSelectedColor()ColorChooser.SelectedColorBindMappinggetSelectedColorBindMapping()BindTypegetSelectedColorBindType()java.lang.StringgetSelectedColorKey()voidload(java.lang.Object context)Loads the selected color from the specified bind context using this color picker button's bind key, if one is set.voidsetSelectedColor(java.awt.Color selectedColor)Sets the selected color.voidsetSelectedColor(java.lang.String selectedColor)Sets the selected color.voidsetSelectedColorBindMapping(ColorChooser.SelectedColorBindMapping bindMapping)voidsetSelectedColorBindType(BindType selectedColorBindType)voidsetSelectedColorKey(java.lang.String selectedColorKey)Sets this color chooser button's data binding key.protected voidsetSkin(Skin skin)Sets the skin, replacing any previous skin.voidsetToggleButton(boolean toggleButton)Sets the button's toggle state.voidstore(java.lang.Object 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, getButtonBindingListeners, getButtonData, getButtonDataBindMapping, getButtonDataBindType, getButtonDataKey, getButtonGroup, getButtonListeners, getButtonPressListeners, getButtonStateListeners, getDataRenderer, getQueuedActionDelay, getSelectedBindMapping, getSelectedBindType, getSelectedKey, getState, getStateBindMapping, getStateBindType, getStateKey, isQueuedAction, isSelected, isToggleButton, isTriState, press, setAction, setAction, setButtonData, setButtonDataBindMapping, setButtonDataBindType, setButtonDataKey, setButtonGroup, setDataRenderer, setEnabled, setQueuedAction, setQueuedActionDelay, setSelected, setSelectedBindMapping, setSelectedBindType, setSelectedKey, setState, setStateBindMapping, setStateBindType, setStateKey, setTriState
-
Methods inherited from class org.apache.pivot.wtk.Component
checkSkin, clearFocus, contains, copyStyle, copyStyle, 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, getGraphics, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getScreenBounds, getSize, getSkin, getStyle, getStyle, getStyleBoolean, getStyleBoolean, getStyleColor, getStyleColor, getStyleFont, getStyleFont, getStyleInt, getStyleInt, getStyles, getTextInputMethodListener, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, invalidate, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, layout, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, offsetToScreen, paint, putStyle, putStyle, reenterMouse, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setAutomationID, setCursor, setDragSource, setDropTarget, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setParent, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setVisible, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
-
-
-
-
Method Detail
-
setSkin
protected void setSkin(Skin skin)
Description copied from class:ComponentSets the skin, replacing any previous skin.
-
getListPopup
public Window getListPopup()
- Returns:
- The popup window associated with this component's skin.
-
setToggleButton
@UnsupportedOperation public void setToggleButton(boolean toggleButton)
Description copied from class:ButtonSets the button's toggle state.- Overrides:
setToggleButtonin classButton- Parameters:
toggleButton- Whether or not this should be a toggle button.- Throws:
java.lang.UnsupportedOperationException- This method is not supported by ColorChooserButton.
-
getSelectedColor
public java.awt.Color getSelectedColor()
- Returns:
- The currently selected color, or
nullif nothing is selected.
-
setSelectedColor
public void setSelectedColor(java.awt.Color selectedColor)
Sets the selected color.- Parameters:
selectedColor- The color to select, ornullto clear the selection.
-
setSelectedColor
public final void setSelectedColor(java.lang.String selectedColor)
Sets the selected color.- Parameters:
selectedColor- A string representing a color.- Throws:
java.lang.IllegalArgumentException- if the string isnull.
-
getSelectedColorKey
public java.lang.String getSelectedColorKey()
- Returns:
- The data binding key that is set on this color chooser button.
-
setSelectedColorKey
public void setSelectedColorKey(java.lang.String selectedColorKey)
Sets this color chooser button's data binding key.- Parameters:
selectedColorKey- The binding key for the selected color.
-
getSelectedColorBindType
public BindType getSelectedColorBindType()
-
setSelectedColorBindType
public void setSelectedColorBindType(BindType selectedColorBindType)
-
getSelectedColorBindMapping
public ColorChooser.SelectedColorBindMapping getSelectedColorBindMapping()
-
setSelectedColorBindMapping
public void setSelectedColorBindMapping(ColorChooser.SelectedColorBindMapping bindMapping)
-
load
public void load(java.lang.Object context)
Loads the selected color from the specified bind context using this color picker button's bind key, if one is set.
-
store
public void store(java.lang.Object context)
Stores the selected color into the specified bind context using this color picker button's bind key, if one is set.
-
clear
public void clear()
If a bind key is set, clears the selected color.
-
getColorChooserButtonSelectionListeners
public ListenerList<ColorChooserButtonSelectionListener> getColorChooserButtonSelectionListeners()
- Returns:
- The color chooser button selection listener list.
-
getColorChooserButtonBindingListeners
public ListenerList<ColorChooserButtonBindingListener> getColorChooserButtonBindingListeners()
- Returns:
- The color chooser button binding listener list.
-
-