blob: 7ec361804567a32c8cf33a59ce74b30c393fc009 [file] [log] [blame]
<test title="Stroke Extension Testing">
<description>
This test validates handling of Stroke implementations
other than BasicStroke.
</description>
<description>
Only BasicStroke has an equivalent in SVG. Other Strokes
are handled by filling the stroked path with the current
Paint.
</description>
<javaCode>
<![CDATA[
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
Shape smallDot = new Ellipse2D.Float(0, 0, 12, 12);
// small rectangle
Shape smallRect = new Rectangle(0, 0, 12, 12);
// Small Triangle
GeneralPath smallTriangle = new GeneralPath();
smallTriangle.moveTo(6, 0);
smallTriangle.lineTo(12, 12);
smallTriangle.lineTo(0, 12);
smallTriangle.closePath();
Shape pattern[] = { smallDot, smallRect, smallTriangle };
ShapeStroke shapeStroke = new ShapeStroke(pattern, 20);
g.setStroke(shapeStroke);
Rectangle rect = new Rectangle(100, 50, 100, 100);
Ellipse2D disc = new Ellipse2D.Double(100, 250, 100, 100);
g.setPaint(Color.black);
g.draw(rect);
g.draw(disc);
]]>
</javaCode>
</test>