I am trying to rotate a Rectangle2D object by a particular theta. But I cannot do this because the method transform(AffineTransform) is undefined for Rectangle2D. Any thoughts on how to do this? Thanks.
Rectangle2D.Double currentVehic = new Rectangle2D.Double(bottomLeft[0], bottomLeft[1],vehicWidth, vehicHeight);
// Rotate the vehicle perimeter about its center
AffineTransform rotate = new AffineTransform();
//Rectangle2D rotatedVehic = AffineTransform.getRotateInstance(theta,x,y);
rotate.setToRotation(theta, x, y);
currentVehic.transform(rotate);
return currentVehic;