Package ca.cgjennings.ui.theme
Class TiledImagePainter<T>
- java.lang.Object
-
- ca.cgjennings.ui.theme.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)
-
-
-
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 interfacejavax.swing.Painter<T>
-
-