y.view
Class ViewAnimationFactory

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

public class ViewAnimationFactory
extends 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)
 
Your browser does not support SVG content.

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 stuctural 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 stuctural 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.
 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.
 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(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(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(GeneralPath path, boolean invertPath, Drawable item, long preferredDuration)
          Creates an AnimationObject that moves the specified Drawable along the given GeneralPath.
 AnimationObject traversePath(GeneralPath path, boolean invertPath, NodeRealizer item, long preferredDuration)
          Creates an AnimationObject that moves the specified NodeRealizer along the given GeneralPath.
 AnimationObject traversePath(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 stuctural 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 stuctural 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.

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

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.

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

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
drawable - the Drawable to which the blur effect is applied
Returns:
an AnimationObject that applies a blurring fade-out effect to drawable.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
drawable - the Drawable to which the fade effect is applied
Returns:
an AnimationObject that applies a fade from invisibility to visibility effect to drawable.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
drawable - the Drawable to which the fade effect is applied
Returns:
an AnimationObject that applies a fade from visibility to invisibility effect to drawable.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
drawable - the Drawable to which the implosion effect is applied
Returns:
an AnimationObject that applies an implosion effect to drawable.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
drawable - the Drawable to which the explosion effect is applied
Returns:
an AnimationObject that applies an explosion effect to drawable.

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.

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

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
drawable - the Drawable to which the whirl effect is applied
Returns:
an AnimationObject that applies a whirling fade-out effect to drawable.

traversePath

public AnimationObject traversePath(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 )

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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
Returns:
an AnimationObject that moves item along path.

traversePath

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

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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]
Returns:
an AnimationObject that moves item along path.

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).

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that moves a node to a specified destination.

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.

Throws:
IllegalArgumentException - if the lengths of nr and destinations are not equal.
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that moves nodes to specified destinations.

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:

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that applies the graphical representation of tgt to src.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that resizes nr to size.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that scales nr according to scaleFactor.

blink

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

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
nr - the NodeRealizer
Returns:
an AnimationObjedct that lets the node blink (once).

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
nr - the NodeRealizer to which the blur effect is applied
Returns:
an AnimationObject that applies a blurring fade-in effect to nr.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that applies a blurring fade-out effect to nr.
Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
nr - the NodeRealizer to which the implosion effect is applied
Returns:
an AnimationObject that applies an implosion effect to nr.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that applies an explosion effect to nr.
Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
nr - the NodeRealizer to which the fade effect is applied
Returns:
an AnimationObject that applies a fade from invisibility to visibility effect to nr.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that applies a fade from visibility to invisibility effect to nr.
Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
nr - the NodeRealizer to which the whirl effect is applied
Returns:
an AnimationObject that applies a whirling fade-in effect to nr.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
nr - the NodeRealizer to which the whirl 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.
Returns:
an AnimationObject that applies a whirling fade-out effect to nr.
Precondition:
The NodeRealizer must be bound to a node that belongs to a Graph2D.

traversePath

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

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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
Returns:
an AnimationObject that moves item along path.
Postcondition:
After the animation is done, the last point in the specified GeneralPath is the center of item.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
er - the EdgeRealizer to which the blur effect is applied
Returns:
an AnimationObject that applies a blurring fade-in effect to er.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that applies a blurring fade-out effect to er.
Precondition:
The EdgeRealizer must be bound to an edge that belongs to a Graph2D.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
er - the EdgeRealizer to which the implosion effect is applied
Returns:
an AnimationObject that applies an implosion effect to er.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that applies an explosion effect to er.
Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
er - the EdgeRealizer to which the fade effect is applied
Returns:
an AnimationObject that applies a fade from invisibility to visibility effect to er.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that applies a fade from visibility to invisibility effect to er.
Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
Parameters:
er - the EdgeRealizer to which the effect is applied
Returns:
an AnimationObject that creates an extracting effect for er.
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.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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.
Returns:
an AnimationObject that creates an retracting effect for er.
Precondition:
The EdgeRealizer must be bound to a edge that belongs to a Graph2D.

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.

Throws:
IllegalArgumentException - if preferredDuration is less than 0.
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: