## org.apache.batik.gvt
Class PatternPaint

    java.lang.Object
      org.apache.batik.gvt.PatternPaint

All Implemented Interfaces:
  java.awt.Paint, java.awt.Transparency

public class PatternPaint
extends java.lang.Object
implements java.awt.Paint

The PatternPaint class provides a way to fill a Shape with a a pattern defined as a GVT Tree.

Field Summary

Fields inherited from interface java.awt.Transparency
`BITMASK, OPAQUE, TRANSLUCENT`

Constructor Summary
`PatternPaint(GraphicsNode node, java.awt.geom.Rectangle2D patternRegion, boolean overflow, java.awt.geom.AffineTransform patternTransform)` Constructs a new `PatternPaint`.

Method Summary
`java.awt.PaintContext` `createContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)` Creates and returns a context used to generate the pattern.
`GraphicsNode` `getGraphicsNode()` Returns the graphics node that define the pattern.
`java.awt.geom.Rectangle2D` `getPatternRect()` Returns the pattern region.
`java.awt.geom.AffineTransform` `getPatternTransform()` Returns the additional transform of the pattern paint.
`int` `getTransparency()` Returns the transparency mode for this pattern paint.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PatternPaint

    public PatternPaint(GraphicsNode node,
                        java.awt.geom.Rectangle2D patternRegion,
                        boolean overflow,
                        java.awt.geom.AffineTransform patternTransform)

  Constructs a new `PatternPaint`.

Parameters:
  `node` - Used to generate the paint pixel pattern
  `patternRegion` - Region to which this paint is constrained
  `overflow` - controls whether or not the node can overflow the patternRegion.
  `patternTransform` - additional transform added on top of the user space to device space transform.

Method Detail

### getGraphicsNode

    public GraphicsNode getGraphicsNode()

  Returns the graphics node that define the pattern.

### getPatternRect

    public java.awt.geom.Rectangle2D getPatternRect()

  Returns the pattern region.

### getPatternTransform

    public java.awt.geom.AffineTransform getPatternTransform()

  Returns the additional transform of the pattern paint.

### createContext

    public java.awt.PaintContext createContext(java.awt.image.ColorModel cm,
                                               java.awt.Rectangle deviceBounds,
                                               java.awt.geom.Rectangle2D userBounds,
                                               java.awt.geom.AffineTransform xform,
                                               java.awt.RenderingHints hints)

  Creates and returns a context used to generate the pattern.

  Specified by:
    `createContext` in interface `java.awt.Paint`

### getTransparency

    public int getTransparency()

  Returns the transparency mode for this pattern paint.

  Specified by:
    `getTransparency` in interface `java.awt.Transparency`

Copyright © 2004 Apache Software Foundation. All Rights Reserved.