Revision 23224

View differences:

trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/animationType/AnimationLayer2D.java
26 26
	private View view;
27 27
	private AnimationObject2D animationObject2D = new AnimationObject2D() ;
28 28
	private String titleWindow;
29
	private String nameClassView;
29
	//private String nameClassView;
30 30

  
31 31
	public AnimationLayer2D() {
32 32
		this.interpolator = new Interpolator2D();
......
61 61
		// Casting the animated object
62 62
		KeyFrame2D keyFrame2D = (KeyFrame2D) animated;
63 63
		// Applies to object
64
		//this.view = (View) animationObject2D.getAnimatedObject("view2D");
64 65
		this.view = (View) this.animationObject2D.getAnimatedView();
65 66
		this.view.getMapControl().getViewPort().setExtent(
66 67
				((ProjectExtent) keyFrame2D.getAnimatedObject()).getExtent());
67 68
		// Repainting the object
68 69
		this.view.getMapControl().drawMap(true);
69
//		this.view.repaintMap();
70
		//this.view.repaintMap();
70 71
	}
71 72

  
72 73
	public int getTypeTrack() {
......
89 90

  
90 91
	
91 92
	public Object getAnimatedObject() {
92
		// if view is null.
93
		if(this.view == null){
93
		if(this.animationObject2D != null) {
94 94
			// getting all views.
95 95
			try{
96 96
				IWindow[] viewArray = PluginServices.getMDIManager().getAllWindows();
97 97
				for (int i = 0; i < viewArray.length; i++) {
98 98
					IWindow window = viewArray[i];
99
					if (window.getClass().getName().equals(this.nameClassView)){
100
						// get the actual name of the view, and compare it with the view saved in xml.
101 99
						if(window.getWindowInfo().getTitle().equals(this.titleWindow)){
102 100
							BaseView newView = (BaseView)window;
103 101
							this.animationObject2D.setAnimatedView(newView);
......
105 103
							IInterpolatorTimeFuntion funtion = FuntionFactory.createObject("com.iver.cit.gvsig.animation.keyframe.interpolator.LinearFuntion");
106 104
							this.interpolator.setFuntion(funtion);
107 105
						}
108
							//this.view = (View3D)newView;
109
					}
110 106
				}
111 107
			}catch(Exception e) {
112 108
				e.printStackTrace();
......
116 112
	}
117 113
	
118 114
	
119
//	public Object getAnimatedObject() {
120
//		// TODO Auto-generated method stub
121
//		this.view = (View) this.animationObject2D.getAnimatedView();
122
//		return this.view;
123
//	}
124

  
125
//	public void setAnimatedObject(Object object) {
126
//		this.view = (View) object;
127
//
128
//	}
129 115
	public void setAnimatedObject(Object object) {
130
		this.animationObject2D = (AnimationObject2D) object;
116
		if (object instanceof AnimationObject2D)
117
			this.animationObject2D = (AnimationObject2D) object;
131 118

  
132 119
	}
133 120
public XMLEntity getXMLEntity() {
......
138 125
		xml.putProperty("className", this.getClassName());
139 126
		xml.putProperty("description", description);
140 127
		xml.putProperty("animationTrackTipe", typeTrack);
141
		xml.putProperty("nameClassView", animationObject2D.getNameClassView());
128
	//	xml.putProperty("nameClassView", animationObject2D.getNameClassView());
142 129
		myActualView = (View) animationObject2D.getAnimatedView();
143 130
		titleWindow = myActualView.getWindowInfo().getTitle();
144 131
		xml.putProperty("titleWindow", titleWindow);
......
147 134
	}
148 135

  
149 136
	public void setXMLEntity(XMLEntity xml) {
150
//		if (xml.contains("className"))
151
//			this.className=	xml.getStringProperty("className");
137
		if (xml.contains("className"))
138
			this.className=	xml.getStringProperty("className");
152 139
		if (xml.contains("animationTrackTipe"))
153 140
			this.typeTrack = xml.getIntProperty("animationTrackTipe");
154
		if (xml.contains("nameClassView"))
155
			this.nameClassView = xml.getStringProperty("nameClassView");
141
//		if (xml.contains("nameClassView"))
142
//			this.nameClassView = xml.getStringProperty("nameClassView");
156 143
		if (xml.contains("titleWindow"))
157 144
			this.titleWindow = xml.getStringProperty("titleWindow");
158 145
		
trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/interpolator/Interpolator2D.java
13 13

  
14 14
public class Interpolator2D implements IInterpolator {
15 15

  
16
	private View view;
17 16
	private String description = "Interpolaci?n basada en encuadres";
18 17
	private String name = "Interpolator2D";
19 18
	
......
25 24
		if (kfList == null)
26 25
			return null;
27 26

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

  
31 30
		switch (kfList.size()) {
32 31
		// this case when there are only has 2 keyframes
trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/keyFrame/KeyFrame2D.java
1 1
package com.iver.cit.gvsig.animation.keyFrame;
2 2

  
3
import java.awt.geom.Rectangle2D;
3 4
import java.util.List;
4 5

  
5 6
import com.iver.cit.gvsig.animation.keyframe.IKeyFrame;
......
10 11

  
11 12
	private String name;
12 13
	private double time;
14
	private  String aliasKeyFrame = "KeyFrame2D";
13 15

  
14 16
	ProjectExtent projectExtent = null;
15
	private Object extend;
17
	private double valueX;
18
	private double valueY;
19
	private double valueW;
20
	private double valueH;
16 21

  
17 22

  
18 23
	public void CapturesProperties() {
......
80 85
		XMLEntity xml = new XMLEntity();
81 86
		
82 87
		xml.putProperty("className", this.getClassName());
83
		xml.putProperty("keyFrameName", name);
88
	//	xml.putProperty("keyFrameName", name);
89
		xml.putProperty("keyFrameAlias", aliasKeyFrame);
84 90
		xml.putProperty("time", time);
85 91
		
86 92
		xml.addChild((this.projectExtent).getXMLEntity());
......
90 96

  
91 97
	public void setXMLEntity(XMLEntity xml) {
92 98
		
93
		if (xml.contains("keyFrameName"))
94
			this.name = xml.getStringProperty("keyFrameName");
99
//		if (xml.contains("keyFrameName"))
100
//			this.name = xml.getStringProperty("keyFrameName");
95 101
		if (xml.contains("time"))
96 102
			this.time = xml.getDoubleProperty("time");
103
		if (xml.contains("keyFrameAlias"))
104
			this.aliasKeyFrame = xml.getStringProperty("keyFrameAlias");
97 105
		
98 106
		XMLEntity xmlProp = xml.getChild(0);
99
		if (xmlProp.contains("eyeX")) {
107
		if (xmlProp.contains("extentX")) {
108
			valueX = xmlProp.getDoubleProperty("extentX");
100 109
		}
110
		if (xmlProp.contains("extentY")) {
111
			valueY = xmlProp.getDoubleProperty("extentY");
112
		}
113
		if (xmlProp.contains("extentW")) {
114
			valueW = xmlProp.getDoubleProperty("extentW");
115
		}
116
		if (xmlProp.contains("extentH")) {
117
			valueH = xmlProp.getDoubleProperty("extentH");
118
		}
101 119
		
120
		Rectangle2D rectangle2D = new Rectangle2D.Double(valueX, valueY, valueW, valueH);
121
		this.projectExtent = new ProjectExtent();
122
		this.projectExtent.setExtent(rectangle2D);
102 123
		
103
//		// Get camera
104
		//XMLEntity xmlProp = xml.getChild(0);
105

  
106 124
		
107 125
		
108 126
	}
trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/animatedObject/AnimationObject2D.java
26 26
	}
27 27
	
28 28
	public Object getAnimatedView() {
29
		return view;
29
		return this.getAnimatedObject("view2D");
30 30
	}
31 31
	
32 32
	public void setAnimatedView(Object object) {
33
		this.view = (BaseView) object;
34
		this.nameClassView = this.view.getClass().getName();
33
		this.addAnimatedObject("view2D", object);
35 34
	}
36 35
	
37 36
	

Also available in: Unified diff