/** * Get the height in pixels of the scrollable content that the scrollbar * controls. * * <p> * This is not the same as the maximum scroll top position. The maximum scroll * position equals the <code>scrollHeight- offsetHeight</code>; * * @return the scroll height * @see #setScrollHeight(int) */ public int getScrollHeight() { return contentDiv.getOffsetHeight(); }
/** * Gets an element's absolute bottom coordinate in the document's coordinate * system. */ public final int getAbsoluteBottom() { return getAbsoluteTop() + getOffsetHeight(); }
/** * Update the layout. */ private void forceLayout() { // No sense in doing layout if we aren't attached or have no content. if (!isAttached() || content == null) { return; } // Resize the content area to fit between the header and footer. int remainingHeight = getElement().getClientHeight(); if (header != null) { int height = Math.max(0, headerContainer.getOffsetHeight()); remainingHeight -= height; contentContainer.getStyle().setTop(height, Unit.PX); } else { contentContainer.getStyle().setTop(0.0, Unit.PX); } if (footer != null) { remainingHeight -= footerContainer.getOffsetHeight(); } contentContainer.getStyle().setHeight(Math.max(0, remainingHeight), Unit.PX); // Provide resize to child. if (content instanceof RequiresResize) { ((RequiresResize) content).onResize(); } }
int deckHeight = deckElem.getOffsetHeight(); if (growing) { fixedHeight = container2.getOffsetHeight(); container2.getStyle().setPropertyPx("height", Math.max(1, fixedHeight - 1)); } else { fixedHeight = container1.getOffsetHeight(); container1.getStyle().setPropertyPx("height", Math.max(1, fixedHeight - 1)); if (deckElem.getOffsetHeight() != deckHeight) { fixedHeight = -1;
@Override protected void onStart() { if (opening) { animFrame.getStyle().setHeight(1.0, Unit.PX); animFrame.getStyle().setPosition(Position.RELATIVE); animFrame.getStyle().clearDisplay(); height = contentContainer.getScrollHeight(); } else { height = contentContainer.getOffsetHeight(); } }
/** * @return the height of scrollable body, subpixels ceiled. */ public int getRequiredHeight() { return preSpacer.getOffsetHeight() + postSpacer.getOffsetHeight() + WidgetUtil.getRequiredHeight(table); }
int offsetHeight = parent.getOffsetHeight(); int offsetWidth = parent.getOffsetWidth(); int height = offsetHeight + 100;
/** * Gets an element's absolute bottom coordinate in the document's coordinate * system. */ public final int getAbsoluteBottom() { return getAbsoluteTop() + getOffsetHeight(); }
/** * Gets an element's absolute bottom coordinate in the document's coordinate * system. */ public final int getAbsoluteBottom() { return getAbsoluteTop() + getOffsetHeight(); }
@Override void animate(Element rElement, double fProgress) { double fHeight = rElement.getOffsetHeight(); rElement.getStyle() .setHeight(fHeight * (1.0d - fProgress), Unit.PX); } },
@Override void animate(Element rElement, double fProgress) { double fHeight = rElement.getOffsetHeight(); rElement.getStyle().setHeight(fHeight * fProgress, Unit.PX); } },
@Override public int getPhysicalHeight() { return getSVGElement().getParentElement().getOffsetHeight(); }
@Override public void onResize() { final Element parentElement = getElement().getParentElement(); final Integer width = parentElement.getOffsetWidth(); final Integer height = parentElement.getOffsetHeight(); if (width > 0 && height > 0) { setPixelSize(width, height); } resizableContent.ifPresent(RequiresResize::onResize); } }
public Size getSize() { Element td = getTdElement(); return new Size( td.getOffsetWidth(), td.getOffsetHeight() ); } }
@Override public Size getDisplaySize() { Element td = getTd(); Size size = new Size( td.getOffsetWidth(), td.getOffsetHeight() ); return size; }
/** * Recalculate the height and width of a native scrollbar. */ private static void maybeRecalculateNativeScrollbarSize() { // Check if the size has already been calculated. if (nativeHeight > -1) { return; } // Create a scrollable element and attach it to the body. Element scrollable = Document.get().createDivElement(); scrollable.getStyle().setPosition(Position.ABSOLUTE); scrollable.getStyle().setTop(-1000.0, Unit.PX); scrollable.getStyle().setLeft(-1000.0, Unit.PX); scrollable.getStyle().setHeight(100.0, Unit.PX); scrollable.getStyle().setWidth(100.0, Unit.PX); scrollable.getStyle().setOverflow(Overflow.SCROLL); scrollable.getStyle().setProperty("direction", "rtl"); Document.get().getBody().appendChild(scrollable); // Add some content. Element content = Document.get().createDivElement(); content.setInnerText("content"); scrollable.appendChild(content); // Measure the height and width. nativeHeight = scrollable.getOffsetHeight() - scrollable.getClientHeight(); nativeWidth = scrollable.getOffsetWidth() - scrollable.getClientWidth(); nativeRtl = (content.getAbsoluteLeft() > scrollable.getAbsoluteLeft()); // Detach the scrollable element. scrollable.removeFromParent(); }
private int getElementsOuterHeight(String... elementClasses) { int elementsOuterHeight = 0; for (String clazzName : elementClasses) { Element element = JQueryWrapper.select(dialog.asWidget()).find(clazzName).get(0); if (element != null) { int margin[] = new ComputedStyle(element).getMargin(); elementsOuterHeight += element.getOffsetHeight() + margin[TOP] + margin[BOTTOM]; } } return elementsOuterHeight; }
@Override protected void onStart() { if (opening) { animFrame.getStyle().setHeight(1.0, Unit.PX); animFrame.getStyle().setPosition(Position.RELATIVE); animFrame.getStyle().clearDisplay(); height = contentContainer.getScrollHeight(); } else { height = contentContainer.getOffsetHeight(); } }
@Override protected void onStart() { if (opening) { animFrame.getStyle().setHeight(1.0, Unit.PX); animFrame.getStyle().setPosition(Position.RELATIVE); animFrame.getStyle().clearDisplay(); height = contentContainer.getScrollHeight(); } else { height = contentContainer.getOffsetHeight(); } }
@Override public int getHeight(Element e) { return (int) (e.getOffsetHeight() - num(curCSS(e, "paddingTop", true)) - num(curCSS(e, "paddingBottom", true)) - num(curCSS(e, "borderTopWidth", true)) - num(curCSS(e, "borderBottomWidth", true))); }