本文整理了Java中com.google.gwt.user.client.Window.getScrollTop()
方法的一些代码示例,展示了Window.getScrollTop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.getScrollTop()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Window
类名称:Window
方法名:getScrollTop
[英]Get the window's scroll top.
[中]获取窗口的滚动顶部。
代码示例来源:origin: com.google.gwt/gwt-servlet
static void onScroll() {
if (scrollHandlersInitialized) {
fireEvent(new Window.ScrollEvent(getScrollLeft(), getScrollTop()));
}
}
代码示例来源:origin: stephenh/tessell
@Override
public int getScrollTop() {
return Window.getScrollTop();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int top = (Window.getClientHeight() - getOffsetHeight()) >> 1;
setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
Window.getScrollTop() + top, 0));
代码示例来源:origin: com.google.gwt/gwt-servlet
int windowTop = Window.getScrollTop();
int windowBottom = Window.getScrollTop() + Window.getClientHeight();
代码示例来源:origin: ArcBees/GWTP
/**
* By default this method centers the popup vertically.
* You can override this method to change the vertical position of the popup.
* @param popupHeight the height of the popup
* @return the top position of the popup.
*/
protected int getTop(int popupHeight) {
return ((Window.getClientHeight() - popupHeight) / 2) + Window.getScrollTop();
}
}
代码示例来源:origin: bedatadriven/activityinfo
public int getVerticalScrollPosition() {
if (scrollAncestor != null) {
return scrollAncestor.getVerticalScrollPosition();
} else {
return Window.getScrollTop();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int y = event.getClientY() - senderElem.getAbsoluteTop()
+ senderElem.getPropertyInt("scrollTop")
+ Window.getScrollTop();
代码示例来源:origin: ArcBees/GWTP
@Override
protected int getTop(int popupHeight) {
int top = widget.getAbsoluteTop();
int windowTop = Window.getScrollTop();
int windowBottom = Window.getScrollTop() + Window.getClientHeight();
int distanceFromWindowTop = top - windowTop;
int distanceToWindowBottom = windowBottom - (top + widget.getOffsetHeight());
if (distanceToWindowBottom < popupHeight && distanceFromWindowTop >= popupHeight) {
top -= popupHeight;
} else {
top += widget.getOffsetHeight();
}
return top;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int clientY = event.getClientY() + Window.getScrollTop();
int rowLeft = hoveringRow.getAbsoluteLeft();
int rowTop = hoveringRow.getAbsoluteTop();
代码示例来源:origin: net.wetheinter/gwt-user
static void onScroll() {
if (scrollHandlersInitialized) {
fireEvent(new Window.ScrollEvent(getScrollLeft(), getScrollTop()));
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
static void onScroll() {
if (scrollHandlersInitialized) {
fireEvent(new Window.ScrollEvent(getScrollLeft(), getScrollTop()));
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
@Override
public void execute() {
resizeDialog();
int left = (Window.getClientWidth() - getOffsetWidth()) >> 1;
int top = (Window.getClientHeight() - getOffsetHeight()) >> 1;
setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
Window.getScrollTop() + top, 0));
}
});
代码示例来源:origin: oVirt/ovirt-engine
private void styleAndPositionMenuContainer(final int eventX, final int eventY) {
menuContainer.addStyleName(OPEN);
clickButton.getElement().setAttribute(ARIA_EXPANDED, Boolean.TRUE.toString());
menuContainer.getElement().getStyle().setPosition(Position.ABSOLUTE);
menuContainer.getElement().getStyle().setTop(Window.getScrollTop() + eventY, Unit.PX);
menuContainer.getElement().getStyle().setLeft(eventX, Unit.PX);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
@Override
public void showContextMenu(Event event) {
if (enabled && actionKeys != null) {
// Show context menu if there are registered action handlers
int left = WidgetUtil.getTouchOrMouseClientX(event)
+ Window.getScrollLeft();
int top = WidgetUtil.getTouchOrMouseClientY(event)
+ Window.getScrollTop();
showContextMenu(left, top);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
@Override
public void showContextMenu(Event event) {
if (_delegate.contextMenuEnabled && enabled && (_delegate.customContextMenu != null || actionKeys != null)) {
// Show context menu if there are registered action handlers
int left = WidgetUtil.getTouchOrMouseClientX(event)
+ Window.getScrollLeft();
int top = WidgetUtil.getTouchOrMouseClientY(event)
+ Window.getScrollTop();
selectRowForContextMenuActions(event);
showContextMenu(left, top);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
@Override
public void showContextMenu(Event event) {
if (_delegate.contextMenuEnabled && enabled && (_delegate.customContextMenu != null || actionKeys != null)) {
// Show context menu if there are registered action handlers
int left = WidgetUtil.getTouchOrMouseClientX(event)
+ Window.getScrollLeft();
int top = WidgetUtil.getTouchOrMouseClientY(event)
+ Window.getScrollTop();
selectRowForContextMenuActions(event);
showContextMenu(left, top);
}
}
代码示例来源:origin: ManfredTremmel/gwt-bean-validators
private boolean isInViewPort() {
final int pageTop = Window.getScrollTop();
final int pageBottom = pageTop + Window.getClientHeight();
final int elementTop = asWidget().getElement().getAbsoluteTop();
final int elementBottom = elementTop + asWidget().getElement().getClientHeight();
return elementTop <= pageBottom && elementBottom >= pageTop;
}
}
代码示例来源:origin: com.ebmwebsourcing.geasytools/geasy-ui
@Override
public void onStop(IDragStopEvent event) {
element.fireEvent(new PositionChangeEvent(oldX, oldY, element.getRelativeX()+element.getUIPanel().getScrollLeft()+Window.getScrollLeft(), element.getRelativeY()+element.getUIPanel().getScrollTop()+Window.getScrollTop()));
}
代码示例来源:origin: com.ebmwebsourcing.geasytools/geasy-ui
@Override
public void onDoubleClick(DoubleClickEvent event) {
//select actual connector
HashMap<String,ISelectable> selectedElements = new HashMap<String,ISelectable>();
selectedElements.put(connector.getId(), connector);
connector.getUIPanel().setSelectedElements(selectedElements);
Point p = new Point(mouseX+connector.getUIPanel().getScrollLeft()+Window.getScrollLeft()-connector.getUIPanel().getAbsoluteLeft(), mouseY+connector.getUIPanel().getScrollTop()+Window.getScrollTop()-connector.getUIPanel().getAbsoluteTop());
Point p2 = new Point(mouseX,mouseY);
ClosestPoints closestPoints = getClosestPoints(p2);
connector.fireEvent(new AddWayPointEvent(p, closestPoints
.getMinPoint(), closestPoints.getMaxPoint()));
}
});
代码示例来源:origin: com.ebmwebsourcing.petalsbpm/bpmn-diagram
public void onMouseMove(MouseMoveEvent event) {
docker.setVisible(true);
docker.setX(event.getClientX()-getUIPanel().getAbsoluteLeft()+getUIPanel().getScrollLeft()+Window.getScrollLeft());
docker.setY(event.getClientY()-getUIPanel().getAbsoluteTop()+getUIPanel().getScrollTop()+Window.getScrollTop());
docker.toBack();
timer.cancel();
}
});
内容来源于网络,如有侵权,请联系作者删除!