当前位置: 首页>>代码示例>>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;未经允许,请勿转载。