Class AbstrAnimShape2DFactory<Obj extends AnimationShape2D>

All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
AnimationShape2DFactory

public abstract class AbstrAnimShape2DFactory<Obj extends AnimationShape2D> extends AnimationObject2DFactory<Obj>
Abstract factory for animation shapes. In addition to controlling the stacking order (z-order) and visibility, this factory can configure an animation shape by adding animation paths to. Each path provides part of a shape's outline. A winding rule is used to determine which paths represent an interior or exterior boundary for the shape. The Z-order and visibility will be ignored by animation layers. When an animation shape is used as part of an animation layer, its visibility should be set to false, which is the default for this factory.

This factory provides a method set(String,int,Object) that will accept instances of Shape, PathIterator, String, and AnimationPath2D as its third argument. If a string is provided, the string must be the name of an instance of AnimationPath2D associated with the factory's animation.

The factory parameters this factory provides are the same as the parameters provided by its subclass AnimationShape2DFactory (the documentation for object.type describes which "object" parameters are used for a given type):

See Also:
  • Constructor Details

    • AbstrAnimShape2DFactory

      protected AbstrAnimShape2DFactory(Animation2D a2d)
      Constructor.
      Parameters:
      a2d - the animation
  • Method Details

    • clear

      public void clear()
      Description copied from class: NamedObjectFactory
      Clear all entries and restore to default values. Note: each subclass that implements this method should call super.clear(). Any subclass that defines parameters should call this method in order to restore the parameters to their default values. When an annotation processor is used for some parameters, those parameters can be restored to their default value by calling the parm manager's setDefaults method with the factory as its argument.
      Overrides:
      clear in class AnimationObject2DFactory<Obj extends AnimationShape2D>
    • clear

      public void clear(String name)
      Description copied from class: NamedObjectFactory
      Clear keys by removing all keys associated with a parameter name or restore a parameter to its default value.
      Overrides:
      clear in class NamedObjectFactory<AnimationObject2DFactory<Obj extends AnimationShape2D>,Simulation,SimObject,Obj extends AnimationShape2D>
      Parameters:
      name - the name of the entry
    • remove

      public void remove(String name, int key)
      Description copied from class: NamedObjectFactory
      Remove an entry with an index from a set of integers.
      Overrides:
      remove in class NamedObjectFactory<AnimationObject2DFactory<Obj extends AnimationShape2D>,Simulation,SimObject,Obj extends AnimationShape2D>
      Parameters:
      name - the name of the entry
      key - the key
    • unset

      public void unset(String name, int index)
      Description copied from class: NamedObjectFactory
      Unset an entry with an index and restore it to the default value.
      Overrides:
      unset in class NamedObjectFactory<AnimationObject2DFactory<Obj extends AnimationShape2D>,Simulation,SimObject,Obj extends AnimationShape2D>
      Parameters:
      name - the name of the entry
      index - the index for the entry
    • set

      public void set(String name, int key, Object value) throws NamedObjectFactory.ConfigException
      Set a value provided as a Shape, PathIterator, AnimationPath2D, or any of the other objects supported by factories, given an index. When the name is "shape", the value can be a Shape, PathIterator, or AnimationPath2D. Otherwise it can be any type acceptable for the entry name.
      Parameters:
      name - the name of the entry
      key - the index
      value - the object providing or specifying a value
      Throws:
      NamedObjectFactory.ConfigException - an exception encapsulating an IllegalArgumentException if an argument is out of bounds or the name does not match a parameter; an UnsupportedOperationException if the factory does not allow this method to be used; an IllegalStateException if the factory is not in a state for which this value may be parsed and entered; IndexOutOfBoundsException if the index is not in a legal range
      IllegalArgumentException - the value had the wrong type
    • initObject

      protected void initObject(Obj obj)
      Description copied from class: NamedObjectFactory
      Initialize an object. This method will call the methods for the object necessary to initialize it based on how the factory was configured, and is called by createObject() and createObjects unless these methods are overridden. The default method does nothing. Subclasses that override this method to provide subclass-specific initializations must start with the statement "super.initObject(object);".
      Overrides:
      initObject in class AnimationObject2DFactory<Obj extends AnimationShape2D>
      Parameters:
      obj - the object to initialize