Package muntjac :: Package ui :: Module absolute_layout :: Class AbsoluteLayout
[hide private]
[frames] | no frames]

Class AbsoluteLayout

source code

                             object --+                        
                                      |                        
                    util.IEventListener --+                    
                                          |                    
              terminal.paintable.IPaintable --+                
                                              |                
                                 object --+   |                
                                          |   |                
     terminal.variable_owner.IVariableOwner --+                
                                              |                
                                 object --+   |                
                                          |   |                
                terminal.sizeable.ISizeable --+                
                                              |                
                           component.IComponent --+            
                                                  |            
                                     object --+   |            
                                              |   |            
   event.method_event_source.IMethodEventSource --+            
                                                  |            
               abstract_component.AbstractComponent --+        
                                                      |        
                             object --+               |        
                                      |               |        
                    util.IEventListener --+           |        
                                          |           |        
              terminal.paintable.IPaintable --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
     terminal.variable_owner.IVariableOwner --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
                terminal.sizeable.ISizeable --+       |        
                                              |       |        
                           component.IComponent --+   |        
                                                  |   |        
            component_container.IComponentContainer --+        
                                                      |        
abstract_component_container.AbstractComponentContainer --+    
                                                          |    
                             object --+                   |    
                                      |                   |    
                    util.IEventListener --+               |    
                                          |               |    
              terminal.paintable.IPaintable --+           |    
                                              |           |    
                                 object --+   |           |    
                                          |   |           |    
     terminal.variable_owner.IVariableOwner --+           |    
                                              |           |    
                                 object --+   |           |    
                                          |   |           |    
                terminal.sizeable.ISizeable --+           |    
                                              |           |    
                           component.IComponent --+       |    
                                                  |       |    
            component_container.IComponentContainer --+   |    
                                                      |   |    
                                         layout.ILayout --+    
                                                          |    
                                             object --+   |    
                                                      |   |    
                                  layout.IMarginHandler --+    
                                                          |    
                             abstract_layout.AbstractLayout --+
                                                              |
                                                 object --+   |
                                                          |   |
                   event.layout_events.ILayoutClickNotifier --+
                                                              |
                                                             AbsoluteLayout

AbsoluteLayout is a layout implementation that mimics html absolute positioning.

Instance Methods [hide private]
 
__init__(self)
Creates an AbsoluteLayout with full size.
source code
 
getComponentIterator(self)
Gets an iterator for going through all components enclosed in the absolute layout.
source code
 
getComponentCount(self)
Gets the number of contained components.
source code
 
replaceComponent(self, oldComponent, newComponent)
Replaces one component with another one.
source code
 
addComponent(self, c, cssPosition=None)
Adds a component to the layout.
source code
 
removeComponent(self, c)
This only implements the events and component parent calls.
source code
 
getPosition(self, component)
Gets the position of a component in the layout.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
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 abstract_layout.AbstractLayout: changeVariables, fireClick, getMargin, setMargin

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

Inherited from 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)
  _CLICK_EVENT = 'layout_click'

Inherited from 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]
  _components
The components in the layout
  _componentToCoordinates
Maps each component to a position
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Creates an AbsoluteLayout with full size.

Overrides: object.__init__

getComponentIterator(self)

source code 

Gets an iterator for going through all components enclosed in the absolute layout.

Returns:
the component iterator.
Overrides: component_container.IComponentContainer.getComponentIterator

getComponentCount(self)

source code 

Gets the number of contained components. Consistent with the iterator returned by getComponentIterator.

Returns:
the number of contained components

replaceComponent(self, oldComponent, newComponent)

source code 

Replaces one component with another one. The new component inherits the old components position.

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

addComponent(self, c, cssPosition=None)

source code 

Adds a component to the layout. The component can be positioned by providing a string formatted in CSS-format.

For example the string "top:10px;left:10px" will position the component 10 pixels from the left and 10 pixels from the top. The identifiers: "top","left","right" and "bottom" can be used to specify the position.

Parameters:
  • c - The component to add to the layout
  • cssPosition - The css position string
Overrides: component_container.IComponentContainer.addComponent

removeComponent(self, c)

source code 

This only implements the events and component parent calls. The extending classes must implement component list maintenance and call this method before component list maintenance.

Parameters:
  • c - the component to be removed.
Overrides: component_container.IComponentContainer.removeComponent
(inherited documentation)

getPosition(self, component)

source code 

Gets the position of a component in the layout. Returns None if component is not attached to the layout.

Parameters:
  • component - The component which position is needed
Returns:
An instance of ComponentPosition containing the position of the component, or null if the component is not enclosed in the layout.

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: abstract_component.AbstractComponent.paintContent
(inherited documentation)

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