Sets the Widget position relatively to its parent.
770438
def __set_position(self):
        

        rectangle = hasattr(self.parent(), "viewport") and self.parent().viewport().rect() or self.parent().rect()
        if not rectangle:
            return

        self.adjustSize()

        if self.__anchor == 0:
            point_x = rectangle.width() / 2 - self.width() / 2
            point_y = self.__vertical_padding
        elif self.__anchor == 1:
            point_x = rectangle.width() - self.width() - self.__horizontal_padding
            point_y = self.__vertical_padding
        elif self.__anchor == 2:
            point_x = rectangle.width() - self.width() - self.__horizontal_padding
            point_y = rectangle.height() / 2 - self.height() / 2
        elif self.__anchor == 3:
            point_x = rectangle.width() - self.width() - self.__horizontal_padding
            point_y = rectangle.height() - self.height() - self.__vertical_padding
        elif self.__anchor == 4:
            point_x = rectangle.width() / 2 - self.width() / 2
            point_y = rectangle.height() - self.height() - self.__vertical_padding
        elif self.__anchor == 5:
            point_x = self.__horizontal_padding
            point_y = rectangle.height() - self.height() - self.__vertical_padding
        elif self.__anchor == 6:
            point_x = self.__horizontal_padding
            point_y = rectangle.height() / 2 - self.height() / 2
        elif self.__anchor == 7:
            point_x = self.__horizontal_padding
            point_y = self.__vertical_padding
        elif self.__anchor == 8:
            point_x = rectangle.width() / 2 - self.width() / 2
            point_y = rectangle.height() / 2 - self.height() / 2

        self.setGeometry(point_x + self.__horizontal_offset, point_y +
                                                             self.__vertical_offset, self.width(), self.height())
370999
def setPosition(self, position):
        
        if position == self._position:
            return
        
        self._position = position
        
        widget   = self.window()
        layout   = self.layout()
        offset   = self.padding()
        min_size = self.minimumPixmapSize()
        
        # set the layout to north
        if position == XDockToolbar.Position.North:
            self.move(0, 0)
            widget.setContentsMargins(0, min_size.height() + offset, 0, 0)
            layout.setDirection(QBoxLayout.LeftToRight)
        
        # set the layout to east
        elif position == XDockToolbar.Position.East:
            self.move(0, 0)
            widget.setContentsMargins(min_size.width() + offset, 0, 0, 0)
            layout.setDirection(QBoxLayout.TopToBottom)
        
        # set the layout to the south
        elif position == XDockToolbar.Position.South:
            widget.setContentsMargins(0, 0, 0, min_size.height() + offset)
            layout.setDirection(QBoxLayout.LeftToRight)
        
        # set the layout to the west
        else:
            widget.setContentsMargins(0, 0, min_size.width() + offset, 0)
            layout.setDirection(QBoxLayout.TopToBottom)
        
        # update the label alignments
        for label in self.actionLabels():
            label.setPosition(position)
        
        # rebuilds the widget
        self.rebuild()
        self.update()
770232
public void setCenterCoordsRelativeToParent(int x, int y) {

        Style style = getElement().getStyle();
        style.setLeft(x - 10, Unit.PX);
        style.setTop(y - 10, Unit.PX);
    }
1251171
def set_position(self, pos, which='both'):
        """"""
        self._polar.set_position(pos, which)
        if self._overlay_axes is not None:
            self._overlay_axes.set_position(pos, which)
        LambertAxes.set_position(self, pos, which)
1103980
public void setPosition(int pos) {
		if (pos < 0 || pos >= number)
			throw new IllegalArgumentException("Position " + pos + " out of range");
		position = pos;
		updateLocationDefinition(position);
		forwardButton.setEnabled(position < number - 1);
		backwardButton.setEnabled(position > 0);
		if (panel.getParent()!=null) positionChanged();
	}
