| Package | Description | 
|---|---|
| java.awt | Contains all of the classes for creating user
interfaces and for painting graphics and images. | 
| java.awt.font | Provides classes and interface relating to fonts. | 
| java.awt.geom | Provides the Java 2D classes for defining and performing operations
on objects related to two-dimensional geometry. | 
| java.awt.image | Provides classes for creating and modifying images. | 
| java.awt.image.renderable | Provides classes and interfaces for producing
rendering-independent images. | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract AffineTransform | GraphicsConfiguration. getDefaultTransform()Returns the default  AffineTransformfor thisGraphicsConfiguration. | 
| abstract AffineTransform | GraphicsConfiguration. getNormalizingTransform()Returns a  AffineTransformthat can be concatenated
 with the defaultAffineTransformof aGraphicsConfigurationso that 72 units in user
 space equals 1 inch in device space. | 
| AffineTransform | MultipleGradientPaint. getTransform()Returns a copy of the transform applied to the gradient. | 
| abstract AffineTransform | Graphics2D. getTransform()Returns a copy of the current  Transformin theGraphics2Dcontext. | 
| AffineTransform | Font. getTransform()Returns a copy of the transform associated with this
  Font. | 
| Modifier and Type | Method and Description | 
|---|---|
| PaintContext | TexturePaint. createContext(ColorModel cm,
             Rectangle deviceBounds,
             Rectangle2D userBounds,
             AffineTransform xform,
             RenderingHints hints)Creates and returns a  PaintContextused to
 generate a tiled image pattern. | 
| PaintContext | GradientPaint. createContext(ColorModel cm,
             Rectangle deviceBounds,
             Rectangle2D userBounds,
             AffineTransform xform,
             RenderingHints hints)Creates and returns a  PaintContextused to
 generate a linear color gradient pattern. | 
| PaintContext | RadialGradientPaint. createContext(ColorModel cm,
             Rectangle deviceBounds,
             Rectangle2D userBounds,
             AffineTransform transform,
             RenderingHints hints)Creates and returns a  PaintContextused to
 generate a circular radial color gradient pattern. | 
| PaintContext | LinearGradientPaint. createContext(ColorModel cm,
             Rectangle deviceBounds,
             Rectangle2D userBounds,
             AffineTransform transform,
             RenderingHints hints)Creates and returns a  PaintContextused to
 generate a linear color gradient pattern. | 
| PaintContext | Paint. createContext(ColorModel cm,
             Rectangle deviceBounds,
             Rectangle2D userBounds,
             AffineTransform xform,
             RenderingHints hints)Creates and returns a  PaintContextused to
 generate the color pattern. | 
| PaintContext | Color. createContext(ColorModel cm,
             Rectangle r,
             Rectangle2D r2d,
             AffineTransform xform,
             RenderingHints hints)Creates and returns a  PaintContextused to
 generate a solid color field pattern. | 
| Font | Font. deriveFont(AffineTransform trans)Creates a new  Fontobject by replicating the currentFontobject and applying a new transform to it. | 
| Font | Font. deriveFont(int style,
          AffineTransform trans)Creates a new  Fontobject by replicating thisFontobject and applying a new style and transform. | 
| abstract boolean | Graphics2D. drawImage(Image img,
         AffineTransform xform,
         ImageObserver obs)Renders an image, applying a transform from image space into user space
 before drawing. | 
| abstract void | Graphics2D. drawRenderableImage(RenderableImage img,
                   AffineTransform xform)Renders a
  RenderableImage,
 applying a transform from image space into user space before drawing. | 
| abstract void | Graphics2D. drawRenderedImage(RenderedImage img,
                 AffineTransform xform)Renders a  RenderedImage,
 applying a transform from image
 space into user space before drawing. | 
| PathIterator | Polygon. getPathIterator(AffineTransform at)Returns an iterator object that iterates along the boundary of this
  Polygonand provides access to the geometry
 of the outline of thisPolygon. | 
| PathIterator | Shape. getPathIterator(AffineTransform at)Returns an iterator object that iterates along the
  Shapeboundary and provides access to the geometry of theShapeoutline. | 
| PathIterator | Polygon. getPathIterator(AffineTransform at,
               double flatness)Returns an iterator object that iterates along the boundary of
 the  Shapeand provides access to the geometry of the
 outline of theShape. | 
| PathIterator | Shape. getPathIterator(AffineTransform at,
               double flatness)Returns an iterator object that iterates along the  Shapeboundary and provides access to a flattened view of theShapeoutline geometry. | 
| abstract void | Graphics2D. setTransform(AffineTransform Tx)Overwrites the Transform in the  Graphics2Dcontext. | 
| abstract void | Graphics2D. transform(AffineTransform Tx)Composes an  AffineTransformobject with theTransformin thisGraphics2Daccording
 to the rule last-specified-first-applied. | 
| Constructor and Description | 
|---|
| LinearGradientPaint(Point2D start,
                   Point2D end,
                   float[] fractions,
                   Color[] colors,
                   MultipleGradientPaint.CycleMethod cycleMethod,
                   MultipleGradientPaint.ColorSpaceType colorSpace,
                   AffineTransform gradientTransform)Constructs a  LinearGradientPaint. | 
