Package muntjac :: Package addon :: Package colorpicker :: Module color_picker_grid :: Class ColorPickerGrid
[hide private]
[frames] | no frames]

Class ColorPickerGrid

source code

                          object --+                
                                   |                
                 util.IEventListener --+            
                                       |            
           terminal.paintable.IPaintable --+        
                                           |        
                              object --+   |        
                                       |   |        
  terminal.variable_owner.IVariableOwner --+        
                                           |        
                              object --+   |        
                                       |   |        
             terminal.sizeable.ISizeable --+        
                                           |        
                     ui.component.IComponent --+    
                                               |    
                                  object --+   |    
                                           |   |    
event.method_event_source.IMethodEventSource --+    
                                               |    
         ui.abstract_component.AbstractComponent --+
                                                   |
                                      object --+   |
                                               |   |
                   color_selector.IColorSelector --+
                                                   |
                                                  ColorPickerGrid

The Class ColorPickerGrid.


Authors:
John Ahlroos, Richard Lincoln
Instance Methods [hide private]
 
__init__(self, colors_or_rows=None, cols=None)
Instantiates a new color picker grid.
source code
 
setColorGrid(self, colors)
Sets the color grid.
source code
 
addListener(self, listener, iface=None)
Adds a color change listener
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Removes a color change listener
source code
 
removeCallback(self, callback, eventType=None) source code
 
getColor(self)
Gets the color.
source code
 
setColor(self, color)
Sets the color.
source code
 
setPosition(self, x, y)
Sets the position.
source code
 
getPosition(self)
Gets the position.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
changeVariables(self, source, variables)
Called when one or more variables handled by the implementing class are changed.
source code
 
fireColorChanged(self, color)
Notifies the listeners that a color change has occurred
source code

Inherited from ui.abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, attach, childRequestedRepaint, detach, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, focus, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, parseStringSize, registerCallback, registerListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidthUnits, withdrawCallback, withdrawListener

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CLIENT_WIDGET = None
hash(x)
  TYPE_MAPPING = 'com.vaadin.addon.colorpicker.ColorPickerGrid'

Inherited from ui.abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Instance Variables [hide private]
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, colors_or_rows=None, cols=None)
(Constructor)

source code 
Instantiates a new color picker grid.

@param colors_or_rows:
           the colors or the rows
@param columns
           the columns

Overrides: object.__init__

setColorGrid(self, colors)

source code 
Sets the color grid.

@param colors
           the new color grid

addListener(self, listener, iface=None)

source code 

Adds a color change listener

Parameters:
  • listener - The color change listener
Raises:
  • ValueError - unless method has a match in object
Overrides: event.method_event_source.IMethodEventSource.addListener

addCallback(self, callback, eventType=None, *args)

source code 
Overrides: terminal.paintable.IPaintable.addCallback

removeListener(self, listener, iface=None)

source code 

Removes a color change listener

Parameters:
  • listener - The listener
Overrides: event.method_event_source.IMethodEventSource.removeListener

removeCallback(self, callback, eventType=None)

source code 
Overrides: terminal.paintable.IPaintable.removeCallback

getColor(self)

source code 

Gets the color.

Returns:
the color
Overrides: color_selector.IColorSelector.getColor
(inherited documentation)

setColor(self, color)

source code 

Sets the color.

Parameters:
  • color - the new color
Overrides: color_selector.IColorSelector.setColor
(inherited documentation)

setPosition(self, x, y)

source code 

Sets the position.

Parameters:
  • x - the x-coordinate
  • y - the y-coordinate

getPosition(self)

source code 

Gets the position.

Returns:
the position

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: ui.abstract_component.AbstractComponent.paintContent
(inherited documentation)

changeVariables(self, source, variables)

source code 

Called when one or more variables handled by the implementing class are changed.

Parameters:
  • source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
  • variables - the Mapping from variable names to new variable values.
Overrides: terminal.variable_owner.IVariableOwner.changeVariables
(inherited documentation)

fireColorChanged(self, color)

source code 

Notifies the listeners that a color change has occurred

Parameters:
  • color - The color which it changed to