Class AnimationLayer2DFactory

All Implemented Interfaces:
Cloneable

public final class AnimationLayer2DFactory extends AbstrAnimLayer2DFactory<AnimationLayer2D>
Factory for creating animation layers. This factory provides the same parameters and object-initialization methods as AbstrAnimLayer2DFactory.

In addition to controlling the stacking order (z-order) and visibility, this factory can configure an animation layer by providing the ability to add standard graphic objects to it, including the following:

  • Arcs.
  • Cubic curves.
  • Ellipses.
  • Images. (The actual image is specified via a URL, and may be scaled, translated, and rotated as desired).
  • Lines.
  • Quadratic paths.
  • Rectangles.
  • Round Rectangles.
  • Spline paths. (A subclass of Path2D.Double that can use splines to provide smooth curves through a specified set of points.)
  • Text.
Most of the above are based on classes in the java.awt.geom package.

While there are a few factory parameters that apply to an animation layer as a whole, most of the parameters are subparameters of the object parameter. These parameters have integer keys, with the parameter object.type indicating the type of the object. For each type, a specific set of subparameters is used. With the exception of spline paths, each object is represented by a set of parameters with a common integer-valued key. For spline paths, the keys are also integer-valued, but multiple keys are needed to describe a path. Each path is delimited by entries with a PATH_START and PATH_END object type. In between are a series of path segments separated by entries with a SEG_END, SEG_END_PREV, SEG_END_NEXT or SEG_CLOSE object type. Each segment can optionally contain one or two control points (the object type is CONTROL_POINT, corresponding to quadratic or cubic Bézier curves. Alternatively, a path segment can contain a series of entries whose object type is SPLINE_POINT or SPLINE_FUNCTION. The allowed sequences of object.type values for these paths are shown in the following diagram:

UML Diagram

The parameters this factory supports are shown in the following table (the documentation for object.type describes which "object" parameters are used for a given type):

  • Constructor Details

    • AnimationLayer2DFactory

      public AnimationLayer2DFactory(Animation2D a2d)
      Constructor.
      Parameters:
      a2d - the animation
    • AnimationLayer2DFactory

      public AnimationLayer2DFactory()
      Constructor for service provider. This constructor should not be used directly. It is necessary because of the introduction of modules in Java 9, and is used by a service provider that allows factories to be listed, possibly with documentation regarding their parameters. It jst calls the default constructor with a null argument.
  • Method Details