Revision 35134
branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/ViewPort.java | ||
---|---|---|
52 | 52 |
import org.cresques.cts.GeoCalc; |
53 | 53 |
import org.cresques.cts.IProjection; |
54 | 54 |
import org.cresques.cts.UTM; |
55 |
import org.slf4j.Logger; |
|
56 |
import org.slf4j.LoggerFactory; |
|
57 |
|
|
55 | 58 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
56 | 59 |
import org.gvsig.fmap.geom.GeometryLocator; |
57 | 60 |
import org.gvsig.fmap.geom.GeometryManager; |
... | ... | |
61 | 64 |
import org.gvsig.fmap.mapcontext.events.ExtentEvent; |
62 | 65 |
import org.gvsig.fmap.mapcontext.events.ProjectionEvent; |
63 | 66 |
import org.gvsig.fmap.mapcontext.events.listeners.ViewPortListener; |
67 |
import org.gvsig.timesupport.Time; |
|
64 | 68 |
import org.gvsig.tools.ToolsLocator; |
65 | 69 |
import org.gvsig.tools.dynobject.DynStruct; |
66 | 70 |
import org.gvsig.tools.lang.Cloneable; |
... | ... | |
69 | 73 |
import org.gvsig.tools.persistence.PersistentState; |
70 | 74 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
71 | 75 |
import org.gvsig.tools.util.Callable; |
72 |
import org.slf4j.Logger; |
|
73 |
import org.slf4j.LoggerFactory; |
|
74 | 76 |
|
75 | 77 |
/** |
76 | 78 |
* <p> |
... | ... | |
175 | 177 |
* @see #setEnvelope(Envelope) |
176 | 178 |
*/ |
177 | 179 |
protected Rectangle2D extent; |
180 |
|
|
181 |
protected Time time; |
|
178 | 182 |
|
179 | 183 |
/** |
180 | 184 |
* <p> |
... | ... | |
1894 | 1898 |
// |
1895 | 1899 |
// return new Color(ret[0], ret[1], ret[2], ret[3]); |
1896 | 1900 |
// } |
1897 |
|
|
1901 |
|
|
1902 |
public Time getTime() { |
|
1903 |
return time; |
|
1904 |
} |
|
1905 |
|
|
1906 |
public void setTime(Time time) { |
|
1907 |
this.time = time; |
|
1908 |
} |
|
1898 | 1909 |
} |
branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/IntersectsTimeAndEnvelopeEvaluator.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.fmap.mapcontext.layers.vectorial; |
|
23 |
|
|
24 |
import org.cresques.cts.IProjection; |
|
25 |
|
|
26 |
import org.gvsig.fmap.dal.feature.Feature; |
|
27 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
28 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
29 |
import org.gvsig.timesupport.Time; |
|
30 |
import org.gvsig.tools.evaluator.EvaluatorData; |
|
31 |
import org.gvsig.tools.evaluator.EvaluatorException; |
|
32 |
|
|
33 |
|
|
34 |
/** |
|
35 |
* @author gvSIG Team |
|
36 |
* @version $Id$ |
|
37 |
* |
|
38 |
*/ |
|
39 |
public class IntersectsTimeAndEnvelopeEvaluator extends IntersectsEnvelopeEvaluator { |
|
40 |
private Time time; |
|
41 |
private String timeName; |
|
42 |
|
|
43 |
public IntersectsTimeAndEnvelopeEvaluator(Envelope envelope, Time time, |
|
44 |
IProjection envelopeProjection, FeatureType featureType, String geomName, String timeName) { |
|
45 |
super(envelope, envelopeProjection, featureType, geomName); |
|
46 |
this.time = time; |
|
47 |
this.timeName = timeName; |
|
48 |
} |
|
49 |
|
|
50 |
public Object evaluate(EvaluatorData data) throws EvaluatorException { |
|
51 |
if (((Boolean)super.evaluate(data)).booleanValue()){ |
|
52 |
Feature feature = ((Feature) data.getContextValue("feature")); |
|
53 |
return new Boolean(time.intersects((Time)feature.get(timeName))); |
|
54 |
} |
|
55 |
return new Boolean(false); |
|
56 |
} |
|
57 |
|
|
58 |
public String getName() { |
|
59 |
return "intersets with tima and envelope"; |
|
60 |
} |
|
61 |
|
|
62 |
public String getSQL() { |
|
63 |
// TODO add the time filter!!! |
|
64 |
return super.getSQL(); |
|
65 |
} |
|
66 |
} |
|
0 | 67 |
Also available in: Unified diff