本文整理汇总了Java中org.gwtopenmaps.openlayers.client.util.JSObject.setProperty方法的典型用法代码示例。如果您正苦于以下问题:Java JSObject.setProperty方法的具体用法?Java JSObject.setProperty怎么用?Java JSObject.setProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gwtopenmaps.openlayers.client.util.JSObject
的用法示例。
在下文中一共展示了JSObject.setProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyColorStyle
import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
private void applyColorStyle(Style style) {
style.setFillColor(getFill().getNormalColor());
style.setFillOpacity(getFill().getOpacity());
style.setStrokeColor(getLine().getNormalColor());
style.setStrokeWidth(getLine().getThickness());
/**
* Se almacena el mismo color de relleno y linea en las propiedades
* userFillColor y userStrokeColor para tenerlo siempre disponible
* y asi poder aplicar los efectos de select y hover mediante eventos
* (ver VectorLayer.addFeatureSelectListeners())
*/
JSObject jsStyle = style.getJSObject();
jsStyle.setProperty("userFillColor", getFill().getNormalColor());
jsStyle.setProperty("userStrokeColor", getLine().getNormalColor());
}
示例2: getStyle
import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
public static JSObject getStyle(VectorStyleDef def) {
String fillColor = def.getFill().getNormalColor();
Double fillOpacity = def.getFill().getOpacity();
String strokeColor = def.getLine().getNormalColor();
Double strokeWidth = new Double(def.getLine().getThickness());
JSObject styleObject = JSObject.createJSObject();
styleObject.setProperty(FILL_NAME, true);
styleObject.setProperty(FILL_COLOR_NAME, fillColor);
styleObject.setProperty(FILL_OPACITY_NAME, fillOpacity);
styleObject.setProperty(STROKE_COLOR_NAME, strokeColor);
styleObject.setProperty(STROKE_WIDTH_NAME, strokeWidth);
styleObject.setProperty(RADIUS_NAME, RADIUS_VALUE);
//icon
String iconUrl = def.getPoint().getExternalGraphic();
if (iconUrl != null) {
JSObject iconObject = JSObject.createJSObject();
iconObject.setProperty(ICON_URL_NAME, iconUrl);
JsArrayInteger iconSize = JSObject.createArray().cast();
iconSize.push(def.getPoint().getGraphicWidth());
iconSize.push(def.getPoint().getGraphicHeight());
JSObject iconSizeObject = iconSize.cast();
iconObject.setProperty(ICON_SIZE_NAME, iconSizeObject);
styleObject.setProperty(ICON_NAME, iconObject);
}
return styleObject;
}
示例3: applyLabelStyle
import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
private void applyLabelStyle(Style style, VectorFeature feature) {
JSObject jsStyle = style.getJSObject();
if(getLabel().isEnabled()) {
style.setLabel(feature.getAttributes().getAttributeAsString(
getLabel().getAttribute().getName()));
style.setFontSize(getLabel().getFontSize() + "px");
/**
* Se almacena el atributo de etiquetado en la propiedad
* userAttributeLabel para tenerlo disponible a la hora de
* recargar el dialogo de estilos
*/
jsStyle.setProperty("userAttributeLabel",
getLabel().getAttribute().getName());
style.setFontWeight(getLabel().isBoldStyle() ? "bold" : "regular");
final boolean labelBackgroung = !getLabel()
.getBackgroundColor().isEmpty();
jsStyle.setProperty("labelOutlineWidth", (labelBackgroung ? 10 : 0));
jsStyle.setProperty("labelOutlineColor", (labelBackgroung ?
getLabel().getBackgroundColor() : ""));
} else {
style.setLabel(null);
jsStyle.unsetProperty("userAttributeLabel");
}
}
示例4: toStyleMap
import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
public StyleMap toStyleMap() {
String labelAttribute = getLabel().isEnabled() ? getLabel().getAttribute().getName() : null;
String colorThemingAttribute = isColorThemingEnabled() ? getColorThemingAttribute().getName() : null;
Style normalStyle = StyleFactory.createStyle(
getLine().getNormalColor(), getLine().getThickness(),
getFill().getNormalColor(), getFill().getOpacity(),
labelAttribute, colorThemingAttribute);
Style selectedStyle = StyleFactory.createStyle(
getLine().getSelectedColor(), getLine().getThickness(),
getFill().getSelectedColor(), getFill().getOpacity(),
labelAttribute, null);
Style hoverStyle = StyleFactory.createStyle(
getLine().getHoverColor(), getLine().getThickness(),
getFill().getHoverColor(), getFill().getOpacity(),
labelAttribute, null);
JSObject jsStyle = normalStyle.getJSObject().getProperty("defaultStyle");
if (getLabel().isEnabled()) {
jsStyle.setProperty("fontSize", getLabel().getFontSize() + "px");
jsStyle.setProperty("fontWeight", getLabel().isBoldStyle() ? "bold" : "regular");
final boolean labelBackgroung = getLabel().getBackgroundColor() != null;
jsStyle.setProperty("labelOutlineWidth", (labelBackgroung ? 10 : 0));
jsStyle.setProperty("labelOutlineColor", labelBackgroung ?
getLabel().getBackgroundColor() : "");
}
jsStyle.setProperty("graphicName", getPoint().getVertexStyle().getStyleName());
jsStyle.setProperty("externalGraphic", getPoint().getExternalGraphic());
jsStyle.setProperty("graphicWidth", getPoint().getGraphicWidth());
jsStyle.setProperty("graphicHeight", getPoint().getGraphicHeight());
return new StyleMap(normalStyle, selectedStyle, hoverStyle);
}
示例5: getDefaultMapOptions
import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
protected static MapOptions getDefaultMapOptions() {
MapOptions mapOptions = new MapOptions();
mapOptions.setProjection("CRS:84");
mapOptions.setDisplayProjection(CRS84);
mapOptions.removeDefaultControls();
mapOptions.setControls(new JObjectArray(new JSObject[0]));
JSObject vendorParams = JSObject.createJSObject();
vendorParams.setProperty("theme", GWT.getModuleBaseURL() + "theme/default/style.css");
mapOptions.setJSObject(vendorParams);
return mapOptions;
}