* Converts a <tt>Stroke</tt> object defined on the specified element.
*
* @param e the element on which the stroke is specified
*/
public static Stroke convertStroke(Element e) {
Value v;
v = CSSUtilities.getComputedStyle
(e, SVGCSSEngine.STROKE_WIDTH_INDEX);
float width = v.getFloatValue();
if (width == 0.0f)
return null; // Stop here no stroke should be painted.
v = CSSUtilities.getComputedStyle
(e, SVGCSSEngine.STROKE_LINECAP_INDEX);
int linecap = convertStrokeLinecap(v);
v = CSSUtilities.getComputedStyle
(e, SVGCSSEngine.STROKE_LINEJOIN_INDEX);
int linejoin = convertStrokeLinejoin(v);
v = CSSUtilities.getComputedStyle
(e, SVGCSSEngine.STROKE_MITERLIMIT_INDEX);
float miterlimit = convertStrokeMiterlimit(v);
v = CSSUtilities.getComputedStyle
(e, SVGCSSEngine.STROKE_DASHARRAY_INDEX);
float[] dasharray = convertStrokeDasharray(v);
float dashoffset = 0;
if (dasharray != null) {
v = CSSUtilities.getComputedStyle
(e, SVGCSSEngine.STROKE_DASHOFFSET_INDEX);
dashoffset = v.getFloatValue();
// make the dashoffset positive since BasicStroke cannot handle
// negative values
if ( dashoffset < 0 ) {
float dashpatternlength = 0;