private static FillInfo createFill(Map<String, Object> properties) { FillInfo f = new FillInfo(); f.setFillColor(getPropValue(FILLCOLOR, properties, DEFAULT_FILLCOLOR)); f.setFillOpacity(getPropValue(FILLOPACITY, properties, DEFAULT_FILLOPACITY)); return f; }
/** * Creates a fill with the specified CSS parameters. * * @param color the color * @param opacity the opacity * @return the fill */ public static FillInfo createFill(String color, float opacity) { FillInfo fillInfo = new FillInfo(); if (color != null) { fillInfo.getCssParameterList().add(createCssParameter("fill", color)); } fillInfo.getCssParameterList().add(createCssParameter("fill-opacity", opacity)); return fillInfo; }
private static void extractProperties(PolygonSymbolizerInfo psi, Map<String, Object> properties) { if (psi.getStroke() != null && psi.getStroke().getCssParameterList() != null) { List<CssParameterInfo> plist = psi.getStroke().getCssParameterList(); properties.put(STROKECOLOR, extractCssPropertyValue(STROKECOLOR, plist, DEFAULT_STROKECOLOR)); properties.put(STROKEOPACITY, extractCssPropertyValue(STROKEOPACITY, plist, DEFAULT_STROKEOPACITY)); properties.put(STROKEWIDTH, extractCssPropertyValue(STROKEWIDTH, plist, DEFAULT_STROKEWIDTH)); } if (psi.getFill() != null && psi.getFill().getCssParameterList() != null) { List<CssParameterInfo> plist = psi.getFill().getCssParameterList(); properties.put(FILLCOLOR, extractCssPropertyValue(FILLCOLOR, plist, DEFAULT_FILLCOLOR)); properties.put(FILLOPACITY, extractCssPropertyValue(FILLOPACITY, plist, DEFAULT_FILLOPACITY)); } }
private static void extractProperties(PointSymbolizerInfo psi, Map<String, Object> properties) { if (psi.getGraphic() != null && psi.getGraphic() != null) { if (psi.getGraphic().getSize() != null && psi.getGraphic().getSize().getValue() != null) { properties.put(SIZE, Float.valueOf(psi.getGraphic().getSize().getValue())); } if (psi.getGraphic().getChoiceList() != null && psi.getGraphic().getChoiceList().size() > 0) { ChoiceInfo ci = psi.getGraphic().getChoiceList().get(0); if (ci.getMark() != null) { if (ci.getMark().getStroke() != null && ci.getMark().getStroke().getCssParameterList() != null) { List<CssParameterInfo> plist = ci.getMark().getStroke().getCssParameterList(); properties.put(STROKECOLOR, extractCssPropertyValue(STROKECOLOR, plist, DEFAULT_STROKECOLOR)); properties.put(STROKEOPACITY, extractCssPropertyValue(STROKEOPACITY, plist, DEFAULT_STROKEOPACITY)); properties.put(STROKEWIDTH, extractCssPropertyValue(STROKEWIDTH, plist, DEFAULT_STROKEWIDTH)); } if (ci.getMark().getFill() != null && ci.getMark().getFill().getCssParameterList() != null) { List<CssParameterInfo> plist = ci.getMark().getFill().getCssParameterList(); properties.put(FILLCOLOR, extractCssPropertyValue(FILLCOLOR, plist, DEFAULT_FILLCOLOR)); properties.put(FILLOPACITY, extractCssPropertyValue(FILLOPACITY, plist, DEFAULT_FILLOPACITY)); } if (ci.getMark().getWellKnownName() != null && ci.getMark().getWellKnownName().getWellKnownName() != null) { properties.put(WELLKNOWNNAME, ci.getMark().getWellKnownName().getWellKnownName()); } } } } }