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


Java FontStyleInfo类代码示例

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


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

示例1: buildMap

import org.geomajas.configuration.FontStyleInfo; //导入依赖的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: createRandomLabelStyle

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
private LabelStyleInfo createRandomLabelStyle(String attributeName) {
	LabelStyleInfo labelStyle = new LabelStyleInfo();
	labelStyle.setLabelAttributeName(attributeName);
	FontStyleInfo fontStyle = new FontStyleInfo();
	fontStyle.setColor("#000000");
	fontStyle.setFamily("Verdana");
	fontStyle.setOpacity(1F);
	fontStyle.setSize(8);
	labelStyle.setFontStyle(fontStyle);

	FeatureStyleInfo backgroundStyle = new FeatureStyleInfo();
	backgroundStyle.setFillColor("#FFFFFF");
	backgroundStyle.setFillOpacity(0.7F);
	backgroundStyle.setStrokeColor("#000099");
	backgroundStyle.setStrokeOpacity(1F);
	backgroundStyle.setStrokeWidth(1);
	labelStyle.setBackgroundStyle(backgroundStyle);

	return labelStyle;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:21,代码来源:IssueRTC2Test.java

示例3: buildTitle

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
protected LabelComponentInfo buildTitle() {
	if (titleText != null) {
		LabelComponentInfo title = new LabelComponentInfo();
		FontStyleInfo style = new FontStyleInfo();
		style.setFamily("Arial");
		style.setStyle("Italic");
		style.setSize(14);
		title.setFont(style);
		title.setBackgroundColor("#FFFFFF");
		title.setBorderColor("#000000");
		title.setFontColor("#000000");
		title.getLayoutConstraint().setAlignmentY(LayoutConstraintInfo.TOP);
		title.getLayoutConstraint().setAlignmentX(LayoutConstraintInfo.CENTER);
		title.setTag("title");
		title.setText(titleText);
		title.getLayoutConstraint().setMarginY(2 * marginY);
		return title;
	} else {
		return null;
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:22,代码来源:TestTemplateBuilder.java

示例4: getFont

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
@Override
public Font getFont(FontStyleInfo fontStyle) {
	int style = Font.PLAIN;
	String styleStr = fontStyle.getStyle();
	if (styleStr != null) {
		styleStr = styleStr.trim();
		if (STYLE_BOLD.equalsIgnoreCase(styleStr)) {
			style = Font.BOLD;
		} else if (STYLE_ITALIC.equalsIgnoreCase(styleStr)) {
			style = Font.ITALIC;
		}
	}
	String family = DEFAULT_FONT;
	if (fontStyle.getFamily() != null) {
		family = fontStyle.getFamily();
	}
	int size = DEFAULT_FONT_SIZE;
	if (fontStyle.getSize() != -1) {
		size = fontStyle.getSize();
	}
	return new Font(family, style, size);
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:23,代码来源:TextServiceImpl.java

示例5: createTextSymbolizer

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
private TextSymbolizer createTextSymbolizer(LabelStyleInfo labelStyle, LayerType layerType) {
	Fill fontFill = styleBuilder.createFill(styleBuilder.literalExpression(labelStyle.getFontStyle().getColor()),
			styleBuilder.literalExpression(labelStyle.getFontStyle().getOpacity()));
	TextSymbolizer symbolizer = styleBuilder.createTextSymbolizer();
	symbolizer.setFill(fontFill);
	FontStyleInfo fontInfo = labelStyle.getFontStyle();
	symbolizer.setFont(styleBuilder.createFont(styleBuilder.literalExpression(fontInfo.getFamily()),
			styleBuilder.literalExpression(fontInfo.getStyle()),
			styleBuilder.literalExpression(fontInfo.getWeight()),
			styleBuilder.literalExpression(fontInfo.getSize())));
	symbolizer.setLabel(styleBuilder.attributeExpression(labelStyle.getLabelAttributeName()));
	Fill haloFill = styleBuilder.createFill(
			styleBuilder.literalExpression(labelStyle.getBackgroundStyle().getFillColor()),
			styleBuilder.literalExpression(labelStyle.getBackgroundStyle().getFillOpacity()));
	symbolizer.setHalo(styleBuilder.createHalo(haloFill, 1));
	// label placement : point at bottom-center of label (same as vectorized)
	switch (layerType) {
		case MULTIPOINT:
		case POINT:
			symbolizer.setLabelPlacement(styleBuilder.createPointPlacement(0.5, 0, 0));
			break;
		default:
			break;
	}
	return symbolizer;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:27,代码来源:StyleConverterServiceImpl.java

示例6: createRandomLabelStyle

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
private LabelStyleInfo createRandomLabelStyle(String attributeName) {
	LabelStyleInfo style = new LabelStyleInfo();
	style.setBackgroundStyle(createRandomPolygonStyle());
	FontStyleInfo fontStyle = new FontStyleInfo();
	fontStyle.setColor(style.getBackgroundStyle().getStrokeColor());
	fontStyle.setFamily("Verdana");
	fontStyle.setOpacity(1F);
	fontStyle.setSize(8);
	fontStyle.setWeight("normal");
	fontStyle.setStyle("normal");
	style.setFontStyle(fontStyle);
	style.setLabelAttributeName(attributeName);
	return style;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:15,代码来源:AddLayerShapeAction.java

示例7: buildTitle

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
protected LabelComponentInfo buildTitle() {
	LabelComponentInfo label = new LabelComponentInfo();
	FontStyleInfo style = new FontStyleInfo();
	style.setFamily(PrintingLayout.templateDefaultFontFamily);
	style.setStyle(PrintingLayout.templateDefaultFontStyle);
	style.setSize((int) PrintingLayout.templateDefaultFontSize);
	label.setFont(style);
	label.setBackgroundColor(PrintingLayout.templateDefaultBackgroundColor);
	label.setBorderColor(PrintingLayout.templateDefaultBorderColor);
	label.setFontColor(PrintingLayout.templateDefaultColor);
	label.getLayoutConstraint().setAlignmentY(LayoutConstraintInfo.TOP);
	label.getLayoutConstraint().setAlignmentX(LayoutConstraintInfo.CENTER);
	label.setTag("title");
	return label;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:16,代码来源:AbstractTemplateBuilder.java

示例8: createTextSymbolizer

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
private TextSymbolizerInfo createTextSymbolizer(FontStyle style) {
	FontStyleInfo font = new FontStyleInfo();
	font.setColor(style.getFillColor());
	font.setFamily(style.getFontFamily());
	font.setSize(style.getFontSize());
	font.setStyle(style.getFontStyle());
	font.setOpacity(1f);
	font.setWeight(style.getFontWeight());
	return StyleUtil.createSymbolizer(font);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:11,代码来源:ImageUrlServiceImpl.java

示例9: FontStyle

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
public FontStyle(FontStyleInfo info) {
	this.fillColor = info.getColor();
	this.fontSize = info.getSize();
	this.fontFamily = info.getFamily();
	this.fontWeight = info.getWeight();
	this.fontStyle = info.getStyle();
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:8,代码来源:FontStyle.java

示例10: buildTitle

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
protected LabelComponentInfo buildTitle() {
	LabelComponentInfo label = new LabelComponentInfo();
	FontStyleInfo style = new FontStyleInfo();
	style.setFamily(PrintLayout.templateDefaultFontFamily);
	style.setStyle(PrintLayout.templateDefaultFontStyle);
	style.setSize((int) PrintLayout.templateDefaultFontSize);
	label.setFont(style);
	label.setBackgroundColor(PrintLayout.templateDefaultBackgroundColor);
	label.setBorderColor(PrintLayout.templateDefaultBorderColor);
	label.setFontColor(PrintLayout.templateDefaultColor);
	label.getLayoutConstraint().setAlignmentY(LayoutConstraintInfo.TOP);
	label.getLayoutConstraint().setAlignmentX(LayoutConstraintInfo.CENTER);
	label.setTag("title");
	return label;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:16,代码来源:AbstractTemplateBuilder.java

示例11: createSymbolizer

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
/**
 * Creates a text symbolizer with the specified font style.
 * 
 * @param style font style
 * @return the symbolizer
 */
public static TextSymbolizerInfo createSymbolizer(FontStyleInfo style) {
	TextSymbolizerInfo symbolizerInfo = new TextSymbolizerInfo();
	FontInfo font = new FontInfo();
	font.setFamily(style.getFamily());
	font.setStyle(style.getStyle());
	font.setWeight(style.getWeight());
	font.setSize(style.getSize());
	symbolizerInfo.setFont(font);
	symbolizerInfo.setFill(createFill(style.getColor(), style.getOpacity()));
	return symbolizerInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:18,代码来源:StyleUtil.java

示例12: ScaleBarComponentInfo

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
/** Constructor. */
public ScaleBarComponentInfo() {
	getLayoutConstraint().setAlignmentX(LayoutConstraintInfo.LEFT);
	getLayoutConstraint().setAlignmentY(LayoutConstraintInfo.BOTTOM);
	getLayoutConstraint().setMarginX(20);
	getLayoutConstraint().setMarginY(20);
	getLayoutConstraint().setWidth(200);
	font = new FontStyleInfo();
	font.setFamily("Dialog");
	font.setStyle("Plain");
	font.setSize(10);
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:13,代码来源:ScaleBarComponentInfo.java

示例13: LegendComponentInfo

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
/**
 * Default constructor.
 */
public LegendComponentInfo() {
	getLayoutConstraint().setAlignmentX(LayoutConstraintInfo.RIGHT);
	getLayoutConstraint().setAlignmentY(LayoutConstraintInfo.BOTTOM);
	getLayoutConstraint().setFlowDirection(LayoutConstraintInfo.FLOW_Y);
	getLayoutConstraint().setMarginX(20);
	getLayoutConstraint().setMarginY(20);
	setTag(LEGEND_TAG);
	font = new FontStyleInfo();
	font.setFamily(DEFAULT_LEGEND_FONT_FAMILY);
	font.setStyle(LEGEND_FONT_STYLE_AS_STRING);
	font.setSize(12);
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:16,代码来源:LegendComponentInfo.java

示例14: toInternal

import org.geomajas.configuration.FontStyleInfo; //导入依赖的package包/类
public Font toInternal(FontStyleInfo info) {
	int style = Font.PLAIN;
	if ("bold".equalsIgnoreCase(info.getStyle())) {
		style = Font.BOLD;
	} else if ("italic".equalsIgnoreCase(info.getStyle())) {
		style = Font.ITALIC;
	}
	return new Font(info.getFamily(), style, info.getSize());
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:10,代码来源:PrintDtoConverterServiceImpl.java

示例15: prepareMap

import org.geomajas.configuration.FontStyleInfo; //导入依赖的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


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