Java Code Examples for com.google.gwt.user.client.ui.HTML#setHeight()

The following examples show how to use com.google.gwt.user.client.ui.HTML#setHeight() . These examples are extracted from open source projects. 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
private HTML buildSliderPart(String width, String height, String cursor, String color, double transparancy) {
    HTML container = new HTML();
    container.setWidth(width);
    container.setHeight(height);
    DOM.setStyleAttribute(container.getElement(), "cursor", cursor);
    DOM.setStyleAttribute(container.getElement(), "backgroundColor", color);

    // transparency styling (see also bug#449 and http://www.quirksmode.org/css/opacity.html)
    // note: since GWT complains, '-msFilter' has to be in plain camelCase (w/o '-')
    // ordering is important here
    DOM.setStyleAttribute(container.getElement(), "opacity", Double.toString(transparancy));
    DOM.setStyleAttribute(container.getElement(), "mozOpacity", Double.toString(transparancy));
    String opacity = "(opacity=" +Double.toString(transparancy*100) + ")";
    DOM.setStyleAttribute(container.getElement(), "msFilter", "\"progid:DXImageTransform.Microsoft.Alpha"+ opacity + "\"");
    DOM.setStyleAttribute(container.getElement(), "filter", "alpha" + opacity);
    return container;
}
 
Example 2
Source Project: swcv   File: WordCloudDetailApp.java    License: MIT License 5 votes vote down vote up
private SimplePanel createPanel(String svg, int width, int height)
{
    SimplePanel panel = new SimplePanel();
    panel.setPixelSize(width, height);
    panel.addStyleName("center");
    HTML html = new HTML(svg);
    html.setWidth("100%");
    html.setHeight("100%");
    panel.add(html);
    return panel;
}
 
Example 3
/**
 * Creates an square spacer
 *
 * @param width  The desired width space
 * @param height The desired height space
 * @return an HTML element meaning the with and height
 */
public static HTML space(String width, String height) {
	HTML spacer = new HTML("");
	spacer.setWidth(width);
	spacer.setHeight(height);
	return spacer;
}
 
Example 4
/**
 * Creates an vertical spacer
 *
 * @param height The desired height space
 * @return an HTML element meaning the height
 */
public static HTML vSpace(String height) {
	HTML spacer = new HTML("");
	spacer.setHeight(height);
	return spacer;
}