This is responsible for building the viewer's UI.  It should
        place the UI in `container`.  Override this to make a custom
        UI.
340478
def build_gui(self, container):
        
        vbox = Widgets.VBox()
        vbox.set_border_width(0)

        w = Viewers.GingaViewerWidget(viewer=self)
        vbox.add_widget(w, stretch=1)

        # need to put this in an hbox with an expanding label or the
        # browser wants to resize the canvas, distorting it
        hbox = Widgets.HBox()
        hbox.add_widget(vbox, stretch=0)
        hbox.add_widget(Widgets.Label(''), stretch=1)

        container.set_widget(hbox)
87568
def create_widget(self):
        
        d = self.declaration
        self.widget = View(self.get_context(), None, d.style)
409916
def add_ui(self, klass, *args, **kwargs):
        '''

        '''
        ui = klass(self.widget, *args, **kwargs)
        self.widget.uis.append(ui)
        return ui
75380
private void buildGui() {
		initWidget(UI_BINDER.createAndBindUi(this));
		getElement().getStyle().setPosition(Position.ABSOLUTE);
		getElement().getStyle().setTop(5, Unit.PX);
		getElement().getStyle().setLeft(5, Unit.PX);

		StopPropagationHandler preventWeirdBehaviourHandler = new StopPropagationHandler();
		addDomHandler(preventWeirdBehaviourHandler, MouseDownEvent.getType());
		addDomHandler(preventWeirdBehaviourHandler, MouseUpEvent.getType());
		addDomHandler(preventWeirdBehaviourHandler, ClickEvent.getType());
		addDomHandler(preventWeirdBehaviourHandler, DoubleClickEvent.getType());

		// Create TOP button:
		topElement.addDomHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				Bbox bounds = mapPresenter.getViewPort().getBounds();
				double deltaY = bounds.getHeight() / 5;
				PanAnimation animation = new PanAnimation(mapPresenter.getViewPort());
				animation.panTo(0, deltaY, 300);
				event.stopPropagation();
			}
		}, ClickEvent.getType());

		// Create RIGHT button:
		rightElement.addDomHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				Bbox bounds = mapPresenter.getViewPort().getBounds();
				double deltaX = bounds.getWidth() / 5;
				PanAnimation animation = new PanAnimation(mapPresenter.getViewPort());
				animation.panTo(deltaX, 0, 300);
				event.stopPropagation();
			}
		}, ClickEvent.getType());

		// Create BOTTOM button:
		bottomElement.addDomHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				Bbox bounds = mapPresenter.getViewPort().getBounds();
				double deltaY = -bounds.getHeight() / 5;
				PanAnimation animation = new PanAnimation(mapPresenter.getViewPort());
				animation.panTo(0, deltaY, 300);
				event.stopPropagation();
			}
		}, ClickEvent.getType());

		// Create LEFT button:
		leftElement.addDomHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				Bbox bounds = mapPresenter.getViewPort().getBounds();
				double deltaX = -bounds.getWidth() / 5;
				PanAnimation animation = new PanAnimation(mapPresenter.getViewPort());
				animation.panTo(deltaX, 0, 300);
				event.stopPropagation();
			}
		}, ClickEvent.getType());
	}
1031876
def setup_ui(self, ):
        
        grid = QtGui.QGridLayout(self)
        self.setLayout(grid)
        self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal, self)
        grid.addWidget(self.splitter)
        grid.setContentsMargins(0, 0, 0, 0)
23779
function () {
            var domElt = this.getDom();
            var content = (this._cfg.label && this._cfg.waiAria) ? aria.utils.Dom.getDomElementChild(domElt, 1) : aria.utils.Dom.getDomElementChild(domElt, 0);
            this._frame.linkToDom(content);
            this.$Container._init.call(this);
        }
800555
def setup_ui(self, ):
        
        w = QtGui.QWidget(self)
        w.setLayout(self.central_widget_vbox)
        self.setCentralWidget(w)
        self.reftrack_treev = WD_TreeView(parent=self)
        self.reftrack_treev.setHeaderHidden(True)
        self.central_widget_vbox.insertWidget(1, self.reftrack_treev)
        self.setup_icons()
        self.model = self.root.get_model()
        self.proxy = self.create_proxy_model(self.model)
        self.proxy.setFilterKeyColumn(-1)  # filter all columns
        self.proxy.setFilterCaseSensitivity(QtCore.Qt.CaseInsensitive)
        self.reftrack_treev.setModel(self.proxy)
        self.reftrack_treev.setItemDelegate(self.reftrackdelegate)
        # hide all columns but the first
        cc = self.proxy.columnCount(QtCore.QModelIndex())
        for i in range(1, cc):
            self.reftrack_treev.setColumnHidden(i, True)
