本文整理汇总了Java中com.google.gwt.user.client.Window.getClientWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Window.getClientWidth方法的具体用法?Java Window.getClientWidth怎么用?Java Window.getClientWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Window
的用法示例。
在下文中一共展示了Window.getClientWidth方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NoteCell
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public NoteCell(String text, final String title) {
super(null);
if (Window.getClientWidth() <= 800 && title != null && !title.isEmpty()) {
iIcon = new Image(RESOURCES.note());
iIcon.setTitle(title);
iIcon.setAltText(title);
iIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
} else {
iNote = new P("unitime-Note");
iNote.setHTML(text);
if (title != null) iNote.setTitle(title);
}
}
示例2: position
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private void position(final UIObject relativeObject, int offsetWidth, int offsetHeight) {
int textBoxOffsetWidth = relativeObject.getOffsetWidth();
int offsetWidthDiff = offsetWidth - textBoxOffsetWidth;
int left = relativeObject.getAbsoluteLeft();
if (offsetWidthDiff > 0) {
int windowRight = Window.getClientWidth() + Window.getScrollLeft();
int windowLeft = Window.getScrollLeft();
int distanceToWindowRight = windowRight - left;
int distanceFromWindowLeft = left - windowLeft;
if (distanceToWindowRight < offsetWidth && distanceFromWindowLeft >= offsetWidthDiff) {
left -= offsetWidthDiff;
}
}
int top = relativeObject.getAbsoluteTop();
int windowTop = Window.getScrollTop();
int windowBottom = Window.getScrollTop() + Window.getClientHeight();
int distanceFromWindowTop = top - windowTop;
int distanceToWindowBottom = windowBottom - (top + relativeObject.getOffsetHeight());
if (distanceToWindowBottom < offsetHeight && distanceFromWindowTop >= offsetHeight) {
top -= offsetHeight;
} else {
top += relativeObject.getOffsetHeight();
}
setPopupPosition(left, top);
}
示例3: recenter
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public void recenter() {
GwtHint.getInstance().hide();
iScrollRooms.getElement().getStyle().clearHeight();
if (getElement().getClientHeight() > Window.getClientHeight() - 100)
iScrollRooms.getElement().getStyle().setHeight(Window.getClientHeight() - 200, Unit.PX);
iScrollDates.getElement().getStyle().clearHeight();
if (getElement().getClientHeight() > Window.getClientHeight() - 100) {
iScrollDates.getElement().getStyle().setHeight(Window.getClientHeight() - 200, Unit.PX);
}
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));
}
示例4: onBrowserEvent
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public void onBrowserEvent(Event event) {
if (iHint.getText().isEmpty()) return;
iX = 10 + event.getClientX() + getElement().getOwnerDocument().getScrollLeft();
iY = 10 + event.getClientY() + getElement().getOwnerDocument().getScrollTop();
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEMOVE:
if (iInfoPanel.isShowing()) {
int maxX = Window.getScrollLeft() + Window.getClientWidth() - iInfoPanel.getOffsetWidth() - 10;
iInfoPanel.setPopupPosition(Math.min(iX, maxX), iY);
} else if (iInfo.getRowCount() > 0) {
iShowInfo.cancel();
iShowInfo.schedule(1000);
}
break;
case Event.ONMOUSEOUT:
iShowInfo.cancel();
if (iInfoPanel.isShowing())
iHideInfo.schedule(1000);
break;
}
}
示例5: openDialog
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static void openDialog(String title, String source, String width, String height, boolean noCacheTS) {
if (sDialog == null) {
if (Window.getClientWidth() <= 800)
sDialog = GWT.create(UniTimeFrameDialogDisplay.Mobile.class);
else
sDialog = GWT.create(UniTimeFrameDialogDisplay.class);
}
sDialog.openDialog(title, source, width, height, noCacheTS);
}
示例6: PageLabel
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public PageLabel() {
if (Window.getClientWidth() <= 800)
iDisplay = GWT.create(PageLabelDisplay.Mobile.class);
else
iDisplay = GWT.create(PageLabelDisplay.class);
initWidget(iDisplay.asWidget());
}
示例7: move
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private void move(boolean show) {
iLastClientWidth = Window.getClientWidth();
iLastScrollLeft = Window.getScrollLeft();
iLastScrollTop = Window.getScrollTop();
iMenu.getElement().getStyle().setWidth(iLastClientWidth - 2, Unit.PX);
iMenu.getElement().getStyle().setLeft(iLastScrollLeft, Unit.PX);
iMenu.getElement().getStyle().setTop(iLastScrollTop, Unit.PX);
iMenu.setVisible(true);
}
示例8: getViewport
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
Rectangle getViewport() {
return new Rectangle(Window.getScrollLeft(), Window.getScrollTop(), Window.getClientWidth(), Window.getClientHeight());
}
示例9: needsMove
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private boolean needsMove() {
return iLastClientWidth != Window.getClientWidth() ||
iLastScrollLeft != Window.getScrollLeft() || iLastScrollTop != Window.getScrollTop();
}
示例10: getDisplay
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
protected static Display getDisplay() {
if (Window.getClientWidth() <= 800)
return NOTIFICATIONS_MOBILE;
else
return NOTIFICATIONS;
}
示例11: computeWidth
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private int computeWidth() {
return Window.getClientWidth() - (HORIZONTAL_MARGIN * 2);
}