private void fillShape(final SWTGraphics2D g2) {
final double lineWidth = g2.getTransformedLineWidth();
if (shape instanceof Rectangle2D) {
g2.fillRect(shapePts[0] + lineWidth / 2, shapePts[1] + lineWidth / 2, shapePts[2] - lineWidth, shapePts[3]
- lineWidth);
}
else if (shape instanceof Ellipse2D) {
g2.fillOval(shapePts[0] + lineWidth / 2, shapePts[1] + lineWidth / 2, shapePts[2] - lineWidth, shapePts[3]
- lineWidth);
}
else if (shape instanceof Arc2D) {
g2.fillArc(shapePts[0] + lineWidth / 2, shapePts[1] + lineWidth / 2, shapePts[2] - lineWidth, shapePts[3]
- lineWidth, shapePts[4], shapePts[5]);
}
else if (shape instanceof RoundRectangle2D) {
g2.fillRoundRect(shapePts[0] + lineWidth / 2, shapePts[1] + lineWidth / 2, shapePts[2] - lineWidth,
shapePts[3] - lineWidth, shapePts[4], shapePts[5]);
}
else {
g2.fill(shape);
}
}
PSWTPath.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:PhET
作者:
评论列表
文章目录