/** * Creates a stroke with the specified CSS parameters. * * @param color the color * @param width the width * @param opacity the opacity * @param dashArray the dash array * @return the stroke */ public static StrokeInfo createStroke(String color, int width, float opacity, String dashArray) { StrokeInfo strokeInfo = new StrokeInfo(); if (color != null) { strokeInfo.getCssParameterList().add(createCssParameter("stroke", color)); } strokeInfo.getCssParameterList().add(createCssParameter("stroke-width", width)); if (dashArray != null) { strokeInfo.getCssParameterList().add(createCssParameter("stroke-dasharray", dashArray)); } strokeInfo.getCssParameterList().add(createCssParameter("stroke-opacity", opacity)); return strokeInfo; }
private static StrokeInfo createStroke(Map<String, Object> properties) { StrokeInfo s = new StrokeInfo(); s.setStrokeColor(getPropValue(STROKECOLOR, properties, DEFAULT_STROKECOLOR)); s.setStrokeWidth(getPropValue(STROKEWIDTH, properties, DEFAULT_STROKEWIDTH)); s.setStrokeOpacity(getPropValue(STROKEOPACITY, properties, DEFAULT_STROKEOPACITY)); return s; }