Layouts header, grid and optional footer.
770926
protected void buildLayout() {
        setSizeFull();
        setSpacing(true);
        setMargin(false);
        setStyleName("group");
        final VerticalLayout gridHeaderLayout = new VerticalLayout();
        gridHeaderLayout.setSizeFull();
        gridHeaderLayout.setSpacing(false);
        gridHeaderLayout.setMargin(false);

        gridHeaderLayout.setStyleName("table-layout");
        gridHeaderLayout.addComponent(gridHeader);

        gridHeaderLayout.setComponentAlignment(gridHeader, Alignment.TOP_CENTER);
        gridHeaderLayout.addComponent(grid);
        gridHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
        gridHeaderLayout.setExpandRatio(grid, 1.0F);

        addComponent(gridHeaderLayout);
        setComponentAlignment(gridHeaderLayout, Alignment.TOP_CENTER);
        setExpandRatio(gridHeaderLayout, 1.0F);
        if (hasFooterSupport()) {
            final Layout footerLayout = getFooterSupport().createFooterMessageComponent();
            addComponent(footerLayout);
            setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
        }

    }
1340376
def _layout_for_ajax(default) #:nodoc:
      ajax_layout = self.class.read_inheritable_attribute(:ajax_layout)
      ajax_layout = if ajax_layout.nil? && default.nil?
          nil
        elsif ajax_layout.nil? && !default.nil? # look for one with the default name in layouts/ajax
          if default =~ /^layouts\/ajax\//
            default
          elsif !(default =~ /^ajax\//)
            "ajax/#{default.sub(/layouts(\/)?/, '')}"
          else
            default
          end
        elsif ajax_layout.include?(?/) # path to specific layout
          ajax_layout
        else # layout name, look in ajax/
          "ajax/#{ajax_layout}"
        end
      ajax_layout = ajax_layout =~ /\blayouts/ ? ajax_layout : "layouts/#{ajax_layout}" if ajax_layout
      ajax_layout
    end
1286578
def setup_ui(self, ):
        
        grid = QtGui.QGridLayout(self)
        grid.setContentsMargins(0, 0, 0, 0)
        self.setLayout(grid)
901047
def set(margins)
      margins.select do |k, v|
        next unless [:left, :right, :top, :bottom, :header, :footer].include? k
        send("#{k}=", v)
      end
    end
360304
protected function loadLayout()
    {
        if ($this->layout instanceof Theme\Layout) {
            // add theme layout public directory
            loader()->addPublicDir($this->layout->getPath() . 'assets');

            presenter()->assets->autoload(
                [
                    'css' => ['layout'],
                    'js'  => ['layout'],
                ]
            );

            $partials = $this->layout->getPartials()->getArrayCopy();

            foreach ($partials as $offset => $partial) {
                if ($partial instanceof SplFileInfo) {
                    presenter()->partials->addPartial($offset, $partial->getPathName());
                }
            }
        }

        return $this;
    }
48084
protected function loadLayout()
    {
        $this->hook->trigger(self::HOOK_LOAD_LAYOUT_BEFORE);

        if ($this->config->get('parable.layout.header')) {
            $this->response->setHeaderContent(
                $this->view->partial($this->config->get('parable.layout.header'))
            );
        }
        if ($this->config->get('parable.layout.footer')) {
            $this->response->setFooterContent(
                $this->view->partial($this->config->get('parable.layout.footer'))
            );
        }

        $this->hook->trigger(self::HOOK_LOAD_LAYOUT_AFTER);
        return $this;
    }
1110952
def define_layout
      super do |components|
        components << Scruffy::Components::Title.new(:title, :position => [5, 2], :size => [90, 7])
                      
        VIEWPORTS.each_pair do |category, position|
          components << Scruffy::Components::Viewport.new(category, :position => position, 
                                                          :size => VIEWPORT_SIZE, &graph_block(category))
        end

        components << Scruffy::Components::Legend.new(:legend, :position => [5, 13], :size => [90, 5])
      end
    end
1092579
function layoutDimensions(options) {
    options = getLayoutDimensionOptions(options);

    if (options.nodeDimensionsIncludeLabels) {
      var bbDim = this.boundingBox();
      return {
        w: bbDim.w,
        h: bbDim.h
      };
    } else {
      return {
        w: this.outerWidth(),
        h: this.outerHeight()
      };
    }
  }
1097400
def _layout(dict_vars, dict_vars_extra):
    """"""
    desc = [(v, m.description) for v, m in dict_vars.items()]
    desc.extend((v, baredoc(m.description))
                for v, m in dict_vars_extra.items())
    _pretty_print(desc, min_col_width=26)
613014
function ()
	{
		var oGrid = this.dom.grid;
		var iWidth = $(oGrid.wrapper).width();
		var iBodyHeight = $(this.s.dt.nTable.parentNode).outerHeight();
		var iFullHeight = $(this.s.dt.nTable.parentNode.parentNode).outerHeight();
		var oOverflow = this._fnDTOverflow();
		var
			iLeftWidth = this.s.iLeftWidth,
			iRightWidth = this.s.iRightWidth,
			iRight;
		var scrollbarAdjust = function ( node, width ) {
			if ( ! oOverflow.bar ) {
				// If there is no scrollbar (Macs) we need to hide the auto scrollbar
				node.style.width = (width+20)+"px";
				node.style.paddingRight = "20px";
				node.style.boxSizing = "border-box";
			}
			else {
				// Otherwise just overflow by the scrollbar
				node.style.width = (width+oOverflow.bar)+"px";
			}
		};

		// When x scrolling - don't paint the fixed columns over the x scrollbar
		if ( oOverflow.x )
		{
			iBodyHeight -= oOverflow.bar;
		}

		oGrid.wrapper.style.height = iFullHeight+"px";

		if ( this.s.iLeftColumns > 0 )
		{
			oGrid.left.wrapper.style.width = iLeftWidth+"px";
			oGrid.left.wrapper.style.height = "1px";
			oGrid.left.body.style.height = iBodyHeight+"px";
			if ( oGrid.left.foot ) {
				oGrid.left.foot.style.top = (oOverflow.x ? oOverflow.bar : 0)+"px"; // shift footer for scrollbar
			}

			scrollbarAdjust( oGrid.left.liner, iLeftWidth );
			oGrid.left.liner.style.height = iBodyHeight+"px";
		}

		if ( this.s.iRightColumns > 0 )
		{
			iRight = iWidth - iRightWidth;
			if ( oOverflow.y )
			{
				iRight -= oOverflow.bar;
			}

			oGrid.right.wrapper.style.width = iRightWidth+"px";
			oGrid.right.wrapper.style.left = iRight+"px";
			oGrid.right.wrapper.style.height = "1px";
			oGrid.right.body.style.height = iBodyHeight+"px";
			if ( oGrid.right.foot ) {
				oGrid.right.foot.style.top = (oOverflow.x ? oOverflow.bar : 0)+"px";
			}

			scrollbarAdjust( oGrid.right.liner, iRightWidth );
			oGrid.right.liner.style.height = iBodyHeight+"px";

			oGrid.right.headBlock.style.display = oOverflow.y ? 'block' : 'none';
			oGrid.right.footBlock.style.display = oOverflow.y ? 'block' : 'none';
		}
	}
1061720
def horizontal_layout(self, draw, slide):
        
        padding = self.padding
        heading = slide['heading']

        top = padding
        left = padding

        top += heading['height'] + padding

        rows = slide['rows']

        for row in rows:

            images = row.get('images', 0)

            items = row['items']
            
            used_width = sum(x.get('width', 0) for x in items)

            available_width = WIDTH - (
                used_width + ((1 + len(items)) * padding))

            if images:
                image_width = available_width // images

            # OK, now set left for all items and image_width for images
            left = padding
            for item in row['items']:

                if item.get('image'):
                    item['width'] = image_width

                item['left'] = left    

                left += item['width'] + padding

        return
787232
public void setHeaderFooter(HeaderFooter headerFooter, int displayAt) {
        this.mode = MODE_MULTIPLE;
        switch(displayAt) {
            case RtfHeaderFooter.DISPLAY_ALL_PAGES:
                headerAll = new RtfHeaderFooter(this.document, headerFooter, this.type, displayAt);
            	break;
            case RtfHeaderFooter.DISPLAY_FIRST_PAGE:
                headerFirst = new RtfHeaderFooter(this.document, headerFooter, this.type, displayAt);
                break;
            case RtfHeaderFooter.DISPLAY_LEFT_PAGES:
                headerLeft = new RtfHeaderFooter(this.document, headerFooter, this.type, displayAt);
                break;
            case RtfHeaderFooter.DISPLAY_RIGHT_PAGES:
                headerRight = new RtfHeaderFooter(this.document, headerFooter, this.type, displayAt);
                break;
        }
    }
772929
function setLayout(d, layout, lastDisplay) {
        if (layout === 'vertical' || layout === 'multimode_vertical' ||
            layout === 'all_vertical') {

            d.displayDiv.style.float = 'none';
            d.titleDiv.style.float = 'none';
            d.titleDiv.style['margin-right'] = '0px';
            d.contentDiv.style.float = 'none';
            return true;
        }
        if (layout === 'horizontal') {
            d.displayDiv.style.float = 'none';
            d.titleDiv.style.float = 'left';
            d.titleDiv.style['margin-right'] = '6px';
            d.contentDiv.style.float = 'right';
            return true;
        }
        if (layout === 'multimode_horizontal') {
            d.displayDiv.style.float = 'left';
            d.titleDiv.style.float = 'none';
            d.titleDiv.style['margin-right'] = '0px';
            d.contentDiv.style.float = 'none';
            if (!lastDisplay) {
                d.displayDiv.style['margin-right'] = '10px';
            }
            return true;
        }
        if (layout === 'all_horizontal') {
            d.displayDiv.style.float = 'left';
            d.titleDiv.style.float = 'left';
            d.titleDiv.style['margin-right'] = '6px';
            d.contentDiv.style.float = 'right';
            if (!lastDisplay) {
                d.displayDiv.style['margin-right'] = '10px';
            }
            return true;
        }
        return false;
    }
353691
public void layoutContainer (Container parent)
    {
        Insets insets = parent.getInsets();
        int pcount = parent.getComponentCount();
        for (int ii = 0; ii < pcount; ii++) {
            Component comp = parent.getComponent(ii);
            if (!comp.isVisible()) {
                continue;
            }

            Object constr = _constraints.get(comp);
            if (constr == null) {
                log.warning("No constraints for child!?", "cont", parent, "comp", comp);
                continue;
            }

            if (constr instanceof Rectangle) {
                Rectangle r = (Rectangle)constr;
                comp.setBounds(insets.left + r.x, insets.top + r.y,
                               r.width, r.height);

            } else {
                Point p = (Point)constr;
                Dimension d = comp.getPreferredSize();
                comp.setBounds(insets.left + p.x, insets.top + p.y,
                               d.width, d.height);
            }
        }
    }
101445
function(bodyContents) {
            // Cleanup
            this.$main.html('');

            if (this.$header) {
                this.$hud.removeClass('has-header');
                this.$header.remove();
                this.$header = null;
            }

            if (this.$footer) {
                this.$hud.removeClass('has-footer');
                this.$footer.remove();
                this.$footer = null;
            }

            // Append the new body contents
            this.$main.append(bodyContents);

            // Look for a header and footer
            var $header = this.$main.find('.' + this.settings.headerClass + ':first'),
                $footer = this.$main.find('.' + this.settings.footerClass + ':first');

            if ($header.length) {
                this.$header = $header.insertBefore(this.$mainContainer);
                this.$hud.addClass('has-header');
            }

            if ($footer.length) {
                this.$footer = $footer.insertAfter(this.$mainContainer);
                this.$hud.addClass('has-footer');
            }
        }
75361
function() {
		var dimensions = this._layoutManager.config.dimensions,
			width = dimensions.dragProxyWidth,
			height = dimensions.dragProxyHeight;

		this.element.width( width );
		this.element.height( height );
		width -= ( this._sided ? dimensions.headerHeight : 0 );
		height -= ( !this._sided ? dimensions.headerHeight : 0 );
		this.childElementContainer.width( width );
		this.childElementContainer.height( height );
		this._contentItem.element.width( width );
		this._contentItem.element.height( height );
		this._contentItem.callDownwards( '_$show' );
		this._contentItem.callDownwards( 'setSize' );
	}
43264
private void initLayout() {

        VerticalLayout page = new VerticalLayout();
        setContent(page);
        page.setId("page");

        page.addComponent(headerLayout);
        initLayoutHeader();

        page.addComponent(mainTab);


        initLayoutFooter();
        page.addComponent(layoutFooter);

    }