106535
def focus_parent(self):
        """"""
        mid = self.get_selected_mid()
        newpos = self._tree.parent_position(mid)
        if newpos is not None:
            newpos = self._sanitize_position((newpos,))
            self.body.set_focus(newpos)
960960
public void setPosition(int height, int width, int positionLeft, int positionTop) {

        positionLeft -= m_borderOffset;

        // make sure highlighting does not introduce additional horizontal scroll-bars
        if ((m_positioningParent == null) && (positionLeft < 0)) {
            // position left should not be negative
            width += positionLeft;
            positionLeft = 0;
        }
        width += (2 * m_borderOffset) - BORDER_WIDTH;
        if ((m_positioningParent == null)
            && (Window.getClientWidth() < (width + positionLeft))
            && (Window.getScrollLeft() == 0)) {
            // highlighting should not extend over the right hand
            width = Window.getClientWidth() - (positionLeft + BORDER_WIDTH);
        }
        Style style = getElement().getStyle();
        style.setLeft(positionLeft, Unit.PX);
        style.setTop(positionTop - m_borderOffset, Unit.PX);
        setHeight((height + (2 * m_borderOffset)) - BORDER_WIDTH);
        setWidth(width);
    }
1195649
def set_dialog_position(self):
        """"""
        left = self.editor.geometry().width()/2 - self.width()/2
        top = self.editor.tabs.tabBar().geometry().height()

        self.move(self.editor.mapToGlobal(QPoint(left, top)))
730574
def setFocus(self, reason=None):
        """"""
        self.formLayout.itemAt(0, QFormLayout.FieldRole).widget().setFocus()
592054
def setCentralWidget(self, widget):
        
        self.setEnabled(widget is not None)
        self._popupWidget.setCentralWidget(widget)
616742
def y_offset(self, container):
        """"""
        offset = (self.parent.y_offset(container)\
                  if hasattr(self.parent, 'y_offset') else 0)
        if self.is_script(container):
            style = self._style(container)
            offset += (self.parent.height(container) *
                       self.position[style.position])
            # The Y offset should only change once for the nesting level
            # where the position style is set, hence we don't recursively
            # get the position style using self.get_style('position')
        return offset
