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


Java LegendRasterizingInfo类代码示例

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


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

示例1: buildMap

import org.geomajas.plugin.rasterizing.command.dto.LegendRasterizingInfo; //导入依赖的package包/类
private MapRasterizingInfo buildMap(MapPresenter mapPresenter) {
	MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
	ViewPort viewPort = mapPresenter.getViewPort();
	mapRasterizingInfo.setBounds(viewPort.getBounds());
	mapRasterizingInfo.setScale(1 / viewPort.getResolution());
	mapRasterizingInfo.setTransparent(true);
	LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo();
	legendRasterizingInfo.setTitle("Legend");
	FontStyleInfo font = new FontStyleInfo();
	font.applyDefaults();
	legendRasterizingInfo.setFont(font);

	mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo);

	// Support for selection of layer object : create container for info on selected features;
	// store the selections layer per layer
	List<ClientLayerInfo> selectedLayers = new ArrayList<ClientLayerInfo>();
	mapRasterizingInfo.setExtraLayers(selectedLayers);

	ClientMapInfo mapInfo = mapPresenter.getConfiguration().getHintValue(GeomajasServerExtension.MAPINFO);
	mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);
	// Note: mapRasterizingInfo at this time is pretty empty (rastering info for
	// layers not yet filled in)
	return mapRasterizingInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:26,代码来源:DefaultPrintableMapBuilder.java

示例2: prepareMap

import org.geomajas.plugin.rasterizing.command.dto.LegendRasterizingInfo; //导入依赖的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: getLegendInfo

import org.geomajas.plugin.rasterizing.command.dto.LegendRasterizingInfo; //导入依赖的package包/类
private LegendRasterizingInfo getLegendInfo(MapContext mapContext) {
	MapRasterizingInfo mapRasterizingInfo = (MapRasterizingInfo) mapContext.getUserData().get(
			LayerFactory.USERDATA_RASTERIZING_INFO);
	return mapRasterizingInfo.getLegendRasterizingInfo();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:6,代码来源:RenderingServiceImpl.java

示例4: testLegend

import org.geomajas.plugin.rasterizing.command.dto.LegendRasterizingInfo; //导入依赖的package包/类
@Test
public void testLegend() throws Exception {
	ClientMapInfo mapInfo = new ClientMapInfo();
	MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
	mapRasterizingInfo.setBounds(new Bbox(-180, -90, 360, 180));
	mapInfo.setCrs("EPSG:4326");
	mapRasterizingInfo.setScale(2);
	mapRasterizingInfo.setTransparent(true);
	mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);

	ClientRasterLayerInfo cl1 = new ClientRasterLayerInfo();
	cl1.setServerLayerId(layerBluemarble.getId());
	cl1.setLabel("Blue Marble");
	RasterLayerRasterizingInfo rr1 = new RasterLayerRasterizingInfo();
	rr1.setCssStyle("opacity:0.5");
	cl1.getWidgetInfo().put(RasterLayerRasterizingInfo.WIDGET_KEY, rr1);
	mapInfo.getLayers().add(cl1);

	ClientVectorLayerInfo cl2 = new ClientVectorLayerInfo();
	cl2.setServerLayerId(layerBeansPoint.getId());
	cl2.setLayerInfo(layerBeansPoint.getLayerInfo());
	cl2.setLabel(layerBeansPoint.getId());
	VectorLayerRasterizingInfo lr2 = new VectorLayerRasterizingInfo();
	lr2.setStyle(layerBeansPointStyleInfo);
	cl2.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, lr2);
	mapInfo.getLayers().add(cl2);

	ClientVectorLayerInfo cl3 = new ClientVectorLayerInfo();
	cl3.setServerLayerId(layerBeansMultiLine.getId());
	cl3.setLayerInfo(layerBeansMultiLine.getLayerInfo());
	cl3.setLabel(layerBeansMultiLine.getId());
	VectorLayerRasterizingInfo lr3 = new VectorLayerRasterizingInfo();
	lr3.setStyle(layerBeansMultiLineStyleInfo);
	cl3.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, lr3);
	mapInfo.getLayers().add(cl3);

	LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo();
	legendRasterizingInfo.setFont(new FontStyleInfo());
	legendRasterizingInfo.getFont().applyDefaults();
	legendRasterizingInfo.getFont().setSize(12);
	legendRasterizingInfo.getFont().setFamily("Arial");
	legendRasterizingInfo.setTitle("legend");
	mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo);
	new LegendAssert(mapInfo).assertEqualImage("legend.png", writeImages, DELTA);
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:46,代码来源:ImageServiceLegendTest.java

示例5: testLegendDynamic

import org.geomajas.plugin.rasterizing.command.dto.LegendRasterizingInfo; //导入依赖的package包/类
@Test
public void testLegendDynamic() throws Exception {
	ClientMapInfo mapInfo = new ClientMapInfo();
	MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
	// set the bounds so no features are visible
	mapRasterizingInfo.setBounds(new Bbox(-180, -90, -170, -80));
	mapInfo.setCrs("EPSG:4326");
	mapRasterizingInfo.setScale(2);
	mapRasterizingInfo.setTransparent(true);
	mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);

	ClientRasterLayerInfo cl1 = new ClientRasterLayerInfo();
	cl1.setServerLayerId(layerBluemarble.getId());
	cl1.setLabel("Blue Marble");
	RasterLayerRasterizingInfo rr1 = new RasterLayerRasterizingInfo();
	rr1.setCssStyle("opacity:0.5");
	cl1.getWidgetInfo().put(RasterLayerRasterizingInfo.WIDGET_KEY, rr1);
	mapInfo.getLayers().add(cl1);

	ClientVectorLayerInfo cl2 = new ClientVectorLayerInfo();
	cl2.setServerLayerId(layerBeansPoint.getId());
	cl2.setLayerInfo(layerBeansPoint.getLayerInfo());
	cl2.setLabel(layerBeansPoint.getId());
	VectorLayerRasterizingInfo lr2 = new VectorLayerRasterizingInfo();
	lr2.setStyle(layerBeansPointStyleInfo);
	cl2.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, lr2);
	mapInfo.getLayers().add(cl2);

	ClientVectorLayerInfo cl3 = new ClientVectorLayerInfo();
	cl3.setServerLayerId(layerBeansMultiLine.getId());
	cl3.setLayerInfo(layerBeansMultiLine.getLayerInfo());
	cl3.setLabel(layerBeansMultiLine.getId());
	VectorLayerRasterizingInfo lr3 = new VectorLayerRasterizingInfo();
	lr3.setStyle(layerBeansMultiLineStyleInfo);
	cl3.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, lr3);
	mapInfo.getLayers().add(cl3);

	LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo();
	legendRasterizingInfo.setFont(new FontStyleInfo());
	legendRasterizingInfo.getFont().applyDefaults();
	legendRasterizingInfo.getFont().setSize(12);
	legendRasterizingInfo.getFont().setFamily("Arial");
	legendRasterizingInfo.setTitle("legend");
	mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo);
	new LegendAssert(mapInfo).assertEqualImage("legend_dynamic.png", writeImages, DELTA);
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:47,代码来源:ImageServiceLegendTest.java


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