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);
}
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);
}
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();
};
}
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);
}
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);
}
}
Aggregations