Revision 23597

View differences:

trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/animationType/AnimationTypeFactoryLayer2D.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19

  
1 20
package com.iver.cit.gvsig.animation.animationType;
2 21

  
3 22
import com.iver.cit.gvsig.animation.AnimationFactory;
trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/animationType/AnimationLayer2D.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19

  
1 20
package com.iver.cit.gvsig.animation.animationType;
2 21

  
3 22
import com.iver.andami.PluginServices;
......
26 45
	private View view;
27 46
	private AnimationObject2D animationObject2D = new AnimationObject2D() ;
28 47
	private String titleWindow;
29
	//private String nameClassView;
30 48

  
31 49
	public AnimationLayer2D() {
32 50
		this.interpolator = new Interpolator2D();
......
60 78

  
61 79
		// Casting the animated object
62 80
		KeyFrame2D keyFrame2D = (KeyFrame2D) animated;
63
		// Applies to object
64
		//this.view = (View) animationObject2D.getAnimatedObject("view2D");
65 81
		this.view = (View) this.animationObject2D.getAnimatedView();
66 82
		this.view.getMapControl().getViewPort().setExtent(
67 83
				((ProjectExtent) keyFrame2D.getAnimatedObject()).getExtent());
68 84
		// Repainting the object
69 85
		this.view.getMapControl().drawMap(true);
70
		//this.view.repaintMap();
71 86
	}
