|
1 |
package com.iver.cit.gvsig.animation.date;
|
|
2 |
|
|
3 |
import com.iver.ai2.gvsig3d.gui.View3D;
|
|
4 |
import com.iver.andami.PluginServices;
|
|
5 |
import com.iver.andami.ui.mdiManager.IWindow;
|
|
6 |
import com.iver.cit.gvsig.animation.IAnimationType;
|
|
7 |
import com.iver.cit.gvsig.animation.dateFilter.DateFilter;
|
|
8 |
import com.iver.cit.gvsig.fmap.layers.FLayer;
|
|
9 |
import com.iver.cit.gvsig.fmap.layers.ICustomVectorialFilter;
|
|
10 |
|
|
11 |
public class AnimationDate3D implements IAnimationType {
|
|
12 |
|
|
13 |
private String className = this.getClass().getName();
|
|
14 |
private String description = "Animacion basada en encuadres para vista 3D plana";
|
|
15 |
private String name = "Animacion vista 3D plana";
|
|
16 |
private int typeTrack = IAnimationType.TIME_TYPE_TRACK;
|
|
17 |
FLayer layer;
|
|
18 |
private int filterMode = 0;
|
|
19 |
ICustomVectorialFilter temporalFilter = null;
|
|
20 |
|
|
21 |
public AnimationDate3D() {
|
|
22 |
}
|
|
23 |
|
|
24 |
public void AppliesToObject(Object animated) {
|
|
25 |
// TODO Auto-generated method stub
|
|
26 |
|
|
27 |
if (temporalFilter == null)
|
|
28 |
temporalFilter = (ICustomVectorialFilter) animated;
|
|
29 |
|
|
30 |
ICustomVectorialFilter filter = (ICustomVectorialFilter) animated;
|
|
31 |
// System.out.println("fechaaaa " + filter);
|
|
32 |
((DateFilter)filter).setFilterMode(filterMode);
|
|
33 |
layer.setProperty("CustomVectorialFilter", filter);
|
|
34 |
// layer.setDirty(true);
|
|
35 |
|
|
36 |
boolean b = temporalFilter.compareTo(filter);
|
|
37 |
// System.out.println("PINTANDO " + b);
|
|
38 |
if (!b){
|
|
39 |
System.out.println("FALSE FALSE FALSE FALSE FALSE FALSE");
|
|
40 |
System.out.println("ANTERIOR");
|
|
41 |
System.out.println(temporalFilter);
|
|
42 |
System.out.println("ACTUAL");
|
|
43 |
System.out.println(filter);
|
|
44 |
layer.getMapContext().redraw();
|
|
45 |
|
|
46 |
IWindow[] f = PluginServices
|
|
47 |
.getMDIManager().getAllWindows();
|
|
48 |
for (int i = 0; i < f.length; i++) {
|
|
49 |
IWindow v = f[i];
|
|
50 |
if (v instanceof View3D) {
|
|
51 |
View3D view3D = (View3D) v;
|
|
52 |
view3D.getCanvas3d().repaint();
|
|
53 |
}
|
|
54 |
}
|
|
55 |
temporalFilter = filter;
|
|
56 |
}
|
|
57 |
// System.out.println("Filtro aplicado a la capa_" + layer.getName());
|
|
58 |
|
|
59 |
}
|
|
60 |
|
|
61 |
public Object getAnimatedObject() {
|
|
62 |
return this.layer;
|
|
63 |
}
|
|
64 |
|
|
65 |
public String getClassName() {
|
|
66 |
return this.name;
|
|
67 |
}
|
|
68 |
|
|
69 |
public String getDescription() {
|
|
70 |
return this.description;
|
|
71 |
}
|
|
72 |
|
|
73 |
public String getName() {
|
|
74 |
return this.name;
|
|
75 |
}
|
|
76 |
|
|
77 |
public int getTypeTrack() {
|
|
78 |
return this.typeTrack;
|
|
79 |
}
|
|
80 |
|
|
81 |
public void setAnimatedObject(Object object) {
|
|
82 |
this.layer = (FLayer) object;
|
|
83 |
|
|
84 |
}
|
|
85 |
|
|
86 |
public void setTypeTrack(int typeTrack) {
|
|
87 |
this.typeTrack = typeTrack;
|
|
88 |
|
|
89 |
}
|
|
90 |
|
|
91 |
public void setClassName(String className) {
|
|
92 |
this.className = className;
|
|
93 |
}
|
|
94 |
|
|
95 |
public void setName(String name) {
|
|
96 |
this.name = name;
|
|
97 |
}
|
|
98 |
|
|
99 |
public void setDescription(String description) {
|
|
100 |
this.description = description;
|
|
101 |
}
|
|
102 |
|
|
103 |
public int getFilterMode() {
|
|
104 |
return filterMode;
|
|
105 |
}
|
|
106 |
|
|
107 |
public void setFilterMode(int filterMode) {
|
|
108 |
this.filterMode = filterMode;
|
|
109 |
}
|
|
110 |
|
|
111 |
}
|