| RadialGradientPaint(Point2D center,
                   float radius,
                   Point2D focus,
                   float[] fractions,
                   Color[] colors,
                   MultipleGradientPaint.CycleMethod cycleMethod,
                   MultipleGradientPaint.ColorSpaceType colorSpace,
                   AffineTransform gradientTransform)Constructs a  RadialGradientPaint. | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract AffineTransform | GlyphVector. getGlyphTransform(int glyphIndex)Returns the transform of the specified glyph within this
  GlyphVector. | 
| AffineTransform | TransformAttribute. getTransform()Returns a copy of the wrapped transform. | 
| AffineTransform | FontRenderContext. getTransform()Gets the transform that is used to scale typographical points
   to pixels in this  FontRenderContext. | 
| Modifier and Type | Method and Description | 
|---|---|
| Shape | ShapeGraphicAttribute. getOutline(AffineTransform tx)Return a  Shapethat represents the region that
 thisShapeGraphicAttributerenders. | 
| Shape | TextLayout. getOutline(AffineTransform tx)Returns a  Shaperepresenting the outline of thisTextLayout. | 
| Shape | GraphicAttribute. getOutline(AffineTransform tx)Return a  Shapethat represents the region that
 thisGraphicAttributerenders. | 
| abstract void | GlyphVector. setGlyphTransform(int glyphIndex,
                 AffineTransform newTX)Sets the transform of the specified glyph within this
  GlyphVector. | 
| Constructor and Description | 
|---|
| FontRenderContext(AffineTransform tx,
                 boolean isAntiAliased,
                 boolean usesFractionalMetrics)Constructs a  FontRenderContextobject from an
 optionalAffineTransformand twobooleanvalues that determine if the newly constructed object has
 anti-aliasing or fractional metrics. | 
| FontRenderContext(AffineTransform tx,
                 Object aaHint,
                 Object fmHint)Constructs a  FontRenderContextobject from an
 optionalAffineTransformand twoObjectvalues that determine if the newly constructed object has
 anti-aliasing or fractional metrics. | 
| TransformAttribute(AffineTransform transform)Wraps the specified transform. | 
| Modifier and Type | Method and Description | 
|---|---|
| AffineTransform | AffineTransform. createInverse()Returns an  AffineTransformobject representing the
 inverse transformation. | 
| static AffineTransform | AffineTransform. getQuadrantRotateInstance(int numquadrants)Returns a transform that rotates coordinates by the specified
 number of quadrants. | 
| static AffineTransform | AffineTransform. getQuadrantRotateInstance(int numquadrants,
                         double anchorx,
                         double anchory)Returns a transform that rotates coordinates by the specified
 number of quadrants around the specified anchor point. | 
| static AffineTransform | AffineTransform. getRotateInstance(double theta)Returns a transform representing a rotation transformation. | 
| static AffineTransform | AffineTransform. getRotateInstance(double vecx,
                 double vecy)Returns a transform that rotates coordinates according to
 a rotation vector. | 
| static AffineTransform | AffineTransform. getRotateInstance(double theta,
                 double anchorx,
                 double anchory)Returns a transform that rotates coordinates around an anchor point. | 
| static AffineTransform | AffineTransform. getRotateInstance(double vecx,
                 double vecy,
                 double anchorx,
                 double anchory)Returns a transform that rotates coordinates around an anchor
 point according to a rotation vector. | 
| static AffineTransform | AffineTransform. getScaleInstance(double sx,
                double sy)Returns a transform representing a scaling transformation. | 
| static AffineTransform | AffineTransform. getShearInstance(double shx,
                double shy)Returns a transform representing a shearing transformation. | 
| static AffineTransform | AffineTransform. getTranslateInstance(double tx,
                    double ty)Returns a transform representing a translation transformation. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | AffineTransform. concatenate(AffineTransform Tx)Concatenates an  AffineTransformTxto
 thisAffineTransformCx in the most commonly useful
 way to provide a new user space
 that is mapped to the former user space byTx. | 
| Area | Area. createTransformedArea(AffineTransform t)Creates a new  Areaobject that contains the same
 geometry as thisAreatransformed by the specifiedAffineTransform. | 
| Shape | Path2D. createTransformedShape(AffineTransform at)Returns a new  Shaperepresenting a transformed version
 of thisPath2D. | 
| PathIterator | RoundRectangle2D. getPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of this
  RoundRectangle2D. | 
| PathIterator | QuadCurve2D. getPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of the
 shape of this  QuadCurve2D. | 
| PathIterator | Ellipse2D. getPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of this
  Ellipse2D. | 
| PathIterator | CubicCurve2D. getPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of the
 shape. | 
| PathIterator | Area. getPathIterator(AffineTransform at)Creates a  PathIteratorfor the outline of thisAreaobject. | 
| PathIterator | Arc2D. getPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of the
 arc. | 
| PathIterator | Path2D.Float. getPathIterator(AffineTransform at)Returns an iterator object that iterates along the
  Shapeboundary and provides access to the geometry of theShapeoutline. | 
