/**
* Draw rectangle
*
* @param aPoint Start point
* @param width Width
* @param height Height
* @param aPGB Polygon break
* @param g Graphics2D
*/
public static void drawRectangle(PointF aPoint, float width, float height, PolygonBreak aPGB, Graphics2D g) {
Color aColor = aPGB.getColor();
if (aPGB.isDrawFill()) {
if (aPGB.isUsingHatchStyle()) {
int size = aPGB.getStyleSize();
BufferedImage bi = getHatchImage(aPGB.getStyle(), size, aPGB.getColor(), aPGB.getBackColor());
Rectangle2D rect = new Rectangle2D.Double(0, 0, size, size);
g.setPaint(new TexturePaint(bi, rect));
g.fill(new Rectangle.Float(aPoint.X, aPoint.Y, width, height));
} else {
g.setColor(aColor);
g.fill(new Rectangle.Float(aPoint.X, aPoint.Y, width, height));
}
}
if (aPGB.isDrawOutline()) {
g.setColor(aPGB.getOutlineColor());
g.setStroke(new BasicStroke(aPGB.getOutlineSize()));
g.draw(new Rectangle.Float(aPoint.X, aPoint.Y, width, height));
}
}
Draw.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:MeteoInfoLib
作者:
评论列表
文章目录