240387
def place_docker(self, docker, area='top'):
        
        # map of options
        m = dict(top    = _g.QtCore.Qt.TopDockWidgetArea,
                 bottom = _g.QtCore.Qt.BottomDockWidgetArea,
                 left   = _g.QtCore.Qt.LeftDockWidgetArea,
                 right  = _g.QtCore.Qt.RightDockWidgetArea)
        
        
        # set the parent
        docker.set_parent(self)

        # events
        docker._window.resizeEvent = self._event_resize
        docker._window.moveEvent   = self._event_move  

        # Keep it in the window        
        docker._window.setFeatures(docker._window.DockWidgetMovable)        
        
        # set it
        self._window.addDockWidget(m[area], docker._window)
        
        return docker
1020450
def create_widget(self):
        
        d = self.declaration
        self.widget = LinearLayout(self.get_context(), None, d.style)
253369
def add_to(self, container):
        '''
        
        '''
        if self.container:
            self.remove_from(self.container)
        container.add(self)
510354
function Layout(options) {
    // Grant this View superpowers.
    this.manage = true;

    // Give this View access to all passed options as instance properties.
    _.extend(this, options);

    // Have Backbone set up the rest of this View.
    Backbone.View.apply(this, arguments);
  }
714173
def create_widget(self):
        
        d = self.declaration
        self.widget = RelativeLayout(self.get_context(), None, d.style)
218725
public static void attachAndEnhance(JQMContainer container) {
        if (container == null) return;
        RootPanel p = getRootPanel();
        if (p == null) return;
        p.add(container);
        enhance(container);
        container.setEnhanced(true);
    }
1329651
def init_layout(self):
        
        parent = self.parent()
        if parent is not None:
            self.adapter = parent.adapter
            self.adapter.addFragment(self.fragment)
1196115
def addToLayout(self, analysis, position=None):
        
        # TODO Redux
        layout = self.getLayout()
        container_uid = self.get_container_for(analysis)
        if IRequestAnalysis.providedBy(analysis) and \
                not IDuplicateAnalysis.providedBy(analysis):
            container_uids = map(lambda slot: slot['container_uid'], layout)
            if container_uid in container_uids:
                position = [int(slot['position']) for slot in layout if
                            slot['container_uid'] == container_uid][0]
            elif not position:
                used_positions = [0, ] + [int(slot['position']) for slot in
                                          layout]
                position = [pos for pos in range(1, max(used_positions) + 2)
                            if pos not in used_positions][0]

        an_type = self.get_analysis_type(analysis)
        self.setLayout(layout + [{'position': position,
                                  'type': an_type,
                                  'container_uid': container_uid,
                                  'analysis_uid': api.get_uid(analysis)}, ])
736733
function Menu (opts) {
    Menu.superclass.constructor.call(this, opts)

    var items = opts.items

    if (Director.sharedDirector.isTouchScreen) {
        this.isTouchEnabled = true
    } else {
        this.isMouseEnabled = true
    }

    var s = Director.sharedDirector.winSize

    this.isRelativeAnchorPoint = false
    this.anchorPoint = ccp(0.5, 0.5)
    this.contentSize = s

    this.position = ccp(s.width / 2, s.height / 2)


    if (items) {
        var z = 0
        items.forEach(function (item) {
            this.addChild({child: item, z: z++})
        }.bind(this))
    }
}
1035700
boolean assignLayout(IAtomContainer container) {

        try {
            // create the library key to lookup an entry, we also store
            // the canonical out ordering
            int n = container.getAtomCount();
            int[] ordering = new int[n];
            String smiles = cansmi(container, ordering);

            // find the points in the library
            for (Point2d[] points : templateMap.get(smiles)) {
                // set the points
                for (int i = 0; i < n; i++) {
                    container.getAtom(i).setPoint2d(new Point2d(points[ordering[i]]));
                }
                return true;
            }
        } catch (CDKException e) {
            // ignored
        }
        return false;
    }