swingx
Version 2005-08-19

org.jdesktop.swingx.plaf
Class PainterUIResource

java.lang.Object
  extended by org.jdesktop.swingx.plaf.PainterUIResource
All Implemented Interfaces:
UIResource, Painter

public class PainterUIResource
extends Object
implements Painter, UIResource

An impl of Painter that implements UIResource. UI classes that create Painters should use this class.


Constructor Summary
PainterUIResource(Painter p)
          Creates a new instance of PainterUIResource
 
Method Summary
 void paint(Graphics2D g, JComponent component)
          Paints on the given Graphics2D object some effect which may or may not be related to the given component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PainterUIResource

public PainterUIResource(Painter p)
Creates a new instance of PainterUIResource

Method Detail

paint

public void paint(Graphics2D g,
                  JComponent component)
Description copied from interface: Painter

Paints on the given Graphics2D object some effect which may or may not be related to the given component. For example, BackgroundPainter will use the background property of the component and the width/height of the component to perform a fill rect. Most other Painters will disregard the component entirely, except to get the component width/height.

The Graphics2D object must be returned to the same state it started at by the end of the method. For example, if "setColor(c)" was called on the graphics object, it should be reset to the original color before the method returns.

Specified by:
paint in interface Painter
Parameters:
g - The Graphics2D object in which to paint
component - The JComponent that the Painter is delegate for.

swingx
Version 2005-08-19