當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。