Revision 20153
trunk/libraries/libAnimationCommon/src/main/java/com/iver/cit/gvsig/animation/animationType/AnimationTransparency.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.animationType; |
|
2 |
|
|
3 |
import com.iver.cit.gvsig.animation.IAnimationType; |
|
4 |
import com.iver.cit.gvsig.animation.animatedObject.AnimationObjectTransparency; |
|
5 |
import com.iver.cit.gvsig.animation.keyFrame.KeyFrameTransparency; |
|
6 |
import com.iver.cit.gvsig.animation.keyframe.IAnimationTypeKeyFrame; |
|
7 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolator; |
|
8 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
|
9 |
import com.iver.cit.gvsig.project.documents.view.gui.BaseView; |
|
10 |
import com.iver.utiles.IPersistence; |
|
11 |
import com.iver.utiles.XMLEntity; |
|
12 |
|
|
13 |
|
|
14 |
public class AnimationTransparency implements IAnimationTypeKeyFrame { |
|
15 |
|
|
16 |
private String className;// = this.getClass().getName(); |
|
17 |
private String description = "Animacion basada en Transparencias"; |
|
18 |
private String name = "AnimationTransparency"; |
|
19 |
private int typeTrack = IAnimationType.TIME_TYPE_TRACK; |
|
20 |
private IInterpolator interpolator; |
|
21 |
private BaseView view; |
|
22 |
private AnimationObjectTransparency animationObjectTransparency; |
|
23 |
|
|
24 |
public AnimationTransparency() { |
|
25 |
} |
|
26 |
|
|
27 |
public String getClassName() { |
|
28 |
return this.getClass().getName(); |
|
29 |
} |
|
30 |
|
|
31 |
public String getDescription() { |
|
32 |
return description; |
|
33 |
} |
|
34 |
|
|
35 |
public String getName() { |
|
36 |
return name; |
|
37 |
} |
|
38 |
|
|
39 |
public void setClassName(String className) { |
|
40 |
this.className = className; |
|
41 |
} |
|
42 |
|
|
43 |
public void setDescription(String description) { |
|
44 |
this.description = description; |
|
45 |
} |
|
46 |
|
|
47 |
public void setName(String name) { |
|
48 |
this.name = name; |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* |
|
53 |
* @param animate : Object to animate. |
|
54 |
* Application of attributes to our object animated. |
|
55 |
* In this animation the object is a layer(FLyerDefault). |
|
56 |
* Attributes: layer transparency. |
|
57 |
* invalidate(): repaint the view. |
|
58 |
*/ |
|
59 |
|
|
60 |
public void AppliesToObject(Object animated) { |
|
61 |
|
|
62 |
KeyFrameTransparency kf = (KeyFrameTransparency) animated; |
|
63 |
FLyrDefault layer = (FLyrDefault)kf.getAnimatedObject(); |
|
64 |
int trans = (int)kf.getLevelTransparency(); |
|
65 |
|
|
66 |
// System.err.println("antes: " + System.currentTimeMillis()); |
|
67 |
// long antes = System.currentTimeMillis(); |
|
68 |
|
|
69 |
layer.setTransparency(trans); |
|
70 |
layer.setDirty(true); |
|
71 |
//((ViewPort3D)layer.getMapContext().getViewPort()).setDirty(true); |
|
72 |
layer.getMapContext().invalidate(); |
|
73 |
|
|
74 |
// System.err.println("despues: " + System.currentTimeMillis()); |
|
75 |
// long despues = System.currentTimeMillis(); |
|
76 |
// System.err.println("intervalo de tiempo: " + (despues-antes)); |
|
77 |
|
|
78 |
System.err.println("aplicando transparencia " + trans + " al objeto " + layer.getName()); |
|
79 |
} |
|
80 |
|
|
81 |
public int getTypeTrack() { |
|
82 |
return typeTrack; |
|
83 |
} |
|
84 |
|
|
85 |
public void setTypeTrack(int typeTrack) { |
|
86 |
this.typeTrack = typeTrack; |
|
87 |
} |
|
88 |
|
|
89 |
public IInterpolator getInterpolator() { |
|
90 |
return this.interpolator; |
|
91 |
} |
|
92 |
|
|
93 |
public void setInterpolator(IInterpolator interpolator) { |
|
94 |
this.interpolator = interpolator; |
|
95 |
} |
|
96 |
|
|
97 |
public Object getAnimatedObject() { |
|
98 |
// TODO Auto-generated method stub |
|
99 |
return this.animationObjectTransparency; |
|
100 |
} |
|
101 |
|
|
102 |
public void setAnimatedObject(Object object) { |
|
103 |
//this.view = (BaseView) object; |
|
104 |
this.animationObjectTransparency = (AnimationObjectTransparency) object; |
|
105 |
} |
|
106 |
|
|
107 |
/* |
|
108 |
* IPersistence methods. |
|
109 |
*/ |
|
110 |
|
|
111 |
public XMLEntity getXMLEntity() { |
|
112 |
|
|
113 |
XMLEntity xml = new XMLEntity(); |
|
114 |
xml.putProperty("className", this.getClassName()); |
|
115 |
xml.putProperty("description", description); |
|
116 |
xml.putProperty("animationTrackTipe", typeTrack); |
|
117 |
xml.putProperty("nameView", animationObjectTransparency.getNameView()); |
|
118 |
xml.putProperty("nameLayer", animationObjectTransparency.getNameLayer()); |
|
119 |
|
|
120 |
xml.addChild(((IPersistence)this.interpolator).getXMLEntity()); |
|
121 |
return xml; |
|
122 |
} |
|
123 |
|
|
124 |
public void setXMLEntity(XMLEntity xml) { |
|
125 |
|
|
126 |
String nameView, nameLayer; |
|
127 |
|
|
128 |
if (xml.contains("className")) |
|
129 |
this.className= xml.getStringProperty("className"); |
|
130 |
if (xml.contains("animationTrackTipe")) |
|
131 |
this.typeTrack = xml.getIntProperty("animationTrackTipe"); |
|
132 |
if (xml.contains("nameView")) |
|
133 |
nameView = xml.getStringProperty("nameView"); |
|
134 |
if (xml.contains("nameLayer")) |
|
135 |
nameLayer = xml.getStringProperty("nameLayer"); |
|
136 |
|
|
137 |
//Acceding to the InterpolatorX of the AnimationTypeX |
|
138 |
XMLEntity xmlInterpolator = xml.getChild(0); |
|
139 |
try { |
|
140 |
String class_name = xmlInterpolator.getStringProperty("className"); |
|
141 |
Class classInterpolator = Class.forName(class_name); |
|
142 |
Object obj = classInterpolator .newInstance(); |
|
143 |
IPersistence objPersist = (IPersistence) obj; |
|
144 |
objPersist.setXMLEntity(xmlInterpolator); |
|
145 |
this.interpolator = (IInterpolator) obj; |
|
146 |
this.setInterpolator(interpolator); |
|
147 |
//this.setAnimatedObject(); |
|
148 |
|
|
149 |
} catch (Exception e) { |
|
150 |
e.printStackTrace(); |
|
151 |
} |
|
152 |
|
|
153 |
} |
|
154 |
} |
trunk/libraries/libAnimationCommon/src/main/java/com/iver/cit/gvsig/animation/animationType/AnimationTypeFactoryTransparency.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.animationType; |
|
2 |
|
|
3 |
import com.iver.cit.gvsig.animation.AnimationFactory; |
|
4 |
|
|
5 |
|
|
6 |
public class AnimationTypeFactoryTransparency extends AnimationFactory { |
|
7 |
|
|
8 |
public static String registerName = "AnimationTransparency"; |
|
9 |
|
|
10 |
|
|
11 |
public static AnimationTransparency animationTransparency; |
|
12 |
|
|
13 |
static { |
|
14 |
if (animationTransparency == null) { |
|
15 |
animationTransparency = new AnimationTransparency(); |
|
16 |
animationTransparency.setClassName("AnimationTransparency"); |
|
17 |
animationTransparency.setName("AnimationTransparency"); |
|
18 |
animationTransparency.setDescription("Animacion basada en transparencias."); |
|
19 |
} |
|
20 |
} |
|
21 |
|
|
22 |
/** |
|
23 |
* Creating a new animation in the factory. |
|
24 |
*/ |
|
25 |
public Object create() { |
|
26 |
|
|
27 |
return animationTransparency; |
|
28 |
} |
|
29 |
|
|
30 |
/** |
|
31 |
* Registers in the points of extension the Factory with alias. |
|
32 |
*/ |
|
33 |
public static void register() { |
|
34 |
register(registerName, new AnimationTypeFactoryTransparency(), "com.iver.cit.gvsig.animation.AnimationTransparency"); |
|
35 |
} |
|
36 |
|
|
37 |
public String getRegisterName() { |
|
38 |
return registerName; |
|
39 |
} |
|
40 |
|
|
41 |
} |
trunk/libraries/libAnimationCommon/src/main/java/com/iver/cit/gvsig/animation/animationType/AnimationKeyFrameTransparencyFactory.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.animationType; |
|
2 |
|
|
3 |
import com.iver.cit.gvsig.animation.AnimationFactory; |
|
4 |
import com.iver.cit.gvsig.animation.keyFrame.KeyFrameTransparency; |
|
5 |
|
|
6 |
|
|
7 |
public class AnimationKeyFrameTransparencyFactory extends AnimationFactory { |
|
8 |
|
|
9 |
public static String registerName = "KeyFrameTransparency"; |
|
10 |
|
|
11 |
|
|
12 |
/** |
|
13 |
* Creating a new animation in the factory. |
|
14 |
*/ |
|
15 |
public Object create() { |
|
16 |
KeyFrameTransparency keyFrameTransparency = new KeyFrameTransparency(); |
|
17 |
return keyFrameTransparency; |
|
18 |
} |
|
19 |
|
|
20 |
/** |
|
21 |
* Registers in the points of extension the Factory with alias. |
|
22 |
*/ |
|
23 |
public static void register() { |
|
24 |
register(registerName, new AnimationKeyFrameTransparencyFactory(), "com.iver.cit.gvsig.animation.KeyFrameTransparency"); |
|
25 |
} |
|
26 |
|
|
27 |
public String getRegisterName() { |
|
28 |
return registerName; |
|
29 |
} |
|
30 |
|
|
31 |
} |
trunk/libraries/libAnimationCommon/src/main/java/com/iver/cit/gvsig/animation/interpolator/InterpolatorTransparency.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.interpolator; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
import com.iver.ai2.gvsig3dgui.view.View3D; |
|
6 |
import com.iver.cit.gvsig.animation.animatedObject.AnimationObjectTransparency; |
|
7 |
import com.iver.cit.gvsig.animation.keyFrame.KeyFrameTransparency; |
|
8 |
import com.iver.cit.gvsig.animation.keyframe.IKeyFrame; |
|
9 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolator; |
|
10 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolatorTimeFuntion; |
|
11 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
|
12 |
import com.iver.cit.gvsig.project.documents.view.gui.BaseView; |
|
13 |
import com.iver.utiles.XMLEntity; |
|
14 |
|
|
15 |
|
|
16 |
/** |
|
17 |
* Class to interpolate the transparency of a activated layer. |
|
18 |
*/ |
|
19 |
|
|
20 |
public class InterpolatorTransparency implements IInterpolator { |
|
21 |
|
|
22 |
public BaseView view; |
|
23 |
private String className;// = this.getClass().getName(); |
|
24 |
private String description = "Interpolaci?n basada en Transparencias"; |
|
25 |
private String name = "InterpolatorTransparency"; |
|
26 |
|
|
27 |
private AnimationObjectTransparency animationObjectTransparency = new AnimationObjectTransparency() ; |
|
28 |
|
|
29 |
public IKeyFrame interpolate(List kfList, int index, double time) { |
|
30 |
KeyFrameTransparency KF = new KeyFrameTransparency(); |
|
31 |
|
|
32 |
// if the list of keyframes is empty. |
|
33 |
if (kfList == null) |
|
34 |
return null; |
|
35 |
|
|
36 |
if (this.view == null) |
|
37 |
return null; |
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
switch (kfList.size()) { |
|
42 |
// this case when there are only has 2 keyframes |
|
43 |
case 2: |
|
44 |
|
|
45 |
KeyFrameTransparency kf1 = (KeyFrameTransparency) kfList.get(0); |
|
46 |
KeyFrameTransparency kf2 = (KeyFrameTransparency) kfList.get(1); |
|
47 |
|
|
48 |
if (index == 1) { |
|
49 |
KeyFrameTransparency kaux = kf1; |
|
50 |
kf1 = kf2; |
|
51 |
kf2 = kaux; |
|
52 |
} |
|
53 |
|
|
54 |
if ((kf1 == null) ||(kf2 == null)) |
|
55 |
return null; |
|
56 |
//initial transparency level. |
|
57 |
double transparencia1 = kf1.getLevelTransparency(); |
|
58 |
//final transparency level. |
|
59 |
double transparencia2 = kf2.getLevelTransparency(); |
|
60 |
|
|
61 |
// Object to animate getting the keyframe. |
|
62 |
FLyrDefault fd1 = (FLyrDefault) kf1.getAnimatedObject(); |
|
63 |
//FLyrDefault fd2 = (FLyrDefault) kf2.getAnimatedObject(); |
|
64 |
|
|
65 |
double time1 = kf1.getTime();//initial time. |
|
66 |
double time2 = kf2.getTime();//final time. |
|
67 |
double valorTrans = linearInterpolate(transparencia1, transparencia2, time1, time2, time); |
|
68 |
System.out.println("valor interpolado " + valorTrans); |
|
69 |
|
|
70 |
//Creating the keyframe KF to return. |
|
71 |
try { |
|
72 |
KF.setLevelTransparency((int)valorTrans); |
|
73 |
KF.setAnimatedObject(fd1);// keyframe with the layer and the new transparecy to apply. |
|
74 |
} catch (Exception e) { |
|
75 |
// TODO Auto-generated catch block |
|
76 |
e.printStackTrace(); |
|
77 |
} |
|
78 |
} |
|
79 |
return KF; |
|
80 |
} |
|
81 |
|
|
82 |
|
|
83 |
private double linearInterpolate(double minX, double minX2, double timePos, |
|
84 |
double timePos2, double time) { |
|
85 |
// P1 + (P2-P1)*((t-t1)/(t2-t1)) |
|
86 |
return (minX + (minX2 - minX) |
|
87 |
* ((time - timePos) / (timePos2 - timePos))); |
|
88 |
} |
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
public Object getAnimatedObject() { |
|
95 |
return this.animationObjectTransparency; |
|
96 |
//return this.view; |
|
97 |
} |
|
98 |
|
|
99 |
|
|
100 |
public void setAnimatedObject(Object object) { |
|
101 |
this.animationObjectTransparency = (AnimationObjectTransparency) object; |
|
102 |
this.view = (View3D) animationObjectTransparency.getAnimatedView(); |
|
103 |
} |
|
104 |
// public Object getAnimatedObject() { |
|
105 |
// |
|
106 |
// return this.view; |
|
107 |
// } |
|
108 |
// |
|
109 |
// public void setAnimatedObject(Object ani) { |
|
110 |
// this.view = (View3D) ani; |
|
111 |
// } |
|
112 |
|
|
113 |
public IInterpolatorTimeFuntion getFuntion() { |
|
114 |
// TODO Auto-generated method stub |
|
115 |
return null; |
|
116 |
} |
|
117 |
|
|
118 |
|
|
119 |
public void setFuntion(IInterpolatorTimeFuntion arg0) { |
|
120 |
// TODO Auto-generated method stub |
|
121 |
|
|
122 |
} |
|
123 |
|
|
124 |
public String getClassName() { |
|
125 |
return this.getClass().getName(); |
|
126 |
} |
|
127 |
|
|
128 |
public String getDescription() { |
|
129 |
return this.description; |
|
130 |
} |
|
131 |
|
|
132 |
public String getName() { |
|
133 |
return this.name; |
|
134 |
} |
|
135 |
|
|
136 |
/* |
|
137 |
* IPersistence methods. |
|
138 |
*/ |
|
139 |
|
|
140 |
public XMLEntity getXMLEntity() { |
|
141 |
XMLEntity xml = new XMLEntity(); |
|
142 |
xml.putProperty("className", this.getClassName()); |
|
143 |
xml.putProperty("description", this.description); |
|
144 |
return xml; |
|
145 |
} |
|
146 |
|
|
147 |
public void setXMLEntity(XMLEntity xml) { |
|
148 |
if (xml.contains("className")) |
|
149 |
this.className= xml.getStringProperty("className"); |
|
150 |
if (xml.contains("description")) |
|
151 |
this.description = xml.getStringProperty("description"); |
|
152 |
|
|
153 |
} |
|
154 |
|
|
155 |
} |
trunk/libraries/libAnimationCommon/src/main/java/com/iver/cit/gvsig/animation/keyFrame/KeyFrameTransparency.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.keyFrame; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
import com.iver.cit.gvsig.animation.keyframe.IKeyFrame; |
|
5 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
|
6 |
import com.iver.utiles.XMLEntity; |
|
7 |
|
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
* @author ?ngel. |
|
12 |
* |
|
13 |
* Class to create a keyframe used in animation with transparency. |
|
14 |
* |
|
15 |
*/ |
|
16 |
|
|
17 |
public class KeyFrameTransparency implements IKeyFrame { |
|
18 |
|
|
19 |
private String name; |
|
20 |
private double time; |
|
21 |
private int levelTransparency; |
|
22 |
private boolean visibility; |
|
23 |
private FLyrDefault layerDefault; |
|
24 |
private String className; |
|
25 |
|
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @see com.iver.cit.gvsig.animation.keyframe.IKeyFrame#CapturesProperties() |
|
30 |
* Capturing the property transparency of the layer and the property is selected?. |
|
31 |
*/ |
|
32 |
|
|
33 |
public void CapturesProperties() { |
|
34 |
if (layerDefault != null){ |
|
35 |
levelTransparency = this.layerDefault.getTransparency(); |
|
36 |
visibility = this.layerDefault.isVisible();//Check box is selected?. |
|
37 |
} |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* Getting the keyframe name. |
|
42 |
*/ |
|
43 |
|
|
44 |
public String getName() { |
|
45 |
// TODO Auto-generated method stub |
|
46 |
return this.name; |
|
47 |
} |
|
48 |
|
|
49 |
public List getPropertiesList() { |
|
50 |
// TODO Auto-generated method stub |
|
51 |
return null; |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* @param name: name of the keyframe. |
|
56 |
* Setting the keyframe name. |
|
57 |
*/ |
|
58 |
|
|
59 |
public void setName(String name) { |
|
60 |
this.name = name; |
|
61 |
|
|
62 |
} |
|
63 |
|
|
64 |
public void setPropertiesList(List list) { |
|
65 |
// TODO Auto-generated method stub |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* Information of the keyframe in a String. |
|
70 |
*/ |
|
71 |
|
|
72 |
public String toString() { |
|
73 |
String result; |
|
74 |
result = " keyframeTransparency:\n"; |
|
75 |
result += " tiempo: " + this.time; |
|
76 |
// result= "Name: " + this.getName(); |
|
77 |
return result; |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* |
|
82 |
* @return the Object to animate.(FLyrDefault) |
|
83 |
*/ |
|
84 |
|
|
85 |
public Object getAnimatedObject() { |
|
86 |
return layerDefault; |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* |
|
91 |
* @param object : Object to animate. |
|
92 |
* Setting the object to animate.(FLyrDefault). |
|
93 |
* |
|
94 |
*/ |
|
95 |
public void setAnimatedObject(Object object) { |
|
96 |
this.layerDefault = (FLyrDefault) object; |
|
97 |
} |
|
98 |
|
|
99 |
/** |
|
100 |
* Getting the time of the keyframe. |
|
101 |
*/ |
|
102 |
|
|
103 |
public double getTime() { |
|
104 |
return time; |
|
105 |
} |
|
106 |
|
|
107 |
public double getLevelTransparency() { |
|
108 |
return levelTransparency; |
|
109 |
} |
|
110 |
|
|
111 |
public void setLevelTransparency(int levelTransparency) { |
|
112 |
this.levelTransparency = levelTransparency; |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* Setting the time of the keyframe. |
|
117 |
*/ |
|
118 |
|
|
119 |
public void setTime(double time) { |
|
120 |
this.time = time; |
|
121 |
} |
|
122 |
|
|
123 |
/** |
|
124 |
* @return the name of the class. |
|
125 |
*/ |
|
126 |
public String getClassName() { |
|
127 |
// TODO Auto-generated method stub |
|
128 |
return this.getClass().getName(); |
|
129 |
} |
|
130 |
|
|
131 |
/* |
|
132 |
* IPersistence methods. |
|
133 |
*/ |
|
134 |
|
|
135 |
public XMLEntity getXMLEntity() { |
|
136 |
|
|
137 |
XMLEntity xml = new XMLEntity(); |
|
138 |
|
|
139 |
xml.putProperty("className", this.getClassName()); |
|
140 |
xml.putProperty("keyFrameName", name); |
|
141 |
xml.putProperty("levelTransparency", levelTransparency); |
|
142 |
xml.putProperty("visibility", visibility); |
|
143 |
xml.putProperty("time", time); |
|
144 |
|
|
145 |
return xml; |
|
146 |
} |
|
147 |
|
|
148 |
public void setXMLEntity(XMLEntity xml) { |
|
149 |
|
|
150 |
// if (xml.contains("className")) |
|
151 |
// this.className = xml.getStringProperty("className"); |
|
152 |
if (xml.contains("keyFrameName")) |
|
153 |
this.name = xml.getStringProperty("keyFrameName"); |
|
154 |
if (xml.contains("levelTransparency")) |
|
155 |
this.levelTransparency = xml.getIntProperty("levelTransparency"); |
|
156 |
if (xml.contains("visibility")) |
|
157 |
this.visibility = xml.getBooleanProperty("visibility"); |
|
158 |
if (xml.contains("time")) |
|
159 |
this.time = xml.getDoubleProperty("time"); |
|
160 |
} |
|
161 |
|
|
162 |
} |
trunk/libraries/libAnimationCommon/src/main/java/com/iver/cit/gvsig/animation/keyFrame/AnimationKeyFrameTransparencyFactory.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.keyFrame; |
|
2 |
|
|
3 |
import com.iver.cit.gvsig.animation.AnimationFactory; |
|
4 |
|
|
5 |
|
|
6 |
public class AnimationKeyFrameTransparencyFactory extends AnimationFactory { |
|
7 |
|
|
8 |
public static String registerName = "KeyFrameTransparency"; |
|
9 |
|
|
10 |
|
|
11 |
/** |
|
12 |
* Creating a new animation in the factory. |
|
13 |
*/ |
|
14 |
public Object create() { |
|
15 |
KeyFrameTransparency keyFrameTransparency = new KeyFrameTransparency(); |
|
16 |
return keyFrameTransparency; |
|
17 |
} |
|
18 |
|
|
19 |
/** |
|
20 |
* Registers in the points of extension the Factory with alias. |
|
21 |
*/ |
|
22 |
public static void register() { |
|
23 |
register(registerName, new AnimationKeyFrameTransparencyFactory(), "com.iver.cit.gvsig.animation.KeyFrameTransparency"); |
|
24 |
} |
|
25 |
|
|
26 |
public String getRegisterName() { |
|
27 |
return registerName; |
|
28 |
} |
|
29 |
|
|
30 |
} |
trunk/libraries/libAnimationCommon/src/main/java/com/iver/cit/gvsig/animation/animatedObject/AnimationObjectTransparency.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.animatedObject; |
|
2 |
|
|
3 |
import com.iver.cit.gvsig.animation.animatedObject.AnimatedObjectBase; |
|
4 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
|
5 |
import com.iver.cit.gvsig.project.documents.view.gui.BaseView; |
|
6 |
|
|
7 |
public class AnimationObjectTransparency extends AnimatedObjectBase{ |
|
8 |
|
|
9 |
private String className; |
|
10 |
private String nameView; |
|
11 |
private String nameLayer; |
|
12 |
private BaseView view; |
|
13 |
private FLyrDefault layerDefault; |
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
public String getClassName() { |
|
18 |
return this.getClass().getName(); |
|
19 |
} |
|
20 |
|
|
21 |
public void setClassName(String className) { |
|
22 |
this.className = className; |
|
23 |
} |
|
24 |
|
|
25 |
public String getNameView() { |
|
26 |
return nameView; |
|
27 |
} |
|
28 |
|
|
29 |
public void setNameView(String nameView) { |
|
30 |
this.nameView = nameView; |
|
31 |
} |
|
32 |
|
|
33 |
public String getNameLayer() { |
|
34 |
return nameLayer; |
|
35 |
} |
|
36 |
|
|
37 |
public void setNameLayer(String nameLayer) { |
|
38 |
this.nameLayer = nameLayer; |
|
39 |
} |
|
40 |
|
|
41 |
public Object getAnimatedView() { |
|
42 |
return view; |
|
43 |
} |
|
44 |
|
|
45 |
public void setAnimatedView(Object object) { |
|
46 |
this.view = (BaseView) object; |
|
47 |
this.nameView = this.view.getName(); |
|
48 |
} |
|
49 |
|
|
50 |
public Object getAnimatedLayer() { |
|
51 |
return layerDefault; |
|
52 |
} |
|
53 |
|
|
54 |
public void setAnimatedLayer(Object object) { |
|
55 |
this.layerDefault = (FLyrDefault) object; |
|
56 |
this.nameLayer = this.layerDefault.getName(); |
|
57 |
} |
|
58 |
|
|
59 |
|
|
60 |
} |
trunk/libraries/libAnimationCommon/src/test/java/com/iver/cit/gvsig/animation/AppTest.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation; |
|
2 |
|
|
3 |
import junit.framework.Test; |
|
4 |
import junit.framework.TestCase; |
|
5 |
import junit.framework.TestSuite; |
|
6 |
|
|
7 |
/** |
|
8 |
* Unit test for simple App. |
|
9 |
*/ |
|
10 |
public class AppTest |
|
11 |
extends TestCase |
|
12 |
{ |
|
13 |
/** |
|
14 |
* Create the test case |
|
15 |
* |
|
16 |
* @param testName name of the test case |
|
17 |
*/ |
|
18 |
public AppTest( String testName ) |
|
19 |
{ |
|
20 |
super( testName ); |
|
21 |
} |
|
22 |
|
|
23 |
/** |
|
24 |
* @return the suite of tests being tested |
|
25 |
*/ |
|
26 |
public static Test suite() |
|
27 |
{ |
|
28 |
return new TestSuite( AppTest.class ); |
|
29 |
} |
|
30 |
|
|
31 |
/** |
|
32 |
* Rigourous Test :-) |
|
33 |
*/ |
|
34 |
public void testApp() |
|
35 |
{ |
|
36 |
assertTrue( true ); |
|
37 |
} |
|
38 |
} |
trunk/libraries/libAnimationCommon/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|
2 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
3 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<groupId>com.iver.cit.gvsig.animation</groupId> |
|
6 |
<artifactId>libAnimationCommon</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<version>1.0-SNAPSHOT</version> |
|
9 |
<name>libAnimationCommon</name> |
|
10 |
<url>http://maven.apache.org</url> |
|
11 |
<parent> |
|
12 |
<groupId>gvsig.basepoms</groupId> |
|
13 |
<artifactId>gvsig-basepoms</artifactId> |
|
14 |
<version>1.0-SNAPSHOT</version> |
|
15 |
</parent> |
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>junit</groupId> |
|
19 |
<artifactId>junit</artifactId> |
|
20 |
<version>3.8.1</version> |
|
21 |
<scope>test</scope> |
|
22 |
</dependency> |
|
23 |
<dependency> |
|
24 |
<groupId>com.iver.cit.gvsig.animation</groupId> |
|
25 |
<artifactId>gvsig-animation</artifactId> |
|
26 |
<version>1.0-SNAPSHOT</version> |
|
27 |
</dependency> |
|
28 |
<dependency> |
|
29 |
<groupId>com.iver.cit</groupId> |
|
30 |
<artifactId>iver-utiles</artifactId> |
|
31 |
<version>1.0</version> |
|
32 |
<scope>system</scope> |
|
33 |
<systemPath> |
|
34 |
C:/java/gvSIG_HEAD_SVN/_fwAndami/lib/iver-utiles.jar |
|
35 |
</systemPath> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>com.iver.cit</groupId> |
|
39 |
<artifactId>Andamy</artifactId> |
|
40 |
<version>1.0</version> |
|
41 |
<scope>system</scope> |
|
42 |
<systemPath> |
|
43 |
C:/java/gvSIG_HEAD_SVN/_fwAndami/andami.jar |
|
44 |
</systemPath> |
|
45 |
</dependency> |
|
46 |
<dependency> |
|
47 |
<groupId>com.iver.cit</groupId> |
|
48 |
<artifactId>AppGVSIG</artifactId> |
|
49 |
<version>1.0</version> |
|
50 |
<scope>system</scope> |
|
51 |
<systemPath> |
|
52 |
C:/java/gvSIG_HEAD_SVN/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/com.iver.cit.gvsig.jar |
|
53 |
</systemPath> |
|
54 |
</dependency> |
|
55 |
<dependency> |
|
56 |
<groupId>com.iver.cit</groupId> |
|
57 |
<artifactId>fmap</artifactId> |
|
58 |
<version>1.0</version> |
|
59 |
<scope>system</scope> |
|
60 |
<systemPath> |
|
61 |
C:/java/gvSIG_HEAD_SVN/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/fmap.jar |
|
62 |
</systemPath> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>com.iver.ai2</groupId> |
|
66 |
<artifactId>gvsig3d</artifactId> |
|
67 |
<version>1.0</version> |
|
68 |
<scope>system</scope> |
|
69 |
<systemPath> |
|
70 |
C:/java/gvSIG_HEAD_SVN/ext3Dgui/lib/com.iver.ai2.gvsig3d.jar |
|
71 |
</systemPath> |
|
72 |
</dependency> |
|
73 |
<dependency> |
|
74 |
<groupId>com.iver.ai2</groupId> |
|
75 |
<artifactId>gvsig3d_share</artifactId> |
|
76 |
<version>1.0</version> |
|
77 |
<scope>system</scope> |
|
78 |
<systemPath> |
|
79 |
C:/java/gvSIG_HEAD_SVN/ext3Dgui/lib/com.iver.ai2.gvsig3d_share.jar |
|
80 |
</systemPath> |
|
81 |
</dependency> |
|
82 |
<dependency> |
|
83 |
<groupId>org.cresques.cts</groupId> |
|
84 |
<artifactId>cresques</artifactId> |
|
85 |
<version>1.0</version> |
|
86 |
<scope>system</scope> |
|
87 |
<systemPath> |
|
88 |
C:/java/gvSIG_HEAD_SVN/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/org.cresques.cts.jar |
|
89 |
</systemPath> |
|
90 |
</dependency> |
|
91 |
<dependency> |
|
92 |
<groupId>com.iver.ai2</groupId> |
|
93 |
<artifactId>gvsig3dgui</artifactId> |
|
94 |
<version>1.0</version> |
|
95 |
<scope>system</scope> |
|
96 |
<systemPath> |
|
97 |
C:/java/gvSIG_HEAD_SVN/_fwAndami/gvSIG/extensiones/com.iver.ai2.gvsig3dgui/lib/com.iver.ai2.gvsig3dgui.jar |
|
98 |
</systemPath> |
|
99 |
</dependency> |
|
100 |
|
|
101 |
</dependencies> |
|
102 |
</project> |
Also available in: Unified diff