pivot.wtk.effects
Interface Decorator

All Known Implementing Classes:
BlurDecorator, ClipDecorator, DropShadowDecorator, FadeDecorator, GrayscaleDecorator, ReflectionDecorator, SaturationDecorator, ScaleDecorator, ShadeDecorator, TagDecorator, TranslationDecorator, WatermarkDecorator

public interface Decorator

Interface defining a component "decorator". Decorators allow a caller to attach additional visual effects to a component.

Author:
gbrown

Method Summary
 Bounds getBounds(Component component)
          Returns the bounding area of the decorator.
 AffineTransform getTransform(Component component)
          Returns the transformation the decorator applies to the component's coordinate space.
 Graphics2D prepare(Component component, Graphics2D graphics)
          Prepares the graphics context into which the component or prior decorator will paint.
 void update()
          Updates the graphics context into which the component or prior decorator was painted.
 

Method Detail

prepare

Graphics2D prepare(Component component,
                   Graphics2D graphics)
Prepares the graphics context into which the component or prior decorator will paint. This method is called immediately prior to Component.paint(Graphics2D); decorators are called in descending order.

Parameters:
component -
graphics -
Returns:
The graphics context that should be used by the component or prior decorators.

update

void update()
Updates the graphics context into which the component or prior decorator was painted. This method is called immediately after Component.paint(Graphics2D); decorators are called in ascending order.


getBounds

Bounds getBounds(Component component)
Returns the bounding area of the decorator.

Parameters:
component -
Returns:
The decorator's bounds, relative to the component's origin.

getTransform

AffineTransform getTransform(Component component)
Returns the transformation the decorator applies to the component's coordinate space.

Returns:
The decorator's transform.