Search in sources :

Example 11 with JsOverlay

use of jsinterop.annotations.JsOverlay in project gwt-cs by iSergio.

the class PerInstanceColorAppearance method create.

@JsOverlay
public static PerInstanceColorAppearance create(boolean closed) {
    PerInstanceColorAppearanceOptions options = new PerInstanceColorAppearanceOptions();
    options.closed = closed;
    return new PerInstanceColorAppearance(options);
}
Also used : PerInstanceColorAppearanceOptions(org.cesiumjs.cs.scene.apperances.options.PerInstanceColorAppearanceOptions) JsOverlay(jsinterop.annotations.JsOverlay)

Example 12 with JsOverlay

use of jsinterop.annotations.JsOverlay in project gwt-cs by iSergio.

the class PolylineGlowMaterialProperty method create.

/**
 * Simple method for create PolylineGlowMaterialProperty by color and glowPower.
 * @param color A Property specifying the Color of the line.
 * @param glowPower A numeric Property specifying the strength of the glow, as a percentage of the total line width.
 * @return PolylineGlowMaterialProperty
 */
@JsOverlay
public static PolylineGlowMaterialProperty create(Color color, double glowPower) {
    PolylineGlowMaterialPropertyOptions options = new PolylineGlowMaterialPropertyOptions();
    options.color = new ConstantProperty<>(color);
    options.glowPower = new ConstantProperty<>(glowPower);
    return new PolylineGlowMaterialProperty(options);
}
Also used : PolylineGlowMaterialPropertyOptions(org.cesiumjs.cs.datasources.properties.options.PolylineGlowMaterialPropertyOptions) JsOverlay(jsinterop.annotations.JsOverlay)

Example 13 with JsOverlay

use of jsinterop.annotations.JsOverlay in project gwt-ol3 by TDesjardins.

the class Map method addMapMoveListener.

/**
 * Adds a map move listener for the given map.
 */
@JsOverlay
public final HandlerRegistration addMapMoveListener(final EventListener<MapEvent> listener) {
    final HandlerRegistration handlerMap = OLUtil.observe(this, "moveend", listener);
    View view = getView();
    if (view == null)
        return handlerMap;
    // if we have a view, fire events while the map is moving
    // try to set up an event handler for the change of the view center
    // as "moveend" will be only fired when the map stops moving
    final HandlerRegistration handlerView = OLUtil.observe(view, "change:center", event -> {
        // create an artificial move event
        ol.events.Event e2 = OLUtil.createLinkedEvent(event, "move", Map.this);
        MapEvent mapEvent = OLUtil.initMapEvent(e2, Map.this);
        listener.onEvent(mapEvent);
    });
    // return a handler registration, which detaches both event handlers
    return () -> {
        handlerMap.removeHandler();
        handlerView.removeHandler();
    };
}
Also used : HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration) JsOverlay(jsinterop.annotations.JsOverlay)

Example 14 with JsOverlay

use of jsinterop.annotations.JsOverlay in project vue-gwt by Axellience.

the class VueComponentOptions method addJavaPropValidator.

/**
 * Add a custom prop validator to validate a property
 * @param javaMethodName Name of the method in the {@link VueComponent}
 * @param propertyName The name of the property to validate
 */
@JsOverlay
public final void addJavaPropValidator(String javaMethodName, String propertyName) {
    PropOptions propDefinition = (PropOptions) props.get(propertyName);
    propDefinition.validator = getJavaComponentMethod(javaMethodName);
}
Also used : PropOptions(com.axellience.vuegwt.core.client.component.options.props.PropOptions) JsOverlay(jsinterop.annotations.JsOverlay)

Example 15 with JsOverlay

use of jsinterop.annotations.JsOverlay in project vue-gwt by Axellience.

the class VueComponentOptions method initData.

/**
 * Initialise the data structure, then set it to either a Factory or directly on the Component.
 * @param useFactory Boolean representing whether or not to use a Factory.
 * @param fieldNames Name of the data fields in the object
 */
@JsOverlay
public final void initData(boolean useFactory, String... fieldNames) {
    dataFields = JsPropertyMap.of();
    for (String fieldName : fieldNames) {
        // Get the default field value from the prototype if any
        Object defaultValue = componentJavaPrototype.get(fieldName);
        if (!Js.isTripleEqual(defaultValue, Js.undefined()))
            dataFields.set(fieldName, defaultValue);
        else
            dataFields.set(fieldName, null);
    }
    if (useFactory) {
        String dataFieldsJSON = JSON.stringify(dataFields);
        this.setData((DataFactory) () -> (JsPropertyMap) JSON.parse(dataFieldsJSON));
    } else {
        this.setData((DataFactory) () -> dataFields);
    }
}
Also used : JsObject(elemental2.core.JsObject) JsPropertyMap(jsinterop.base.JsPropertyMap) JsOverlay(jsinterop.annotations.JsOverlay)

Aggregations

JsOverlay (jsinterop.annotations.JsOverlay)19 JsonObject (elemental.json.JsonObject)4 PropOptions (com.axellience.vuegwt.core.client.component.options.props.PropOptions)3 JsPropertyMap (jsinterop.base.JsPropertyMap)3 JsObject (elemental2.core.JsObject)2 EllipsoidSurfaceAppearanceOptions (org.cesiumjs.cs.scene.apperances.options.EllipsoidSurfaceAppearanceOptions)2 ComputedOptions (com.axellience.vuegwt.core.client.component.options.computed.ComputedOptions)1 HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)1 Function (elemental2.core.Function)1 Date (java.util.Date)1 RecordUpdate (org.activityinfo.model.resource.RecordUpdate)1 PolylineGlowMaterialPropertyOptions (org.cesiumjs.cs.datasources.properties.options.PolylineGlowMaterialPropertyOptions)1 PerInstanceColorAppearanceOptions (org.cesiumjs.cs.scene.apperances.options.PerInstanceColorAppearanceOptions)1 ParticleBurstOptions (org.cesiumjs.cs.scene.particle.options.ParticleBurstOptions)1 Event (org.jboss.errai.common.client.dom.Event)1 EventListener (org.jboss.errai.common.client.dom.EventListener)1 HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)1