if (getStroke() == null) {
boundingShape = shape2D;
} else {
int strokeThickness = getStrokeThickness();
BasicStroke basicStroke = new BasicStroke(strokeThickness);
java.awt.Shape strokeShape = basicStroke.createStrokedShape(shape2D);
boundingShape = strokeShape;
}
java.awt.Rectangle bounds = boundingShape.getBounds();
setBounds(bounds.x, bounds.y, bounds.width, bounds.height);