public class ColorPickerGrid extends AbstractComponent implements ColorSelector
Component.ErrorEvent, Component.Event, Component.Focusable, Component.ListenerClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListenerSizeable.UnitDESIGN_ATTR_PLAIN_TEXTSIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS| Constructor and Description |
|---|
ColorPickerGrid()
Instantiates a new color picker grid.
|
ColorPickerGrid(Color[][] colors)
Instantiates a new color picker grid.
|
ColorPickerGrid(int rows,
int columns)
Instantiates a new color picker grid.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColorChangeListener(ColorChangeListener listener)
Adds a color change listener
|
void |
fireColorChanged(Color color)
Notifies the listeners that a color change has occurred
|
Color |
getColor()
Gets the color.
|
int[] |
getPosition()
Gets the position.
|
protected ColorPickerGridState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
void |
removeColorChangeListener(ColorChangeListener listener)
Removes a color change listener
|
void |
setColor(Color color)
Sets the color.
|
void |
setColorGrid(Color[][] colors)
Sets the color grid.
|
void |
setPosition(int x,
int y)
Sets the position.
|
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, writeDesignaddAttachListener, 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, setResourceclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdpublic ColorPickerGrid()
public ColorPickerGrid(int rows,
int columns)
rows - the rowscolumns - the columnspublic ColorPickerGrid(Color[][] colors)
colors - the colorspublic void setColorGrid(Color[][] colors)
colors - the new color gridpublic void addColorChangeListener(ColorChangeListener listener)
addColorChangeListener in interface HasColorChangeListenerlistener - The color change listenerpublic Color getColor()
ColorSelectorgetColor in interface ColorSelectorpublic void removeColorChangeListener(ColorChangeListener listener)
removeColorChangeListener in interface HasColorChangeListenerlistener - The listenerpublic void setColor(Color color)
ColorSelectorsetColor in interface ColorSelectorcolor - the new colorpublic void setPosition(int x,
int y)
x - the xy - the ypublic int[] getPosition()
public void fireColorChanged(Color color)
color - The color which it changed toprotected ColorPickerGridState getState()
AbstractComponentgetState in class AbstractComponentCopyright © 2023 Vaadin Ltd. All rights reserved.