Example usage for com.google.gwt.user.client.ui UIObject setPixelSize

List of usage examples for com.google.gwt.user.client.ui UIObject setPixelSize

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui UIObject setPixelSize.

Prototype

public void setPixelSize(int width, int height) 

Source Link

Document

Sets the object's size, in pixels, not including decorations such as border, margin, and padding.

Usage

From source file:ca.upei.ic.timetable.client.UIUtils.java

License:Apache License

public static void objectSetPixelSizeIntelligently(UIObject object, int width, int height) {

    if (width >= 0 && height >= 0) {
        object.setPixelSize(width, height);
    } else if (width >= 0 && height < 0) {
        object.setWidth(Integer.toString(width) + "px");
    } else if (width < 0 && height >= 0) {
        object.setHeight(Integer.toString(height) + "px");
    }//from  w w w  . j ava  2s.  c  o m
}

From source file:com.tractionsoftware.gwt.user.client.util.Geometry.java

License:Apache License

/**
 * Sets the size of a UIObject/*from  w  w w. j  a  v a2 s .  co  m*/
 */
public static final void setSize(UIObject o, Rect size) {
    o.setPixelSize(size.w, size.h);

}