|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.LayoutMorpher
public class LayoutMorpher
This class applies layout information provided by a suitable
GraphLayout
instance to a given Graph2DView
's internal graph
in an animated fashion.
Constructor Summary | |
---|---|
LayoutMorpher()
Creates a new un initialized instance of this class. |
|
LayoutMorpher(Graph2DView view,
GraphLayout gli)
Creates a new LayoutMorpher that applies the given GraphLayout to the graph that resides in the given view. |
Method Summary | |
---|---|
protected java.awt.geom.Rectangle2D |
calcBoundingBox(Graph graph,
GraphLayout gli,
java.awt.geom.Rectangle2D tb)
Calculates the true bounding box of the graph using the given GraphLayout. |
void |
calcFrame(double time)
Calculates the next animation frame. |
void |
disposeAnimation()
Disposes the animation. |
void |
execute()
Deprecated. Use the no-argument constructor and the execute(Graph2DView, y.layout.GraphLayout) method instead. |
void |
execute(Graph2DView view,
GraphLayout layout)
Convenience method that executes the animation using a new AnimationPlayer . |
Node |
getFocusNode()
Returns the node being focused at the end of the animation. |
void |
initAnimation()
Initializes the animation. |
protected void |
initialize(Graph2DView view,
GraphLayout layout)
Initializes this instance to work on the provided view and morph to the given layout. |
boolean |
isEasedExecution()
Returns true iff the layout morphing is animated using ease
in/ease out effects for a smoother animation start/animation end feeling. |
boolean |
isEdgeLabelAnimationEnabled()
Determines whether or not edge label placement changes are animated. |
boolean |
isKeepZoomFactor()
Returns whether the zoom factor is kept when morphing. |
boolean |
isNodeLabelAnimationEnabled()
Determines whether or not node label placement changes are animated. |
boolean |
isSmoothViewTransform()
Returns whether the animation will smoothly transform the view's zoom level and translation. |
long |
preferredDuration()
Returns the preferred duration for the animated layout morphing in milliseconds. |
void |
setEasedExecution(boolean easedExecution)
Specifies whether the layout morphing should be animated using ease in/ ease out effects for a smoother animation start/animation end feeling. |
void |
setEdgeLabelAnimationEnabled(boolean enabled)
Specifies whether or not edge label placement changes are animated. |
void |
setFocusNode(Node focusNode)
Sets the node being focused at the end of the animation. |
void |
setKeepZoomFactor(boolean keepZoomFactor)
Specifies whether the zoom factor of the view is kept when morphing the layout. |
void |
setNodeLabelAnimationEnabled(boolean enabled)
Specifies whether or not node label placement changes are animated. |
void |
setPreferredDuration(long preferredDuration)
Specifies the preferred duration for the animated layout morphing in milliseconds. |
void |
setSmoothViewTransform(boolean smoothViewTransform)
Specifies whether the animation will smoothly transform the view's zoom level and translation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LayoutMorpher()
initialized
instance of this class.
public LayoutMorpher(Graph2DView view, GraphLayout gli)
no-arg
constructor
and calling initialize(Graph2DView, y.layout.GraphLayout)
after that with the corresponding arguments.
Method Detail |
---|
public boolean isEasedExecution()
true
iff the layout morphing is animated using ease
in/ease out effects for a smoother animation start/animation end feeling.
By the default, layout morphing is eased.
true
iff the layout morphing is animated using ease
in/ease out effects for a smoother animation start/animation end feeling.public void setEasedExecution(boolean easedExecution)
easedExecution
- if true
, layout morphing is animated
using ease in/ease out effectspublic long preferredDuration()
preferredDuration
in interface AnimationObject
public void setPreferredDuration(long preferredDuration)
preferredDuration
- the animation duration in millisecondspublic Node getFocusNode()
If the returned node is not null
and part of the associated
view's graph, then the coordinate system of the view will be smoothly
translated during the animation to the effect that the focused node will
be centered at the end of the animation process.
The zoom level of the view will not change if a focus node is defined.
public void setFocusNode(Node focusNode)
If the given focusNode
is unequal to null
and
part of the associated view's graph, then the coordinate system of
the view will be smoothly translated during the animation to the effect
that the focused node will be centered at the end of the animation
process.
The zoom level of the view will remain unchanged if such a focus node is defined.
Note that this feature, smoothViewTransform
,
and keepZoomFactor
are mutually exclusive
in the sense that only one is obeyed.
If two or more of these features are used, then this one precludes the others.
focusNode
- The node that is to be focused at the end of the animation.public boolean isSmoothViewTransform()
By default this feature is disabled.
public void setSmoothViewTransform(boolean smoothViewTransform)
By default this feature is disabled.
Note that this feature, focusNode
, and keepZoomFactor
are mutually exclusive in the sense that only one is obeyed.
If two or more of these features are used, then this one precludes keepZoomFactor
.
smoothViewTransform
- if true
, the animation will
smoothly transform the view's zoom level and translation.public void initAnimation()
initAnimation
in interface AnimationObject
protected java.awt.geom.Rectangle2D calcBoundingBox(Graph graph, GraphLayout gli, java.awt.geom.Rectangle2D tb)
public void calcFrame(double time)
calcFrame
in interface AnimationObject
time
- a point in [0.0, 1.0]public void disposeAnimation()
disposeAnimation
in interface AnimationObject
public void execute()
execute(Graph2DView, y.layout.GraphLayout)
method instead.
AnimationPlayer
.
Note that this method can only be used if the constructor with the arguments has been used
.
public void execute(Graph2DView view, GraphLayout layout)
AnimationPlayer
.
protected void initialize(Graph2DView view, GraphLayout layout)
view
- The view to work in.layout
- The target layout.public boolean isKeepZoomFactor()
false
.
public void setKeepZoomFactor(boolean keepZoomFactor)
false
.
Note that this feature, smoothViewTransform
,
and focusNode
are mutually exclusive in the sense
that only one is obeyed.
If two or more of these features are used, then this one is precluded by the
others.
keepZoomFactor
- if true
, then the zoom factor is kept
while morphing.public boolean isEdgeLabelAnimationEnabled()
Default to true
.
true
if edge label placement changes are animated;
false
otherwise.setEdgeLabelAnimationEnabled(boolean)
public void setEdgeLabelAnimationEnabled(boolean enabled)
enabled
- if true
edge label placement changes are
animated.isEdgeLabelAnimationEnabled()
public boolean isNodeLabelAnimationEnabled()
Default to true
.
true
if node label placement changes are animated;
false
otherwise.setNodeLabelAnimationEnabled(boolean)
public void setNodeLabelAnimationEnabled(boolean enabled)
enabled
- if true
node label placement changes are
animated.isNodeLabelAnimationEnabled()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |