當前位置: 首頁>>代碼示例>>Java>>正文


Java DOM.getElementPropertyInt方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.DOM.getElementPropertyInt方法的典型用法代碼示例。如果您正苦於以下問題:Java DOM.getElementPropertyInt方法的具體用法?Java DOM.getElementPropertyInt怎麽用?Java DOM.getElementPropertyInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.DOM的用法示例。


在下文中一共展示了DOM.getElementPropertyInt方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import com.google.gwt.user.client.DOM; //導入方法依賴的package包/類
@Override
protected void init() {
	clientWidth = DOM.getElementPropertyInt(label.getElement(), "clientHeight");
	clientWidth = DOM.getElementPropertyInt(label.getElement(), "clientHeight");
	clientHeight = DOM.getElementPropertyInt(label.getElement(), "clientHeight");
	offsetWidth = label.getOffsetWidth();
	offsetHeight = label.getOffsetHeight();
	offsetTop = DOM.getElementPropertyInt(label.getElement(), "offsetTop");
	offsetLeft = DOM.getElementPropertyInt(label.getElement(), "offsetLeft");

	boder = (offsetHeight - clientHeight) / 2;

	custom();

	this.setPixelSize((int) offsetWidth + offsetLeft * 2, (int) offsetHeight
			+ offsetTop * 2);
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:18,代碼來源:DatasetWidget.java

示例2: init

import com.google.gwt.user.client.DOM; //導入方法依賴的package包/類
/**
 * Init BaseWidget: clientWidth/Height, offsetWidth/Height,border,
 * Set PixelSize of BaseWidget, and call custom to draw NodeShape shape
 * Must be called after the control is attached, so call the init function in the onAttach function
 */
protected void init() {
	clientWidth = DOM.getElementPropertyInt(label.getElement(), "clientWidth");
	if (clientWidth < 100) {
		label.setWidth("100px");
	}
	clientWidth = DOM.getElementPropertyInt(label.getElement(), "clientWidth");
	clientHeight = DOM
			.getElementPropertyInt(label.getElement(), "clientHeight");
	offsetWidth = label.getOffsetWidth();
	offsetHeight = label.getOffsetHeight();
	offsetTop = DOM.getElementPropertyInt(label.getElement(), "offsetTop");
	offsetLeft = DOM.getElementPropertyInt(label.getElement(), "offsetLeft");

	boder = (offsetHeight - clientHeight) / 2;
	clientLeft = (offsetWidth - clientWidth)/2;

	custom();

	this.setPixelSize((int) offsetWidth + offsetLeft * 2, (int) offsetHeight
			+ offsetTop * 2);
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:27,代碼來源:BaseWidget.java

示例3: redraw

import com.google.gwt.user.client.DOM; //導入方法依賴的package包/類
/**
 * Redraw the progress bar when something changes the layout.
 */
public void redraw() {
  if (isAttached()) {
    int width = DOM.getElementPropertyInt(getElement(), "clientWidth");
    int height = DOM.getElementPropertyInt(getElement(), "clientHeight");
    onResize(width, height);
  }
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:11,代碼來源:MiniProgressBar.java

示例4: onResize

import com.google.gwt.user.client.DOM; //導入方法依賴的package包/類
/**
 * This method is called when the dimensions of the parent element change.
 * Subclasses should override this method as needed.
 *
 * Move the text to the center of the progress bar.
 *
 * @param width the new client width of the element
 * @param height the new client height of the element
 */
public void onResize(int width, int height) {
  if (textVisible) {
    int textWidth = DOM.getElementPropertyInt(textElement, "offsetWidth");
    int left = (width / 2) - (textWidth / 2);
    DOM.setStyleAttribute(textElement, "left", left + "px");
  }
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:17,代碼來源:MiniProgressBar.java


注:本文中的com.google.gwt.user.client.DOM.getElementPropertyInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。