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

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

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

Element.getAbsoluteRight介绍

[英]Gets an element's absolute right coordinate in the document's coordinate system.
[中]获取元素在文档坐标系中的绝对右坐标。

代码示例

代码示例来源:origin: pl.touk.gwtaculous/gwtaculous-lib

  1. public static boolean isMouseCursorWithinElement(Element element, int mousePosX, int mousePosY){
  2. int elementTop = element.getAbsoluteTop();
  3. int elementLeft = element.getAbsoluteLeft();
  4. int elementBottom = element.getAbsoluteBottom();
  5. int elementRight = element.getAbsoluteRight();
  6. if (mousePosX > elementLeft && mousePosX < elementRight && mousePosY > elementTop && mousePosY < elementBottom) {
  7. return true;
  8. }
  9. return false;
  10. }

代码示例来源:origin: pl.touk.gwtaculous/gwtaculous-lib

  1. private void calculateMoveRestriction(DragObject dragObject){
  2. isMouseMoveAxisX = dragOptionsCache.contains(DragOption.MOVE_AXIS_X) && (!dragOptionsCache.contains(DragOption.BLOCK_WIDGET));
  3. isMouseMoveAxisY = dragOptionsCache.contains(DragOption.MOVE_AXIS_Y) && (!dragOptionsCache.contains(DragOption.BLOCK_WIDGET));;
  4. isMouseMoveRestricted = (isMouseMoveAxisX != isMouseMoveAxisY) || (dragOptionsCache.contains(DragOption.BLOCK_WIDGET));
  5. if (dragObject.getContainerElement()!= null) {
  6. Element container = dragObject.getContainerElement();
  7. Element dragged = dragObject.getDragElement();
  8. maxMousePositionX = container.getAbsoluteRight() - dragged.getClientWidth();
  9. maxMousePositionY = container.getAbsoluteBottom() - dragged.getClientHeight();
  10. minMousePositionX = container.getAbsoluteLeft();
  11. minMousePositionY = container.getAbsoluteTop();
  12. isMouseMoveRestricted = true;
  13. }
  14. }

代码示例来源:origin: org.eclipse.che.core/che-core-ide-app

  1. @Override
  2. public void onMouseOver(MouseOverEvent event) {
  3. final Element panel = event.getRelativeElement();
  4. tooltip
  5. .getStyle()
  6. .setProperty("top", (panel.getAbsoluteTop() + panel.getOffsetHeight() + 9) + "px");
  7. tooltip
  8. .getStyle()
  9. .setProperty(
  10. "right",
  11. (Document.get().getClientWidth() - panel.getAbsoluteRight() - 2) + "px");
  12. }
  13. },

代码示例来源:origin: gwtbootstrap3/gwtbootstrap3

  1. @Override
  2. public void execute() {
  3. PopupPanel panel = getPopupPanel();
  4. if (box.isAttached())
  5. {
  6. Element e = box.getElement();
  7. panel.setWidth((e.getAbsoluteRight() - e.getAbsoluteLeft() - 2) + Unit.PX.getType());
  8. panel.setPopupPosition(e.getAbsoluteLeft(), e.getAbsoluteBottom());
  9. }
  10. else
  11. {
  12. panel.hide();
  13. }
  14. }
  15. });

代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3

  1. @Override
  2. public void execute() {
  3. PopupPanel panel = getPopupPanel();
  4. if (box.isAttached())
  5. {
  6. Element e = box.getElement();
  7. panel.setWidth((e.getAbsoluteRight() - e.getAbsoluteLeft() - 2) + Unit.PX.getType());
  8. panel.setPopupPosition(e.getAbsoluteLeft(), e.getAbsoluteBottom());
  9. }
  10. else
  11. {
  12. panel.hide();
  13. }
  14. }
  15. });

代码示例来源:origin: fr.putnami.pwt/pwt

  1. public void popup(Widget container, Widget relativeTo) {
  2. this.setVisible(true);
  3. StyleUtils.addStyle(this, InputDatePicker.STYLE_POPUP);
  4. RootPanel.get().add(this);
  5. Element positioningElement = this.getElement();
  6. Element relativeElement = relativeTo.getElement();
  7. int targetHeight = relativeElement.getOffsetHeight();
  8. int targetTop = relativeElement.getAbsoluteTop();
  9. int positioningWidth = positioningElement.getOffsetWidth();
  10. int targetRight = relativeElement.getAbsoluteRight();
  11. Style elementStyle = positioningElement.getStyle();
  12. elementStyle.setPosition(Position.ABSOLUTE);
  13. elementStyle.setLeft(targetRight - positioningWidth, Unit.PX);
  14. elementStyle.setTop(targetTop + targetHeight, Unit.PX);
  15. StyleUtils.addStyle(this, InputDatePicker.STYLE_FADE);
  16. StyleUtils.addStyle(this, InputDatePicker.STYLE_SHOW);
  17. this.setFocus(true);
  18. if (this.popupBlurHandler == null) {
  19. this.popupBlurHandler = this.addBlurHandler(new BlurHandler() {
  20. @Override
  21. public void onBlur(BlurEvent event) {
  22. InputDatePicker.this.hide();
  23. }
  24. });
  25. }
  26. }

代码示例来源:origin: Putnami/putnami-web-toolkit

  1. public void popup(Widget container, Widget relativeTo) {
  2. this.setVisible(true);
  3. StyleUtils.addStyle(this, InputDatePicker.STYLE_POPUP);
  4. RootPanel.get().add(this);
  5. Element positioningElement = this.getElement();
  6. Element relativeElement = relativeTo.getElement();
  7. int targetHeight = relativeElement.getOffsetHeight();
  8. int targetTop = relativeElement.getAbsoluteTop();
  9. int positioningWidth = positioningElement.getOffsetWidth();
  10. int targetRight = relativeElement.getAbsoluteRight();
  11. Style elementStyle = positioningElement.getStyle();
  12. elementStyle.setPosition(Position.ABSOLUTE);
  13. elementStyle.setLeft(targetRight - positioningWidth, Unit.PX);
  14. elementStyle.setTop(targetTop + targetHeight, Unit.PX);
  15. StyleUtils.addStyle(this, InputDatePicker.STYLE_FADE);
  16. StyleUtils.addStyle(this, InputDatePicker.STYLE_SHOW);
  17. this.setFocus(true);
  18. if (this.popupBlurHandler == null) {
  19. this.popupBlurHandler = this.addBlurHandler(new BlurHandler() {
  20. @Override
  21. public void onBlur(BlurEvent event) {
  22. InputDatePicker.this.hide();
  23. }
  24. });
  25. }
  26. }

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. int right = splitter.getAbsoluteRight();

相关文章

Element类方法