| PathIterator | Path2D.Double. getPathIterator(AffineTransform at)Returns an iterator object that iterates along the
  Shapeboundary and provides access to the geometry of theShapeoutline. | 
| PathIterator | Line2D. getPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of this
  Line2D. | 
| PathIterator | Rectangle2D. getPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of this
  Rectangle2D. | 
| PathIterator | QuadCurve2D. getPathIterator(AffineTransform at,
               double flatness)Returns an iteration object that defines the boundary of the
 flattened shape of this  QuadCurve2D. | 
| PathIterator | CubicCurve2D. getPathIterator(AffineTransform at,
               double flatness)Return an iteration object that defines the boundary of the
 flattened shape. | 
| PathIterator | Area. getPathIterator(AffineTransform at,
               double flatness)Creates a  PathIteratorfor the flattened outline of
 thisAreaobject. | 
| PathIterator | Path2D. getPathIterator(AffineTransform at,
               double flatness)Returns an iterator object that iterates along the  Shapeboundary and provides access to a flattened view of theShapeoutline geometry. | 
| PathIterator | Line2D. getPathIterator(AffineTransform at,
               double flatness)Returns an iteration object that defines the boundary of this
 flattened  Line2D. | 
| PathIterator | RectangularShape. getPathIterator(AffineTransform at,
               double flatness)Returns an iterator object that iterates along the
  Shapeobject's boundary and provides access to a
 flattened view of the outline of theShapeobject's geometry. | 
| PathIterator | Rectangle2D. getPathIterator(AffineTransform at,
               double flatness)Returns an iteration object that defines the boundary of the
 flattened  Rectangle2D. | 
| void | AffineTransform. preConcatenate(AffineTransform Tx)Concatenates an  AffineTransformTxto
 thisAffineTransformCx
 in a less commonly used way such thatTxmodifies the
 coordinate transformation relative to the absolute pixel
 space rather than relative to the existing user space. | 
| void | AffineTransform. setTransform(AffineTransform Tx)Sets this transform to a copy of the transform in the specified
  AffineTransformobject. | 
| void | Area. transform(AffineTransform t)Transforms the geometry of this  Areausing the specifiedAffineTransform. | 
| abstract void | Path2D. transform(AffineTransform at)Transforms the geometry of this path using the specified
  AffineTransform. | 
| void | Path2D.Float. transform(AffineTransform at)Transforms the geometry of this path using the specified
  AffineTransform. | 
| void | Path2D.Double. transform(AffineTransform at)Transforms the geometry of this path using the specified
  AffineTransform. | 
| Constructor and Description | 
|---|
| AffineTransform(AffineTransform Tx)Constructs a new  AffineTransformthat is a copy of
 the specifiedAffineTransformobject. | 
| Double(Shape s,
      AffineTransform at)Constructs a new double precision  Path2Dobject
 from an arbitraryShapeobject, transformed by anAffineTransformobject. | 
| Float(Shape s,
     AffineTransform at)Constructs a new single precision  Path2Dobject
 from an arbitraryShapeobject, transformed by anAffineTransformobject. | 
| Modifier and Type | Method and Description | 
|---|---|
| AffineTransform | AffineTransformOp. getTransform()Returns the affine transform used by this transform operation. | 
| Constructor and Description | 
|---|
| AffineTransformOp(AffineTransform xform,
                 int interpolationType)Constructs an  AffineTransformOpgiven an affine transform
 and the interpolation type. | 
| AffineTransformOp(AffineTransform xform,
                 RenderingHints hints)Constructs an  AffineTransformOpgiven an affine transform. | 
| Modifier and Type | Method and Description | 
|---|---|
| AffineTransform | RenderContext. getTransform()Gets the current user-to-device AffineTransform. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | RenderContext. concatenateTransform(AffineTransform modTransform)Modifies the current user-to-device transform by appending another
 transform. | 
| void | RenderContext. concetenateTransform(AffineTransform modTransform)Deprecated. 
 replaced by
                  concatenateTransform(AffineTransform). | 
| void | RenderContext. preConcatenateTransform(AffineTransform modTransform)Modifies the current user-to-device transform by prepending another
 transform. | 
| void | RenderContext. preConcetenateTransform(AffineTransform modTransform)Deprecated. 
 replaced by
                  preConcatenateTransform(AffineTransform). | 
| void | RenderContext. setTransform(AffineTransform newTransform)Sets the current user-to-device AffineTransform contained
 in the RenderContext to a given transform. | 
| Constructor and Description | 
|---|
| RenderContext(AffineTransform usr2dev)Constructs a RenderContext with a given transform. | 
| RenderContext(AffineTransform usr2dev,
             RenderingHints hints)Constructs a RenderContext with a given transform and rendering hints. | 
| RenderContext(AffineTransform usr2dev,
             Shape aoi)Constructs a RenderContext with a given transform and area of interest. | 
| RenderContext(AffineTransform usr2dev,
             Shape aoi,
             RenderingHints hints)Constructs a RenderContext with a given transform. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.