229142
function setPos(){
          var currentStep = scope.joyride.config.steps[scope.joyride.current];

          $timeout(function(){

            removeClassByPrefix(joyrideContainer, "jr_pos_");
            var step = scope.joyride.config.steps[scope.joyride.current];
            

          // If step type equals 'element' set position and styles
          if (step.type == 'element' && document.querySelector(step.selector)) {
            joyrideContainer.removeAttribute('style');
            angular.element(joyrideContainer).addClass('jr_element');
            

            if (document.querySelector(".jr_target")) {
              angular.element(document.querySelector(".jr_target")).removeClass('jr_target');  
            }
            
            var jrElement = angular.element(document.querySelector(step.selector));
            var position = getElementOffset(jrElement[0]);
            var window_width = window.innerWidth;

            var jrWidth = joyrideContainer.offsetWidth;
            var targetWidth = jrElement[0].offsetWidth;
            
            var jrHeight = joyrideContainer.clientHeight;
            var targetHeight = jrElement[0].clientHeight;
                
            jrElement.addClass('jr_target');

            /********************************************
            Check where the step should be positioned then 
            change the position property accordingly
            ********************************************/
            var placement = step.placement || 'bottom';
            if (step.responsive && window_width < step.responsive.breakpoint) {
              placement = step.responsive.placement || 'bottom';
            }

            angular.element(joyrideContainer).addClass('jr_pos_'+placement);

            if (currentStep.appendToBody){
              if (placement === 'top' || placement === 'bottom') {
                if (placement === 'top') {
                  position.top -= jrHeight + 20;
                }

                else {
                  position.top += targetHeight + 20;
                }
                

                position.left = ((position.left + targetWidth/2) - jrWidth/2 );
                
              }

              else{
                
                
                position.top = ((position.top + targetHeight/2) - jrHeight/2 );
                if (placement === 'left') {
                  position.left -= jrWidth + 20;

                }

                else {
                  position.left += targetWidth + 20;
                }

              }

              // Set joyride position
              joyrideContainer.style.left = position.left + 'px';
              joyrideContainer.style.top = position.top + 'px';
              joyrideContainer.style.right = 'auto';
              joyrideContainer.style.bottom = 'auto';
              joyrideContainer.style.transform = 'none';
              
            
            }

            /** 
            Check if Joyride is out of bounds and adjust position
            */
            
            var joyridePosition = getElementOffset(joyrideContainer);

            /**
            Handle top/bottom cases
            */
            if(placement !== "left" && placement !== "right"){

              if(joyridePosition.left < 0){
                var triangle = document.querySelector(".jr_container .triangle");
                triangle.style.left = (targetWidth/2 - triangle.offsetWidth/2)  + 'px';
                triangle.style.right = "auto";
                joyrideContainer.style.left = 0;
                joyrideContainer.style.right = "auto";
              }

              else if((joyridePosition.left + jrWidth) > window_width){
                var tempPos = joyridePosition.left + (jrWidth/2)
                var triangle = document.querySelector(".jr_container .triangle");
                triangle.style.right = (targetWidth/2 - triangle.offsetWidth/2)  + 'px';
                triangle.style.left = "auto";
                joyrideContainer.style.left = "auto";
                joyrideContainer.style.right = 0;
              }
            }
            

            /**
            Handle left/right cases
            */
            else{

              if(joyridePosition.top < 0){
                var triangle = document.querySelector(".jr_container .triangle");
                var trianglePos = targetHeight/2 - triangle.offsetHeight/2;
                triangle.style.top = trianglePos < 0 ? 0 + "px" : trianglePos + "px";

                triangle.style.bottom = "auto";
                joyrideContainer.style.top = 0;
                joyrideContainer.style.transform = "none";
              }

            }

            // Scroll to element if scroll is enabled
              if (step.scroll !== false) {
                if (placement === 'bottom') {
                  scroll_pos = position.top - targetHeight;
                }
                else if(placement === 'top'){
                  scroll_pos = position.top - jrHeight;
                }
                else{
                  if(targetHeight < jrHeight){
                    scroll_pos = position.top -  (jrHeight - targetHeight) /2;
                  }
                }
                
                scrollToElement(scroll_pos);
              }
          }


          // If step isn't an element
          else{
            angular.element(joyrideContainer).removeClass('jr_element');
            if (document.querySelector(".jr_target")) {
              angular.element(document.querySelector(".jr_target")).removeClass('jr_target');  
            }
            joyrideContainer.style.left = '';
            joyrideContainer.style.top = getScroll(placement, joyrideContainer) + 100 + 'px';
          }
      });

        }
305316
public void positionDeferred(final CmsChoiceMenuEntryWidget widgetEntry) {

        getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
        getElement().getStyle().setVisibility(Style.Visibility.HIDDEN);
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {

            public void execute() {

                positionNextToMenuEntry(widgetEntry);
                getElement().getStyle().setVisibility(Style.Visibility.VISIBLE);
            }

        });
    }
843931
public static final void setPosition(UIObject o, Rect pos) {
        Style style = o.getElement().getStyle();
        style.setPropertyPx("left", pos.x);
        style.setPropertyPx("top", pos.y);
    }
403292
public void setPopupPosition(int popupX, int popupY) {
        // Will check if the popup is out of container
        this.popupX = popupX;
        this.popupY = popupY;
        setLeft(popupX);
        setTop(popupY);
    }
283594
public static IPosition inParent(IChild<?> owner, int x, int y)
	{
		return new DynamicPosition(0, 0, leftAligned(owner, x), topAligned(owner, y));
	}
641339
public void set(Viewport src) {
        this.left = src.left;
        this.top = src.top;
        this.right = src.right;
        this.bottom = src.bottom;
    }