Class ColorPickerGradient
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.ui.components.colorpicker.ColorPickerGradient
-
- All Implemented Interfaces:
ContextClickEvent.ContextClickNotifier,MethodEventSource,ClientConnector,Sizeable,Connector,Component,ColorSelector,HasColorChangeListener,Serializable
public class ColorPickerGradient extends AbstractComponent implements ColorSelector
A component that represents a color gradient within a color picker.- Since:
- 7.0.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Constructor Description ColorPickerGradient(String id, AbstractColorPicker.Coordinates2Color converter)Instantiates a new color picker gradient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColorChangeListener(ColorChangeListener listener)Adds aColorChangeListenerto the component.voidfireColorChanged(Color color)Notifies the listeners that the color has changedColorgetColor()Gets the color.protected ColorPickerGradientStategetState()Returns the shared state bean with information to be sent from the server to the client.voidremoveColorChangeListener(ColorChangeListener listener)Removes aColorChangeListenerfrom the component.voidsetBackgroundColor(Color color)Sets the background color.voidsetColor(Color c)Sets the color.-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined, writeDesign
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
-
-
-
Constructor Detail
-
ColorPickerGradient
public ColorPickerGradient(String id, AbstractColorPicker.Coordinates2Color converter)
Instantiates a new color picker gradient.- Parameters:
id- the idconverter- the converter
-
-
Method Detail
-
setColor
public void setColor(Color c)
Description copied from interface:ColorSelectorSets the color.- Specified by:
setColorin interfaceColorSelector- Parameters:
c- the new color
-
addColorChangeListener
public void addColorChangeListener(ColorChangeListener listener)
Description copied from interface:HasColorChangeListenerAdds aColorChangeListenerto the component.- Specified by:
addColorChangeListenerin interfaceHasColorChangeListener
-
removeColorChangeListener
public void removeColorChangeListener(ColorChangeListener listener)
Description copied from interface:HasColorChangeListenerRemoves aColorChangeListenerfrom the component.- Specified by:
removeColorChangeListenerin interfaceHasColorChangeListener
-
setBackgroundColor
public void setBackgroundColor(Color color)
Sets the background color.- Parameters:
color- the new background color
-
getColor
public Color getColor()
Description copied from interface:ColorSelectorGets the color.- Specified by:
getColorin interfaceColorSelector- Returns:
- the color
-
fireColorChanged
public void fireColorChanged(Color color)
Notifies the listeners that the color has changed- Parameters:
color- The color which it changed to
-
getState
protected ColorPickerGradientState getState()
Description copied from class:AbstractComponentReturns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().- Overrides:
getStatein classAbstractComponent- Returns:
- updated component shared state
-
-