bibliothek.gui.dock.util
Interface BackgroundPaint


public interface BackgroundPaint

A BackgroundPaint is used to paint the background of various Components of this framework.
Please note that some items provided by a DockTheme do not use a BackgroundPaint because they already paint their background in a specific way.

Author:
Benjamin Sigg

Field Summary
static BackgroundPaint SOLID
          Simple BackgroundPaint that will attempt to make any background opaque (not transparent)
static BackgroundPaint TRANSPARENT
          Simple BackgroundPaint that will attempt to make any background transparent
 
Method Summary
 void install(BackgroundComponent component)
          Informs this paint that is will be used by component.
 void paint(BackgroundComponent background, PaintableComponent paintable, Graphics g)
          Paints the background component using the graphics context g.
 void uninstall(BackgroundComponent component)
          Informs this paint that it is no longer used by component.
 

Field Detail

TRANSPARENT

static final BackgroundPaint TRANSPARENT
Simple BackgroundPaint that will attempt to make any background transparent


SOLID

static final BackgroundPaint SOLID
Simple BackgroundPaint that will attempt to make any background opaque (not transparent)

Method Detail

install

void install(BackgroundComponent component)
Informs this paint that is will be used by component.

Parameters:
component - the component that is going to use this paint, not null

uninstall

void uninstall(BackgroundComponent component)
Informs this paint that it is no longer used by component.

Parameters:
component - the component that no longer uses this paint, not null

paint

void paint(BackgroundComponent background,
           PaintableComponent paintable,
           Graphics g)
Paints the background component using the graphics context g. The exact behavior of this method may depend on the type of component.
This method should be aware of the different paint-methods of PaintableComponent, for example PaintableComponent.paintBackground(Graphics): Further more implementations should follow these guide lines to prevent artifacts while painting:

Parameters:
background - the component to paint, is installed on this paint, not null
paintable - the part of the component that is to be painted, may be a child-Component
g - the graphics context to use
Throws:
IllegalArgumentException - if component is not equal to background or not a child of background