/** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a rotation transform. * Subsequent rendering is rotated by the specified radians relative * to the previous origin. * This is equivalent to calling <code>transform(R)</code>, where R is an * <code>AffineTransform</code> represented by the following matrix: * <pre> * [ cos(theta) -sin(theta) 0 ] * [ sin(theta) cos(theta) 0 ] * [ 0 0 1 ] * </pre> * Rotating with a positive angle theta rotates points on the positive * x axis toward the positive y axis. * @param theta the angle of rotation in radians */ public void rotate(double theta){ transform.rotate(theta); transformStack.add(TransformStackElement.createRotateElement(theta)); }
/** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a rotation transform. * Subsequent rendering is rotated by the specified radians relative * to the previous origin. * This is equivalent to calling <code>transform(R)</code>, where R is an * <code>AffineTransform</code> represented by the following matrix: * <pre> * [ cos(theta) -sin(theta) 0 ] * [ sin(theta) cos(theta) 0 ] * [ 0 0 1 ] * </pre> * Rotating with a positive angle theta rotates points on the positive * x axis toward the positive y axis. * @param theta the angle of rotation in radians */ public void rotate(double theta){ transform.rotate(theta); transformStack.add(TransformStackElement.createRotateElement(theta)); }
/** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a rotation transform. * Subsequent rendering is rotated by the specified radians relative * to the previous origin. * This is equivalent to calling <code>transform(R)</code>, where R is an * <code>AffineTransform</code> represented by the following matrix: * <pre> * [ cos(theta) -sin(theta) 0 ] * [ sin(theta) cos(theta) 0 ] * [ 0 0 1 ] * </pre> * Rotating with a positive angle theta rotates points on the positive * x axis toward the positive y axis. * @param theta the angle of rotation in radians */ public void rotate(double theta){ transform.rotate(theta); transformStack.add(TransformStackElement.createRotateElement(theta)); }
/** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a translated rotation * transform. Subsequent rendering is transformed by a transform * which is constructed by translating to the specified location, * rotating by the specified radians, and translating back by the same * amount as the original translation. This is equivalent to the * following sequence of calls: * <pre> * translate(x, y); * rotate(theta); * translate(-x, -y); * </pre> * Rotating with a positive angle theta rotates points on the positive * x axis toward the positive y axis. * @param theta the angle of rotation in radians * @param x x coordinate of the origin of the rotation * @param y y coordinate of the origin of the rotation */ public void rotate(double theta, double x, double y){ transform.rotate(theta, x, y); transformStack.add(TransformStackElement.createTranslateElement(x, y)); transformStack.add(TransformStackElement.createRotateElement(theta)); transformStack.add(TransformStackElement.createTranslateElement(-x, -y)); }
/** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a translated rotation * transform. Subsequent rendering is transformed by a transform * which is constructed by translating to the specified location, * rotating by the specified radians, and translating back by the same * amount as the original translation. This is equivalent to the * following sequence of calls: * <pre> * translate(x, y); * rotate(theta); * translate(-x, -y); * </pre> * Rotating with a positive angle theta rotates points on the positive * x axis toward the positive y axis. * @param theta the angle of rotation in radians * @param x x coordinate of the origin of the rotation * @param y y coordinate of the origin of the rotation */ public void rotate(double theta, double x, double y){ transform.rotate(theta, x, y); transformStack.add(TransformStackElement.createTranslateElement(x, y)); transformStack.add(TransformStackElement.createRotateElement(theta)); transformStack.add(TransformStackElement.createTranslateElement(-x, -y)); }
/** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a translated rotation * transform. Subsequent rendering is transformed by a transform * which is constructed by translating to the specified location, * rotating by the specified radians, and translating back by the same * amount as the original translation. This is equivalent to the * following sequence of calls: * <pre> * translate(x, y); * rotate(theta); * translate(-x, -y); * </pre> * Rotating with a positive angle theta rotates points on the positive * x axis toward the positive y axis. * @param theta the angle of rotation in radians * @param x x coordinate of the origin of the rotation * @param y y coordinate of the origin of the rotation */ public void rotate(double theta, double x, double y){ transform.rotate(theta, x, y); transformStack.add(TransformStackElement.createTranslateElement(x, y)); transformStack.add(TransformStackElement.createRotateElement(theta)); transformStack.add(TransformStackElement.createTranslateElement(-x, -y)); }