Package org.apache.batik.gvt
Class PatternPaint
java.lang.Object
org.apache.batik.gvt.PatternPaint
- All Implemented Interfaces:
Paint
,Transparency
The PatternPaint class provides a way to fill a Shape with a a pattern
defined as a GVT Tree.
- Version:
- $Id: PatternPaint.java 1733416 2016-03-03 07:07:13Z gadams $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PatternPaintContext
private GraphicsNode
TheGraphicsNode
that thisPaint
uses to produce the pixel patternprivate boolean
Controls whether or not the pattern overflows the pattern tileprivate Rectangle2D
The region to which this paint is constrainedprivate AffineTransform
Additional pattern transform, added on top of the user space to device space transform (i.e., before the tiling spaceprivate Filter
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
-
Constructor Summary
ConstructorsConstructorDescriptionPatternPaint
(GraphicsNode node, Rectangle2D patternRegion, boolean overflow, AffineTransform patternTransform) Constructs a newPatternPaint
. -
Method Summary
Modifier and TypeMethodDescriptioncreateContext
(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Creates and returns a context used to generate the pattern.Returns the graphics node that define the pattern.boolean
Returns the pattern region.Returns the additional transform of the pattern paint.int
Returns the transparency mode for this pattern paint.
-
Field Details
-
node
TheGraphicsNode
that thisPaint
uses to produce the pixel pattern -
patternRegion
The region to which this paint is constrained -
patternTransform
Additional pattern transform, added on top of the user space to device space transform (i.e., before the tiling space -
tile
-
overflow
private boolean overflowControls whether or not the pattern overflows the pattern tile -
lastContext
-
-
Constructor Details
-
PatternPaint
public PatternPaint(GraphicsNode node, Rectangle2D patternRegion, boolean overflow, AffineTransform patternTransform) Constructs a newPatternPaint
.- Parameters:
node
- Used to generate the paint pixel patternpatternRegion
- Region to which this paint is constrainedoverflow
- 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 Details
-
getGraphicsNode
Returns the graphics node that define the pattern. -
getPatternRect
Returns the pattern region. -
getPatternTransform
Returns the additional transform of the pattern paint. -
getOverflow
public boolean getOverflow() -
createContext
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Creates and returns a context used to generate the pattern.- Specified by:
createContext
in interfacePaint
-
getTransparency
public int getTransparency()Returns the transparency mode for this pattern paint.- Specified by:
getTransparency
in interfaceTransparency
-