Ensures correct size of the widget.
490502
@Override
    protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int width = 200;
        if (MeasureSpec.UNSPECIFIED != MeasureSpec.getMode(widthMeasureSpec)) {
            width = MeasureSpec.getSize(widthMeasureSpec);
        }

        int height = thumbImage.getHeight()
                + (!showTextAboveThumbs ? 0 : PixelUtil.dpToPx(getContext(), HEIGHT_IN_DP))
                + (thumbShadow ? thumbShadowYOffset + thumbShadowBlur : 0);
        if (MeasureSpec.UNSPECIFIED != MeasureSpec.getMode(heightMeasureSpec)) {
            height = Math.min(height, MeasureSpec.getSize(heightMeasureSpec));
        }
        setMeasuredDimension(width, height);
    }
303406
def _resize(self, width, height):
        '''
        
        '''
        self._dirty_size = width, height
        self.reset_canvas(width, height)
        self.draw()
        self._dirty_draw = True
358255
def setCentralWidget( self, widget ):
        
        self._scrollArea.takeWidget()
        self._scrollArea.setWidget(widget)
        
        self.adjustSize()
869707
def sizeHint(self, column):
        
        hint = super(XTreeWidgetItem, self).sizeHint(column)
        hint.setHeight(max(hint.height(), self.fixedHeight()))
        return hint
1204588
void ensureSize(long position) {
		assertNonNegativePosition(position);
		if (position >= this.size) {
			this.validHashCode = false;
			long newSize = position + 1;
			int arrayOfBitsLength = this.arrayOfBits.length;
			int sizeInWords = getSizeInWords(newSize);
			while (sizeInWords > arrayOfBitsLength) {
				arrayOfBitsLength = GROWTH_FACTOR * arrayOfBitsLength;
			}
			resizeArray(arrayOfBitsLength);
			this.size = newSize;
		}
	}
796566
def adjustSize(self):
        
        widget = self.centralWidget()
        if widget is None:
            super(XPopupWidget, self).adjustSize()
            return
        
        widget.adjustSize()
        hint = widget.minimumSizeHint()
        size = widget.minimumSize()
        
        width  = max(size.width(),  hint.width())
        height = max(size.height(), hint.height())
        
        width += 20
        height += 20
        
        if self._buttonBoxVisible:
            height += self.buttonBox().height() + 10
            
        if self._titleBarVisible:
            height += max(self._dialogButton.height(),
                          self._closeButton.height()) + 10
        
        curr_w = self.width()
        curr_h = self.height()
        
        # determine if we need to move based on our anchor
        anchor = self.anchor()
        if anchor & (self.Anchor.LeftBottom | self.Anchor.RightBottom | \
                       self.Anchor.BottomLeft | self.Anchor.BottomCenter | \
                       self.Anchor.BottomRight):
            delta_y = height - curr_h
        
        elif anchor & (self.Anchor.LeftCenter | self.Anchor.RightCenter):
            delta_y = (height - curr_h) / 2
        
        else:
            delta_y = 0
        
        if anchor & (self.Anchor.RightTop | self.Anchor.RightCenter | \
                       self.Anchor.RightTop | self.Anchor.TopRight):
            delta_x = width - curr_w
        
        elif anchor & (self.Anchor.TopCenter | self.Anchor.BottomCenter):
            delta_x = (width - curr_w) / 2
        
        else:
            delta_x = 0
        
        self.setMinimumSize(width, height)
        self.resize(width, height)
        
        pos = self.pos()
        pos.setX(pos.x() - delta_x)
        pos.setY(pos.y() - delta_y)
        
        self.move(pos)
752650
def resizeEvent(self, event):
        
        super(XWalkthroughWidget, self).resizeEvent(event)
        
        if self.isVisible():
            self.autoLayout()
1249734
def updateGeometry(self):
        
        WIDGET_BORDER_MARGIN = 5
        SCROLLBAR_WIDTH = 30  # just a guess

        sizeHint = self.sizeHint()
        width = sizeHint.width()
        height = sizeHint.height()

        cursorRect = self._qpart.cursorRect()
        parentSize = self.parentWidget().size()

        spaceBelow = parentSize.height() - cursorRect.bottom() - WIDGET_BORDER_MARGIN
        spaceAbove = cursorRect.top() - WIDGET_BORDER_MARGIN

        if height <= spaceBelow or \
           spaceBelow > spaceAbove:
            yPos = cursorRect.bottom()
            if height > spaceBelow and \
               spaceBelow > self.minimumHeight():
                height = spaceBelow
                width = width + SCROLLBAR_WIDTH
        else:
            if height > spaceAbove and \
               spaceAbove > self.minimumHeight():
                height = spaceAbove
                width = width + SCROLLBAR_WIDTH
            yPos = max(3, cursorRect.top() - height)

        xPos = cursorRect.right() - self._horizontalShift()

        if xPos + width + WIDGET_BORDER_MARGIN > parentSize.width():
            xPos = max(3, parentSize.width() - WIDGET_BORDER_MARGIN - width)

        self.setGeometry(xPos, yPos, width, height)
        self._closeIfNotUpdatedTimer.stop()
94388
def onresize(self, emitter, width, height):
        
        super(MyApp, self).onresize(emitter, width, height)
1249918
def element_height_should_be(self, locator, expected):
		""""""

		self._info("Verifying element '%s' height is '%s'" % (locator, expected))
		self._check_element_size(locator, 'height', expected)
235566
def resizeEvent( self, event ):
        
        super(XNavigationEdit, self).resizeEvent(event)
        
        w = self.width()
        h = self.height()
        
        self._scrollWidget.resize(w - 4, h - 4)
        
        if ( self._scrollWidget.width() < self._partsWidget.width() ):
           self.scrollParts( self._partsWidget.width() - self._scrollWidget.width() )
423531
def configure(self, width, height):
        """"""
        self._imgwin_set = True
        self.set_window_size(width, height)
978267
def resizeEvent(self, event):
        
        super(XTabWidget, self).resizeEvent(event)
        self.adjustButtons()
838181
def sizeHint(self, option, index):
        
        size = super(XTreeWidgetDelegate, self).sizeHint(option, index)
        
        tree = self.parent()
        item = tree.itemFromIndex(index)
        
        try:
            fixed_height = item.fixedHeight()
        except:
            fixed_height = 0
        
        if fixed_height:
            size.setHeight(fixed_height)
        
        return size
467806
private int setViewSize(int mode, int size, int drawableWidth) {
        int viewSize;
        switch (mode) {
            case MeasureSpec.EXACTLY:
                viewSize = size;
                break;

            case MeasureSpec.AT_MOST:
                viewSize = Math.min(drawableWidth, size);
                break;

            case MeasureSpec.UNSPECIFIED:
                viewSize = drawableWidth;
                break;

            default:
                viewSize = size;
                break;
        }
        return viewSize;
    }
156797
def width(self, value):
        """"""
        if self._width != value and \
           isinstance(value, (int, float, long)):
            self._width = value
46315
def maxsize(self, size):
        """"""
        if size < 0:
            raise ValueError('maxsize must be non-negative')
        with self._lock:
            self._enforce_size_limit(size)
            self._maxsize = size