public class

FillableShape.Animator

extends StrokedShape.Animator<AnimatorType extends Animator<AnimatorType>>
java.lang.Object
   ↳ sofia.graphics.Shape.Animator<AnimatorType extends sofia.graphics.Shape.Animator<AnimatorType>>
     ↳ sofia.graphics.StrokedShape.Animator<AnimatorType extends sofia.graphics.StrokedShape.Animator<AnimatorType>>
       ↳ sofia.graphics.FillableShape.Animator<AnimatorType extends sofia.graphics.FillableShape.Animator<AnimatorType>>

Class Overview

Provides animation support for shapes. Most uses of this class will not need to reference it directly; for example, an animation can be constructed and played by chaining method calls directly:

     shape.animate(500).color(Color.blue).alpha(128).play();
In situations where the type of the class must be referenced directly (for example, when one is passed to an event handler like onAnimationDone), referring to the name of that type can be somewhat awkward due to the use of some Java generics tricks to ensure that the methods chain properly. In nearly all cases, it is reasonable to use a "?" wildcard in place of the generic parameter:
     Shape.Animator<?> anim = shape.animate(500).color(Color.blue);
     anim.play();

Summary

Protected Constructors
FillableShape.Animator(long duration)
Creates a new animator for the specified shape.
Public Methods
AnimatorType fillColor(Color fillColor)
Sets the final fill color of the shape when the animation ends.
FillableShape getShape()
Gets the shape that the receiver is animating.
[Expand]
Inherited Methods
From class sofia.graphics.StrokedShape.Animator
From class sofia.graphics.Shape.Animator
From class java.lang.Object

Protected Constructors

protected FillableShape.Animator (long duration)

Creates a new animator for the specified shape. Users cannot call call this constructor directly; instead, they need to use the StrokedShape#animate(long) method to get an animator object.

Parameters
duration the length of one pass of the animation, in milliseconds

Public Methods

public AnimatorType fillColor (Color fillColor)

Sets the final fill color of the shape when the animation ends.

Parameters
fillColor the final fill color of the shape when the animation ends
Returns
  • this animator, for method chaining

public FillableShape getShape ()

Gets the shape that the receiver is animating.

Returns
  • the shape that the receiver is animating