Revision 18746

View differences:

trunk/extensions/extAnimation2D/src/com/iver/cit/gvsig/animation/ExtensionAnimacion2D.java
27 27
		InterpolatorFactory.register("Interpolator2D", new Interpolator2D());
28 28
		
29 29
		
30
		
30 31
	}
31 32

  
32 33
	public boolean isEnabled() {
trunk/extensions/extAnimation2D/src/com/iver/cit/gvsig/animation/AnimationLayer2D.java
1 1
package com.iver.cit.gvsig.animation;
2 2

  
3

  
4

  
3 5
import com.iver.andami.PluginServices;
4 6
import com.iver.andami.ui.mdiManager.IWindow;
7
import com.iver.cit.gvsig.animation.animatedObject.IAnimatedObject;
5 8
import com.iver.cit.gvsig.animation.keyframe.IAnimationTypeKeyFrame;
6 9
import com.iver.cit.gvsig.animation.keyframe.interpolator.FuntionFactory;
7 10
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolator;
......
20 23
	private int typeTrack = IAnimationType.TIME_TYPE_TRACK;
21 24
	private IInterpolator interpolator;
22 25
	private View view;
23
	private AnimationObject2D animationObject2D = new AnimationObject2D() ;
26
	private IAnimatedObject animationObject2D = new AnimationObject2D() ;
24 27
	private String titleWindow;
25 28
	private String nameClassView;
26 29

  
......
54 57

  
55 58
	public void AppliesToObject(Object animated) {
56 59

  
60
		
57 61
		// Casting the animated object
58 62
		KeyFrame2D keyFrame2D = (KeyFrame2D) animated;
59 63
		// Applies to object
60
		this.view = (View) this.animationObject2D.getAnimatedView();
64
		this.view = (View) this.animationObject2D.getAnimatedObject("view2D");
61 65
		this.view.getMapControl().getViewPort().setExtent(
62 66
				((ProjectExtent) keyFrame2D.getAnimatedObject()).getExtent());
63 67
		// Repainting the object
......
85 89

  
86 90
	
87 91
	public Object getAnimatedObject() {
88
		// if view is null.
89
		if(this.view == null){
90
			// getting all views.
92
		// if animated object is null.
93
		if(this.animationObject2D != null){
94
			// getting all objects.
91 95
			try{
92 96
				IWindow[] viewArray = PluginServices.getMDIManager().getAllWindows();
93 97
				for (int i = 0; i < viewArray.length; i++) {
......
96 100
						// get the actual name of the view, and compare it with the view saved in xml.
97 101
						if(window.getWindowInfo().getTitle().equals(this.titleWindow)){
98 102
							BaseView newView = (BaseView)window;
99
							this.animationObject2D.setAnimatedView(newView);
103
							this.animationObject2D.addAnimatedObject("view2D", newView);
104
//							this.animationObject3DFlat.setAnimatedView(newView);
100 105
							this.setAnimatedObject(this.animationObject2D);
101
							IInterpolatorTimeFuntion funtion = FuntionFactory.createObject("com.iver.cit.gvsig.animation.keyframe.interpolator.LinearFuntion");
102
							this.interpolator.setFuntion(funtion);
106
							IInterpolatorTimeFuntion function = FuntionFactory.createObject("com.iver.cit.gvsig.animation.keyframe.interpolator.LinearFuntion");
107
							this.interpolator.setFuntion(function);
103 108
						}
104
							//this.view = (View3D)newView;
105 109
					}
106 110
				}
107 111
			}catch(Exception e) {
......
123 127
//
124 128
//	}
125 129
	public void setAnimatedObject(Object object) {
126
		this.animationObject2D = (AnimationObject2D) object;
130
		this.animationObject2D = (IAnimatedObject) object;
127 131

  
128 132
	}
129 133
public XMLEntity getXMLEntity() {
130 134
		
131
		View myActualView = null;
135
	//	View myActualView = null;
132 136
		
133 137
		XMLEntity xml = new XMLEntity();
134 138
		xml.putProperty("className", this.getClassName());
135 139
		xml.putProperty("description", description);
136 140
		xml.putProperty("animationTrackTipe", typeTrack);
137
		xml.putProperty("nameClassView", animationObject2D.getNameClassView());
138
		myActualView = (View) animationObject2D.getAnimatedView();
141

  
142
		View myActualView = (View) animationObject2D.getAnimatedObject("view2D");
143
		xml.putProperty("nameClassView", myActualView.getClass().getName());
144
		
139 145
		titleWindow = myActualView.getWindowInfo().getTitle();
140 146
		xml.putProperty("titleWindow", titleWindow);
141 147
		xml.addChild(((IPersistence)this.interpolator).getXMLEntity());
trunk/extensions/extAnimation2D/src/com/iver/cit/gvsig/animation/Interpolator2D.java
24 24
		if (kfList == null)
25 25
			return null;
26 26

  
27
		if (this.view == null)
28
			return null;
27
//		if (this.view == null)
28
//			return null;
29 29

  
30 30
		switch (kfList.size()) {
31 31
		// this case when there are only has 2 keyframes
trunk/extensions/extAnimation2D/src/com/iver/cit/gvsig/animation/KeyFrame2D.java
96 96
			this.time = xml.getDoubleProperty("time");
97 97
		
98 98
		XMLEntity xmlProp = xml.getChild(0);
99
		if (xmlProp.contains("eyeX")) {
99
		if (xmlProp.contains("extentX")) {
100
			//System.out.println("hola");
101
			this.projectExtent = ProjectExtent.createFromXML(xmlProp);
100 102
		}
101 103
		
102
		
103
//		// Get camera
104
		//XMLEntity xmlProp = xml.getChild(0);
105

  
106
		
107
		
108 104
	}
109 105

  
110 106
}
trunk/extensions/extAnimation2D/src/com/iver/cit/gvsig/animation/AnimationObject2D.java
1 1
package com.iver.cit.gvsig.animation;
2 2

  
3 3
import com.iver.cit.gvsig.animation.animatedObject.AnimatedObjectBase;
4
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
5 4

  
6 5
public class AnimationObject2D extends AnimatedObjectBase {
7 6
	
8
	private String nameClassView;
9
	private BaseView view;
7
//	private String nameClassView;
8
//	private BaseView view;
10 9
	
11 10
	public String getClassName() {
12 11
		return this.getClass().getName();
......
15 14
	public void setClassName(String className) {
16 15
	}
17 16
	
18
	public String getNameClassView() {
19
		return nameClassView;
20
		
21
	}
17
//	public String getNameClassView() {
18
//		return nameClassView;
19
//		
20
//	}
21
//	
22
//	public void setNameView(String nameView) {
23
//		this.nameClassView = nameView;
24
//		
25
//	}
22 26
	
23
	public void setNameView(String nameView) {
24
		this.nameClassView = nameView;
25
		
26
	}
27
	
28 27
	public Object getAnimatedView() {
29
		return view;
28
		return this.getAnimatedObject("view2D");
30 29
	}
31 30
	
32 31
	public void setAnimatedView(Object object) {
33
		this.view = (BaseView) object;
34
		this.nameClassView = this.view.getClass().getName();
32
		//this.view = (BaseView) object;
33
		//this.nameClassView = this.view.getClass().getName();
34
		this.addAnimatedObject("view2D", object);
35 35
	}
36 36
	
37 37
	

Also available in: Unified diff