Revision 18657 trunk/extensions/extAnimationGUI/src/com/iver/ai2/animationgui/gui/MenuAnimationTransparency.java
MenuAnimationTransparency.java | ||
---|---|---|
9 | 9 |
import com.iver.andami.ui.mdiManager.IWindow; |
10 | 10 |
import com.iver.cit.gvsig.ProjectExtension; |
11 | 11 |
import com.iver.cit.gvsig.animation.AnimationContainer; |
12 |
import com.iver.cit.gvsig.animation.AnimationKeyFrameTransparencyFactory; |
|
13 |
import com.iver.cit.gvsig.animation.AnimationObjectTransparency; |
|
14 | 12 |
import com.iver.cit.gvsig.animation.AnimationPlayer; |
15 |
import com.iver.cit.gvsig.animation.AnimationTransparency; |
|
16 |
import com.iver.cit.gvsig.animation.InterpolatorTransparency; |
|
17 |
import com.iver.cit.gvsig.animation.KeyFrameTransparency; |
|
13 |
import com.iver.cit.gvsig.animation.IAnimationType; |
|
14 |
import com.iver.cit.gvsig.animation.animatedObject.AnimatedObjectBase; |
|
18 | 15 |
import com.iver.cit.gvsig.animation.interval.AnimationKeyFrameInterval; |
16 |
import com.iver.cit.gvsig.animation.keyframe.IKeyFrame; |
|
17 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolator; |
|
18 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.InterpolatorFactory; |
|
19 | 19 |
import com.iver.cit.gvsig.animation.traks.AnimationTimeTrack; |
20 | 20 |
import com.iver.cit.gvsig.animation.traks.IAnimationTrack; |
21 | 21 |
import com.iver.cit.gvsig.fmap.MapContext; |
... | ... | |
44 | 44 |
private AnimationTimeTrack animationTimeTrack = null; |
45 | 45 |
private AnimationKeyFrameInterval AKFinterval = null; |
46 | 46 |
private List keyFrameList = null; |
47 |
private AnimationObjectTransparency object = new AnimationObjectTransparency();
|
|
47 |
private AnimatedObjectBase object = new AnimatedObjectBase();
|
|
48 | 48 |
|
49 | 49 |
public void execute(String actionCommand) { |
50 |
AnimationKeyFrameTransparencyFactory animKeyFrame = null; |
|
51 | 50 |
|
52 | 51 |
// if the button pressed is "this" |
53 | 52 |
if (actionCommand.equals("CREARANIMTRANSP")) { |
... | ... | |
56 | 55 |
// Getting the active windows |
57 | 56 |
IWindow window = PluginServices.getMDIManager().getActiveWindow(); |
58 | 57 |
|
58 |
// Getting the animation container |
|
59 | 59 |
ac = this.getAnimationContainer(); |
60 | 60 |
|
61 |
|
|
62 |
// Getting the animation extension point |
|
61 | 63 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
62 | 64 |
ExtensionPoint extPoint = ((ExtensionPoint) extensionPoints.get("Animation")); |
63 | 65 |
|
... | ... | |
85 | 87 |
animationTimeTrack = null; |
86 | 88 |
animationTimeTrack = this.getAnimationTimeTrack("Track_layer_" + i, ac); |
87 | 89 |
animationTimeTrack.setEnabale(true); |
88 |
object.setAnimatedLayer(actives[i]);
|
|
90 |
object.addAnimatedObject("layer",actives[i]);
|
|
89 | 91 |
|
90 | 92 |
|
91 | 93 |
// Generating the interval. |
... | ... | |
96 | 98 |
|
97 | 99 |
keyFrameList = new ArrayList(); |
98 | 100 |
// KeyFrameTransparency kfTransAux = new KeyFrameTransparency(); |
99 |
KeyFrameTransparency kfTransAux = null;
|
|
100 |
KeyFrameTransparency kfTransIni = null;
|
|
101 |
KeyFrameTransparency kfTransFin = null;
|
|
101 |
IKeyFrame kfTransAux = null;
|
|
102 |
IKeyFrame kfTransIni = null;
|
|
103 |
IKeyFrame kfTransFin = null;
|
|
102 | 104 |
try { |
103 |
kfTransAux = (KeyFrameTransparency)extPoint.create("KeyFrameTransparency");
|
|
104 |
kfTransIni = (KeyFrameTransparency)extPoint.create("KeyFrameTransparency");
|
|
105 |
kfTransFin = (KeyFrameTransparency)extPoint.create("KeyFrameTransparency");
|
|
105 |
kfTransAux = (IKeyFrame)extPoint.create("KeyFrameTransparency");
|
|
106 |
kfTransIni = (IKeyFrame)extPoint.create("KeyFrameTransparency");
|
|
107 |
kfTransFin = (IKeyFrame)extPoint.create("KeyFrameTransparency");
|
|
106 | 108 |
} |
107 | 109 |
catch (InstantiationException e1) { |
108 | 110 |
e1.printStackTrace(); |
... | ... | |
138 | 140 |
|
139 | 141 |
kfTransFin.setName("KF3_layer_" + i);//name of keyframe. |
140 | 142 |
kfTransFin.setTime(tiempo);// saving final time interval. |
141 |
kfTransFin.setLevelTransparency(0);// interpolation: layer transparency in the moment to 0. |
|
143 |
// kfTransFin.setLevelTransparency(0);// interpolation: layer transparency in the moment to 0.
|
|
142 | 144 |
kfTransFin.setAnimatedObject(actives[i]); //save the same layer in the third keyframe |
143 | 145 |
keyFrameList.add(kfTransFin);//adding to the list. |
144 | 146 |
} catch (Exception e) { |
... | ... | |
210 | 212 |
.getMDIManager().getActiveWindow(); |
211 | 213 |
|
212 | 214 |
if (f instanceof BaseView) { |
213 |
AnimationTransparency animTransp = null;
|
|
215 |
IAnimationType animTransp = null;
|
|
214 | 216 |
try { |
215 | 217 |
System.out.println(extPoint.getDescription()); |
216 | 218 |
|
217 | 219 |
//Instancing my new animation based in transparency. |
218 |
animTransp = (AnimationTransparency)extPoint.create("AnimationTransparency");
|
|
220 |
animTransp = (IAnimationType)extPoint.create("AnimationTransparency");
|
|
219 | 221 |
} catch (InstantiationException e) { |
220 | 222 |
e.printStackTrace(); |
221 | 223 |
} catch (IllegalAccessException e) { |
... | ... | |
228 | 230 |
//Saving the view( in this case a BaseView). |
229 | 231 |
BaseView view = (BaseView)f; |
230 | 232 |
|
231 |
object.setAnimatedView(view);
|
|
233 |
object.addAnimatedObject("view", view);
|
|
232 | 234 |
|
233 | 235 |
at.setAnimatedObject(object); |
234 | 236 |
animTransp.setAnimatedObject(object); |
235 | 237 |
//My interpolator based in time and transparency. |
236 |
InterpolatorTransparency interTransparency = new InterpolatorTransparency();
|
|
238 |
IInterpolator interTransparency = InterpolatorFactory.createObject("InterpolatorTransparency");
|
|
237 | 239 |
animTransp.setInterpolator(interTransparency); |
238 | 240 |
at.setAnimationType(animTransp); |
239 |
interTransparency.setAnimatedObject(object); |
|
240 | 241 |
} |
241 | 242 |
} |
242 | 243 |
return at; |
Also available in: Unified diff