Digital Signal Processing Reference
In-Depth Information
D Source Code
Stroke solidStroke =
46
new BasicStroke(strokeWidth, capsstyle, joinstyle);
47
Stroke dashedStrokeOuter =
48
new BasicStroke(strokeWidth, capsstyle, joinstyle, 1.0f
, outerDashing, 0.0f);
49
Stroke dashedStrokeInner =
50
new BasicStroke(strokeWidth, capsstyle, joinstyle, 1.0f
, innerDashing, 0.0f);
51
52
53
drawShapes(outerContourShapes, g2d, solidStroke,
dashedStrokeOuter, outerColor);
drawShapes(innerContourShapes, g2d, solidStroke,
dashedStrokeInner, innerColor);
54
}
55
}
56
57
58
void drawShapes(Shape[] shapes, Graphics2D g2d, Stroke
solidStrk, Stroke dashedStrk, Color col) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
59
g2d.setColor(col);
60
for (int i = 0; i < shapes.length; i++) {
61
Shape s = shapes[i];
62
if (s instanceof Polygon)
63
g2d.setStroke(dashedStrk);
64
else
65
g2d.setStroke(solidStrk);
66
g2d.draw(shapes[i]);
67
}
68
}
69
70
71 }
Search WWH ::




Custom Search