Class 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.
    Version:
    $Id: PatternPaint.java 1733416 2016-03-03 07:07:13Z gadams $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private PatternPaintContext lastContext  
      private GraphicsNode node
      The GraphicsNode that this Paint uses to produce the pixel pattern
      private boolean overflow
      Controls whether or not the pattern overflows the pattern tile
      private java.awt.geom.Rectangle2D patternRegion
      The region to which this paint is constrained
      private java.awt.geom.AffineTransform patternTransform
      Additional pattern transform, added on top of the user space to device space transform (i.e., before the tiling space
      private Filter tile  
      • Fields inherited from interface java.awt.Transparency

        BITMASK, OPAQUE, TRANSLUCENT
    • Constructor Summary

      Constructors 
      Constructor Description
      PatternPaint​(GraphicsNode node, java.awt.geom.Rectangle2D patternRegion, boolean overflow, java.awt.geom.AffineTransform patternTransform)
      Constructs a new PatternPaint.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      boolean getOverflow()  
      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
    • Field Detail

      • node

        private GraphicsNode node
        The GraphicsNode that this Paint uses to produce the pixel pattern
      • patternRegion

        private java.awt.geom.Rectangle2D patternRegion
        The region to which this paint is constrained
      • patternTransform

        private java.awt.geom.AffineTransform patternTransform
        Additional pattern transform, added on top of the user space to device space transform (i.e., before the tiling space
      • overflow

        private boolean overflow
        Controls whether or not the pattern overflows the pattern tile
    • 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.
      • getOverflow

        public boolean getOverflow()
      • 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