Java Code Examples for com.google.gwt.dom.client.Style#setRight()

The following examples show how to use com.google.gwt.dom.client.Style#setRight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Scrollbar.java    From djvu-html5 with GNU General Public License v2.0 6 votes vote down vote up
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);
	}
}