com.google.gwt.dom.client.Element.getOffsetHeight()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(297)

本文整理了Java中com.google.gwt.dom.client.Element.getOffsetHeight()方法的一些代码示例,展示了Element.getOffsetHeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getOffsetHeight()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getOffsetHeight

Element.getOffsetHeight介绍

[英]The height of an element relative to the layout.
[中]元素相对于布局的高度。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Get the height in pixels of the scrollable content that the scrollbar
  3. * controls.
  4. *
  5. * <p>
  6. * This is not the same as the maximum scroll top position. The maximum scroll
  7. * position equals the <code>scrollHeight- offsetHeight</code>;
  8. *
  9. * @return the scroll height
  10. * @see #setScrollHeight(int)
  11. */
  12. public int getScrollHeight() {
  13. return contentDiv.getOffsetHeight();
  14. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets an element's absolute bottom coordinate in the document's coordinate
  3. * system.
  4. */
  5. public final int getAbsoluteBottom() {
  6. return getAbsoluteTop() + getOffsetHeight();
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Update the layout.
  3. */
  4. private void forceLayout() {
  5. // No sense in doing layout if we aren't attached or have no content.
  6. if (!isAttached() || content == null) {
  7. return;
  8. }
  9. // Resize the content area to fit between the header and footer.
  10. int remainingHeight = getElement().getClientHeight();
  11. if (header != null) {
  12. int height = Math.max(0, headerContainer.getOffsetHeight());
  13. remainingHeight -= height;
  14. contentContainer.getStyle().setTop(height, Unit.PX);
  15. } else {
  16. contentContainer.getStyle().setTop(0.0, Unit.PX);
  17. }
  18. if (footer != null) {
  19. remainingHeight -= footerContainer.getOffsetHeight();
  20. }
  21. contentContainer.getStyle().setHeight(Math.max(0, remainingHeight), Unit.PX);
  22. // Provide resize to child.
  23. if (content instanceof RequiresResize) {
  24. ((RequiresResize) content).onResize();
  25. }
  26. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. int deckHeight = deckElem.getOffsetHeight();
  2. if (growing) {
  3. fixedHeight = container2.getOffsetHeight();
  4. container2.getStyle().setPropertyPx("height",
  5. Math.max(1, fixedHeight - 1));
  6. } else {
  7. fixedHeight = container1.getOffsetHeight();
  8. container1.getStyle().setPropertyPx("height",
  9. Math.max(1, fixedHeight - 1));
  10. if (deckElem.getOffsetHeight() != deckHeight) {
  11. fixedHeight = -1;

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. protected void onStart() {
  3. if (opening) {
  4. animFrame.getStyle().setHeight(1.0, Unit.PX);
  5. animFrame.getStyle().setPosition(Position.RELATIVE);
  6. animFrame.getStyle().clearDisplay();
  7. height = contentContainer.getScrollHeight();
  8. } else {
  9. height = contentContainer.getOffsetHeight();
  10. }
  11. }

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

  1. /**
  2. * @return the height of scrollable body, subpixels ceiled.
  3. */
  4. public int getRequiredHeight() {
  5. return preSpacer.getOffsetHeight() + postSpacer.getOffsetHeight()
  6. + WidgetUtil.getRequiredHeight(table);
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. int offsetHeight = parent.getOffsetHeight();
  2. int offsetWidth = parent.getOffsetWidth();
  3. int height = offsetHeight + 100;

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. /**
  2. * Gets an element's absolute bottom coordinate in the document's coordinate
  3. * system.
  4. */
  5. public final int getAbsoluteBottom() {
  6. return getAbsoluteTop() + getOffsetHeight();
  7. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Gets an element's absolute bottom coordinate in the document's coordinate
  3. * system.
  4. */
  5. public final int getAbsoluteBottom() {
  6. return getAbsoluteTop() + getOffsetHeight();
  7. }

代码示例来源:origin: de.esoco/gewt

  1. @Override
  2. void animate(Element rElement, double fProgress)
  3. {
  4. double fHeight = rElement.getOffsetHeight();
  5. rElement.getStyle()
  6. .setHeight(fHeight * (1.0d - fProgress), Unit.PX);
  7. }
  8. },

代码示例来源:origin: de.esoco/gewt

  1. @Override
  2. void animate(Element rElement, double fProgress)
  3. {
  4. double fHeight = rElement.getOffsetHeight();
  5. rElement.getStyle().setHeight(fHeight * fProgress, Unit.PX);
  6. }
  7. },

代码示例来源:origin: OpenNMS/opennms

  1. @Override
  2. public int getPhysicalHeight() {
  3. return getSVGElement().getParentElement().getOffsetHeight();
  4. }

代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-client

  1. @Override
  2. public void onResize() {
  3. final Element parentElement = getElement().getParentElement();
  4. final Integer width = parentElement.getOffsetWidth();
  5. final Integer height = parentElement.getOffsetHeight();
  6. if (width > 0 && height > 0) {
  7. setPixelSize(width, height);
  8. }
  9. resizableContent.ifPresent(RequiresResize::onResize);
  10. }
  11. }

代码示例来源:origin: fr.lteconsulting/hexa.core

  1. public Size getSize()
  2. {
  3. Element td = getTdElement();
  4. return new Size( td.getOffsetWidth(), td.getOffsetHeight() );
  5. }
  6. }

代码示例来源:origin: ltearno/hexa.tools

  1. @Override
  2. public Size getDisplaySize()
  3. {
  4. Element td = getTd();
  5. Size size = new Size( td.getOffsetWidth(), td.getOffsetHeight() );
  6. return size;
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Recalculate the height and width of a native scrollbar.
  3. */
  4. private static void maybeRecalculateNativeScrollbarSize() {
  5. // Check if the size has already been calculated.
  6. if (nativeHeight > -1) {
  7. return;
  8. }
  9. // Create a scrollable element and attach it to the body.
  10. Element scrollable = Document.get().createDivElement();
  11. scrollable.getStyle().setPosition(Position.ABSOLUTE);
  12. scrollable.getStyle().setTop(-1000.0, Unit.PX);
  13. scrollable.getStyle().setLeft(-1000.0, Unit.PX);
  14. scrollable.getStyle().setHeight(100.0, Unit.PX);
  15. scrollable.getStyle().setWidth(100.0, Unit.PX);
  16. scrollable.getStyle().setOverflow(Overflow.SCROLL);
  17. scrollable.getStyle().setProperty("direction", "rtl");
  18. Document.get().getBody().appendChild(scrollable);
  19. // Add some content.
  20. Element content = Document.get().createDivElement();
  21. content.setInnerText("content");
  22. scrollable.appendChild(content);
  23. // Measure the height and width.
  24. nativeHeight = scrollable.getOffsetHeight() - scrollable.getClientHeight();
  25. nativeWidth = scrollable.getOffsetWidth() - scrollable.getClientWidth();
  26. nativeRtl = (content.getAbsoluteLeft() > scrollable.getAbsoluteLeft());
  27. // Detach the scrollable element.
  28. scrollable.removeFromParent();
  29. }

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

  1. private int getElementsOuterHeight(String... elementClasses) {
  2. int elementsOuterHeight = 0;
  3. for (String clazzName : elementClasses) {
  4. Element element = JQueryWrapper.select(dialog.asWidget()).find(clazzName).get(0);
  5. if (element != null) {
  6. int margin[] = new ComputedStyle(element).getMargin();
  7. elementsOuterHeight += element.getOffsetHeight() + margin[TOP] + margin[BOTTOM];
  8. }
  9. }
  10. return elementsOuterHeight;
  11. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. @Override
  2. protected void onStart() {
  3. if (opening) {
  4. animFrame.getStyle().setHeight(1.0, Unit.PX);
  5. animFrame.getStyle().setPosition(Position.RELATIVE);
  6. animFrame.getStyle().clearDisplay();
  7. height = contentContainer.getScrollHeight();
  8. } else {
  9. height = contentContainer.getOffsetHeight();
  10. }
  11. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. protected void onStart() {
  3. if (opening) {
  4. animFrame.getStyle().setHeight(1.0, Unit.PX);
  5. animFrame.getStyle().setPosition(Position.RELATIVE);
  6. animFrame.getStyle().clearDisplay();
  7. height = contentContainer.getScrollHeight();
  8. } else {
  9. height = contentContainer.getOffsetHeight();
  10. }
  11. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. @Override
  2. public int getHeight(Element e) {
  3. return (int) (e.getOffsetHeight() - num(curCSS(e, "paddingTop", true))
  4. - num(curCSS(e, "paddingBottom", true))
  5. - num(curCSS(e, "borderTopWidth", true)) - num(curCSS(e, "borderBottomWidth", true)));
  6. }

相关文章

Element类方法