本文整理了Java中com.google.gwt.dom.client.Element.getAbsoluteLeft()
方法的一些代码示例,展示了Element.getAbsoluteLeft()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getAbsoluteLeft()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getAbsoluteLeft
[英]Gets an element's absolute left coordinate in the document's coordinate system.
[中]
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets an element's absolute left coordinate in the document's coordinate
* system.
*
* @param elem the element to be measured
* @return the element's absolute left coordinate
* @deprecated Use {@link Element#getAbsoluteLeft()} instead.
*/
@Deprecated
public static int getAbsoluteLeft(Element elem) {
return elem.getAbsoluteLeft();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets an element's absolute right coordinate in the document's coordinate
* system.
*/
public final int getAbsoluteRight() {
return getAbsoluteLeft() + getOffsetWidth();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void setPosition(int offsetWidth, int offsetHeight) {
panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
lastParent.getAbsoluteTop() + offsetY);
}
});
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the touch x-position relative to a given element.
*
* @param target the element whose coordinate system is to be used
* @return the relative x-position
*/
public final int getRelativeX(Element target) {
return getClientX() - target.getAbsoluteLeft() + target.getScrollLeft()
+ target.getOwnerDocument().getScrollLeft();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the mouse x-position relative to a given element.
*
* @param target the element whose coordinate system is to be used
* @return the relative x-position
*/
public int getRelativeX(Element target) {
NativeEvent e = getNativeEvent();
return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() +
target.getOwnerDocument().getScrollLeft();
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Gets an element's absolute left coordinate in the document's coordinate
* system.
*
* @param elem the element to be measured
* @return the element's absolute left coordinate
* @deprecated Use {@link Element#getAbsoluteLeft()} instead.
*/
@Deprecated
public static int getAbsoluteLeft(Element elem) {
return elem.getAbsoluteLeft();
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
/**
* Measures the left margin of an element
*
* @param element
* The element to measure
* @return Left margin in pixels
*/
public static int measureMarginLeft(Element element) {
return element.getAbsoluteLeft()
- element.getParentElement().getAbsoluteLeft();
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Gets an element's absolute right coordinate in the document's coordinate
* system.
*/
public final int getAbsoluteRight() {
return getAbsoluteLeft() + getOffsetWidth();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Gets an element's absolute right coordinate in the document's coordinate
* system.
*/
public final int getAbsoluteRight() {
return getAbsoluteLeft() + getOffsetWidth();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* 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();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int x = event.getClientX() - senderElem.getAbsoluteLeft()
+ senderElem.getPropertyInt("scrollLeft")
+ Window.getScrollLeft();
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
public void setPosition(int offsetWidth, int offsetHeight) {
panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
lastParent.getAbsoluteTop() + offsetY);
}
});
代码示例来源:origin: oVirt/ovirt-engine
public ColumnResizeHandler(Element headerElement, Column<T, ?> column, HasResizableColumns<T> table) {
this.headerElement = headerElement;
this.column = column;
this.table = table;
this.eventHandler = Event.addNativePreviewHandler(this);
this.columnAbsoluteLeft = headerElement.getAbsoluteLeft();
// Indicate resize start
table.onResizeStart(column, headerElement);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int containerTop = getAbsoluteTop();
int left = selectedElem.getAbsoluteLeft() - containerLeft;
int top = selectedElem.getAbsoluteTop() - containerTop;
int width = selectedElem.getPropertyInt("offsetWidth");
代码示例来源:origin: pl.touk.gwtaculous/gwtaculous-lib
public static boolean isMouseCursorWithinElement(Element element, int mousePosX, int mousePosY){
int elementTop = element.getAbsoluteTop();
int elementLeft = element.getAbsoluteLeft();
int elementBottom = element.getAbsoluteBottom();
int elementRight = element.getAbsoluteRight();
if (mousePosX > elementLeft && mousePosX < elementRight && mousePosY > elementTop && mousePosY < elementBottom) {
return true;
}
return false;
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Get the current offset of the first matched element, in pixels, relative to the document. The
* returned object contains two integer properties, top and left. The method works only with
* visible elements.
*/
public Offset offset() {
Element e = get(0);
return e == null ? new Offset(0, 0) : new Offset(e.getAbsoluteLeft(), e.getAbsoluteTop());
}
代码示例来源:origin: threerings/playn
/**
* Gets the event's x-position relative to a given element.
*
* @param e native event
* @param target the element whose coordinate system is to be used
* @return the relative x-position
*/
static float getRelativeX(NativeEvent e, Element target) {
return (e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft()
+ target.getOwnerDocument().getScrollLeft()) / HtmlGraphics.experimentalScale;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
public static int getRelativeXOfEvent(final DomEvent event) {
final NativeEvent e = event.getNativeEvent();
final Element target = event.getRelativeElement();
return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() + target.getOwnerDocument().getScrollLeft();
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
private int getRelativeX(final ContextMenuEvent event) {
final NativeEvent e = event.getNativeEvent();
final Element target = event.getRelativeElement();
return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() + target.getOwnerDocument().getScrollLeft();
}
代码示例来源:origin: org.jboss.ballroom/widgets
@Override
protected void onEnterKeyDown(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
popup.setPopupPosition(parent.getAbsoluteLeft()-5, parent.getAbsoluteTop()-5);
popup.show();
popup.setAutoHideEnabled(true);
delegate.onRowSelection(context.getIndex());
}
内容来源于网络,如有侵权,请联系作者删除!