Package org.apache.pivot.wtk.effects
Class RotationDecorator
- java.lang.Object
-
- org.apache.pivot.wtk.effects.RotationDecorator
-
-
Constructor Summary
Constructors Constructor Description RotationDecorator()
Creates a new rotation decorator with the default theta value (zero).RotationDecorator(double theta)
Creates a new rotation decorator with the specified theta value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bounds
getBounds(Component component)
Returns the bounding area of the decorator.double
getTheta()
java.awt.geom.AffineTransform
getTransform(Component component)
Returns the transformation the decorator applies to the component's coordinate space.java.awt.Graphics2D
prepare(Component component, java.awt.Graphics2D graphics)
Prepares the graphics context into which the component or prior decorator will paint.void
setTheta(double theta)
Sets the rotation angle, in radians.
-
-
-
Constructor Detail
-
RotationDecorator
public RotationDecorator()
Creates a new rotation decorator with the default theta value (zero).
-
RotationDecorator
public RotationDecorator(double theta)
Creates a new rotation decorator with the specified theta value.- Parameters:
theta
- The rotation angle, in radians.
-
-
Method Detail
-
getTheta
public double getTheta()
- Returns:
- The rotation angle, in radians.
-
setTheta
public void setTheta(double theta)
Sets the rotation angle, in radians.- Parameters:
theta
- The rotation angle, in radians.
-
prepare
public java.awt.Graphics2D prepare(Component component, java.awt.Graphics2D graphics)
Prepares the graphics context into which the component or prior decorator will paint. This method is called immediately prior toComponent.paint(Graphics2D)
; decorators are called in descending order.
-
getBounds
public Bounds getBounds(Component component)
Returns the bounding area of the decorator.This default simply returns the bounds of the component's size.
-
getTransform
public java.awt.geom.AffineTransform getTransform(Component component)
Returns the transformation the decorator applies to the component's coordinate space.This default simply returns a new
AffineTransform
.- Specified by:
getTransform
in interfaceDecorator
- Parameters:
component
- The component the decorator is attached to.- Returns:
- The decorator's transform.
-
-