Search this API

y.view
Class ViewAnimationFactory

java.lang.Object
  extended by y.view.ViewAnimationFactory

public class ViewAnimationFactory
extends java.lang.Object

Provides factory methods for miscellaneous animations.

Animations created through the factory methods of this class require either the associated Graph2DView or the associated Graph2DViewRepaintManager to be registered as an AnimationListener with the AnimationPlayer used to process the animations.
For this reason, a convenience factory method createConfiguredPlayer is provided that ensures that a suitable AnimationListener is registered on the returned AnimationPlayer.

This class also provides factory methods to create Drawable representations of NodeRealizer, EdgeRealizer, and YLabel instances.

See Also:
AnimationPlayer, Graph2DViewRepaintManager, createConfiguredPlayer(), createDrawable(NodeRealizer), createDrawable(EdgeRealizer), createDrawable(YLabel)
 

Nested Class Summary
static class ViewAnimationFactory.AnimationQuality
          Enumeration type that governs the quality/performance trade-off of certain animation effects.
static class ViewAnimationFactory.NodeOrder
          Enumeration type that governs the chronological order of animation effects for nodes in fade-in and fade-out animations for whole graph structures.
static class ViewAnimationFactory.StructuralEffect
          Enumeration type that governs the structural consequences of certain animation effects.
 
Field Summary
static ViewAnimationFactory.StructuralEffect APPLY_EFFECT
          Structural effect hint to recommend applying structural effects.
static ViewAnimationFactory.NodeOrder CLOCKWISE
          Orders nodes descending according to the angle of the polar coordinates relative to the center of the associated graph.
static ViewAnimationFactory.NodeOrder COUNTER_CLOCKWISE
          Orders nodes ascending according to the angle of the polar coordinates relative to the center of the associated graph.
static ViewAnimationFactory.AnimationQuality DEFAULT
          Animations are chosen according to what the factory determines to be appropriate.
static ViewAnimationFactory.AnimationQuality HIGH_PERFORMANCE
          Appropriate animations are chosen with a preference for animation speed.
static ViewAnimationFactory.AnimationQuality HIGH_QUALITY
          Appropriate animations are chosen with a preference for animation quality.
static ViewAnimationFactory.NodeOrder LEFT_TO_RIGHT
          Orders nodes ascending according to the x coordinate of the node realizer.
static ViewAnimationFactory.StructuralEffect RESET_EFFECT
          Structural effect hint to recommend resetting all animation side effects.
static ViewAnimationFactory.NodeOrder RIGHT_TO_LEFT
          Orders nodes descending according to the x coordinate of the node realizer.
static ViewAnimationFactory.StructuralEffect SIMULATE_EFFECT
          Structural effect hint to recommend simulating structural effects only.
 
Constructor Summary
ViewAnimationFactory(Graph2DView view)
          Creates a new ViewAnimationFactory that produces animations for the specified Graph2DView.
ViewAnimationFactory(Graph2DViewRepaintManager repaintManager)
          Creates a new ViewAnimationFactory that produces animations for the specified Graph2DViewRepaintManager and its associated Graph2DView.
 
