The stroke (that is, the border) of the shape is controlled
by the properties strokeColor
, strokeWidth
, strokeDashArray
, strokeEndCaps
, strokeLineJoins
, strokeMiterLimit
,
and strokeDashPhase
.
The strokeColor
property sets
the color used to paint the stroke.
The other properties are used to create an instance of java.awt.BasicStroke
:
strokeWidth
specifies
the width of the stroke.
strokeDashArray
is
used to create dashed or dotted strokes. It is an array of floating-point
values that specify the lengths of the alternate painted and transparent
segments.
strokeEndCaps
specifies
the shape of the ends of the dash segments.
strokeLineJoins
and strokeMiterLimit
specify
how the stroke looks at the angles between two segments.
The following code example shows how to create a blue
dashed stroke, with rounded segment ends, visible segments that have
a length of 4, and transparent segments that have a length of 2, in
the style sheet.
Styling rule for the border (stroke) of a node
node {
strokeColor : "blue";
strokeDashArray : "4,2";
strokeEndCaps : "CAP_ROUNDS";
}
For more details of the stroke-related properties, see
the documentation of the BasicStroke
class
in the Java™
documentation.