本文整理汇总了Java中org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo.setPaintLabels方法的典型用法代码示例。如果您正苦于以下问题:Java VectorLayerRasterizingInfo.setPaintLabels方法的具体用法?Java VectorLayerRasterizingInfo.setPaintLabels怎么用?Java VectorLayerRasterizingInfo.setPaintLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo
的用法示例。
在下文中一共展示了VectorLayerRasterizingInfo.setPaintLabels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareMap
import org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo; //导入方法依赖的package包/类
private ClientMapInfo prepareMap(GetTileContainer tileContainer, TileMetadata tileMetadata, NamedStyleInfo style) {
ClientMapInfo mapInfo = new ClientMapInfo();
MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
mapRasterizingInfo.setBounds(converterService.toDto(tileContainer.getTile().getBounds()));
mapInfo.setCrs(tileMetadata.getCrs());
mapRasterizingInfo.setScale(tileMetadata.getScale());
mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);
ClientVectorLayerInfo clientVectorLayerInfo = new ClientVectorLayerInfo();
clientVectorLayerInfo.setServerLayerId(tileMetadata.getLayerId());
clientVectorLayerInfo.setNamedStyleInfo(style);
VectorLayerRasterizingInfo vectorLayerRasterizingInfo = new VectorLayerRasterizingInfo();
vectorLayerRasterizingInfo.setFilter(tileMetadata.getFilter());
vectorLayerRasterizingInfo.setPaintGeometries(tileMetadata.isPaintGeometries());
vectorLayerRasterizingInfo.setPaintLabels(tileMetadata.isPaintLabels());
vectorLayerRasterizingInfo.setFilter(tileMetadata.getFilter());
vectorLayerRasterizingInfo.setStyle(style);
clientVectorLayerInfo.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, vectorLayerRasterizingInfo);
mapInfo.getLayers().add(clientVectorLayerInfo);
return mapInfo;
}
示例2: checkOrRender
import org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo; //导入方法依赖的package包/类
protected void checkOrRender(String fileName, boolean paintLabels, boolean paintGeometries, VectorLayer layer,
NamedStyleInfo styleInfo, Bbox box) throws Exception {
ClientMapInfo mapInfo = new ClientMapInfo();
MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
mapRasterizingInfo.setBounds(box);
mapInfo.setCrs("EPSG:4326");
mapRasterizingInfo.setScale(1);
mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);
ClientVectorLayerInfo clientVectorLayerInfo = new ClientVectorLayerInfo();
clientVectorLayerInfo.setVisible(true);
clientVectorLayerInfo.setServerLayerId(layer.getId());
clientVectorLayerInfo.setNamedStyleInfo(styleInfo);
VectorLayerRasterizingInfo vectorLayerRasterizingInfo = new VectorLayerRasterizingInfo();
vectorLayerRasterizingInfo.setPaintGeometries(true);
vectorLayerRasterizingInfo.setPaintLabels(true);
vectorLayerRasterizingInfo.setStyle(styleInfo);
clientVectorLayerInfo.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, vectorLayerRasterizingInfo);
mapInfo.getLayers().add(clientVectorLayerInfo);
new MapAssert(mapInfo).assertEqualImage(fileName, writeImages, DELTA);
}
示例3: checkOrRender
import org.geomajas.plugin.rasterizing.command.dto.VectorLayerRasterizingInfo; //导入方法依赖的package包/类
private void checkOrRender(String fileName, boolean paintLabels, boolean paintGeometries, VectorLayer layer,
NamedStyleInfo styleInfo, Bbox box) throws Exception {
ClientMapInfo mapInfo = new ClientMapInfo();
MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
mapRasterizingInfo.setBounds(box);
mapInfo.setCrs("EPSG:4326");
mapRasterizingInfo.setScale(1);
mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);
ClientVectorLayerInfo clientVectorLayerInfo = new ClientVectorLayerInfo();
clientVectorLayerInfo.setVisible(true);
clientVectorLayerInfo.setServerLayerId(layer.getId());
clientVectorLayerInfo.setNamedStyleInfo(styleInfo);
VectorLayerRasterizingInfo vectorLayerRasterizingInfo = new VectorLayerRasterizingInfo();
vectorLayerRasterizingInfo.setPaintGeometries(true);
vectorLayerRasterizingInfo.setPaintLabels(true);
vectorLayerRasterizingInfo.setStyle(styleInfo);
clientVectorLayerInfo.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, vectorLayerRasterizingInfo);
mapInfo.getLayers().add(clientVectorLayerInfo);
new MapAssert(mapInfo).assertEqualImage(fileName, writeImages, DELTA);
}
示例4: 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;
}