svn-gvsig-desktop / import / ext3D / branches / ext3D_v1.1 / libAnimation / src / com / iver / cit / gvsig / animation / interval / AnimationFunctionInterval.java @ 15445
History | View | Annotate | Download (2.75 KB)
1 |
package com.iver.cit.gvsig.animation.interval; |
---|---|
2 |
|
3 |
import com.iver.cit.gvsig.animation.IAnimationType; |
4 |
import com.iver.cit.gvsig.animation.keyframe.AnimationFunction; |
5 |
import com.iver.utiles.XMLEntity; |
6 |
|
7 |
public class AnimationFunctionInterval implements IAnimationTimeInterval { |
8 |
|
9 |
//private List animationFuncionList;
|
10 |
private AnimationFunction animationFunctionItem;
|
11 |
|
12 |
private double initialTime = 0; |
13 |
|
14 |
private double endTime = 1; |
15 |
|
16 |
private double intervalTime = endTime - initialTime; |
17 |
|
18 |
private String className; |
19 |
|
20 |
public AnimationFunction getAnimationFuncionItem() {
|
21 |
return animationFunctionItem;
|
22 |
} |
23 |
|
24 |
public void setAnimationFuncionList(AnimationFunction animationFuncionItem) { |
25 |
this.animationFunctionItem = animationFuncionItem;
|
26 |
} |
27 |
|
28 |
public double getEndTime() { |
29 |
return this.endTime; |
30 |
} |
31 |
|
32 |
public double getInitialTime() { |
33 |
return this.initialTime; |
34 |
} |
35 |
|
36 |
public double getIntervalTime() { |
37 |
return endTime - initialTime;
|
38 |
} |
39 |
|
40 |
public void setEndTime(double time) { |
41 |
this.endTime = time;
|
42 |
|
43 |
} |
44 |
|
45 |
public void setInitialTime(double time) { |
46 |
this.initialTime = time;
|
47 |
} |
48 |
|
49 |
public void setIntervalTime(double time) { |
50 |
this.intervalTime = time;
|
51 |
} |
52 |
|
53 |
public String toString() { |
54 |
|
55 |
String result;
|
56 |
//List AFL = this.animationFuncionList;
|
57 |
result = "Mostrando lista de funciones de animacion del intervalo Tini:"
|
58 |
+ this.getInitialTime() + " Tend" + this.getEndTime(); |
59 |
|
60 |
result+= this.animationFunctionItem; // ESTO NO SE SI ES ASI |
61 |
|
62 |
// for (Iterator iter = AFL.iterator(); iter.hasNext();) {
|
63 |
// Object element = (Object) iter.next();
|
64 |
// result += "\n" + element;
|
65 |
// }
|
66 |
return result;
|
67 |
} |
68 |
|
69 |
public void apply(double tini, double tend, IAnimationType animationType, |
70 |
Object animated) {
|
71 |
// TODO Auto-generated method stub
|
72 |
} |
73 |
|
74 |
public String getClassName() { |
75 |
// TODO Auto-generated method stub
|
76 |
return this.getClass().getName(); |
77 |
} |
78 |
|
79 |
|
80 |
public XMLEntity getXMLEntity() {
|
81 |
// TODO Auto-generated method stub
|
82 |
XMLEntity xml = new XMLEntity();
|
83 |
xml.putProperty("class_name", this.getClassName()); |
84 |
xml.putProperty("begin_time", initialTime);
|
85 |
xml.putProperty("end_time", endTime);
|
86 |
xml.putProperty("interval_time", intervalTime);
|
87 |
//this.animationFunctionItem.getXMLEntity();
|
88 |
|
89 |
return xml;
|
90 |
} |
91 |
|
92 |
|
93 |
public void setXMLEntity(XMLEntity xml) { |
94 |
// TODO Auto-generated method stub
|
95 |
if (xml.contains("class_name")) |
96 |
className= xml.getStringProperty("class_name");
|
97 |
if (xml.contains("begin_time")) |
98 |
initialTime = xml.getDoubleProperty("begin_time");
|
99 |
if (xml.contains("end_time")) |
100 |
endTime = xml.getDoubleProperty("end_time");
|
101 |
if (xml.contains("interval_time")) |
102 |
intervalTime = xml.getDoubleProperty("interval_time");
|
103 |
//this.animationFunctionItem.setXMLEntity(xml);
|
104 |
|
105 |
} |
106 |
} |