本文整理匯總了Java中com.google.gwt.dom.client.Style.setBottom方法的典型用法代碼示例。如果您正苦於以下問題:Java Style.setBottom方法的具體用法?Java Style.setBottom怎麽用?Java Style.setBottom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.dom.client.Style
的用法示例。
在下文中一共展示了Style.setBottom方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setThumb
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
public void setThumb(double center, double width) {
Style style = getElement().getStyle();
if (width >= 1) {
style.setVisibility(Visibility.HIDDEN);
return;
} else {
style.setVisibility(Visibility.VISIBLE);
}
if (isHorizontal) {
style.setLeft(100 * (center - width / 2), Unit.PCT);
style.setRight(100 * (1 - center - width / 2), Unit.PCT);
} else {
style.setTop(100.0 * (center - width / 2), Unit.PCT);
style.setBottom(100 * (1 - center - width / 2), Unit.PCT);
}
}
示例2: createSpanElement
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private SpanElement createSpanElement(final Cursor cursor,
final double left,
final double width) {
final SpanElement span = document.createSpanElement();
span.setAttribute("title",
title);
final Style style = span.getStyle();
style.setCursor(cursor);
style.setPosition(Position.ABSOLUTE);
style.setBottom(0,
PX);
style.setHeight(source.getOffsetHeight(),
PX);
style.setTop(source.getOffsetTop(),
PX);
style.setWidth(width,
PX);
style.setLeft(left,
PX);
return span;
}
示例3: putCover
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
/**
* Puts cover element on the covered element.
* The cover and covered elements have the same position and size.
*
* @param cover the cover element
* @param covered the covered element
*/
public static void putCover(Element cover, Element covered) {
Element parent = covered.getParentElement();
Rect coveredRect = DomUtil.getElementAbsoluteRect(covered);
Rect parentRect = DomUtil.getElementAbsoluteRect(parent);
Style coverStyle = cover.getStyle();
coverStyle.setPosition(Style.Position.ABSOLUTE);
coverStyle.setTop(coveredRect.getTop() - parentRect.getTop(), Style.Unit.PX);
coverStyle.setLeft(coveredRect.getLeft() - parentRect.getLeft(), Style.Unit.PX);
coverStyle.setRight(parentRect.getRight() - coveredRect.getRight(), Style.Unit.PX);
coverStyle.setBottom(parentRect.getBottom() - coveredRect.getBottom(), Style.Unit.PX);
parent.appendChild(cover);
}