public class ViewportAnimation extends Object implements IAnimation
CanvasControl
.Constructor and Description |
---|
ViewportAnimation(CanvasControl canvas,
RectD targetBounds,
Duration preferredDuration)
Creates a new instance of
ViewportAnimation . |
Modifier and Type | Method and Description |
---|---|
void |
animate(double time)
Does the animation according to the relative animation time.
|
protected void |
applyCenterPoint(PointD focus)
Effectively applies the center point value.
|
protected void |
applyViewPoint(PointD focus)
Effectively applies the view point value.
|
protected void |
applyZoom(double value)
Effectively applies the zoom value.
|
void |
cancel()
Cancels this viewport animation so that subsequent calls to
animate(double) or cleanup() won't affect
the viewport anymore. |
void |
cleanup()
Cleans up after the animation.
|
double |
getMaximumTargetZoom()
Gets the maximum zoom level to use after the animation.
|
Duration |
getPreferredDuration()
Gets the preferred duration of the animation.
|
ScrollPane.ScrollBarPolicy |
getScrollBarVisibility()
Gets the scroll bar visibility that will be used during the animation.
|
RectD |
getTargetBounds()
Gets the target world bounds.
|
InsetsD |
getTargetViewMargins()
Gets the margins in view coordinate dimensions to use at the target zoom level.
|
void |
initialize()
Initializes this animation.
|
boolean |
isViewportLimiterConsiderationEnabled()
|
void |
setMaximumTargetZoom(double value)
Sets the maximum zoom level to use after the animation.
|
void |
setPreferredDuration(Duration value)
Sets the preferred duration of the animation.
|
void |
setScrollBarVisibility(ScrollPane.ScrollBarPolicy value)
Sets the scroll bar visibility that will be used during the animation.
|
void |
setTargetBounds(RectD value)
Sets the target world bounds.
|
void |
setTargetViewMargins(InsetsD value)
Sets the margins in view coordinate dimensions to use at the target zoom level.
|
void |
setViewportLimiterConsiderationEnabled(boolean value)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createEasedAnimation, createEasedAnimation, createEasedAnimation, createEdgeSegmentAnimation, createGraphAnimation, createLabelAnimation, createNodeAnimation, createParallelAnimation, createParallelAnimation, createParallelAnimation, createParallelAnimation, createParallelAnimation, createPathAnimation, createPortAnimation, createTableAnimation
public ViewportAnimation(CanvasControl canvas, RectD targetBounds, Duration preferredDuration)
ViewportAnimation
.canvas
- The canvas control.targetBounds
- The target world bounds for the animation.preferredDuration
- The preferred duration.public void animate(double time)
IAnimation
The animation starts with the time 0 and ends with time 1.
animate
in interface IAnimation
time
- the animation time [0,1]protected void applyCenterPoint(PointD focus)
protected void applyViewPoint(PointD focus)
protected void applyZoom(double value)
public void cancel()
animate(double)
or cleanup()
won't affect
the viewport anymore.public void cleanup()
cleanup
in interface IAnimation
public final double getMaximumTargetZoom()
The default is Double.POSITIVE_INFINITY
.
setMaximumTargetZoom(double)
public final Duration getPreferredDuration()
getPreferredDuration
in interface IAnimation
setPreferredDuration(Duration)
public final ScrollPane.ScrollBarPolicy getScrollBarVisibility()
hidden
.setScrollBarVisibility(ScrollPane.ScrollBarPolicy)
public final RectD getTargetBounds()
setTargetBounds(RectD)
public final InsetsD getTargetViewMargins()
(0,0,0,0)
setTargetViewMargins(InsetsD)
public void initialize()
This has to be called once before any calls to animate(double)
. An instance of ViewportAnimation
can be
reused after an animation by setting new TargetBounds
or a new PreferredDuration
and calling Initialize() again.
initialize
in interface IAnimation
public final boolean isViewportLimiterConsiderationEnabled()
ViewportLimiter
of the CanvasControl
whose Viewport
is animated.
Default is false
.
true
if the ViewportLimiter
should be considered, otherwise
false
.setViewportLimiterConsiderationEnabled(boolean)
public final void setMaximumTargetZoom(double value)
The default is Double.POSITIVE_INFINITY
.
value
- The maximum target zoom.getMaximumTargetZoom()
public final void setPreferredDuration(Duration value)
value
- The PreferredDuration to set.getPreferredDuration()
public final void setScrollBarVisibility(ScrollPane.ScrollBarPolicy value)
value
- The scroll bar visibility to use during animation. The default is hidden
.getScrollBarVisibility()
public final void setTargetBounds(RectD value)
value
- The TargetBounds to set.getTargetBounds()
public final void setTargetViewMargins(InsetsD value)
value
- The target view margins. The default is (0,0,0,0)
getTargetViewMargins()
public final void setViewportLimiterConsiderationEnabled(boolean value)
ViewportLimiter
of the CanvasControl
whose Viewport
is animated.
Default is false
.
value
- true
if the ViewportLimiter
should be considered, otherwise
false
.isViewportLimiterConsiderationEnabled()