72 87

  
73 88
	public int getTypeTrack() {
......
76 91

  
77 92
	public void setTypeTrack(int typeTrack) {
78 93
		this.typeTrack = typeTrack;
79

  
80 94
	}
81 95

  
82 96
	public IInterpolator getInterpolator() {
......
85 99

  
86 100
	public void setInterpolator(IInterpolator interpolator) {
87 101
		this.interpolator = interpolator;
88

  
89 102
	}
90 103

  
91 104
	
......
125 138
		xml.putProperty("className", this.getClassName());
126 139
		xml.putProperty("description", description);
127 140
		xml.putProperty("animationTrackTipe", typeTrack);
128
	//	xml.putProperty("nameClassView", animationObject2D.getNameClassView());
129 141
		myActualView = (View) animationObject2D.getAnimatedView();
130 142
		titleWindow = myActualView.getWindowInfo().getTitle();
131 143
		xml.putProperty("titleWindow", titleWindow);
......
138 150
			this.className=	xml.getStringProperty("className");
139 151
		if (xml.contains("animationTrackTipe"))
140 152
			this.typeTrack = xml.getIntProperty("animationTrackTipe");
141
//		if (xml.contains("nameClassView"))
142
//			this.nameClassView = xml.getStringProperty("nameClassView");
143 153
		if (xml.contains("titleWindow"))
144 154
			this.titleWindow = xml.getStringProperty("titleWindow");
145 155
		
......
147 157
		
148 158
		try {
149 159
			String class_name = xmlInterpolator.getStringProperty("className");
150
			Class classInterpolator = Class.forName(class_name);
160
			Class<?> classInterpolator = Class.forName(class_name);
151 161
			Object obj = classInterpolator .newInstance();
152 162
			IPersistence objPersist = (IPersistence) obj;
153 163
			objPersist.setXMLEntity(xmlInterpolator);
trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/interpolator/Interpolator2D.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19

  
1 20
package com.iver.cit.gvsig.animation.interpolator;
2 21

  
3 22
import java.awt.geom.Rectangle2D;
......
8 27
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolator;
9 28
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolatorTimeFuntion;
10 29
import com.iver.cit.gvsig.project.ProjectExtent;
11
import com.iver.cit.gvsig.project.documents.view.gui.View;
12 30
import com.iver.utiles.XMLEntity;
13 31

  
14 32
public class Interpolator2D implements IInterpolator {
......
18 36
	
19 37
	private IInterpolatorTimeFuntion funtion; 
20 38

  
21
	public IKeyFrame interpolate(List kfList, int index, double time) {
39
	public IKeyFrame interpolate(List<IKeyFrame> kfList, int index, double time) {
22 40
		KeyFrame2D KF = new KeyFrame2D();
23 41

  
24 42
		if (kfList == null)
25 43
			return null;
26 44

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

  
30 46
		switch (kfList.size()) {
31 47
		// this case when there are only has 2 keyframes
......
43 59
			ProjectExtent vp1 = (ProjectExtent) kf1.getAnimatedObject();
44 60
			ProjectExtent vp2 = (ProjectExtent) kf2.getAnimatedObject();
45 61

  
46
			// ViewPort vp = view.getMapControl().getViewPort();
47 62

  
48 63
			double min1 = vp1.getExtent().getMinX();
49 64
			double time1 = kf1.getTime();
......
64 79
					bottom);
65 80
			ProjectExtent pe = new ProjectExtent();
66 81
			pe.setExtent(newExtent);
67
			// pe.setEncuadre("temporal_keyframe");
68
			// vp.setExtent(newExtent);
69 82
			KF.setAnimatedObject(pe);
70 83
			break;
71

  
72 84
		}
73 85

  
74 86
		return KF;
......
109 121
	}
110 122
	
111 123
	public void setXMLEntity(XMLEntity xml) {
112
//		if (xml.contains("className"))
113
//			this.className=	xml.getStringProperty("className");
114 124
		if (xml.contains("description"))
115 125
			this.description = xml.getStringProperty("description");
116 126
		
trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/keyFrame/KeyFrame2D.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19

  
1 20
package com.iver.cit.gvsig.animation.keyFrame;
2 21

  
3 22
import java.awt.geom.Rectangle2D;
......
22 41

  
23 42
	public void CapturesProperties() {
24 43
		// TODO Auto-generated method stub
25

  
26 44
	}
27 45

  
28 46
	public void CapturesProperties(ProjectExtent projectExtent) {
29 47
		this.projectExtent = projectExtent;
30

  
31 48
	}
32 49

  
33 50
	public String getName() {
34
		// TODO Auto-generated method stub
35 51
		return this.name;
36 52
	}
37 53

  
38
	public List getPropertiesList() {
54
	public List<IKeyFrame> getPropertiesList() {
39 55
		// TODO Auto-generated method stub
40 56
		return null;
41 57
	}
......
45 61

  
46 62
	}
47 63

  
48
	public void setPropertiesList(List list) {
64
	public void setPropertiesList(List<IKeyFrame> list) {
49 65
		// TODO Auto-generated method stub
50

  
51 66
	}
52 67

  
53 68
	public String toString() {
......
56 71
		result += " tiempo: " + this.time;
57 72
		result += " nombre del extent: " + this.projectExtent.getDescription();
58 73

  
59
		// result= "Name: " + this.getName();
60 74
		return result;
61 75
	}
62 76

  
63 77

  
64 78
	public Object getAnimatedObject() {
65
		// TODO Auto-generated method stub
66 79
		return projectExtent;
67 80
	}
68 81
	public void setAnimatedObject(Object object) {
......
85 98
		XMLEntity xml = new XMLEntity();
86 99
		
87 100
		xml.putProperty("className", this.getClassName());
88
	//	xml.putProperty("keyFrameName", name);
89 101
		xml.putProperty("keyFrameAlias", aliasKeyFrame);
90 102
		xml.putProperty("time", time);
91 103
		
......
96 108

  
97 109
	public void setXMLEntity(XMLEntity xml) {
98 110
		
99
//		if (xml.contains("keyFrameName"))
100
//			this.name = xml.getStringProperty("keyFrameName");
101 111
		if (xml.contains("time"))
102 112
			this.time = xml.getDoubleProperty("time");
103 113
		if (xml.contains("keyFrameAlias"))
......
121 131
		this.projectExtent = new ProjectExtent();
122 132
		this.projectExtent.setExtent(rectangle2D);
123 133
		
124
		
125
		
126 134
	}
127

  
128 135
}
trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/animatedObject/AnimationObject2D.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19

  
20

  
1 21
package com.iver.cit.gvsig.animation.animatedObject;
2 22

  
3
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
4 23

  
5

  
6 24
public class AnimationObject2D extends AnimatedObjectBase {
7 25
	
8 26
	private String nameClassView;
9
	private BaseView view;
10 27
	
11 28
	public String getClassName() {
12 29
		return this.getClass().getName();

Also available in: Unified diff