if (labelType.getBackgroundStyle() != null) { bgColor = context.getColor(labelType.getBackgroundStyle().getFillColor(), labelType .getBackgroundStyle().getFillOpacity()); if (labelType.getBackgroundStyle() != null) { borderColor = context.getColor(labelType.getBackgroundStyle().getStrokeColor(), labelType .getBackgroundStyle().getStrokeOpacity()); if (labelType.getBackgroundStyle() != null) { linewidth = labelType.getBackgroundStyle().getStrokeWidth();
/** * 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(); }
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; }