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


Java VectorLayerRasterizingInfo.setShowing方法代码示例

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


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

示例1: onClick

import org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo; //导入方法依赖的package包/类
public void onClick(ClickEvent clickEvent) {
	imageUrlService.makeRasterizable(mapWidget);
	if (showAllLayers) {
		for (Layer<?> layer : mapWidget.getMapModel().getLayers()) {
			if (layer instanceof VectorLayer) {
				VectorLayerRasterizingInfo vectorInfo = (VectorLayerRasterizingInfo) layer.getLayerInfo()
						.getWidgetInfo().get(VectorLayerRasterizingInfo.WIDGET_KEY);
				vectorInfo.setShowing(true);
			} else if (layer instanceof RasterLayer) {
				RasterLayerRasterizingInfo rasterInfo = (RasterLayerRasterizingInfo) layer.getLayerInfo()
						.getWidgetInfo().get(RasterLayerRasterizingInfo.WIDGET_KEY);
				rasterInfo.setShowing(true);
			}
		}
	}
	imageUrlService.createImageUrl(mapWidget, new ImageUrlCallback() {

		public void onImageUrl(String mapUrl, String legendUrl) {
			com.google.gwt.user.client.Window.open(legendUrl, "_blank", null);
		}
	}, !showAllLayers);
	if (showAllLayers) {
		imageUrlService.makeRasterizable(mapWidget);
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:26,代码来源:GetLegendImageAction.java

示例2: prepareMap

import org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo; //导入方法依赖的package包/类
private void prepareMap() {
	MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
	mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);
	mapRasterizingInfo.setTransparent(true);
	mapRasterizingInfo.setDpi(96);
	for (ClientLayerInfo clientLayerInfo : mapInfo.getLayers()) {
		if (clientLayerInfo instanceof ClientVectorLayerInfo) {
			ClientVectorLayerInfo vectorLayerInfo = (ClientVectorLayerInfo) clientLayerInfo;
			VectorLayerRasterizingInfo vectorLayerRasterizingInfo = new VectorLayerRasterizingInfo();
			vectorLayerRasterizingInfo.setPaintGeometries(true);
			vectorLayerRasterizingInfo.setStyle(vectorLayerInfo.getNamedStyleInfo());
			vectorLayerRasterizingInfo.setShowing(true);
			vectorLayerInfo.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, vectorLayerRasterizingInfo);
		} else if (clientLayerInfo instanceof ClientRasterLayerInfo) {
			ClientRasterLayerInfo rasterLayerInfo = (ClientRasterLayerInfo) clientLayerInfo;
			RasterLayerRasterizingInfo rasterLayerRasterizingInfo = new RasterLayerRasterizingInfo();
			rasterLayerRasterizingInfo.setCssStyle(rasterLayerInfo.getStyle());
			rasterLayerRasterizingInfo.setShowing(true);
			rasterLayerInfo.getWidgetInfo().put(RasterLayerRasterizingInfo.WIDGET_KEY, rasterLayerRasterizingInfo);
		}
	}
	LegendRasterizingInfo legend = new LegendRasterizingInfo();
	FontStyleInfo fontStyleInfo = new FontStyleInfo();
	fontStyleInfo.applyDefaults();
	legend.setFont(fontStyleInfo);
	legend.setTitle("test");
	legend.setWidth(100);
	legend.setHeight(500);
	mapRasterizingInfo.setLegendRasterizingInfo(legend);
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:31,代码来源:TestTemplateBuilder.java

示例3: build

import org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo; //导入方法依赖的package包/类
@Override
public ClientLayerInfo build(MapPresenter mapPresenter, Layer layer, Bbox worldBounds, double resolution) {
	VectorServerLayer vectorLayer = (VectorServerLayer) layer;
	VectorLayerRasterizingInfo vectorRasterizingInfo = new VectorLayerRasterizingInfo();
	vectorRasterizingInfo.setPaintGeometries(true);
	vectorRasterizingInfo.setPaintLabels(vectorLayer.isLabeled());
	vectorRasterizingInfo.setShowing(layer.isShowing());
	ClientVectorLayerInfo layerInfo = (ClientVectorLayerInfo) vectorLayer.getLayerInfo();
	vectorRasterizingInfo.setStyle(layerInfo.getNamedStyleInfo());
	if (!vectorLayer.getSelectedFeatures().isEmpty()) {
		Collection<Feature> selectedFeatures = vectorLayer.getSelectedFeatures();
		Iterator<Feature> iterator = selectedFeatures.iterator();
		List<String> featureIds = new ArrayList<String>(selectedFeatures.size());
		while (iterator.hasNext()) {
			Feature feature = iterator.next();
			featureIds.add(feature.getId());
		}
		vectorRasterizingInfo.setSelectedFeatureIds(featureIds.toArray(new String[selectedFeatures.size()]));
		ClientMapInfo mapInfo = mapPresenter.getConfiguration().getHintValue(GeomajasServerExtension.MAPINFO);
		FeatureStyleInfo selectStyle;
		switch (layerInfo.getLayerType()) {
			case GEOMETRY:
			case LINESTRING:
			case MULTILINESTRING:
				selectStyle = mapInfo.getLineSelectStyle();
				break;
			case MULTIPOINT:
			case POINT:
				selectStyle = mapInfo.getPointSelectStyle();
				break;
			case MULTIPOLYGON:
			case POLYGON:
				selectStyle = mapInfo.getPolygonSelectStyle();
				break;
			default:
				throw new IllegalArgumentException("Unknown layer type " + layerInfo.getLayerType());
		}
		selectStyle.applyDefaults();
		RuleInfo selectionRule = StyleUtil.createRule(layerInfo.getLayerType(), selectStyle);
		vectorRasterizingInfo.setSelectionRule(selectionRule);
	}
	layerInfo.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, vectorRasterizingInfo);
	return layerInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:45,代码来源:VectorServerLayerBuilder.java


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