Search in sources :

Example 1 with Unit

use of com.google.gwt.dom.client.Style.Unit in project blogwt by billy1380.

the class MapHelper method showMap.

/**
 * @param element
 * @param lines
 * @param params
 */
public static void showMap(Element element, List<String> lines, Map<String, String> params) {
    Style s = element.getStyle();
    float width = floatParam(params, "width", 100);
    Unit widthUnits = unitParam(params, "widthUnits", Unit.PCT);
    s.setWidth(width, widthUnits);
    float height = floatParam(params, "height", 200);
    Unit heightUnits = unitParam(params, "heightUnits", Unit.PT);
    s.setHeight(height, heightUnits);
    float lat = floatParam(params, "lat", -34.397f);
    float lng = floatParam(params, "lng", 150.644f);
    int zoom = intParam(params, "zoom", 8);
    String markerName = params.get("markerName");
    showMap(element, lat, lng, zoom, markerName);
}
Also used : Style(com.google.gwt.dom.client.Style) Unit(com.google.gwt.dom.client.Style.Unit)

Example 2 with Unit

use of com.google.gwt.dom.client.Style.Unit in project blogwt by billy1380.

the class MapHelper method unitParam.

public static Unit unitParam(Map<String, String> params, String name, Unit defaultValue) {
    String paramUnit = params.get(name);
    Unit units = defaultValue;
    if (paramUnit != null) {
        try {
            units = Unit.valueOf(paramUnit);
        } catch (Exception ex) {
        }
    }
    return units;
}
Also used : Unit(com.google.gwt.dom.client.Style.Unit)

Aggregations

Unit (com.google.gwt.dom.client.Style.Unit)2 Style (com.google.gwt.dom.client.Style)1