本文整理汇总了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);
}
示例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);
}
示例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);
}
}
示例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");
}
}