com.vaadin.ui.components.colorpicker
Class ColorPickerGrid

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.components.colorpicker.ColorPickerGrid
All Implemented Interfaces:
MethodEventSource, ClientConnector, Sizeable, com.vaadin.shared.Connector, Component, ColorSelector, HasColorChangeListener, java.io.Serializable

public class ColorPickerGrid
extends AbstractComponent
implements ColorSelector

A component that represents a color selection grid within a color picker.

Since:
7.0.0
See Also:
Serialized Form

Nested Class Summary
 
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.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
 
Field Summary
 
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
ColorPickerGrid()
          Instantiates a new color picker grid.
ColorPickerGrid(com.vaadin.shared.ui.colorpicker.Color[][] colors)
          Instantiates a new color picker grid.
ColorPickerGrid(int rows, int columns)
          Instantiates a new color picker grid.
 
Method Summary
 void addColorChangeListener(ColorChangeListener listener)
          Adds a color change listener
 void fireColorChanged(com.vaadin.shared.ui.colorpicker.Color color)
          Notifies the listeners that a color change has occurred
 com.vaadin.shared.ui.colorpicker.Color getColor()
          Gets the color.
 int[] getPosition()
          Gets the position.
protected  com.vaadin.shared.ui.colorpicker.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(com.vaadin.shared.ui.colorpicker.Color color)
          Sets the color.
 void setColorGrid(com.vaadin.shared.ui.colorpicker.Color[][] colors)
          Sets the color grid.
 void setPosition(int x, int y)
          Sets the position.
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined
 
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.ui.Component
getUI
 
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

ColorPickerGrid

public ColorPickerGrid()
Instantiates a new color picker grid.


ColorPickerGrid

public ColorPickerGrid(int rows,
                       int columns)
Instantiates a new color picker grid.

Parameters:
rows - the rows
columns - the columns

ColorPickerGrid

public ColorPickerGrid(com.vaadin.shared.ui.colorpicker.Color[][] colors)
Instantiates a new color picker grid.

Parameters:
colors - the colors
Method Detail

setColorGrid

public void setColorGrid(com.vaadin.shared.ui.colorpicker.Color[][] colors)
Sets the color grid.

Parameters:
colors - the new color grid

addColorChangeListener

public void addColorChangeListener(ColorChangeListener listener)
Adds a color change listener

Specified by:
addColorChangeListener in interface HasColorChangeListener
Parameters:
listener - The color change listener

getColor

public com.vaadin.shared.ui.colorpicker.Color getColor()
Description copied from interface: ColorSelector
Gets the color.

Specified by:
getColor in interface ColorSelector
Returns:
the color

removeColorChangeListener

public void removeColorChangeListener(ColorChangeListener listener)
Removes a color change listener

Specified by:
removeColorChangeListener in interface HasColorChangeListener
Parameters:
listener - The listener

setColor

public void setColor(com.vaadin.shared.ui.colorpicker.Color color)
Description copied from interface: ColorSelector
Sets the color.

Specified by:
setColor in interface ColorSelector
Parameters:
color - the new color

setPosition

public void setPosition(int x,
                        int y)
Sets the position.

Parameters:
x - the x
y - the y

getPosition

public int[] getPosition()
Gets the position.

Returns:
the position

fireColorChanged

public void fireColorChanged(com.vaadin.shared.ui.colorpicker.Color color)
Notifies the listeners that a color change has occurred

Parameters:
color - The color which it changed to

getState

protected com.vaadin.shared.ui.colorpicker.ColorPickerGridState getState()
Description copied from class: AbstractComponent
Returns 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:
getState in class AbstractComponent
Returns:
updated component shared state


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.