Method Summary
 AnimationObject blink(NodeRealizer nr, long preferredDuration)
          Creates an AnimationObject that lets the node represented by the specified NodeRealizer blink (once).
 AnimationObject blurIn(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies a blurring fade-in effect to the specified Drawable.
 AnimationObject blurIn(EdgeRealizer er, long preferredDuration)
          Creates an AnimationObject that applies a blurring fade-in effect to the specified EdgeRealizer.
 AnimationObject blurIn(NodeRealizer nr, long preferredDuration)
          Creates an AnimationObject that applies a blurring fade-in effect to the specified NodeRealizer.
 AnimationObject blurOut(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies a blurring fade-out effect to the specified Drawable.
 AnimationObject blurOut(EdgeRealizer er, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies a blurring fade-out effect to the specified EdgeRealizer.
 AnimationObject blurOut(NodeRealizer nr, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies a blurring fade-out effect to the specified NodeRealizer.
 AnimationObject color(EdgeRealizer er, java.awt.Color lineColor, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that changes the lineColor property of the specified EdgeRealizer to the given color value.
 AnimationObject color(NodeRealizer nr, java.awt.Color fillColor, java.awt.Color fillColor2, java.awt.Color lineColor, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that changes the appropriate color properties of the specified NodeRealizer to the given color values.
 AnimationPlayer createConfiguredPlayer()
          Creates a new AnimationPlayer that is set to be non-blocking and on which an AnimationListener, which ensures that this factory's Graph2DView gets updated on animation events, has been registered.
static Drawable createDrawable(EdgeRealizer er)
          Creates a Drawable representation of the specified EdgeRealizer that is independent of the graph to which the realizer's edge belongs.
static Drawable createDrawable(NodeRealizer nr)
          Creates a Drawable representation of the specified NodeRealizer that is independent of the graph to which the realizer's node belongs.
static Drawable createDrawable(YLabel label)
          Creates a Drawable representation of the specified YLabel.
 AnimationObject explode(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies an explosion effect to the specified Drawable.
 AnimationObject explode(EdgeRealizer er, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies an explosion effect to the specified EdgeRealizer.
 AnimationObject explode(NodeRealizer nr, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies an explosion effect to the specified NodeRealizer.
 AnimationObject extract(EdgeRealizer er, long preferredDuration)
          Creates an AnimationObject that traverses the edge path of the edge represented by the specified EdgeRealizer from source node to target node thereby creating an extracting effect.
 AnimationObject fadeIn(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies a fade from invisibility to visibility effect to the specified Drawable.
 AnimationObject fadeIn(EdgeRealizer er, long preferredDuration)
          Creates an AnimationObject that applies a fade from invisibility to visibility effect to the specified EdgeRealizer.
 AnimationObject fadeIn(Graph2D graph, ViewAnimationFactory.NodeOrder order, boolean obeyEdgeDirection, double ratio, long preferredDuration)
          Creates an AnimationObject that applies a fade-in effect to the specified Graph2D by successively fading in nodes and extracting edges.
 AnimationObject fadeIn(NodeRealizer nr, long preferredDuration)
          Creates an AnimationObject that applies a fade from invisibility to visibility effect to the specified NodeRealizer.
 AnimationObject fadeOut(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies a fade from visibility to invisibility effect to the specified Drawable.
 AnimationObject fadeOut(EdgeRealizer er, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies a fade from visibility to invisibility effect to the specified EdgeRealizer.
 AnimationObject fadeOut(Graph2D graph, ViewAnimationFactory.NodeOrder order, boolean obeyEdgeDirection, double ratio, long preferredDuration)
          Creates an AnimationObject that applies a fade-out effect to the specified Graph2D by successively fading out nodes and retracting edges.
 AnimationObject fadeOut(NodeRealizer nr, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies a fade from visibility to invisibility effect to the specified NodeRealizer.
 AnimationObject focusView(double newZoom, Value2D newCenter, long preferredDuration)
          Creates an AnimationObject that smoothly changes the zoom level and center view point of this factory's Graph2DView.
 ViewAnimationFactory.AnimationQuality getQuality()
          Returns the quality hint that is used to determine whether the animations created by this factory should be optimized for quality or performance.
 Graph2DViewRepaintManager getRepaintManager()
          Returns the Graph2DViewRepaintManager for which this factory produces animations.
 Graph2DView getView()
          Returns the Graph2DView for which this factory produces animations.
 AnimationObject implode(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies an implosion effect to the specified Drawable.
 AnimationObject implode(EdgeRealizer er, long preferredDuration)
          Creates an AnimationObject that applies an implosion effect to the specified EdgeRealizer.
 AnimationObject implode(NodeRealizer nr, long preferredDuration)
          Creates an AnimationObject that applies an implosion effect to the specified NodeRealizer.
 AnimationObject morph(NodeRealizer src, NodeRealizer tgt, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies the graphical representation of tgt to the node represented by src.
 AnimationObject move(NodeRealizer[] nr, Value2D[] destinations, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that moves the nodes represented by the specified NodeRealizers in such a way, that the center of each node is translated to the appropriate coordinates given by the destinations array.
 AnimationObject move(NodeRealizer nr, Value2D destination, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that moves the node represented by the specified NodeRealizer in such a way, that the center of the node is translated to the specified destination (in view coordinates).
 AnimationObject moveCamera(java.awt.geom.GeneralPath path, long preferredDuration)
          Creates an AnimationObject that simulates camera movement for this factory's Graph2DView along the given GeneralPath.
 AnimationObject moveCamera(Value2D destination, long preferredDuration)
          Creates an AnimationObject that simulates camera movement for this factory's Graph2DView.
 AnimationObject resize(NodeRealizer nr, Value2D size, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that resizes the node represented by the specified NodeRealizer.
 AnimationObject retract(EdgeRealizer er, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that traverses the edge path of the edge represented by the specified EdgeRealizer from the target node to the source node thereby creating an retracting effect.
 AnimationObject scale(NodeRealizer nr, Value2D scaleFactor, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that scales the node represented by the specified NodeRealizer.
 void setQuality(ViewAnimationFactory.AnimationQuality quality)
          Specifies the quality hint that is used to determine whether the animations created by this factory should be optimized for quality or performance.
 AnimationObject traverseEdge(EdgeRealizer er, EdgeRealizer visitedTheme, EdgeRealizer unvisitedTheme, boolean srcToTgt, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that continuously applies the given visitedTheme to er while traversing the edge path of er from source node to target node.
 AnimationObject traverseEdge(EdgeRealizer er, EdgeRealizer visitedTheme, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that continuously applies the given visitedTheme to er while traversing the edge path of er from source node to target node.
 AnimationObject traversePath(java.awt.geom.GeneralPath path, boolean invertPath, Drawable item, boolean rotateInDirection, boolean restrictRotation, long preferredDuration)
          Creates an AnimationObject that moves the specified Drawable along the given GeneralPath.
 AnimationObject traversePath(java.awt.geom.GeneralPath path, boolean invertPath, Drawable item, long preferredDuration)
          Creates an AnimationObject that moves the specified Drawable along the given GeneralPath.
 AnimationObject traversePath(java.awt.geom.GeneralPath path, boolean invertPath, NodeRealizer item, long preferredDuration)
          Creates an AnimationObject that moves the specified NodeRealizer along the given GeneralPath.
 AnimationObject traversePath(java.awt.geom.GeneralPath path, boolean invertPath, Value2DSettable position, Value2DSettable direction, long preferredDuration)
          Creates an AnimationObject that allows for generic movement related effects.
 AnimationObject whirlIn(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies a whirling fade-in effect to the specified Drawable.
 AnimationObject whirlIn(NodeRealizer nr, long preferredDuration)
          Creates an AnimationObject that applies a whirling fade-in effect to the specified NodeRealizer.
 AnimationObject whirlOut(Drawable drawable, long preferredDuration)
          Creates an AnimationObject that applies a whirling fade-out effect to the specified Drawable.
 AnimationObject whirlOut(NodeRealizer nr, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies a whirling fade-out effect to the specified NodeRealizer.
 AnimationObject zoom(double newZoom, ViewAnimationFactory.StructuralEffect effect, long preferredDuration)
          Creates an AnimationObject that applies the specified zoom factor to this factory's Graph2DView.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT_TO_RIGHT

public static final ViewAnimationFactory.NodeOrder LEFT_TO_RIGHT
Orders nodes ascending according to the x coordinate of the node realizer.


RIGHT_TO_LEFT

public static final ViewAnimationFactory.NodeOrder RIGHT_TO_LEFT
Orders nodes descending according to the x coordinate of the node realizer.


CLOCKWISE

public static final ViewAnimationFactory.NodeOrder CLOCKWISE
Orders nodes descending according to the angle of the polar coordinates relative to the center of the associated graph.


COUNTER_CLOCKWISE

public static final ViewAnimationFactory.NodeOrder COUNTER_CLOCKWISE
Orders nodes ascending according to the angle of the polar coordinates relative to the center of the associated graph.


HIGH_QUALITY

public static final ViewAnimationFactory.AnimationQuality HIGH_QUALITY
Appropriate animations are chosen with a preference for animation quality.


DEFAULT

public static final ViewAnimationFactory.AnimationQuality DEFAULT
Animations are chosen according to what the factory determines to be appropriate.


HIGH_PERFORMANCE

public static final ViewAnimationFactory.AnimationQuality HIGH_PERFORMANCE
Appropriate animations are chosen with a preference for animation speed.


RESET_EFFECT

public static final ViewAnimationFactory.StructuralEffect RESET_EFFECT
Structural effect hint to recommend resetting all animation side effects.


SIMULATE_EFFECT

public static final ViewAnimationFactory.StructuralEffect SIMULATE_EFFECT
Structural effect hint to recommend simulating structural effects only. E.g. simulating to fade out a certain edge or node may result in the edge or node being set to invisible instead of actually removing the edge or node from the graph structure. How the simulation of a structural effect is handled depends on the animation.


APPLY_EFFECT

public static final ViewAnimationFactory.StructuralEffect APPLY_EFFECT
Structural effect hint to recommend applying structural effects. E.g. applying the structural effect of a fade out animation may result in actually removing a certain edge or node from its graph structure. How the application of a structural effect is handled depends on the animation.

Constructor Detail

ViewAnimationFactory

public ViewAnimationFactory(Graph2DView view)
Creates a new ViewAnimationFactory that produces animations for the specified Graph2DView.

Parameters:
view - the Graph2DView

ViewAnimationFactory

public ViewAnimationFactory(Graph2DViewRepaintManager repaintManager)
Creates a new ViewAnimationFactory that produces animations for the specified Graph2DViewRepaintManager and its associated Graph2DView.

Parameters:
repaintManager - the Graph2DViewRepaintManager
Method Detail

getQuality

public ViewAnimationFactory.AnimationQuality getQuality()
Returns the quality hint that is used to determine whether the animations created by this factory should be optimized for quality or performance.

Returns:
the quality hint that is used to determine whether the animations created by this factory should be optimized for quality or performance.

setQuality

public void setQuality(ViewAnimationFactory.AnimationQuality quality)
Specifies the quality hint that is used to determine whether the animations created by this factory should be optimized for quality or performance. To what extend the quality hint is respected depends on the various animations.

Parameters:
quality - the AnimationQuality hint
Throws:
java.lang.IllegalArgumentException - if quality is null.

getView

public Graph2DView getView()
Returns the Graph2DView for which this factory produces animations.

Returns:
the Graph2DView for which this factory produces animations.

getRepaintManager

public Graph2DViewRepaintManager getRepaintManager()
Returns the Graph2DViewRepaintManager for which this factory produces animations. May be null.

Returns:
the Graph2DViewRepaintManager for which this factory produces animations.

blurIn

public AnimationObject blurIn(Drawable drawable,
                              long preferredDuration)
Creates an AnimationObject that applies a blurring fade-in effect to the specified Drawable.

The effect is visualized by adding a specialized image copy of drawable to the specified Graph2D. After the animation is done, the image copy is removed again. If the location of the specified Drawable changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Parameters:
drawable - the Drawable to which the blur effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a blurring fade-in effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

blurOut

public AnimationObject blurOut(Drawable drawable,
                               long preferredDuration)
Creates an AnimationObject that applies a blurring fade-out effect to the specified Drawable.

The effect is visualized by adding a specialized image copy of drawable to the specified Graph2D. After the animation is done, the image copy is removed again. If the location of the specified Drawable changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Parameters:
drawable - the Drawable to which the blur effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a blurring fade-out effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeIn

public AnimationObject fadeIn(Drawable drawable,
                              long preferredDuration)
Creates an AnimationObject that applies a fade from invisibility to visibility effect to the specified Drawable.

The effect is visualized by adding a specialized image copy of drawable to the specified Graph2D. After the animation is done, the image copy is removed again. If the location of the specified Drawable changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Parameters:
drawable - the Drawable to which the fade effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from invisibility to visibility effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeOut

public AnimationObject fadeOut(Drawable drawable,
                               long preferredDuration)
Creates an AnimationObject that applies a fade from visibility to invisibility effect to the specified Drawable.

The effect is visualized by adding a specialized image copy of drawable to the specified Graph2D. After the animation is done, the image copy is removed again. If the location of the specified Drawable changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Parameters:
drawable - the Drawable to which the fade effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from visibility to invisibility effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

implode

public AnimationObject implode(Drawable drawable,
                               long preferredDuration)
Creates an AnimationObject that applies an implosion effect to the specified Drawable.

Note:
This is an expensive effect since several Image objects have to be created. Applying this effect to a lot of objects at the same time will almost certainly result in very low animation frame rates.

Parameters:
drawable - the Drawable to which the implosion effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies an implosion effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

explode

public AnimationObject explode(Drawable drawable,
                               long preferredDuration)
Creates an AnimationObject that applies an explosion effect to the specified Drawable.

Note:
This is an expensive effect since several Image objects have to be created. Applying this effect to a lot of objects at the same time will almost certainly result in very low animation frame rates.

Parameters:
drawable - the Drawable to which the explosion effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies an explosion effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

whirlIn

public AnimationObject whirlIn(Drawable drawable,
                               long preferredDuration)
Creates an AnimationObject that applies a whirling fade-in effect to the specified Drawable.

The effect is visualized by adding a specialized image copy of drawable to the specified Graph2D. After the animation is done, the image copy is removed again. If the location of the specified Drawable changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Parameters:
drawable - the Drawable to which the whirl effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a whirling fade-in effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

whirlOut

public AnimationObject whirlOut(Drawable drawable,
                                long preferredDuration)
Creates an AnimationObject that applies a whirling fade-out effect to the specified Drawable.

The effect is visualized by adding a specialized image copy of drawable to the specified Graph2D. After the animation is done, the image copy is removed again. If the location of the specified Drawable changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Parameters:
drawable - the Drawable to which the whirl effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a whirling fade-out effect to drawable.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

traversePath

public AnimationObject traversePath(java.awt.geom.GeneralPath path,
                                    boolean invertPath,
                                    Drawable item,
                                    long preferredDuration)
Creates an AnimationObject that moves the specified Drawable along the given GeneralPath. Invoking this method is equal to calling
traversePath( path, invertPath, item, false, false )

Parameters:
path - the GeneralPath to be traversed.
invertPath - if true, the specified path is traversed backwards, i.e. from last point to first point.
item - the Drawable to move along the specified path.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that moves item along path.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

traversePath

public AnimationObject traversePath(java.awt.geom.GeneralPath path,
                                    boolean invertPath,
                                    Drawable item,
                                    boolean rotateInDirection,
                                    boolean restrictRotation,
                                    long preferredDuration)
Creates an AnimationObject that moves the specified Drawable along the given GeneralPath.

Parameters:
path - the GeneralPath to be traversed.
invertPath - if true, the specified path is traversed backwards, i.e. from last point to first point.
item - the Drawable to move along the specified path.
rotateInDirection - if true the item is rotated to match the direction of path at any given position.
restrictRotation - if true the rotation angle which is applied to item is mapped to [-Pi/2, Pi/2].
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that moves item along path.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

color

public AnimationObject color(NodeRealizer nr,
                             java.awt.Color fillColor,
                             java.awt.Color fillColor2,
                             java.awt.Color lineColor,
                             ViewAnimationFactory.StructuralEffect effect,
                             long preferredDuration)
Creates an AnimationObject that changes the appropriate color properties of the specified NodeRealizer to the given color values.

Parameters:
nr - the NodeRealizer representing the node whose graphical representation is changed.
fillColor - the new color value for the specified NodeRealizer's fillColor property.
fillColor2 - the new color value for the specified NodeRealizer's fillColor2 property.
lineColor - the new color value for the specified NodeRealizer's lineColor property.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, fillColor, fillColor2, and lineColor are reset to their pre-animation state.
  • APPLY_EFFECT:
    All modifications to fillColor, fillColor2, and lineColor are kept.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies the given colors to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

move

public AnimationObject move(NodeRealizer nr,
                            Value2D destination,
                            ViewAnimationFactory.StructuralEffect effect,
                            long preferredDuration)
Creates an AnimationObject that moves the node represented by the specified NodeRealizer in such a way, that the center of the node is translated to the specified destination (in view coordinates).

Parameters:
nr - the NodeRealizers representing the nodes to be moved.
destination - the destination of the node movement in view coordinates.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, the node position is reset to its pre-animation coordinates.
  • APPLY_EFFECT:
    After the animation is done, the node is centered in the specified destination.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that moves a node to a specified destination.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

move

public AnimationObject move(NodeRealizer[] nr,
                            Value2D[] destinations,
                            ViewAnimationFactory.StructuralEffect effect,
                            long preferredDuration)
Creates an AnimationObject that moves the nodes represented by the specified NodeRealizers in such a way, that the center of each node is translated to the appropriate coordinates given by the destinations array.

Parameters:
nr - the NodeRealizers representing the nodes to be moved.
destinations - the destinations of the node movements in view coordinates.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, the node positions are reset to their pre-animation coordinates.
  • APPLY_EFFECT:
    After the animation is done, the nodes are centered in the specified destinations.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that moves nodes to specified destinations.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0 or if the lengths of nr and destinations are not equal.

morph

public AnimationObject morph(NodeRealizer src,
                             NodeRealizer tgt,
                             ViewAnimationFactory.StructuralEffect effect,
                             long preferredDuration)
Creates an AnimationObject that applies the graphical representation of tgt to the node represented by src. The following properties of src are modified:

Parameters:
src - the NodeRealizer representing the node whose graphical representation is changed.
tgt - the NodeRealizer that is used as a template for src.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, all modified properties are reset to their pre-animation state.
  • APPLY_EFFECT:
    All modifications to the above listed properties are kept.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies the graphical representation of tgt to src.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

resize

public AnimationObject resize(NodeRealizer nr,
                              Value2D size,
                              ViewAnimationFactory.StructuralEffect effect,
                              long preferredDuration)
Creates an AnimationObject that resizes the node represented by the specified NodeRealizer. The x data of the specified Value2D instance is interpreted as the node's new width; the y data accordingly as its new height.

Note:
A negative width or height will result in a invisible node.

Parameters:
nr - the NodeRealizer representing the node to be resized.
size - the Value2D representing the new node size.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, the node size is reset to its pre-animation state.
  • APPLY_EFFECT:
    After the animation is done, the size modification is kept.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that resizes nr to size.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

scale

public AnimationObject scale(NodeRealizer nr,
                             Value2D scaleFactor,
                             ViewAnimationFactory.StructuralEffect effect,
                             long preferredDuration)
Creates an AnimationObject that scales the node represented by the specified NodeRealizer. The x data of the specified Value2D instance is interpreted as scale factor for the node width; the y data accordingly as scale factor for the node height.

Note:
A negative width or height will result in a invisible node.

Parameters:
nr - the NodeRealizer representing the node to be resized.
scaleFactor - the Value2D representing the scale factors for node width and height.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, the node size is reset to its pre-animation state.
  • APPLY_EFFECT:
    After the animation is done, the size modification is kept.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that scales nr according to scaleFactor.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

blink

public AnimationObject blink(NodeRealizer nr,
                             long preferredDuration)
Creates an AnimationObject that lets the node represented by the specified NodeRealizer blink (once).

Parameters:
nr - the NodeRealizer.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that lets the node blink (once).
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

blurIn

public AnimationObject blurIn(NodeRealizer nr,
                              long preferredDuration)
Creates an AnimationObject that applies a blurring fade-in effect to the specified NodeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which nr belongs. After the animation is done, the image copy is removed again. If the location of the specified NodeRealizer changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Postcondition:
After the animation is done, the NodeRealizer's visible property will be true.
Parameters:
nr - the NodeRealizer to which the blur effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a blurring fade-in effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

blurOut

public AnimationObject blurOut(NodeRealizer nr,
                               ViewAnimationFactory.StructuralEffect effect,
                               long preferredDuration)
Creates an AnimationObject that applies a blurring fade-out effect to the specified NodeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which nr belongs. After the animation is done, the image copy is removed again. If the location of the specified NodeRealizer changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Parameters:
nr - the NodeRealizer to which the blur effect is applied.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, nr is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of nr is set to false.
  • APPLY_EFFECT:
    After the animation is done, the node, to which nr is bound, has been removed from its associated graph.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a blurring fade-out effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

implode

public AnimationObject implode(NodeRealizer nr,
                               long preferredDuration)
Creates an AnimationObject that applies an implosion effect to the specified NodeRealizer.

Note:
This is an expensive effect since several Image objects have to be created. Applying this effect to a lot of nodes at the same time will almost certainly result in very low animation frame rates.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Postcondition:
After the animation is done, the NodeRealizer's visible property will be true.
Parameters:
nr - the NodeRealizer to which the implosion effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies an implosion effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

explode

public AnimationObject explode(NodeRealizer nr,
                               ViewAnimationFactory.StructuralEffect effect,
                               long preferredDuration)
Creates an AnimationObject that applies an explosion effect to the specified NodeRealizer.

Note:
This is an expensive effect since several Image objects have to be created. Applying this effect to a lot of nodes at the same time will almost certainly result in very low animation frame rates.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Parameters:
nr - the NodeRealizer to which the blur effect is applied.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, nr is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of nr is set to false.
  • APPLY_EFFECT:
    After the animation is done, the node, to which nr is bound, has been removed from its associated graph.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies an explosion effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeIn

public AnimationObject fadeIn(NodeRealizer nr,
                              long preferredDuration)
Creates an AnimationObject that applies a fade from invisibility to visibility effect to the specified NodeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which nr belongs. After the animation is done, the image copy is removed again. If the location of the specified NodeRealizer changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Postcondition:
After the animation is done, the NodeRealizer's visible property will be true.
Parameters:
nr - the NodeRealizer to which the fade effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from invisibility to visibility effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeOut

public AnimationObject fadeOut(NodeRealizer nr,
                               ViewAnimationFactory.StructuralEffect effect,
                               long preferredDuration)
Creates an AnimationObject that applies a fade from visibility to invisibility effect to the specified NodeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which nr belongs. After the animation is done, the image copy is removed again. If the location of the specified NodeRealizer changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Parameters:
nr - the NodeRealizer to which the fade effect is applied.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, nr is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of nr is set to false.
  • APPLY_EFFECT:
    After the animation is done, the node, to which nr is bound, has been removed from its associated graph.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from visibility to invisibility effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

whirlIn

public AnimationObject whirlIn(NodeRealizer nr,
                               long preferredDuration)
Creates an AnimationObject that applies a whirling fade-in effect to the specified NodeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which nr belongs. After the animation is done, the image copy is removed again. If the location of the specified NodeRealizer changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Postcondition:
After the animation is done, the NodeRealizer's visible property will be true.
Parameters:
nr - the NodeRealizer to which the whirl effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a whirling fade-in effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

whirlOut

public AnimationObject whirlOut(NodeRealizer nr,
                                ViewAnimationFactory.StructuralEffect effect,
                                long preferredDuration)
Creates an AnimationObject that applies a whirling fade-out effect to the specified NodeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which nr belongs. After the animation is done, the image copy is removed again. If the location of the specified NodeRealizer changes during the animation, the location of the image used to visualize the animation effect is adjusted accordingly.

Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.
Parameters:
nr - the NodeRealizer to which the whirl effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, nr is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of nr is set to false.
  • APPLY_EFFECT:
    After the animation is done, the node, to which nr is bound, has been removed from its associated graph.
Returns:
an AnimationObject that applies a whirling fade-out effect to nr.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

traversePath

public AnimationObject traversePath(java.awt.geom.GeneralPath path,
                                    boolean invertPath,
                                    NodeRealizer item,
                                    long preferredDuration)
Creates an AnimationObject that moves the specified NodeRealizer along the given GeneralPath.

Postcondition:
After the animation is done, the last point in the specified GeneralPath is the center of item.
Parameters:
path - the GeneralPath to be traversed.
invertPath - if true, the specified path is traversed backwards, i.e. from last point to first point.
item - the NodeRealizer to move along the specified path.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that moves item along path.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

blurIn

public AnimationObject blurIn(EdgeRealizer er,
                              long preferredDuration)
Creates an AnimationObject that applies a blurring fade-in effect to the specified EdgeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which er belongs. After the animation is done, the image copy is removed again. The image is created as a snapshot of the specified EdgeRealizer when the animation is initialized. The animation effect will therefore not reflect changes that are made to er after initAnimation has been called.

Precondition:
The EdgeRealizer must be bound to an edge that belongs to a Graph2D.
Postcondition:
After the animation is done, the EdgeRealizer's visible property will be true.
Parameters:
er - the EdgeRealizer to which the blur effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a blurring fade-in effect to er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

blurOut

public AnimationObject blurOut(EdgeRealizer er,
                               ViewAnimationFactory.StructuralEffect effect,
                               long preferredDuration)
Creates an AnimationObject that applies a blurring fade-out effect to the specified EdgeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which er belongs. After the animation is done, the image copy is removed again. The image is created as a snapshot of the specified EdgeRealizer when the animation is initialized. The animation effect will therefore not reflect changes that are made to er after initAnimation has been called.

Precondition:
The EdgeRealizer must be bound to an edge that belongs to a Graph2D.
Parameters:
er - the EdgeRealizer to which the blur effect is applied.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, er is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of er is set to false.
  • APPLY_EFFECT:
    After the animation is done, the edge, to which er is bound, has been removed from its associated graph.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a blurring fade-out effect to er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

color

public AnimationObject color(EdgeRealizer er,
                             java.awt.Color lineColor,
                             ViewAnimationFactory.StructuralEffect effect,
                             long preferredDuration)
Creates an AnimationObject that changes the lineColor property of the specified EdgeRealizer to the given color value.

Parameters:
er - the EdgeRealizer representing the edge whose graphical representation is changed.
lineColor - the new color value for the specified EdgeRealizer's lineColor property.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, lineColor is reset to its pre-animation state.
  • APPLY_EFFECT:
    All modifications to lineColor are kept.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies the given line color to er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

implode

public AnimationObject implode(EdgeRealizer er,
                               long preferredDuration)
Creates an AnimationObject that applies an implosion effect to the specified EdgeRealizer.

Note:
This is an expensive effect since several Image objects have to be created. Applying this effect to a lot of edges at the same time will almost certainly result in very low animation frame rates.

Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.
Postcondition:
After the animation is done, the EdgeRealizer's visible property will be true.
Parameters:
er - the EdgeRealizer to which the implosion effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies an implosion effect to er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

explode

public AnimationObject explode(EdgeRealizer er,
                               ViewAnimationFactory.StructuralEffect effect,
                               long preferredDuration)
Creates an AnimationObject that applies an explosion effect to the specified EdgeRealizer.

Note:
This is an expensive effect since several Image objects have to be created. Applying this effect to a lot of edges at the same time will almost certainly result in very low animation frame rates.

Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.
Parameters:
er - the EdgeRealizer to which the explosion effect is applied.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, er is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of er is set to false.
  • APPLY_EFFECT:
    After the animation is done, the edge, to which er is bound, has been removed from its associated graph.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies an explosion effect to er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeIn

public AnimationObject fadeIn(EdgeRealizer er,
                              long preferredDuration)
Creates an AnimationObject that applies a fade from invisibility to visibility effect to the specified EdgeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which er belongs. After the animation is done, the image copy is removed again. The image is created as a snapshot of the specified EdgeRealizer when the animation is initialized. The animation effect will therefore not reflect changes that are made to er after initAnimation has been called.

Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.
Postcondition:
After the animation is done, the EdgeRealizer's visible property will be true.
Parameters:
er - the EdgeRealizer to which the fade effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from invisibility to visibility effect to er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeOut

public AnimationObject fadeOut(EdgeRealizer er,
                               ViewAnimationFactory.StructuralEffect effect,
                               long preferredDuration)
Creates an AnimationObject that applies a fade from visibility to invisibility effect to the specified EdgeRealizer.

The effect is visualized by adding a specialized image copy to the Graph2D to which er belongs. After the animation is done, the image copy is removed again. The image is created as a snapshot of the specified EdgeRealizer when the animation is initialized. The animation effect will therefore not reflect changes that are made to er after initAnimation has been called.

Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.
Parameters:
er - the EdgeRealizer to which the fade effect is applied.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, er is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of er is set to false.
  • APPLY_EFFECT:
    After the animation is done, the edge, to which er is bound, has been removed from its associated graph.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from visibility to invisibility effect to er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

extract

public AnimationObject extract(EdgeRealizer er,
                               long preferredDuration)
Creates an AnimationObject that traverses the edge path of the edge represented by the specified EdgeRealizer from source node to target node thereby creating an extracting effect.

Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.
Postcondition:
After the animation is done, the EdgeRealizer's visible property will be true.
Parameters:
er - the EdgeRealizer to which the effect is applied.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that creates an extracting effect for er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

retract

public AnimationObject retract(EdgeRealizer er,
                               ViewAnimationFactory.StructuralEffect effect,
                               long preferredDuration)
Creates an AnimationObject that traverses the edge path of the edge represented by the specified EdgeRealizer from the target node to the source node thereby creating an retracting effect.

Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.
Parameters:
er - the EdgeRealizer to which the effect is applied.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, er is reset to its pre-animation state.
  • SIMULATE_EFFECT:
    After the animation is done, the visible property of er is set to false.
  • APPLY_EFFECT:
    After the animation is done, the edge, to which er is bound, has been removed from its associated graph.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that creates an retracting effect for er.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

traverseEdge

public AnimationObject traverseEdge(EdgeRealizer er,
                                    EdgeRealizer visitedTheme,
                                    ViewAnimationFactory.StructuralEffect effect,
                                    long preferredDuration)
Creates an AnimationObject that continuously applies the given visitedTheme to er while traversing the edge path of er from source node to target node.

The animation effect will not reflect changes that are made to er after the animation has been initialized.

Precondition:
The er must be bound to a edge that belongs to a Graph2D.
Parameters:
er - the edge path to be traversed.
visitedTheme - the EdgeRealizer whose visual properties are used to mark the already traversed portion of the path.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, er is reset to its pre-animation state.
  • APPLY_EFFECT:
    After the animation is done, the visual properties of visitedTheme are applied to er. The following properties of er are modified:
    • visibility
    • lineColor
    • lineType
    • sourceArrow
    • targetArrow
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that simulates edge traversal by partially applying the visual properties of visitedTheme to er
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

traverseEdge

public AnimationObject traverseEdge(EdgeRealizer er,
                                    EdgeRealizer visitedTheme,
                                    EdgeRealizer unvisitedTheme,
                                    boolean srcToTgt,
                                    ViewAnimationFactory.StructuralEffect effect,
                                    long preferredDuration)
Creates an AnimationObject that continuously applies the given visitedTheme to er while traversing the edge path of er from source node to target node.

The animation effect will not reflect changes that are made to er after the animation has been initialized.

Precondition:
The er must be bound to a edge that belongs to a Graph2D.
Parameters:
er - the edge path to be traversed.
visitedTheme - the EdgeRealizer whose visual properties are used to mark the already traversed portion of the path.
unvisitedTheme - the EdgeRealizer whose visual properties are used to mark the not yet traversed portion of the path.
srcToTgt - if true the edge path is traversed from source node to target node; otherwise the direction is inverted.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, er is reset to its pre-animation state.
  • APPLY_EFFECT:
    After the animation is done, the visual properties of visitedTheme are applied to er. The following properties of er are modified:
    • visibility
    • lineColor
    • lineType
    • sourceArrow
    • targetArrow
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that simulates edge traversal by partially applying the visual properties of visitedTheme to er
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

traversePath

public AnimationObject traversePath(java.awt.geom.GeneralPath path,
                                    boolean invertPath,
                                    Value2DSettable position,
                                    Value2DSettable direction,
                                    long preferredDuration)
Creates an AnimationObject that allows for generic movement related effects. The position on the path and the direction of the movement at any given time during the animation is reported via the specified position's and direction's set methods.

Parameters:
path - the GeneralPath to be traversed.
invertPath - if true, the specified path is traversed backwards, i.e. from last point to first point.
position - callback provider for the position on the path at any given time during the animation.
direction - callback provider for the direction of the movement at any given time during the animation.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that allows for generic movement related effects.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

moveCamera

public AnimationObject moveCamera(Value2D destination,
                                  long preferredDuration)
Creates an AnimationObject that simulates camera movement for this factory's Graph2DView.

Postcondition:
After the animation is done, destination is the center of view.
Parameters:
destination - the destination of the camera movement.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that simulates camera movement.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

moveCamera

public AnimationObject moveCamera(java.awt.geom.GeneralPath path,
                                  long preferredDuration)
Creates an AnimationObject that simulates camera movement for this factory's Graph2DView along the given GeneralPath.

Postcondition:
After the animation is done, the last point in the specified GeneralPath is the center of view.
Parameters:
path - the path of the camera movement.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that simulates camera movement.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

zoom

public AnimationObject zoom(double newZoom,
                            ViewAnimationFactory.StructuralEffect effect,
                            long preferredDuration)
Creates an AnimationObject that applies the specified zoom factor to this factory's Graph2DView.

Parameters:
newZoom - the new zoom factor for the given Graph2DView.
effect - specifies post-animation structural effects:
  • RESET_EFFECT:
    After the animation is done, the zoom factor of this factory's view is reset to its pre-animation value.
  • APPLY_EFFECT:
    After the animation is done, the new zoom factor of this factory's view is kept.
  • SIMULATE_EFFECT:
    Same as APPLY_EFFECT.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies the specified zoom factor to this factory's Graph2DView.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeIn

public AnimationObject fadeIn(Graph2D graph,
                              ViewAnimationFactory.NodeOrder order,
                              boolean obeyEdgeDirection,
                              double ratio,
                              long preferredDuration)
Creates an AnimationObject that applies a fade-in effect to the specified Graph2D by successively fading in nodes and extracting edges.

Postcondition:
After the animation is done, the visible property of all realizers in graph will be true.
Parameters:
graph - the Graph to which the fade effect is applied.
order - specifies an ordering of the nodes in graph that determines the chronological order of the fade-in effects for the nodes.
obeyEdgeDirection - if true, edge extraction is done from edge source to edge target; otherwise edge extraction is done according to the given NodeOrder.
ratio - specifies the ratio of the preferred duration for the fade effects of the individual graph objects to the total preferred duration given by preferredDuration.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from invisibility to visibility effect to graph.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

fadeOut

public AnimationObject fadeOut(Graph2D graph,
                               ViewAnimationFactory.NodeOrder order,
                               boolean obeyEdgeDirection,
                               double ratio,
                               long preferredDuration)
Creates an AnimationObject that applies a fade-out effect to the specified Graph2D by successively fading out nodes and retracting edges.

Postcondition:
After the animation is done, the visible property of all realizers in graph will be false.
Parameters:
graph - the Graph to which the fade effect is applied.
order - specifies an ordering of the nodes in graph that determines the chronological order of the fade-out effects for the nodes.
obeyEdgeDirection - if true, edge retraction is done from edge source to edge target; otherwise edge retraction is done according to the given NodeOrder.
ratio - specifies the ratio of the preferred duration for the fade effects of the individual graph objects to the total preferred duration given by preferredDuration.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that applies a fade from visibility to invisibility effect to graph.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

createDrawable

public static Drawable createDrawable(NodeRealizer nr)
Creates a Drawable representation of the specified NodeRealizer that is independent of the graph to which the realizer's node belongs.

Parameters:
nr - the NodeRealizer
Returns:
a Drawable representation of nr.

createDrawable

public static Drawable createDrawable(EdgeRealizer er)
Creates a Drawable representation of the specified EdgeRealizer that is independent of the graph to which the realizer's edge belongs.

This implementation works properly for simple edge paths only.

Parameters:
er - the EdgeRealizer
Returns:
a Drawable representation of er.

createDrawable

public static Drawable createDrawable(YLabel label)
Creates a Drawable representation of the specified YLabel.

Parameters:
label - the YLabel
Returns:
a Drawable representation of label.

createConfiguredPlayer

public AnimationPlayer createConfiguredPlayer()
Creates a new AnimationPlayer that is set to be non-blocking and on which an AnimationListener, which ensures that this factory's Graph2DView gets updated on animation events, has been registered.

Returns:
a non-blocking AnimationPlayer

focusView

public AnimationObject focusView(double newZoom,
                                 Value2D newCenter,
                                 long preferredDuration)
Creates an AnimationObject that smoothly changes the zoom level and center view point of this factory's Graph2DView.

Parameters:
newZoom - the new zoom level
newCenter - the new center coordinate of the view.
preferredDuration - the preferred animation duration measured in milliseconds.
Returns:
an AnimationObject that that smoothly changes the zoom level and center view point of this factory's Graph2DView.
Throws:
java.lang.IllegalArgumentException - if preferredDuration is less than 0.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.