Revision 23105 trunk/extensions/extAnimationGUI/src/com/iver/ai2/animationgui/gui/AnimationContol3D.java
AnimationContol3D.java | ||
---|---|---|
16 | 16 |
import java.awt.event.KeyEvent; |
17 | 17 |
import java.awt.event.KeyListener; |
18 | 18 |
import java.net.URL; |
19 |
import java.util.Iterator; |
|
20 |
import java.util.List; |
|
19 | 21 |
|
20 | 22 |
import javax.swing.ImageIcon; |
21 | 23 |
import javax.swing.JButton; |
... | ... | |
25 | 27 |
import javax.swing.JTextField; |
26 | 28 |
|
27 | 29 |
import org.gvsig.gui.beans.swing.GridBagLayoutPanel; |
30 |
import org.gvsig.gvsig3dgui.view.View3D; |
|
31 |
import org.gvsig.osgvp.viewer.IViewerContainer; |
|
28 | 32 |
|
29 | 33 |
import com.iver.ai2.gvsig3d.resources.ResourcesFactory; |
30 | 34 |
import com.iver.andami.PluginServices; |
31 | 35 |
import com.iver.andami.ui.mdiManager.SingletonWindow; |
32 | 36 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
37 |
import com.iver.cit.gvsig.animation.AnimationContainer; |
|
33 | 38 |
import com.iver.cit.gvsig.animation.AnimationPlayer; |
39 |
import com.iver.cit.gvsig.animation.animatedObject.IAnimatedObject; |
|
40 |
import com.iver.cit.gvsig.animation.traks.IAnimationTrack; |
|
34 | 41 |
|
35 | 42 |
/** |
36 | 43 |
* @author |
... | ... | |
121 | 128 |
|
122 | 129 |
initialize(); |
123 | 130 |
} |
131 |
|
|
132 |
|
|
133 |
private void updateAnimatedObjects(AnimationPlayer animationPlayer) { |
|
134 |
IViewerContainer canvas = null; |
|
135 |
AnimationContainer ac = animationPlayer.getAnimationContainer(); |
|
136 |
List<IAnimationTrack> atl = ac.getAnimationTrackList(); |
|
137 |
for (Iterator iterator = atl.iterator(); iterator.hasNext();) { |
|
138 |
IAnimationTrack track = (IAnimationTrack) iterator.next(); |
|
139 |
IAnimatedObject animatedObject = (IAnimatedObject) track.getAnimatedObject(); |
|
140 |
try { |
|
141 |
//if persistence is loaded, the canvas is null in this step |
|
142 |
canvas = (IViewerContainer) animatedObject.getAnimatedObject("canvas"); |
|
143 |
} |
|
144 |
catch (Exception e) { |
|
145 |
//if canvas is null, do nothing |
|
146 |
} |
|
147 |
|
|
148 |
if (canvas == null) { |
|
149 |
//Getting the name of the view |
|
150 |
View3D view = (View3D) animatedObject.getAnimatedObject("view"); |
|
151 |
//Getting the canvas and insert this canvas in the animated object |
|
152 |
animatedObject.addAnimatedObject("canvas", view.getCanvas3d()); |
|
153 |
} |
|
154 |
} |
|
155 |
|
|
156 |
} |
|
124 | 157 |
|
125 | 158 |
/* |
126 | 159 |
* Panel creation. |
... | ... | |
352 | 385 |
// this.animationPlayer.setGlobalTime(globalTime); |
353 | 386 |
// this.animationPlayer.setAnimationFrequency(this.animationPlayer.getAnimationFrequency());//frequency |
354 | 387 |
// in the AnimationPlayer. |
388 |
|
|
389 |
updateAnimatedObjects(this.animationPlayer); |
|
390 |
|
|
355 | 391 |
this.animationPlayer.play(); |
356 | 392 |
playFlag = true; |
357 | 393 |
if (this.animationPlayer.getAnimationPlayerState() == AnimationPlayer.ANIMATION_PLAY) { |
Also available in: Unified diff