Revision 15445

View differences:

import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/AnimationContainer.java
13 13

  
14 14
	// IAnimationTrakc List
15 15
	public List AnimationTrackList;
16

  
17
	private String className;
16 18
	
17 19
	private static AnimationPlayer animationPlayer = new AnimationPlayer();
18 20

  
......
139 141
	 */
140 142
	public XMLEntity getXMLEntity() {
141 143
		XMLEntity xml = new XMLEntity();
142
		xml.putProperty("className", this.getClassName());		
144
		xml.putProperty("class_name", this.getClassName());		
143 145
		for (int i = 0; i < this.AnimationTrackList.size(); i++) {			
144 146
			IAnimationTrack trackElement = (IAnimationTrack) this.AnimationTrackList.get(i);			
145 147
			trackElement.getXMLEntity();
......
151 153
	 * @param xml
152 154
	 */
153 155
	public void setXMLEntity(XMLEntity xml) {
154
		
156
		if (xml.contains("class_name"))
157
			className = xml.getStringProperty("class_name");	
155 158
		for (int i = 0; i < this.AnimationTrackList.size(); i++) {
156 159
			IAnimationTrack trackElement = (IAnimationTrack) this.AnimationTrackList.get(i);			
157 160
			trackElement.setXMLEntity(xml);			
import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/keyframe/AnimationFunction.java
1 1
package com.iver.cit.gvsig.animation.keyframe;
2 2

  
3 3
import java.util.List;
4

  
5 4
import com.iver.utiles.IPersistance;
6 5
import com.iver.utiles.XMLEntity;
7 6

  
8 7
public class AnimationFunction implements IPersistance{
9 8

  
10 9
	private List AnimationFunctionList;
10
	private String className;
11 11
	
12 12
	//private AnimationFunction animationFunctionItem;
13 13

  
......
36 36
	public XMLEntity getXMLEntity() {
37 37
		// TODO Auto-generated method stub
38 38
		XMLEntity xml = new XMLEntity();
39
		xml.putProperty("className", this.getClassName());
40 39
		
40
		xml.putProperty("class_name", this.getClassName());		
41 41
		for (int i = 0; i < this.AnimationFunctionList.size(); i++) {
42 42
			AnimationFunction animationFunctionItem = (AnimationFunction) this.AnimationFunctionList.get(i);			
43
			//animationFunctionItem.get	
43
			return null;//provisional	
44 44
		}	
45 45
		return null;
46 46
	}
......
49 49
	public void setXMLEntity(XMLEntity xml) {
50 50
		// TODO Auto-generated method stub
51 51
		
52
		
52
		if (xml.contains("class_name"))
53
			className = xml.getStringProperty("class_name");	
53 54
		for (int i = 0; i < this.AnimationFunctionList.size(); i++) {
54 55
			AnimationFunction animationFunctionItem = (AnimationFunction) this.AnimationFunctionList.get(i);			
55
			//animationFunctionItem.set	
56
			return;	 //provisional
56 57
		}	
57 58
		
58 59
	}
import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/interval/AnimationFunctionInterval.java
15 15

  
16 16
	private double intervalTime = endTime - initialTime;
17 17

  
18
	private String className;
19

  
18 20
	public AnimationFunction getAnimationFuncionItem() {
19 21
		return animationFunctionItem;
20 22
	}
......
67 69
	public void apply(double tini, double tend, IAnimationType animationType,
68 70
			Object animated) {
69 71
		// TODO Auto-generated method stub
72
	}
70 73

  
74
	public String getClassName() {
75
		// TODO Auto-generated method stub
76
		return this.getClass().getName();
71 77
	}
78
	
72 79

  
73

  
74 80
	public XMLEntity getXMLEntity() {
75 81
		// TODO Auto-generated method stub
76 82
		XMLEntity xml = new XMLEntity();
77
		xml.putProperty("className", this.getClassName());
78
		
83
		xml.putProperty("class_name", this.getClassName());		
79 84
		xml.putProperty("begin_time", initialTime);
80 85
		xml.putProperty("end_time", endTime);
81 86
		xml.putProperty("interval_time", intervalTime);
82
		this.animationFunctionItem.getXMLEntity();	
87
		//this.animationFunctionItem.getXMLEntity();	
83 88
				
84
		return null;
89
		return xml;
85 90
	}
86 91

  
87 92

  
88 93
	public void setXMLEntity(XMLEntity xml) {
89 94
		// TODO Auto-generated method stub
90
		
95
		if (xml.contains("class_name"))
96
			className=	xml.getStringProperty("class_name");
91 97
		if (xml.contains("begin_time"))
92 98
			initialTime = xml.getDoubleProperty("begin_time");
93 99
		if (xml.contains("end_time"))
94 100
			endTime = xml.getDoubleProperty("end_time");
95 101
		if (xml.contains("interval_time"))
96 102
			intervalTime = xml.getDoubleProperty("interval_time");
97
		this.animationFunctionItem.setXMLEntity(xml);	
103
		//this.animationFunctionItem.setXMLEntity(xml);	
98 104
				
99
		
100 105
	}
101
	
102
	public String getClassName() {
103
		// TODO Auto-generated method stub
104
		return this.getClass().getName();
105
	}
106

  
107 106
}
import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/interval/AnimationDatedInterval.java
19 19
	private String endDateString = new String();
20 20

  
21 21
	private String sFormat = new String( "Y-m-d" );
22

  
23
	private String className;
22 24
	
23 25
	static final SimpleDateFormat sdf = new SimpleDateFormat( "dd/MM/yyyy" );
24 26
	
......
99 101
		
100 102
		XMLEntity xml = new XMLEntity();
101 103
		xml.putProperty("className", this.getClassName());				
102
		xml.putProperty("beginDateInterval", beginDateString);
103
		xml.putProperty("endDateInterval", endDateString);
104
	//	xml.putProperty("beginDateInterval", beginDateString);
105
	//	xml.putProperty("endDateInterval", endDateString);
104 106
		
105 107
		beginDateString = DateTime.dateToString(beginDateInterval, sFormat);
106 108
		endDateString = DateTime.dateToString(endDateInterval, sFormat);
......
109 111
		xml.putProperty("end_date", endDateString);
110 112
		
111 113
		
112
		return null;
114
		return xml;
113 115
	}
114 116

  
115 117
	public void setXMLEntity(XMLEntity xml) {
116 118
		
117
		if (xml.contains("beginDateInterval"))
118
			beginDateString = xml.getStringProperty("beginDateInterval");
119
		if (xml.contains("endDateInterval"))
120
			endDateString = xml.getStringProperty("endDateInterval");
121 119
		
120
		if (xml.contains("class_name"))
121
			className =	xml.getStringProperty("class_name");
122
		if (xml.contains("begin_date"))
123
			beginDateString = xml.getStringProperty("begin_date");
124
		if (xml.contains("end_date"))
125
			endDateString = xml.getStringProperty("end_date");
126
		
122 127
	}
123 128
}
import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/interval/AnimationKeyFrameInterval.java
3 3
import java.util.ArrayList;
4 4
import java.util.Iterator;
5 5
import java.util.List;
6
import com.iver.cit.gvsig.animation.IAnimationType;
6 7

  
7
import com.iver.cit.gvsig.animation.IAnimationType;
8 8
import com.iver.cit.gvsig.animation.keyframe.IAnimationTypeKeyFrame;
9 9
import com.iver.cit.gvsig.animation.keyframe.IInterpolator;
10 10
import com.iver.cit.gvsig.animation.keyframe.IKeyFrame;
......
22 22

  
23 23
	private double intervalTime = endTime - initialTime;
24 24

  
25
	private String className;
26

  
25 27
	public List getKeyFrameList() {
26 28
		return KeyFrameList;
27 29
	}
......
125 127
	public XMLEntity getXMLEntity() {
126 128
		// TODO Auto-generated method stub
127 129
		XMLEntity xml = new XMLEntity();
128
		xml.putProperty("className", this.getClassName());
129 130

  
131
		xml.putProperty("class_name", this.getClassName());
130 132
		xml.putProperty("begin_time", initialTime);
131 133
		xml.putProperty("end_time", endTime);
132 134
		xml.putProperty("interval_time", intervalTime);
133 135

  
134
		for (int i = 0; i < this.KeyFrameList.size(); i++) {
135
			IKeyFrame keyFrameItem = (IKeyFrame) this.KeyFrameList.get(i);
136
			keyFrameItem.getXMLEntity();
137
		}
138
		return null;
136
	/*	for (int i = 0; i < this.KeyFrameList.size(); i++) {
137
			IKeyFrame keyFrameItem = (IKeyFrame) this.KeyFrameList.get(i);			
138
			keyFrameItem.getXMLEntity();	
139
		}		*/
140
		return xml;		
141

  
139 142
	}
140 143

  
141 144
	public void setXMLEntity(XMLEntity xml) {
142 145
		// TODO Auto-generated method stub
143 146

  
147
		if (xml.contains("class_name"))
148
			className=	xml.getStringProperty("class_name");
144 149
		if (xml.contains("begin_time"))
145 150
			initialTime = xml.getDoubleProperty("begin_time");
146 151
		if (xml.contains("end_time"))
147 152
			endTime = xml.getDoubleProperty("end_time");
148 153
		if (xml.contains("interval_time"))
149 154
			intervalTime = xml.getDoubleProperty("interval_time");
150
		for (int i = 0; i < this.KeyFrameList.size(); i++) {
155
	
156
		/*	for (int i = 0; i < this.KeyFrameList.size(); i++) {
151 157
			IKeyFrame keyFrameItem = (IKeyFrame) this.KeyFrameList.get(i);
152 158
			keyFrameItem.setXMLEntity(xml);
153
		}
159
		}*/
154 160

  
155 161
	}
156 162

  
import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/traks/AnimationTimeTrack.java
1 1
package com.iver.cit.gvsig.animation.traks;
2 2

  
3
import java.sql.Time;
4 3
import java.util.ArrayList;
5 4
import java.util.Iterator;
6 5
import java.util.List;
7

  
8 6
import com.iver.cit.gvsig.animation.IAnimationType;
9 7
import com.iver.cit.gvsig.animation.interval.AnimationFunctionInterval;
10 8
import com.iver.cit.gvsig.animation.interval.AnimationKeyFrameInterval;
11 9
import com.iver.cit.gvsig.animation.interval.IAnimationInterval;
12 10
import com.iver.cit.gvsig.animation.interval.IAnimationTimeInterval;
13
import com.iver.utiles.IPersistance;
14 11
import com.iver.utiles.XMLEntity;
15 12

  
16 13
public class AnimationTimeTrack implements IAnimationTrack {
17 14

  
18 15
	private IAnimationType animationType;
19 16

  
20
	private String name;
17
	private String Name;
21 18

  
22 19
	private String Description;
23 20

  
......
31 28

  
32 29
	private Object animatedObject;
33 30

  
31
	private String className ;
32

  
34 33
	public AnimationTimeTrack(IAnimationType animationType) {
35 34
		this.animationTimeIntervalList = new ArrayList();
36 35
		this.animationType = animationType;
......
50 49
	}
51 50

  
52 51
	public String getName() {
53
		return this.name;
52
		return this.Name;
54 53
	}
55 54

  
56 55

  
......
128 127
	}
129 128

  
130 129
	public void setName(String name) {
131
		this.name = name;
130
		this.Name = name;
132 131
	}
133 132
	
134 133
	public String toString() {
......
178 177
		
179 178
		
180 179
		XMLEntity xml = new XMLEntity();
181
		xml.putProperty("className", this.getClassName());
182
		xml.putProperty("type", animationType);
180
		xml.putProperty("class_name", this.getClassName());
181
		xml.putProperty("name", Name);
183 182
		xml.putProperty("description",Description );
184
		xml.putProperty("animated_object", animatedObject);
185 183
		xml.putProperty("begin_time", beginTime);
186 184
		xml.putProperty("end_time", endTime);
187 185
		
188
		for (int i = 0; i < this.animationTimeIntervalList.size(); i++) {
189
			IAnimationTimeInterval timeInterval = (IAnimationTimeInterval) this.animationTimeIntervalList.get(i);			
190
			timeInterval.getXMLEntity();	
191
		}		
192
		return null;
186
//		for (int i = 0; i < this.animationTimeIntervalList.size(); i++) {
187
//			IAnimationTimeInterval timeInterval = (IAnimationTimeInterval) this.animationTimeIntervalList.get(i);			
188
//			timeInterval.getXMLEntity();	
189
//		}		
190
		return xml;
193 191
	}
194 192
	
195 193
	public void setXMLEntity(XMLEntity xml) {
196 194
		// TODO Auto-generated method stub
197
		if (xml.contains("type"))
198
			animationType = (IAnimationType) xml.getObjectProperty("type");		
199
		if (xml.contains("descripcion"))
195
		if (xml.contains("class_name"))
196
			className =	xml.getStringProperty("class_name");
197
		if (xml.contains("name"))
198
			Name =	xml.getStringProperty("name");
199
		if (xml.contains("description"))
200 200
			Description = xml.getStringProperty("description");
201
		if (xml.contains("animateted_object"))
202
			animatedObject = xml.getObjectProperty("animated_object");
203 201
		if (xml.contains("begin_time"))
204 202
			beginTime = xml.getDoubleProperty("begin_time");
205 203
		if (xml.contains("end_time"))
206 204
			endTime = xml.getDoubleProperty("end_time");
207
	//	this.setBeginTime(new Time(Long.parseLong(xml.getStringProperty("animated_object"))));
208 205
		
206
//		
207
//		for (int i = 0; i < this.animationTimeIntervalList.size(); i++) {
208
//			IAnimationTimeInterval timeInterval = (IAnimationTimeInterval) this.animationTimeIntervalList.get(i);			
209
//			timeInterval.setXMLEntity(xml);	
210
//		}		
209 211
		
210
		
211
		for (int i = 0; i < this.animationTimeIntervalList.size(); i++) {
212
			IAnimationTimeInterval timeInterval = (IAnimationTimeInterval) this.animationTimeIntervalList.get(i);			
213
			timeInterval.setXMLEntity(xml);	
214
		}		
215
		
216 212
	}
217 213
	
218 214
}
import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/traks/AnimationDatedTrack.java
35 35
	private Date endDate;
36 36
	
37 37
	private String sFormat = new String( "Y-m-d" );
38

  
39
	private String className;
38 40
	
39 41
	//private AnimationDatedInterval datedInterval;
40 42

  
......
170 172
	
171 173
	public void setXMLEntity(XMLEntity xml) {
172 174
		// TODO method to do persisence to this class
173
		if (xml.contains("type"))
174
			animationType = (IAnimationType) xml.getObjectProperty("type");		
175
		
176
		if (xml.contains("class_name"))
177
			className =	xml.getStringProperty("class_name");
178
		if (xml.contains("name"))
179
			Name =	xml.getStringProperty("name");
175 180
		if (xml.contains("descripcion"))
176 181
			Description = xml.getStringProperty("description");
177
		if (xml.contains("animateted_object"))
178
			animatedObject = xml.getObjectProperty("animated_object");
179 182
		if (xml.contains("begin_date"))
180 183
			beginDateString = xml.getStringProperty("begin_date");
181 184
		if (xml.contains("end_date"))
182 185
			endDateString = xml.getStringProperty("end_date");
183 186
		
184 187
		
185
		for (int i = 0; i < this.animationDateIntervalList.size(); i++) {
186
			AnimationDatedInterval datedInterval = (AnimationDatedInterval) this.animationDateIntervalList.get(i);			
187
			datedInterval.setXMLEntity(xml);			
188
		}					
188
//		for (int i = 0; i < this.animationDateIntervalList.size(); i++) {
189
//			AnimationDatedInterval datedInterval = (AnimationDatedInterval) this.animationDateIntervalList.get(i);			
190
//			datedInterval.setXMLEntity(xml);			
191
//		}					
189 192

  
190 193
	}
191 194

  
192 195
	public XMLEntity getXMLEntity() {
193 196
		// TODO method to get persisence to this class
194 197
		
195
		
196

  
197 198
		XMLEntity xml = new XMLEntity();
198
		xml.putProperty("className", this.getClassName());
199
		xml.putProperty("type", animationType);
199
		xml.putProperty("class_name", this.getClassName());
200
		xml.putProperty("name", Name);
200 201
		xml.putProperty("description",Description );
201
		xml.putProperty("animated_object", animatedObject);
202 202
		
203 203
		beginDateString = DateTime.dateToString(beginDate, sFormat);
204 204
		endDateString = DateTime.dateToString(endDate, sFormat);
......
206 206
		xml.putProperty("begin_date", beginDateString);
207 207
		xml.putProperty("end_date", endDateString);
208 208
		
209
		for (int i = 0; i < this.animationDateIntervalList.size(); i++) {			
210
			AnimationDatedInterval datedInterval = (AnimationDatedInterval) this.animationDateIntervalList.get(i);			
211
			datedInterval.getXMLEntity();
212
		}		
209
//		for (int i = 0; i < this.animationDateIntervalList.size(); i++) {			
210
//			AnimationDatedInterval datedInterval = (AnimationDatedInterval) this.animationDateIntervalList.get(i);			
211
//			datedInterval.getXMLEntity();
212
//		}		
213 213
		return xml;
214 214
		
215 215
	}
import/ext3D/branches/ext3D_v1.1/libAnimation/src/com/iver/cit/gvsig/animation/AnimationPlayer.java
60 60

  
61 61
	private boolean pauseFlag = false;
62 62

  
63
	
64
	private double m_length;
65

  
66
	private String className;
67

  
68

  
63 69
	private static boolean occupied = false;
64 70

  
71

  
65 72
	private static Animation3D a3D;
66 73

  
67 74
	public void play() {
......
406 413
	public XMLEntity getXMLEntity() {
407 414
		// TODO Auto-generated method stub
408 415
		XMLEntity xml = new XMLEntity();
409
		xml.putProperty("className", this.getClassName());
416
		xml.putProperty("class_name", this.getClassName());
410 417
		xml.putProperty("mode", mode);
411
		xml.putProperty("length",auxTime);
418
		xml.putProperty("length",globalTime);
412 419
		xml.putProperty("framerate",frameRate);
413 420

  
414 421
		return xml;
......
419 426
		// TODO Auto-generated method stub
420 427

  
421 428
		
429
		if (xml.contains("class_name"))
430
			className = xml.getStringProperty("class_name");	
422 431
		if (xml.contains("mode"))
423 432
			mode = xml.getIntProperty("mode");		
424 433
		if (xml.contains("length"))
425
			auxTime = xml.getIntProperty("length");
434
			globalTime = xml.getDoubleProperty("length");
426 435
		if (xml.contains("framerate"))
427 436
			frameRate = xml.getIntProperty("framerate");
428 437
				

Also available in: Unified diff