Interface RegionPainter<T>

All Known Implementing Classes:
ButtonlessScrollBarUI.ThumbPainter, EffectPainter, RectanglePainter, RegionPainter.Alpha, RegionPainter.Image

public interface RegionPainter<T>
The RegionPainter interface defines exactly one method, paint. It is used in situations where the developer can change the painting routine of a component without having to resort to subclassing the component. It is also generically useful when doing any form of painting delegation.

Painters are simply encapsulations of Java2D code and make it fairly trivial to reuse existing painters or to combine them together. Implementations of this interface are also trivial to write, such that if you can't find a painter that does what you need, you can write one with minimal effort.

See Also:
  • invalid reference
    com.sun.java.swing.Painter
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    This class provides a base functionality to paint a region with the specified alpha.
    static class 
    This class provides a caching functionality for a region painter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    paint(Graphics2D g, int x, int y, int width, int height, T object)
    Renders to the given Graphics2D object.
  • Method Details

    • paint

      void paint(Graphics2D g, int x, int y, int width, int height, T object)
      Renders to the given Graphics2D object.
      Parameters:
      g - the Graphics2D object to render to
      x - X position of the area to paint
      y - Y position of the area to paint
      width - width of the area to paint
      height - height of the area to paint
      object - an optional configuration parameter