本文整理匯總了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");
}
}