/** * Applies default values to all properties that have not been set. * * @since 1.10.0 */ public void applyDefaults() { if (getName() == null) { setName(DEFAULT_NAME); } if (getFeatureStyles().size() == 0) { getFeatureStyles().add(new FeatureStyleInfo()); } for (FeatureStyleInfo featureStyle : getFeatureStyles()) { featureStyle.applyDefaults(); } if (getLabelStyle().getLabelAttributeName() == null) { getLabelStyle().setLabelAttributeName(LabelStyleInfo.ATTRIBUTE_NAME_ID); } getLabelStyle().getBackgroundStyle().applyDefaults(); getLabelStyle().getFontStyle().applyDefaults(); }
Font font = new Font("Helvetica", Font.ITALIC, 10); Color fontColor = Color.black; if (labelType.getFontStyle() != null) { fontColor = context .getColor(labelType.getFontStyle().getColor(), labelType.getFontStyle().getOpacity());
VectorLayerRasterizingInfo vectorRasterizingInfo = (VectorLayerRasterizingInfo) clientLayerInfo .getWidgetInfo(VectorLayerRasterizingInfo.WIDGET_KEY); int origSize = vectorRasterizingInfo.getStyle().getLabelStyle().getFontStyle().getSize(); vectorRasterizingInfo.getStyle().getLabelStyle().getFontStyle() .setSize(origSize * request.getDpi() / 96);