Package muntjac :: Package addon :: Package weelayout :: Module wee_layout :: Class WeeLayout
[hide private]
[frames] | no frames]

Class WeeLayout

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 --+               |        
                                         |               |        
                       util.IEventListener --+           |        
                                             |           |        
                 terminal.paintable.IPaintable --+       |        
                                                 |       |        
                                    object --+   |       |        
                                             |   |       |        
        terminal.variable_owner.IVariableOwner --+       |        
                                                 |       |        
                                    object --+   |       |        
                                             |   |       |        
                   terminal.sizeable.ISizeable --+       |        
                                                 |       |        
                           ui.component.IComponent --+   |        
                                                     |   |        
            ui.component_container.IComponentContainer --+        
                                                         |        
ui.abstract_component_container.AbstractComponentContainer --+    
                                                             |    
                                object --+                   |    
                                         |                   |    
                       util.IEventListener --+               |    
                                             |               |    
                 terminal.paintable.IPaintable --+           |    
                                                 |           |    
                                    object --+   |           |    
                                             |   |           |    
        terminal.variable_owner.IVariableOwner --+           |    
                                                 |           |    
                                    object --+   |           |    
                                             |   |           |    
                   terminal.sizeable.ISizeable --+           |    
                                                 |           |    
                           ui.component.IComponent --+       |    
                                                     |       |    
            ui.component_container.IComponentContainer --+   |    
                                                         |   |    
                                         ui.layout.ILayout --+    
                                                             |    
                                                object --+   |    
                                                         |   |    
                                  ui.layout.IMarginHandler --+    
                                                             |    
                             ui.abstract_layout.AbstractLayout --+
                                                                 |
                                                    object --+   |
                                                             |   |
                      event.layout_events.ILayoutClickNotifier --+
                                                                 |
                                                                WeeLayout

Server side component for the VWeeLayout widget.

Instance Methods [hide private]
 
__init__(self, direction)
Create a new layout.
source code
 
addComponent(self, *args)
Add a component into this container.
source code
 
removeComponent(self, c)
Removes the component from this container.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
getComponentIterator(self)
Gets an iterator to the collection of contained components.
source code
 
replaceComponent(self, oldComponent, newComponent)
Replaces the component in the container with another one without changing position.
source code
 
setComponentAlignment(self, childComponent, alignment)
Set the alignment of component in this layout.
source code
 
getComponentAlignment(self, childComponent) source code
 
getComponentIndex(self, component)
Returns the index of the given component.
source code
 
getComponent(self, index)
Returns the component at the given position.
source code
 
size(self)
Returns the number of components in the layout.
source code
 
setClipping(self, clip)
Set the clipping value for this layout.
source code
 
setSmartRelativeSizes(self, smartRelatives)
When the layout size is undefined, relative sizes are calculated as zeros.
source code
 
addListener(self, listener, iface=None)
Listens the component attach/detach events.
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Stops the listening component attach/detach events.
source code
 
removeCallback(self, callback, eventType=None) source code

Inherited from ui.abstract_layout.AbstractLayout: changeVariables, fireClick, getMargin, setMargin

Inherited from ui.abstract_component_container.AbstractComponentContainer: attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, getInvalidSizedChildren, moveComponentsFrom, removeAllComponents, repaintChangedChildTrees, repaintChildTrees, requestRepaintAll, setEnabled, setHeight, setWidth

Inherited from ui.abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, childRequestedRepaint, 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, setErrorHandler, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, 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 = 'org.vaadin.weelayout.WeeLayout'
  _CLICK_EVENT = 'layout_click'

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, direction)
(Constructor)

source code 

Create a new layout. The direction of the child components must be specified. The direction can only be set once.

Parameters:
  • direction - The direction in which the child components will flow, either Direction.VERTICAL or Direction .HORIZONTAL
Overrides: object.__init__

addComponent(self, *args)

source code 

Add a component into this container. The component is added after the previous component or into indexed position in this container.

Parameters:
  • args - tuple of the form:
    • (c)
      • the component to be added.
    • (c, alignment)
      • the component to be added.
      • the alignment for the component.
    • (c, width, height, alignment)
      • the component to be added.
      • set the width of the component. Use <code>null</code> to leave untouched.
      • set the height of the component. Use <code>null</code> to leave untouched.
      • the alignment for the component.
    • (c, index)
      • the component to be added.
      • the Index of the component position. The components currently in and after the position are shifted forwards.
    • (c, index, alignment)
      • the component to be added.
      • the Index of the component position. The components currently in and after the position are shifted forwards.
      • the alignment for the component.
Overrides: ui.component_container.IComponentContainer.addComponent

removeComponent(self, c)

source code 

Removes the component from this container.

Parameters:
  • c - the component to be removed.
Overrides: ui.component_container.IComponentContainer.removeComponent

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)

getComponentIterator(self)

source code 

Gets an iterator to the collection of contained components. Using this iterator it is possible to step through all components contained in this container.

Returns:
the component iterator.
Overrides: ui.component_container.IComponentContainer.getComponentIterator
(inherited documentation)

replaceComponent(self, oldComponent, newComponent)

source code 

Replaces the component in the container with another one without changing position.

This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. IComponent attach and detach events should be taken care as with add and remove.

Parameters:
  • oldComponent - the old component that will be replaced.
  • newComponent - the new component to be replaced.
Overrides: ui.component_container.IComponentContainer.replaceComponent
(inherited documentation)

setComponentAlignment(self, childComponent, alignment)

source code 

Set the alignment of component in this layout. Only one direction is affected, depending on the layout direction, i.e. only vertical alignment is considered when the direction is horizontal.

getComponentIndex(self, component)

source code 

Returns the index of the given component.

Parameters:
  • component - The component to look up.
Returns:
The index of the component or -1 if the component is not a child.

getComponent(self, index)

source code 

Returns the component at the given position.

Parameters:
  • index - The position of the component.
Returns:
The component at the given index.
Raises:
  • IndexError - If the index is out of range.

size(self)

source code 

Returns the number of components in the layout.

Returns:
Component amount

setClipping(self, clip)

source code 

Set the clipping value for this layout. If clipping is True, components overflowing outside the layout boundaries will be clipped. Otherwise overflowing components are visible.

Parameters:
  • clip - the new clipping value.

setSmartRelativeSizes(self, smartRelatives)

source code 

When the layout size is undefined, relative sizes are calculated as zeros. Set this flag to True if you wish for the layout to calculate relative sizes inside undefined sized layouts as well (the largest component will determine the size).

addListener(self, listener, iface=None)

source code 

Listens the component attach/detach events.

Parameters:
  • listener - the listener to add.
Raises:
  • ValueError - unless method has a match in object
Overrides: event.layout_events.ILayoutClickNotifier.addListener
(inherited documentation)

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

source code 
Overrides: event.layout_events.ILayoutClickNotifier.addCallback

removeListener(self, listener, iface=None)

source code 

Stops the listening component attach/detach events.

Parameters:
  • listener - the listener to removed.
Overrides: event.layout_events.ILayoutClickNotifier.removeListener
(inherited documentation)

removeCallback(self, callback, eventType=None)

source code 
Overrides: event.layout_events.ILayoutClickNotifier.removeCallback