当前位置: 首页>>代码示例>>Java>>正文


Java JSObject.getPropertyAsString方法代码示例

本文整理汇总了Java中org.gwtopenmaps.openlayers.client.util.JSObject.getPropertyAsString方法的典型用法代码示例。如果您正苦于以下问题:Java JSObject.getPropertyAsString方法的具体用法?Java JSObject.getPropertyAsString怎么用?Java JSObject.getPropertyAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gwtopenmaps.openlayers.client.util.JSObject的用法示例。


在下文中一共展示了JSObject.getPropertyAsString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getColorStyleData

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
private void getColorStyleData(Style style) {
	if(style != null) {
		JSObject jsStyle = style.getJSObject();
		String fillColor = jsStyle.getPropertyAsString("userFillColor");			
		String strokeColor = jsStyle.getPropertyAsString("userStrokeColor");
		int thickness = (int) Math.floor(style.getStrokeWidth());
					
		/**
		 * Si estamos en modo de estilo por feature, hay que coger el color 
		 * de referencia de las propiedades userFillColor y userStrokeColor, 
		 * puesto que los features afectados están seleccionados y por tanto
		 * tienen asignado el color de relleno y linea del modo selección 
		 */
		getFill().setNormalColor(fillColor != null ? fillColor : style.getFillColor());
		getFill().setOpacity(style.getFillOpacity());
		getLine().setNormalColor(strokeColor != null ? strokeColor : style.getStrokeColor());
		getLine().setThickness(thickness);	
	}
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:20,代码来源:VectorFeatureStyleDef.java

示例2: getLabelStyleData

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
private void getLabelStyleData(Style style, VectorLayer layer) {
	if(style != null) {
		JSObject jsStyle = style.getJSObject();
		
		boolean enabled = jsStyle.getPropertyAsString("userAttributeLabel") != null 
				&& !jsStyle.getPropertyAsString("userAttributeLabel").isEmpty();			
				
		if(enabled) {
			getLabel().setAttribute(layer.getAttribute(
					jsStyle.getPropertyAsString("userAttributeLabel")));
										
			getLabel().setFontSize(getFontSize(jsStyle));
			getLabel().setBoldStyle(isBoldFont(jsStyle));
			getLabel().setBackgroundColor(jsStyle.getPropertyAsString("labelOutlineColor"));
		} 
	} 
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:18,代码来源:VectorFeatureStyleDef.java

示例3: getFontSize

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
private Integer getFontSize(JSObject style) {		
	String fontSize = style.getPropertyAsString("fontSize");
	
	if(fontSize != null && !fontSize.isEmpty()) {
		fontSize = fontSize.substring(0, fontSize.lastIndexOf("px"));
		return Integer.parseInt(fontSize);					
	}
	return LabelStyle.DEFAULT_FONT_SIZE;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:VectorFeatureStyleDef.java

示例4: isBoldFont

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
private boolean isBoldFont(JSObject style) {
	String fontWeight = style.getPropertyAsString("fontWeight");
	
	if(fontWeight == null || fontWeight.isEmpty()) {
		fontWeight = "regular";
	}
	return fontWeight.equalsIgnoreCase("bold");
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:9,代码来源:VectorFeatureStyleDef.java

示例5: getStyleDef

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入方法依赖的package包/类
public VectorFeatureStyleDef getStyleDef(JSObject styleObject) {
	VectorFeatureStyleDef def = new VectorFeatureStyleDef();

	if (styleObject.hasProperty(LeafletStyle.FILL_COLOR_NAME)) {
		String fillColor = styleObject.getPropertyAsString(LeafletStyle.FILL_COLOR_NAME);
		def.getFill().setNormalColor(fillColor);
	}

	if (styleObject.hasProperty(LeafletStyle.FILL_OPACITY_NAME)) {
		Double fillOpacity = styleObject.getPropertyAsDouble(LeafletStyle.FILL_OPACITY_NAME);
		def.getFill().setOpacity(fillOpacity);
	}

	if (styleObject.hasProperty(LeafletStyle.STROKE_COLOR_NAME)) {
		String strokeColor = styleObject.getPropertyAsString(LeafletStyle.STROKE_COLOR_NAME);
		def.getLine().setNormalColor(strokeColor);
	}

	if (styleObject.hasProperty(LeafletStyle.STROKE_WIDTH_NAME)) {
		Double strokeWidth = styleObject.getPropertyAsDouble(LeafletStyle.STROKE_WIDTH_NAME);
		def.getLine().setThickness(strokeWidth.intValue());
	}

	JSObject iconObject = styleObject.getProperty(LeafletStyle.ICON_NAME);
	if (iconObject != null) {

		if (iconObject.hasProperty(LeafletStyle.ICON_URL_NAME)) {
			String iconUrl = iconObject.getPropertyAsString(LeafletStyle.ICON_URL_NAME);
			def.getPoint().setExternalGraphic(iconUrl);
		}

		if (iconObject.hasProperty(LeafletStyle.ICON_SIZE_NAME)) {
			JsArrayInteger iconSize = iconObject.getProperty(LeafletStyle.ICON_SIZE_NAME).cast();

			int iconWidth = iconSize.get(0);
			int iconHeight = iconSize.get(1);

			def.getPoint().setGraphicWidth(iconWidth);
			def.getPoint().setGraphicHeight(iconHeight);
		}
	}

	return def;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:45,代码来源:GeoJSONCSS.java


注:本文中的org.gwtopenmaps.openlayers.client.util.JSObject.getPropertyAsString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。