当前位置: 首页>>代码示例>>Java>>正文


Java Window.getClientWidth方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:WebTable.java

示例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);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:26,代码来源:FilterBox.java

示例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));
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:AddMeetingsDialog.java

示例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;
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:InfoPanelImpl.java

示例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);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:10,代码来源:UniTimeFrameDialog.java

示例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());
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:PageLabel.java

示例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);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:10,代码来源:UniTimeMenuBar.java

示例8: getViewport

import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
Rectangle getViewport() {
    return new Rectangle(Window.getScrollLeft(), Window.getScrollTop(), Window.getClientWidth(), Window.getClientHeight());
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:4,代码来源:ViewportHelper.java

示例9: needsMove

import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private boolean needsMove() {
	return iLastClientWidth != Window.getClientWidth() ||
		iLastScrollLeft != Window.getScrollLeft() || iLastScrollTop != Window.getScrollTop();
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:5,代码来源:UniTimeMenuBar.java

示例10: getDisplay

import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
protected static Display getDisplay() {
	if (Window.getClientWidth() <= 800)
		return NOTIFICATIONS_MOBILE;
	else
		return NOTIFICATIONS;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:7,代码来源:UniTimeNotifications.java

示例11: computeWidth

import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private int computeWidth() {
	return Window.getClientWidth() - (HORIZONTAL_MARGIN * 2);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:4,代码来源:LayerEditDialog.java


注:本文中的com.google.gwt.user.client.Window.getClientWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。