Revision 684 org.gvsig.animation3d/trunk/org.gvsig.animation3d/org.gvsig.animation3d.swing/org.gvsig.animation3d.swing.impl/src/main/java/org/gvsig/animation3d/swing/impl/MultipleFlyToOrbitViewAnimator.java
MultipleFlyToOrbitViewAnimator.java | ||
---|---|---|
29 | 29 |
*/ |
30 | 30 |
public class MultipleFlyToOrbitViewAnimator extends CompoundAnimator { |
31 | 31 |
|
32 |
private final long DEFAULT_MIN_MILLIS = 4000; |
|
33 |
private final long DEFAULT_MAX_MILLIS = 14000; |
|
34 |
|
|
32 | 35 |
private List<Frame3D> frames; |
33 | 36 |
private int index; |
34 | 37 |
private OrbitView orbitView; |
38 |
private long minMillis; |
|
39 |
private long maxMillis; |
|
35 | 40 |
|
36 | 41 |
/** |
37 | 42 |
* @param orbitView |
... | ... | |
42 | 47 |
this.orbitView = orbitView; |
43 | 48 |
this.frames = frames; |
44 | 49 |
this.index = 0; |
50 |
this.minMillis = DEFAULT_MIN_MILLIS; |
|
51 |
this.maxMillis = DEFAULT_MAX_MILLIS; |
|
45 | 52 |
setFrame(frames.get(index)); |
46 | 53 |
} |
47 | 54 |
|
55 |
/** |
|
56 |
* |
|
57 |
* @param orbitView |
|
58 |
* @param frames |
|
59 |
* @param minMillis |
|
60 |
* @param maxMillis |
|
61 |
*/ |
|
62 |
public MultipleFlyToOrbitViewAnimator(OrbitView orbitView, List<Frame3D> frames, |
|
63 |
long minMillis, long maxMillis) { |
|
64 |
this(orbitView, frames); |
|
65 |
this.minMillis = minMillis; |
|
66 |
this.maxMillis = maxMillis; |
|
67 |
setFrame(frames.get(index)); |
|
68 |
} |
|
69 |
|
|
48 | 70 |
@Override |
49 | 71 |
protected void setImpl(double interpolant) { |
50 | 72 |
boolean allStopped = true; |
... | ... | |
77 | 99 |
Angle newPitch = Angle.fromDegrees(frame.getPitch()); |
78 | 100 |
|
79 | 101 |
long timeToMove = |
80 |
AnimationSupport.getScaledTimeMillisecs(orbitView.getEyePosition(), newCenterPos, 4000,
|
|
81 |
14000);
|
|
102 |
AnimationSupport.getScaledTimeMillisecs(orbitView.getEyePosition(), newCenterPos, |
|
103 |
minMillis, maxMillis);
|
|
82 | 104 |
|
83 | 105 |
interpolator = new ScheduledInterpolator(timeToMove); |
84 | 106 |
|
85 | 107 |
animators = |
86 | 108 |
createAnimators(orbitView, orbitView.getCenterPosition(), newCenterPos, |
87 | 109 |
orbitView.getHeading(), newHeading, orbitView.getPitch(), newPitch, |
88 |
orbitView.getZoom(), frame.getZoom(), timeToMove, |
|
89 |
WorldWind.ABSOLUTE); |
|
110 |
orbitView.getZoom(), frame.getZoom(), timeToMove, WorldWind.ABSOLUTE); |
|
90 | 111 |
} |
91 | 112 |
|
92 | 113 |
private Animator[] createAnimators(OrbitView orbitView, Position beginCenterPos, |
... | ... | |
97 | 118 |
new OnSurfacePositionAnimator(orbitView.getGlobe(), new ScheduledInterpolator( |
98 | 119 |
timeToMove), beginCenterPos, endCenterPos, |
99 | 120 |
OrbitViewPropertyAccessor.createCenterPositionAccessor(orbitView), altitudeMode); |
100 |
|
|
121 |
|
|
101 | 122 |
// Create an elevation animator with ABSOLUTE altitude mode because the |
102 | 123 |
// OrbitView altitude mode applies to the |
103 | 124 |
// center position, not the zoom. |
... | ... | |
105 | 126 |
new ViewElevationAnimator(orbitView.getGlobe(), beginZoom, endZoom, beginCenterPos, |
106 | 127 |
endCenterPos, WorldWind.ABSOLUTE, |
107 | 128 |
OrbitViewPropertyAccessor.createZoomAccessor(orbitView)); |
108 |
|
|
129 |
|
|
109 | 130 |
centerAnimator.useMidZoom = zoomAnimator.getUseMidZoom(); |
110 | 131 |
|
111 | 132 |
AngleAnimator headingAnimator = |
Also available in: Unified diff