com.jgoodies.animation.components

Class FanComponent


public final class FanComponent
extends JComponent

A Swing component that paints a set of triangles as a fan.
Version:
$Revision: 1.1 $
Author:
Karsten Lentzsch
See Also:
FanAnimation, FanRenderer

Constructor Summary

FanComponent(int triangleCount, Color baseColor)
Constructs a FanComponent for the specified number of triangles and base color.

Method Summary

Point2D
getOrigin()
double
getRotation()
void
paintComponent(Graphics g)
Delegates painting to the fan renderer.
void
setOrigin(Point2D origin)
Sets a new origin of the fan.
void
setRotation(double rotation)
Sets a new rotation.

Constructor Details

FanComponent

public FanComponent(int triangleCount,
                    Color baseColor)
Constructs a FanComponent for the specified number of triangles and base color.
Parameters:
triangleCount - the number of triangles to be displayed
baseColor - the base color used to build the translucent triangle colors from

Method Details

getOrigin

public Point2D getOrigin()

getRotation

public double getRotation()

paintComponent

public void paintComponent(Graphics g)
Delegates painting to the fan renderer. Switches on anti-aliasing and the high quality mode before invoking the renderer.
Parameters:
g - the Graphics object to render on

setOrigin

public void setOrigin(Point2D origin)
Sets a new origin of the fan.
Parameters:
origin - the origin to be set

setRotation

public void setRotation(double rotation)
Sets a new rotation.
Parameters:
rotation - the rotation to be set

Copyright © 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved.