Class TiledImagePainter<T>

  • Type Parameters:
    T - the type of object being painted (may be null)
    All Implemented Interfaces:
    javax.swing.Painter<T>

    public class TiledImagePainter<T>
    extends java.lang.Object
    implements javax.swing.Painter<T>
    A painter that tiles an image over the entire painted surface. For best results, the caller should ensure that the tile image has seamless edges.
    Since:
    3.0
    Author:
    Chris Jennings
    • Constructor Summary

      Constructors 
      Constructor Description
      TiledImagePainter​(java.awt.image.BufferedImage tileImage)
      Creates a painter that tiles the supplied image.
      TiledImagePainter​(java.lang.String resource)
      Creates a painter that loads its tile image from a resource.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void paint​(java.awt.Graphics2D g, java.lang.Object object, int width, int height)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TiledImagePainter

        public TiledImagePainter​(java.lang.String resource)
        Creates a painter that loads its tile image from a resource.
        Parameters:
        resource - the resource of the tile image
      • TiledImagePainter

        public TiledImagePainter​(java.awt.image.BufferedImage tileImage)
        Creates a painter that tiles the supplied image.
        Parameters:
        tileImage - the image to tile
    • Method Detail

      • paint

        public void paint​(java.awt.Graphics2D g,
                          java.lang.Object object,
                          int width,
                          int height)
        Specified by:
        paint in interface javax.swing.Painter<T>