jv.anim

## Interface PsTimeListenerIf

- All Known Implementing Classes:
    MathTimerListener, MyProject, PgHarmonicMap, PgSurface_CatenoidHelicoid, PgSurfacePair, PjCatenoid, PjClosedPoly, PjConformal, PjConjugate, PjCurvature, PjCurve, PjCycloid, PjDeCasteljau, PjElasticCurve, PjEllipse, PjEventCamera, PjExprOde, PjGeodesic, PjHarmonic, PjHeight, PjHelicoid, PjHodge, PjImportModel, PjJuliaSet, PjKeyframe, PjKleinBottle, PjLantern, PjLIC, PjLife, PjLinear, PjLSystem, PjMarchingCubes, PjMaxPrinciple, PjMinesweeper, PjModel, PjParmCurve, PjParmSurface, PjPickEvent, PjPlatonic, PjPolygonSet, PjProject, PjPythagoreanTree, PjRivara, PjRootFinder, PjRotation, PjRuler, PjRungeKutta, PjSizeEdge, PjSizePolygon, PjSizeVertex, PjSlider, PjSmooth, PjSnake, PjSubdivision, PjSubdivisionCurve, PjSurface, PjSurfCurve, PjTextureCube, PjTexturedSurface, PjTorusKnot, PjTransform, PjTranslation, PjVectorField, PjWeierstrass, PjZigZag, PnExplodePolytope, PsKeyframe, PwEvolve, PwExplode, PwGeodesicFlow, PwSeeds, PwUnfold

      public interface PsTimeListenerIf

  Interface required for all objects who want to register itself in an animation manager.

  Usage of animations:

  1. Implement the interface PsTimeListenerIf in a class which shall be animated.
  2. Create an instance of PsAnimation and register the above dynamic class.
  3. Show the animationPanel using `anim.getAnimationPanel().setVisible(true)` and start animation from panel, or directly call `anim.start()`.

  The following code describes how to register a dynamic object as animation. After the registration, the animation may be started from code or interactively from the animation manager's info panel. The info panel is available by calling anim#getAnimationPanel()#setVisible(true), or, if the manager is created inside a project, by registering the manager in the project via project#setAnimation(anim) and then pressing F4 or Strg-A.

  Somewhere, e.g. in the initialization method of a project:

              // The class DynSample is a user defined class to be animated. The
              // class must implement the interface PsTimeListenerIf.
                    DynSample dyn = new DynSample();
              // Create a new animation manager which will supervise the animation.
                    PsAnimation anim = new PsAnimation();
                    anim.setName("Sample Animation");
              // Register the sample dynamic object within the animation manager
              // as a listener of timer events.
              // In return, the animation will itself register as animation in the listener.
              // This enables JavaView to display the animation panel of the listener.
                    anim.addTimeListener(dyn);
              // Set initial time of animation. This will result in a call of dyn.setTime(PsTimeEvent time).
                    anim.setTime(0.);

  In DynSample.java:

              // DynSample.setTime(PsTimeEvent time) should recompute the dynamic object
              // according to the new current time.
              public boolean setTime(PsTimeEvent time) {
                 // recompute dynamic object
                 ...
                 // further, update itself to let the system know about its change.
                 update(this);
                 return true;
              }

  See Also:
    `PsAnimation`, `PsKeyframeIf`, `MyProject`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PsAnimation` | `getAnimation()` Get the animation manager where this listener is registered.
    `java.lang.String` | `getName()` Get name of listener object.
    `boolean` | `hasAnimation()` Check whether this object is registered as listener of an animation manager.
    `void` | `setAnimation(PsAnimation anAnimation)` Assign the animation manager where this listener is registered.
    `boolean` | `setTime(PsTimeEvent timeEvent)` Animation updates the dynamic object through this method whenever time has changed.

- - ### Method Detail

    - #### getName

          java.lang.String getName()

      Get name of listener object. It will e.g. be used as title of the animation panel.

    - #### setTime

          boolean setTime(PsTimeEvent timeEvent)

      Animation updates the dynamic object through this method whenever time has changed.

    - #### getAnimation

          PsAnimation getAnimation()

      Get the animation manager where this listener is registered. This listener may only have a single animation manager which is assigned by the animation manager when this listener is registered using `setAnimation(PsAnimation)`.
      See Also:
        `hasAnimation()`, `setAnimation(PsAnimation)`

    - #### hasAnimation

          boolean hasAnimation()

      Check whether this object is registered as listener of an animation manager.
      See Also:
        `getAnimation()`, `setAnimation(PsAnimation)`

    - #### setAnimation

          void setAnimation(PsAnimation anAnimation)

      Assign the animation manager where this listener is registered. This method is invoked by the animation manager during registration of this listener, and usually is not required to be called by a user. If this listener has an assigned animation manager, then its animation panel may be shown to change the current time of this listener.

      Only one animation manager may be assigned to this listener. Subsequent assignments will replace the previous assignment.

      See Also:
        `getAnimation()`, `hasAnimation()`

"

The software JavaView? is copyright protected. All Rights Reserved.
"