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