* [ 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 abstract void rotate(double 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 the x coordinate of the origin of the rotation * @param y the y coordinate of the origin of the rotation */ public abstract void rotate(double theta, double x, double y); /** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a scaling transformation * Subsequent rendering is resized according to the specified scaling * factors relative to the previous scaling. * This is equivalent to calling <code>transform(S)</code>, where S is an * <code>AffineTransform</code> represented by the following matrix: * <pre> * [ sx 0 0 ] * [ 0 sy 0 ] * [ 0 0 1 ] * </pre> * @param sx the amount by which X coordinates in subsequent * rendering operations are multiplied relative to previous * rendering operations. * @param sy the amount by which Y coordinates in subsequent * rendering operations are multiplied relative to previous * rendering operations. */ public abstract void scale(double sx, double sy); /** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a shearing transform. * Subsequent renderings are sheared by the specified * multiplier relative to the previous position. * This is equivalent to calling <code>transform(SH)</code>, where SH * is an <code>AffineTransform</code> represented by the following * matrix: * <pre> * [ 1 shx 0 ] * [ shy 1 0 ] * [ 0 0 1 ] * </pre> * @param shx the multiplier by which coordinates are shifted in * the positive X axis direction as a function of their Y coordinate * @param shy the multiplier by which coordinates are shifted in * the positive Y axis direction as a function of their X coordinate */ public abstract void shear(double shx, double shy); /** * Composes an <code>AffineTransform</code> object with the * <code>Transform</code> in this <code>Graphics2D</code> according * to the rule last-specified-first-applied. If the current * <code>Transform</code> is Cx, the result of composition * with Tx is a new <code>Transform</code> Cx'. Cx' becomes the * current <code>Transform</code> for this <code>Graphics2D</code>. * Transforming a point p by the updated <code>Transform</code> Cx' is * equivalent to first transforming p by Tx and then transforming * the result by the original <code>Transform</code> Cx. In other * words, Cx'(p) = Cx(Tx(p)). A copy of the Tx is made, if necessary, * so further modifications to Tx do not affect rendering. * @param Tx the <code>AffineTransform</code> object to be composed with * the current <code>Transform</code> * @see #setTransform * @see AffineTransform */ public abstract void transform(AffineTransform Tx); /** * Overwrites the Transform in the <code>Graphics2D</code> context. * WARNING: This method should <b>never</b> be used to apply a new * coordinate transform on top of an existing transform because the * <code>Graphics2D</code> might already have a transform that is * needed for other purposes, such as rendering Swing * components or applying a scaling transformation to adjust for the * resolution of a printer. * <p>To add a coordinate transform, use the * <code>transform</code>, <code>rotate</code>, <code>scale</code>, * or <code>shear</code> methods. The <code>setTransform</code> * method is intended only for restoring the original * <code>Graphics2D</code> transform after rendering, as shown in this * example: * <pre><blockquote> * // Get the current transform * AffineTransform saveAT = g2.getTransform(); * // Perform transformation * g2d.transform(...); * // Render * g2d.draw(...); * // Restore original transform * g2d.setTransform(saveAT); * </blockquote></pre> * * @param Tx the <code>AffineTransform</code> that was retrieved * from the <code>getTransform</code> method * @see #transform * @see #getTransform * @see AffineTransform */ public abstract void setTransform(AffineTransform Tx); /** * Returns a copy of the current <code>Transform</code> in the * <code>Graphics2D</code> context. * @return the current <code>AffineTransform</code> in the * <code>Graphics2D</code> context. * @see #transform * @see #setTransform */ public abstract AffineTransform getTransform(); /** * Returns the current <code>Paint</code> of the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Paint</code>, * which defines a color or pattern. * @see #setPaint * @see java.awt.Graphics#setColor */ public abstract Paint getPaint(); /** * Returns the current <code>Composite</code> in the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Composite</code>, * which defines a compositing style. * @see #setComposite */ public abstract Composite getComposite(); /** * Sets the background color for the <code>Graphics2D</code> context. * The background color is used for clearing a region. * When a <code>Graphics2D</code> is constructed for a * <code>Component</code>, the background color is * inherited from the <code>Component</code>. Setting the background color * in the <code>Graphics2D</code> context only affects the subsequent * <code>clearRect</code> calls and not the background color of the * <code>Component</code>. To change the background * of the <code>Component</code>, use appropriate methods of * the <code>Component</code>. * @param color the background color that isused in * subsequent calls to <code>clearRect</code> * @see #getBackground * @see java.awt.Graphics#clearRect */ public abstract void setBackground(Color color); /** * Returns the background color used for clearing a region. * @return the current <code>Graphics2D</code> <code>Color</code>, * which defines the background color. * @see #setBackground */ public abstract Color getBackground(); /** * Returns the current <code>Stroke</code> in the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Stroke</code>, * which defines the line style. * @see #setStroke */ public abstract Stroke getStroke(); /** * Intersects the current <code>Clip</code> with the interior of the * specified <code>Shape</code> and sets the <code>Clip</code> to the * resulting intersection. The specified <code>Shape</code> is * transformed with the current <code>Graphics2D</code> * <code>Transform</code> before being intersected with the current * <code>Clip</code>. This method is used to make the current * <code>Clip</code> smaller. * To make the <code>Clip</code> larger, use <code>setClip</code>. * The <i>user clip</i> modified by this method is independent of the * clipping associated with device bounds and visibility. If no clip has * previously been set, or if the clip has been cleared using * {@link Graphics#setClip(Shape) setClip} with a <code>null</code> * argument, the specified <code>Shape</code> becomes the new * user clip. * @param s the <code>Shape</code> to be intersected with the current * <code>Clip</code>. If <code>s</code> is <code>null</code>, * this method clears the current <code>Clip</code>. */ public abstract void clip(Shape s); /** * Get the rendering context of the <code>Font</code> within this * <code>Graphics2D</code> context. * The {@link FontRenderContext} * encapsulates application hints such as anti-aliasing and * fractional metrics, as well as target device specific information * such as dots-per-inch. This information should be provided by the * application when using objects that perform typographical * formatting, such as <code>Font</code> and * <code>TextLayout</code>. This information should also be provided * by applications that perform their own layout and need accurate * measurements of various characteristics of glyphs such as advance * and line height when various rendering hints have been applied to * the text rendering. * * @return a reference to an instance of FontRenderContext. * @see java.awt.font.FontRenderContext * @see java.awt.Font#createGlyphVector * @see java.awt.font.TextLayout * @since 1.2 */ public abstract FontRenderContext getFontRenderContext(); }Lines 1001–1234 of 1234. Previous lines
* [ 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 abstract void rotate(double 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 the x coordinate of the origin of the rotation * @param y the y coordinate of the origin of the rotation */ public abstract void rotate(double theta, double x, double y); /** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a scaling transformation * Subsequent rendering is resized according to the specified scaling * factors relative to the previous scaling. * This is equivalent to calling <code>transform(S)</code>, where S is an * <code>AffineTransform</code> represented by the following matrix: * <pre> * [ sx 0 0 ] * [ 0 sy 0 ] * [ 0 0 1 ] * </pre> * @param sx the amount by which X coordinates in subsequent * rendering operations are multiplied relative to previous * rendering operations. * @param sy the amount by which Y coordinates in subsequent * rendering operations are multiplied relative to previous * rendering operations. */ public abstract void scale(double sx, double sy); /** * Concatenates the current <code>Graphics2D</code> * <code>Transform</code> with a shearing transform. * Subsequent renderings are sheared by the specified * multiplier relative to the previous position. * This is equivalent to calling <code>transform(SH)</code>, where SH * is an <code>AffineTransform</code> represented by the following * matrix: * <pre> * [ 1 shx 0 ] * [ shy 1 0 ] * [ 0 0 1 ] * </pre> * @param shx the multiplier by which coordinates are shifted in * the positive X axis direction as a function of their Y coordinate * @param shy the multiplier by which coordinates are shifted in * the positive Y axis direction as a function of their X coordinate */ public abstract void shear(double shx, double shy); /** * Composes an <code>AffineTransform</code> object with the * <code>Transform</code> in this <code>Graphics2D</code> according * to the rule last-specified-first-applied. If the current * <code>Transform</code> is Cx, the result of composition * with Tx is a new <code>Transform</code> Cx'. Cx' becomes the * current <code>Transform</code> for this <code>Graphics2D</code>. * Transforming a point p by the updated <code>Transform</code> Cx' is * equivalent to first transforming p by Tx and then transforming * the result by the original <code>Transform</code> Cx. In other * words, Cx'(p) = Cx(Tx(p)). A copy of the Tx is made, if necessary, * so further modifications to Tx do not affect rendering. * @param Tx the <code>AffineTransform</code> object to be composed with * the current <code>Transform</code> * @see #setTransform * @see AffineTransform */ public abstract void transform(AffineTransform Tx); /** * Overwrites the Transform in the <code>Graphics2D</code> context. * WARNING: This method should <b>never</b> be used to apply a new * coordinate transform on top of an existing transform because the * <code>Graphics2D</code> might already have a transform that is * needed for other purposes, such as rendering Swing * components or applying a scaling transformation to adjust for the * resolution of a printer. * <p>To add a coordinate transform, use the * <code>transform</code>, <code>rotate</code>, <code>scale</code>, * or <code>shear</code> methods. The <code>setTransform</code> * method is intended only for restoring the original * <code>Graphics2D</code> transform after rendering, as shown in this * example: * <pre><blockquote> * // Get the current transform * AffineTransform saveAT = g2.getTransform(); * // Perform transformation * g2d.transform(...); * // Render * g2d.draw(...); * // Restore original transform * g2d.setTransform(saveAT); * </blockquote></pre> * * @param Tx the <code>AffineTransform</code> that was retrieved * from the <code>getTransform</code> method * @see #transform * @see #getTransform * @see AffineTransform */ public abstract void setTransform(AffineTransform Tx); /** * Returns a copy of the current <code>Transform</code> in the * <code>Graphics2D</code> context. * @return the current <code>AffineTransform</code> in the * <code>Graphics2D</code> context. * @see #transform * @see #setTransform */ public abstract AffineTransform getTransform(); /** * Returns the current <code>Paint</code> of the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Paint</code>, * which defines a color or pattern. * @see #setPaint * @see java.awt.Graphics#setColor */ public abstract Paint getPaint(); /** * Returns the current <code>Composite</code> in the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Composite</code>, * which defines a compositing style. * @see #setComposite */ public abstract Composite getComposite(); /** * Sets the background color for the <code>Graphics2D</code> context. * The background color is used for clearing a region. * When a <code>Graphics2D</code> is constructed for a * <code>Component</code>, the background color is * inherited from the <code>Component</code>. Setting the background color * in the <code>Graphics2D</code> context only affects the subsequent * <code>clearRect</code> calls and not the background color of the * <code>Component</code>. To change the background * of the <code>Component</code>, use appropriate methods of * the <code>Component</code>. * @param color the background color that isused in * subsequent calls to <code>clearRect</code> * @see #getBackground * @see java.awt.Graphics#clearRect */ public abstract void setBackground(Color color); /** * Returns the background color used for clearing a region. * @return the current <code>Graphics2D</code> <code>Color</code>, * which defines the background color. * @see #setBackground */ public abstract Color getBackground(); /** * Returns the current <code>Stroke</code> in the * <code>Graphics2D</code> context. * @return the current <code>Graphics2D</code> <code>Stroke</code>, * which defines the line style. * @see #setStroke */ public abstract Stroke getStroke(); /** * Intersects the current <code>Clip</code> with the interior of the * specified <code>Shape</code> and sets the <code>Clip</code> to the * resulting intersection. The specified <code>Shape</code> is * transformed with the current <code>Graphics2D</code> * <code>Transform</code> before being intersected with the current * <code>Clip</code>. This method is used to make the current * <code>Clip</code> smaller. * To make the <code>Clip</code> larger, use <code>setClip</code>. * The <i>user clip</i> modified by this method is independent of the * clipping associated with device bounds and visibility. If no clip has * previously been set, or if the clip has been cleared using * {@link Graphics#setClip(Shape) setClip} with a <code>null</code> * argument, the specified <code>Shape</code> becomes the new * user clip. * @param s the <code>Shape</code> to be intersected with the current * <code>Clip</code>. If <code>s</code> is <code>null</code>, * this method clears the current <code>Clip</code>. */ public abstract void clip(Shape s); /** * Get the rendering context of the <code>Font</code> within this * <code>Graphics2D</code> context. * The {@link FontRenderContext} * encapsulates application hints such as anti-aliasing and * fractional metrics, as well as target device specific information * such as dots-per-inch. This information should be provided by the * application when using objects that perform typographical * formatting, such as <code>Font</code> and * <code>TextLayout</code>. This information should also be provided * by applications that perform their own layout and need accurate * measurements of various characteristics of glyphs such as advance * and line height when various rendering hints have been applied to * the text rendering. * * @return a reference to an instance of FontRenderContext. * @see java.awt.font.FontRenderContext * @see java.awt.Font#createGlyphVector * @see java.awt.font.TextLayout * @since 1.2 */ public abstract FontRenderContext getFontRenderContext(); }