本文整理了Java中com.google.gwt.user.client.Element.getAbsoluteLeft()
方法的一些代码示例,展示了Element.getAbsoluteLeft()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getAbsoluteLeft()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:getAbsoluteLeft
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the object's absolute left position in pixels, as measured from the
* browser window's client area.
*
* @return the object's absolute left position
*/
public int getAbsoluteLeft() {
return getElement().getAbsoluteLeft();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the popup's left position relative to the browser's client area.
*
* @return the popup's left position
*/
public int getPopupLeft() {
return getElement().getAbsoluteLeft();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the position of the left outer border edge of the widget relative to
* the left outer border edge of the panel.
*
* @param w the widget whose position is to be retrieved
* @return the widget's left position
*/
public int getWidgetLeft(Widget w) {
checkWidgetParent(w);
return w.getElement().getAbsoluteLeft()
- getElement().getAbsoluteLeft();
}
代码示例来源:origin: com.extjs/gxt
/**
* Gets the current X position of the element based on page coordinates.
* Element must be part of the DOM tree to have page coordinates.
*
* @return the x position of the element
*/
public int getX() {
return dom.getAbsoluteLeft();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Gets the object's absolute left position in pixels, as measured from the
* browser window's client area.
*
* @return the object's absolute left position
*/
public int getAbsoluteLeft() {
return getElement().getAbsoluteLeft();
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Gets the object's absolute left position in pixels, as measured from the
* browser window's client area.
*
* @return the object's absolute left position
*/
public int getAbsoluteLeft() {
return getElement().getAbsoluteLeft();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Gets the popup's left position relative to the browser's client area.
*
* @return the popup's left position
*/
public int getPopupLeft() {
return getElement().getAbsoluteLeft();
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Gets the popup's left position relative to the browser's client area.
*
* @return the popup's left position
*/
public int getPopupLeft() {
return getElement().getAbsoluteLeft();
}
代码示例来源:origin: com.ebmwebsourcing.geasytools/geasy-ui
public float getAbsoluteX() {
return this.getElement().getAbsoluteLeft();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Gets the position of the left outer border edge of the widget relative to
* the left outer border edge of the panel.
*
* @param w the widget whose position is to be retrieved
* @return the widget's left position
*/
public int getWidgetLeft(Widget w) {
checkWidgetParent(w);
return w.getElement().getAbsoluteLeft()
- getElement().getAbsoluteLeft();
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Gets the position of the left outer border edge of the widget relative to
* the left outer border edge of the panel.
*
* @param w the widget whose position is to be retrieved
* @return the widget's left position
*/
public int getWidgetLeft(Widget w) {
checkWidgetParent(w);
return w.getElement().getAbsoluteLeft()
- getElement().getAbsoluteLeft();
}
代码示例来源:origin: de.esoco/gewt
/***************************************
* Get the offset for the horizontal scroll
*
* @return The offset
*/
private int getPageScrollLeft()
{
Element rBodyElement = RootPanel.getBodyElement();
return DOM.getParent(rBodyElement).getAbsoluteLeft();
}
代码示例来源:origin: stackoverflow.com
public static boolean isVisible(Element e)
{
//vp = viewPort, b = bottom, l = left, t = top, r = right
int vpWidth = Window.getClientWidth();
int vpHeight = Window.getClientHeight();
boolean tViz = ( e.getAbsoluteTop() >= 0 && e.getAbsoluteTop()< vpHeight);
boolean bViz = (e.getAbsoluteBottom() > 0 && e.getAbsoluteBottom() <= vpHeight);
boolean lViz = (e.getAbsoluteLeft() >= 0 && e.getAbsoluteLeft() < vpWidth);
boolean rViz = (e.getAbsoluteRight() > 0 && e.getAbsoluteRight() <= vpWidth);
boolean vVisible = tViz && bViz;
boolean hVisible = lViz && rViz;
return hVisible && vVisible;
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Slide the knob to a new location.
*
* @param event
* the mouse event
*/
private void slideKnob(Event event) {
int x = DOM.eventGetClientX(event);
if (x > 0) {
int lineWidth = lineElement.getOffsetWidth();
int lineLeft = lineElement.getAbsoluteLeft();
double percent = (double) (x - lineLeft) / lineWidth * 1.0;
setCurrentValue(getTotalRange() * percent + minValue, true);
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
/**
* Gets the mouse x-position relative to the canvas element.
* @param clientX The event's clientX value.
* @return the relative x-position
*/
private double getRelativeX(final double clientX) {
return clientX - getCanvasElement().getAbsoluteLeft() + getCanvasElement().getScrollLeft() +
getCanvasElement().getOwnerDocument().getScrollLeft();
}
代码示例来源:origin: com.extjs/gxt
protected void moveFocus(Element selectedElem) {
if (selectedElem == null) return;
int containerLeft = getAbsoluteLeft();
int containerTop = getAbsoluteTop();
int left = selectedElem.getAbsoluteLeft() - containerLeft;
int top = selectedElem.getAbsoluteTop() - containerTop;
int width = selectedElem.getOffsetWidth();
int height = selectedElem.getOffsetHeight();
if (width == 0 || height == 0) {
focusEl.setLeftTop(0, 0);
return;
}
focusEl.setLeftTop(left, top);
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
private void beginMovingWindow(Event event) {
if (draggable) {
showDraggingCurtain();
dragging = true;
startX = WidgetUtil.getTouchOrMouseClientX(event);
startY = WidgetUtil.getTouchOrMouseClientY(event);
origX = getElement().getAbsoluteLeft();
origY = getElement().getAbsoluteTop();
DOM.setCapture(getElement());
event.preventDefault();
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
void resize()
{
if( fakeDiv == null )
{
fakeDiv = DOM.createDiv();
fakeDiv.getStyle().setPosition( Position.FIXED );
fakeDiv.getStyle().setLeft( -10000, Unit.PX );
getElement().getParentElement().insertAfter( fakeDiv, getElement() );
applyStyle( fakeDiv );
}
int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
fakeDiv.setInnerText( getText() );
int height = getElement().getClientHeight();
int newHeight = fakeDiv.getClientHeight() + 25;
if( height < newHeight )
getElement().getStyle().setHeight( newHeight, Unit.PX );
}
代码示例来源:origin: ltearno/hexa.tools
void resize()
{
if( fakeDiv == null )
{
fakeDiv = DOM.createDiv();
fakeDiv.getStyle().setPosition( Position.FIXED );
fakeDiv.getStyle().setLeft( -10000, Unit.PX );
getElement().getParentElement().insertAfter( fakeDiv, getElement() );
applyStyle( fakeDiv );
}
int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
fakeDiv.setInnerText( getText() );
int height = getElement().getClientHeight();
int newHeight = fakeDiv.getClientHeight() + 25;
if( height < newHeight )
getElement().getStyle().setHeight( newHeight, Unit.PX );
}
代码示例来源:origin: oVirt/ovirt-engine
private void attachAutoCloseHandler() {
removeAutoCloseHandler();
autoCloseHandler = RootPanel.get().addDomHandler(e -> {
if (isVisible()) {
int top = content.asWidget().getElement().getAbsoluteTop();
int left = content.asWidget().getElement().getAbsoluteLeft();
int right = content.asWidget().getElement().getAbsoluteRight();
int bottom = content.asWidget().getElement().getAbsoluteBottom();
if (e.getY() < top || e.getY() > bottom || e.getX() < left || e.getX() > right) {
hide();
}
}
}, ClickEvent.getType());
}
内容来源于网络,如有侵权,请联系作者删除!