Revision 23597 trunk/libraries/libAnimation2D/src/main/java/com/iver/cit/gvsig/animation/interpolator/Interpolator2D.java
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 |
|
Also available in: Unified diff