Revision 43604
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<groupId>org.gvsig</groupId> |
|
6 |
<artifactId>org.gvsig.timesupport</artifactId> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<description>TimeSupport example project</description> |
|
10 |
<parent> |
|
11 |
<groupId>org.gvsig</groupId> |
|
12 |
<artifactId>org.gvsig.desktop.library</artifactId> |
|
13 |
<version>2.0.210</version> |
|
14 |
</parent> |
|
15 |
<build> |
|
16 |
<plugins> |
|
17 |
<plugin> |
|
18 |
<groupId>org.codehaus.mojo</groupId> |
|
19 |
<artifactId>animal-sniffer-maven-plugin</artifactId> |
|
20 |
<configuration> |
|
21 |
<skip>true</skip> |
|
22 |
</configuration> |
|
23 |
</plugin> |
|
24 |
|
|
25 |
</plugins> |
|
26 |
</build> |
|
27 |
<dependencyManagement> |
|
28 |
<dependencies> |
|
29 |
|
|
30 |
<dependency> |
|
31 |
<groupId>org.swinglabs</groupId> |
|
32 |
<artifactId>swingx</artifactId> |
|
33 |
<version>1.6</version> |
|
34 |
</dependency> |
|
35 |
<dependency> |
|
36 |
<groupId>com.toedter</groupId> |
|
37 |
<artifactId>jcalendar</artifactId> |
|
38 |
<version>1.3.2</version> |
|
39 |
</dependency> |
|
40 |
</dependencies> |
|
41 |
</dependencyManagement> |
|
42 |
|
|
43 |
|
|
44 |
<modules> |
|
45 |
<module>org.gvsig.timesupport.lib</module> |
|
46 |
<module>org.gvsig.timesupport.swing</module> |
|
47 |
</modules> |
|
48 |
|
|
49 |
</project> |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
|
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.timesupport.lib</artifactId> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.timesupport</artifactId> |
|
11 |
<version>2.0.210</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<modules> |
|
15 |
<module>org.gvsig.timesupport.lib.api</module> |
|
16 |
<module>org.gvsig.timesupport.lib.impl</module> |
|
17 |
</modules> |
|
18 |
</project> |
|
19 |
|
|
20 |
|
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/Time.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.timesupport; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* <p> |
|
27 |
* This object is in the top level of the time hierarchy. All the temporal |
|
28 |
* objects have to inherit of this interface. |
|
29 |
* </p> |
|
30 |
* |
|
31 |
* @see https://gvsig.org/web/projects/gvsig-desktop/docs/devel/org-gvsig-sensors/1-0.0/analysis-and-design/detailed-view/time-support/libraries/org-gvsig-timesupport-lib |
|
32 |
* |
|
33 |
* @author gvSIG Team |
|
34 |
* @version $Id$ |
|
35 |
* |
|
36 |
*/ |
|
37 |
public interface Time { |
|
38 |
|
|
39 |
/** |
|
40 |
* Does this time intersects with the time passed. |
|
41 |
* @param time |
|
42 |
* an instant to check against, null means now |
|
43 |
* @return |
|
44 |
* <code>true</code> if the time intersects with the time passed in |
|
45 |
*/ |
|
46 |
public boolean intersects(Time time); |
|
47 |
|
|
48 |
/** |
|
49 |
* Checks if the time is a relative temporal type, that is an object that has |
|
50 |
* a Chronology that establish how a time object can be converted into other |
|
51 |
* object with date time fields. |
|
52 |
* @return |
|
53 |
* <code>true</code) if the time object is relative |
|
54 |
*/ |
|
55 |
public boolean isRelative(); |
|
56 |
|
|
57 |
/** |
|
58 |
* Checks if the time is an absolute temporal type, that is an object that doesn't |
|
59 |
* has a time zone. |
|
60 |
* @return |
|
61 |
* <code>true</code> if the time object is absolute |
|
62 |
*/ |
|
63 |
public boolean isAbsolute(); |
|
64 |
|
|
65 |
/** |
|
66 |
* Checks if the time is an interval, that is an object that represents |
|
67 |
* a period of time between two instants. |
|
68 |
* @return |
|
69 |
* <code>true</code> if the time object is an interval |
|
70 |
*/ |
|
71 |
public boolean isInterval(); |
|
72 |
|
|
73 |
/** |
|
74 |
* Checks if the time is an instant, that is an object that represents |
|
75 |
* a position in a time scale. In practice, an instant is an interval |
|
76 |
* whose duration is less than the resolution of the time scale. |
|
77 |
* @return |
|
78 |
* <code>true</code> if the time object is an instant. |
|
79 |
*/ |
|
80 |
public boolean isInstant(); |
|
81 |
|
|
82 |
/** |
|
83 |
* Gets the chronology of the instant. The Chronology provides conversion |
|
84 |
* from the millisecond value to meaningful fields in a particular calendar system. |
|
85 |
* @return |
|
86 |
* the Chronology, never null |
|
87 |
*/ |
|
88 |
public Chronology getChronology(); |
|
89 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/DataTypes.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.timesupport; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* <p> |
|
27 |
* This interface defines a set of constants for basic time data types. |
|
28 |
* </p> |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
* @version $Id$ |
|
32 |
* |
|
33 |
*/ |
|
34 |
public interface DataTypes extends org.gvsig.tools.dataTypes.DataTypes { |
|
35 |
|
|
36 |
public static final int INSTANT = OBJECT + 4; |
|
37 |
public static final int INTERVAL = OBJECT + 5; |
|
38 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/AbsoluteInstantTypeNotRegisteredException.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.timesupport; |
|
23 |
|
|
24 |
/** |
|
25 |
* Exception thrown when there is an error getting a TimeSupport message. |
|
26 |
* |
|
27 |
* @author gvSIG team |
|
28 |
* @version $Id$ |
|
29 |
*/ |
|
30 |
public class AbsoluteInstantTypeNotRegisteredException extends TimeSupportException { |
|
31 |
|
|
32 |
private static final long serialVersionUID = -4051458353306878010L; |
|
33 |
|
|
34 |
private static final String MESSAGE = |
|
35 |
"An error has been produced " + "getting the AbsoluteInstantTypeNotRegisteredException"; |
|
36 |
|
|
37 |
private static final String KEY = "_AbsoluteInstantTypeNotRegisteredException"; |
|
38 |
|
|
39 |
/** |
|
40 |
* Creates a new {@link AbsoluteInstantTypeNotRegisteredException}. |
|
41 |
* |
|
42 |
* @param cause |
|
43 |
* the original cause |
|
44 |
*/ |
|
45 |
public AbsoluteInstantTypeNotRegisteredException(int dateTimeFieldTypeNotRegisteredException) { |
|
46 |
super(MESSAGE, null, KEY, serialVersionUID); |
|
47 |
} |
|
48 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/animation/TimeAnimationDataModel.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.timesupport.animation; |
|
23 |
|
|
24 |
import org.gvsig.timesupport.RelativeInstant; |
|
25 |
|
|
26 |
/** |
|
27 |
* Data model for animation. This is useful to configure the animation |
|
28 |
* parameters. When the animation runs read the values of this object. |
|
29 |
* |
|
30 |
* @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a> |
|
31 |
* |
|
32 |
*/ |
|
33 |
public interface TimeAnimationDataModel { |
|
34 |
public static final int PLAY = 0; |
|
35 |
public static final int STOP = 1; |
|
36 |
public static final int PAUSE = 2; |
|
37 |
public static final int CLOSE = 3; |
|
38 |
|
|
39 |
public static final int ACCEPT = 0; |
|
40 |
public static final int CANCEL = 1; |
|
41 |
|
|
42 |
//************************* |
|
43 |
|
|
44 |
/** |
|
45 |
* Assigns the window time. The scale is the selected with the |
|
46 |
* method setWindowScale. |
|
47 |
* @param windowTime |
|
48 |
* Window of time of each step |
|
49 |
*/ |
|
50 |
public void setWindowTime(int windowTime); |
|
51 |
|
|
52 |
/** |
|
53 |
* Gets the window time. The scale is the selected with the |
|
54 |
* method setWindowScale. |
|
55 |
*/ |
|
56 |
public int getWindowTime(); |
|
57 |
|
|
58 |
/** |
|
59 |
* Gets the initial speed in milliseconds |
|
60 |
* @param speed |
|
61 |
*/ |
|
62 |
public int getTimeStep(); |
|
63 |
|
|
64 |
/** |
|
65 |
* Sets the animation speed |
|
66 |
* @param speed |
|
67 |
* Speed in milliseconds |
|
68 |
*/ |
|
69 |
public void setTimeStep(int timeStep); |
|
70 |
|
|
71 |
/** |
|
72 |
* Returns a constant defined in TimeAnimation. This constant represents the |
|
73 |
* scale of time of the window (year, month, day, ...) |
|
74 |
* @return |
|
75 |
*/ |
|
76 |
public int getWindowTimeScale(); |
|
77 |
|
|
78 |
/** |
|
79 |
* Assigns a constant defined in TimeAnimation. This constant represents the |
|
80 |
* scale of time of the window (year, month, day, ...) |
|
81 |
* @return |
|
82 |
*/ |
|
83 |
public void setWindowTimeScale(int windowTimeScale); |
|
84 |
|
|
85 |
/** |
|
86 |
* Returns a constant defined in TimeAnimation. This constant represents the |
|
87 |
* scale of time of the time step (year, month, day, ...) |
|
88 |
* @return |
|
89 |
*/ |
|
90 |
public int getTimeStepScale(); |
|
91 |
|
|
92 |
/** |
|
93 |
* Assigns a constant defined in TimeAnimation. This constant represents the |
|
94 |
* scale of time of the time step (year, month, day, ...) |
|
95 |
* @return |
|
96 |
*/ |
|
97 |
public void setTimeStepScale(int timeStepScale); |
|
98 |
|
|
99 |
//************************* |
|
100 |
|
|
101 |
/** |
|
102 |
* Gets the time step initial value in the text field |
|
103 |
* @param timeStep |
|
104 |
*/ |
|
105 |
public int getSpeed(); |
|
106 |
|
|
107 |
/** |
|
108 |
* Sets the speed of progress |
|
109 |
* @param speed |
|
110 |
*/ |
|
111 |
public void setSpeed(int speed); |
|
112 |
|
|
113 |
/** |
|
114 |
* Gets the number of iterations |
|
115 |
* @return |
|
116 |
*/ |
|
117 |
public int getIterations(); |
|
118 |
|
|
119 |
/** |
|
120 |
* Sets the number of iterations |
|
121 |
* @param iterations |
|
122 |
*/ |
|
123 |
public void setIterations(int iterations); |
|
124 |
|
|
125 |
/** |
|
126 |
* Gets the number of loops |
|
127 |
* @return |
|
128 |
*/ |
|
129 |
public int getLoop(); |
|
130 |
|
|
131 |
/** |
|
132 |
* Sets the number of loops |
|
133 |
* @return |
|
134 |
*/ |
|
135 |
public void setLoop(int loop); |
|
136 |
|
|
137 |
//*************************** |
|
138 |
|
|
139 |
/** |
|
140 |
* Sets the time window to visualize in each time instant. The time window is the |
|
141 |
* amount of data to show in each step. At the beginning this window goes from the |
|
142 |
* initial data time. When the animation has been started this window is moving along |
|
143 |
* the time line. |
|
144 |
* @param start |
|
145 |
* Instant in which the animation starts |
|
146 |
* @param end |
|
147 |
* Instant in which the animation ends |
|
148 |
*/ |
|
149 |
public void setTimeWindow(RelativeInstant start, RelativeInstant end); |
|
150 |
|
|
151 |
/** |
|
152 |
* Gets the end of the time window to visualize in each time instant. The time window is the |
|
153 |
* amount of data to show in each step. At the beginning this window goes from the |
|
154 |
* initial data time. When the animation has been started this window is moving along |
|
155 |
* the time line. |
|
156 |
* @return {@link RelativeInstant} |
|
157 |
*/ |
|
158 |
public RelativeInstant getEndTimeWindow(); |
|
159 |
|
|
160 |
/** |
|
161 |
* Gets the begin of the time window to visualize in each time instant. The time window is the |
|
162 |
* amount of data to show in each step. At the beginning this window goes from the |
|
163 |
* initial data time. When the animation has been started this window is moving along |
|
164 |
* the time line. |
|
165 |
* @return {@link RelativeInstant} |
|
166 |
*/ |
|
167 |
public RelativeInstant getInitTimeWindow(); |
|
168 |
|
|
169 |
//*************************** |
|
170 |
|
|
171 |
/** |
|
172 |
* Sets the time interval. The time interval contains two date. The start date is the moment |
|
173 |
* in which the animation starts and in the end date the animation ends. |
|
174 |
* @param timeWindowValue |
|
175 |
*/ |
|
176 |
public void setTimeInterval(RelativeInstant start, RelativeInstant end); |
|
177 |
|
|
178 |
/** |
|
179 |
* Gets the initial date of the time window to visualize in each time instant. |
|
180 |
* The time window is the amount of data to show in each step. |
|
181 |
* @return {@link RelativeInstant} |
|
182 |
*/ |
|
183 |
public RelativeInstant getInitTime(); |
|
184 |
|
|
185 |
/** |
|
186 |
* Gets the end date of the time window to visualize in each time instant. |
|
187 |
* The time window is the amount of data to show in each step. |
|
188 |
* @return {@link RelativeInstant} |
|
189 |
*/ |
|
190 |
public RelativeInstant getEndTime(); |
|
191 |
|
|
192 |
//*************************** |
|
193 |
|
|
194 |
/** |
|
195 |
* Gets an array of seven values. Each element of this |
|
196 |
* array represents the number of years, months, days, hours, |
|
197 |
* minutes, seconds and milliseconds of a window time. |
|
198 |
*/ |
|
199 |
public int[] getWindowTimeByPartOfData(); |
|
200 |
|
|
201 |
/** |
|
202 |
* Gets an array of seven values. Each element of this |
|
203 |
* array represents the number of years, months, days, hours, |
|
204 |
* minutes, seconds and milliseconds of a step. |
|
205 |
*/ |
|
206 |
public int[] getStepByPartOfData(); |
|
207 |
|
|
208 |
/** |
|
209 |
* Gets the slider position. This position is specified in real time. |
|
210 |
* @return {@link RelativeInstant} |
|
211 |
*/ |
|
212 |
public RelativeInstant getSliderPosition(); |
|
213 |
|
|
214 |
/** |
|
215 |
* Assigns the slider position. This position is specified in real time. |
|
216 |
* @param position |
|
217 |
*/ |
|
218 |
public void setSliderPosition(RelativeInstant position); |
|
219 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/animation/AnimateClient.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.timesupport.animation; |
|
23 |
|
|
24 |
import org.gvsig.timesupport.RelativeInstant; |
|
25 |
|
|
26 |
/** |
|
27 |
* This interface should be implemented by clients of this module. The |
|
28 |
* library calls update function each time that an increment happen. |
|
29 |
* |
|
30 |
* @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a> |
|
31 |
* |
|
32 |
*/ |
|
33 |
public interface AnimateClient { |
|
34 |
/** |
|
35 |
* Updates the animation client |
|
36 |
* @param startDateTime |
|
37 |
* Date when the step starts |
|
38 |
* @param endDateTime |
|
39 |
* Date when the step ends |
|
40 |
*/ |
|
41 |
public void update(RelativeInstant startDateTime, RelativeInstant endDateTime); |
|
42 |
|
|
43 |
/** |
|
44 |
* This event is thrown when an iteration finishes. An iteration is a complete |
|
45 |
* cycle from the start date to the finish date. |
|
46 |
* @param endDateTime |
|
47 |
* Date when the iteration ends |
|
48 |
*/ |
|
49 |
public void endIteration(RelativeInstant endDateTime); |
|
50 |
|
|
51 |
/** |
|
52 |
* This event is thrown when the animation finishes |
|
53 |
*/ |
|
54 |
public void end(); |
|
55 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/animation/TimeAnimation.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.timesupport.animation; |
|
23 |
|
|
24 |
/** |
|
25 |
* Time animation main interface. That is the main interface to control an |
|
26 |
* animation by time. |
|
27 |
* |
|
28 |
* @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a> |
|
29 |
* |
|
30 |
*/ |
|
31 |
public interface TimeAnimation { |
|
32 |
public static final int YEAR = 0; |
|
33 |
public static final int MONTH = 1; |
|
34 |
public static final int WEEK = 2; |
|
35 |
public static final int DAY = 3; |
|
36 |
public static final int HOUR = 4; |
|
37 |
public static final int MINUTE = 5; |
|
38 |
public static final int SECOND = 6; |
|
39 |
public static final int MILLISECOND = 7; |
|
40 |
|
|
41 |
public static final int NO_LOOP = 0; |
|
42 |
public static final int LOOP = 1; |
|
43 |
public static final int LOOP_N = 2; |
|
44 |
|
|
45 |
/** |
|
46 |
* Gets the data model for time animation. Data model contains |
|
47 |
* the time window, the step, the speed of progress and other |
|
48 |
* information about an animation |
|
49 |
* @return {@link TimeAnimationDataModel} |
|
50 |
*/ |
|
51 |
public TimeAnimationDataModel getDataModel(); |
|
52 |
|
|
53 |
/** |
|
54 |
* Sets the client which receives events from the animation |
|
55 |
* @param client |
|
56 |
* Interface with the functions to call when the animation increase a step, ends |
|
57 |
* or an iteration ends |
|
58 |
*/ |
|
59 |
public void setAnimateClient(AnimateClient client); |
|
60 |
|
|
61 |
/** |
|
62 |
* Stops the animation |
|
63 |
*/ |
|
64 |
public void stopAnimation(); |
|
65 |
|
|
66 |
/** |
|
67 |
* Pauses the animation |
|
68 |
*/ |
|
69 |
public void pauseAnimation(); |
|
70 |
|
|
71 |
/** |
|
72 |
* Starts the animation |
|
73 |
*/ |
|
74 |
public void startAnimation(); |
|
75 |
|
|
76 |
/** |
|
77 |
* Tests if this thread is alive. A thread is alive if it has been started and has not yet died. |
|
78 |
*/ |
|
79 |
public boolean isAlive(); |
|
80 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/AbsoluteIntervalTypeNotRegisteredException.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.timesupport; |
|
23 |
|
|
24 |
/** |
|
25 |
* Exception thrown when there is an error getting a TimeSupport message. |
|
26 |
* |
|
27 |
* @author gvSIG team |
|
28 |
* @version $Id$ |
|
29 |
*/ |
|
30 |
public class AbsoluteIntervalTypeNotRegisteredException extends TimeSupportException { |
|
31 |
|
|
32 |
private static final long serialVersionUID = -4051458353306878010L; |
|
33 |
|
|
34 |
private static final String MESSAGE = |
|
35 |
"An error has been produced " + "getting the AbsoluteIntervalTypeNotRegisteredException"; |
|
36 |
|
|
37 |
private static final String KEY = "_absoluteIntervalTypeNotRegisteredException"; |
|
38 |
|
|
39 |
/** |
|
40 |
* Creates a new {@link AbsoluteIntervalTypeNotRegisteredException}. |
|
41 |
* |
|
42 |
* @param cause |
|
43 |
* the original cause |
|
44 |
*/ |
|
45 |
public AbsoluteIntervalTypeNotRegisteredException(int durationFieldTypeNotRegisteredException) { |
|
46 |
super(MESSAGE, null, KEY, serialVersionUID); |
|
47 |
} |
|
48 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/EditableRelativeInstant.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.timesupport; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* <p> |
|
27 |
* The {@link RelativeInstant} ins inmutable, but sometimes is necessary to |
|
28 |
* edit it. This class is an editable copy of a realtive instant that |
|
29 |
* cab be edited. |
|
30 |
* </p> |
|
31 |
* <p> |
|
32 |
* A huge part of the documentation of this class has been retrieved |
|
33 |
* from the joda-time library. |
|
34 |
* </p> |
|
35 |
* |
|
36 |
* @see http://joda-time.sourceforge.net |
|
37 |
* @see https://gvsig.org/web/projects/gvsig-desktop/docs/devel/org-gvsig-sensors/1-0.0/analysis-and-design/detailed-view/time-support/libraries/org-gvsig-timesupport-lib |
|
38 |
* |
|
39 |
* @author gvSIG Team |
|
40 |
* @version $Id$ |
|
41 |
* |
|
42 |
*/ |
|
43 |
public interface EditableRelativeInstant extends RelativeInstant{ |
|
44 |
|
|
45 |
/** |
|
46 |
* Set the time from fields. The date part of this object will be unaffected. |
|
47 |
* |
|
48 |
* @param hour |
|
49 |
* the hour |
|
50 |
* @param minuteOfHour |
|
51 |
* the minute of the hour |
|
52 |
* @param secondOfMinute |
|
53 |
* the second of the minute |
|
54 |
* @param millisOfSecond |
|
55 |
* the millisecond of the second |
|
56 |
* @throws IllegalArgumentException if the value is invalid |
|
57 |
* |
|
58 |
*/ |
|
59 |
public void setTime(final int hour, final int minuteOfHour, final int secondOfMinute, final int millisOfSecond); |
|
60 |
|
|
61 |
/** |
|
62 |
* Set the date from fields. The time part of this object will be unaffected. |
|
63 |
* |
|
64 |
* @param year |
|
65 |
* the year |
|
66 |
* @param monthOfYear |
|
67 |
* the month of the year |
|
68 |
* @param dayOfMonth |
|
69 |
* the day of the month |
|
70 |
* @throws IllegalArgumentException if the value is invalid |
|
71 |
*/ |
|
72 |
public void setDate(final int year, final int monthOfYear, final int dayOfMonth); |
|
73 |
|
|
74 |
/** |
|
75 |
* Add a number of years to the date. |
|
76 |
* |
|
77 |
* @param years the years to add |
|
78 |
* @throws IllegalArgumentException if the value is invalid |
|
79 |
*/ |
|
80 |
public void addYears(final int years); |
|
81 |
|
|
82 |
/** |
|
83 |
* Add a number of days to the date. |
|
84 |
* |
|
85 |
* @param days |
|
86 |
* the days to add |
|
87 |
* @throws IllegalArgumentException if the value is invalid |
|
88 |
*/ |
|
89 |
public void addDays(final int days); |
|
90 |
|
|
91 |
/** |
|
92 |
* Add a number of hours to the date. |
|
93 |
* |
|
94 |
* @param hours |
|
95 |
* the hours to add |
|
96 |
* @throws IllegalArgumentException if the value is invalid |
|
97 |
*/ |
|
98 |
public void addHours(final int hours); |
|
99 |
|
|
100 |
/** |
|
101 |
* Add a number of minutes to the date. |
|
102 |
* |
|
103 |
* @param minutes |
|
104 |
* the minutes to add |
|
105 |
* @throws IllegalArgumentException if the value is invalid |
|
106 |
*/ |
|
107 |
public void addMinutes(final int minutes); |
|
108 |
|
|
109 |
/** |
|
110 |
* Add a number of seconds to the date. |
|
111 |
* |
|
112 |
* @param seconds |
|
113 |
* the seconds to add |
|
114 |
* @throws IllegalArgumentException if the value is invalid |
|
115 |
*/ |
|
116 |
public void addSeconds(final int seconds); |
|
117 |
|
|
118 |
/** |
|
119 |
* Add a number of millis to the date. |
|
120 |
* |
|
121 |
* @param millis |
|
122 |
* the millis to add |
|
123 |
* @throws IllegalArgumentException if the value is invalid |
|
124 |
*/ |
|
125 |
public void addMillis(final int millis); |
|
126 |
} |
|
127 |
|
|
128 |
|
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/TimeSupportException.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.timesupport; |
|
23 |
|
|
24 |
import org.gvsig.tools.exception.BaseException; |
|
25 |
|
|
26 |
/** |
|
27 |
* Generic exception thrown in the TimeSupport API when the exception or error |
|
28 |
* may be dealt by the program or the user of the program which is a client of |
|
29 |
* the TimeSupport API. |
|
30 |
* |
|
31 |
* @see {@link TimeFactoryService} |
|
32 |
* @see {@link TimeSupportManager} |
|
33 |
* @author gvSIG team. |
|
34 |
* @version $Id$ |
|
35 |
*/ |
|
36 |
public class TimeSupportException extends BaseException { |
|
37 |
|
|
38 |
private static final long serialVersionUID = 6756475060924237176L; |
|
39 |
|
|
40 |
private static final String MESSAGE = |
|
41 |
"An error has been produced in the TimeSupport library"; |
|
42 |
|
|
43 |
private static final String KEY = "_TimeSupportException"; |
|
44 |
|
|
45 |
/** |
|
46 |
* Constructor to be used in rare cases, usually you must create a new child |
|
47 |
* exception class for each case. |
|
48 |
* <strong>Don't use this constructor in child classes.</strong> |
|
49 |
*/ |
|
50 |
public TimeSupportException() { |
|
51 |
super(MESSAGE, KEY, serialVersionUID); |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* Constructor to be used in rare cases, usually you must create a new child |
|
56 |
* exception class for each case. |
|
57 |
* <p> |
|
58 |
* <strong>Don't use this constructor in child classes.</strong> |
|
59 |
* </p> |
|
60 |
* |
|
61 |
* @param cause |
|
62 |
* the original cause of the exception |
|
63 |
*/ |
|
64 |
public TimeSupportException(Exception cause) { |
|
65 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* @see BaseException#BaseException(String, String, long). |
|
70 |
* @param message |
|
71 |
* the default messageFormat to describe the exception |
|
72 |
* @param key |
|
73 |
* the key to use to search a localized messageFormnata |
|
74 |
* @param code |
|
75 |
* the unique code to identify the exception |
|
76 |
*/ |
|
77 |
protected TimeSupportException(String message, String key, long code) { |
|
78 |
super(message, key, code); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
83 |
* @param message |
|
84 |
* the default messageFormat to describe the exception |
|
85 |
* @param cause |
|
86 |
* the original cause of the exception |
|
87 |
* @param key |
|
88 |
* the key to use to search a localized messageFormnata |
|
89 |
* @param code |
|
90 |
* the unique code to identify the exception |
|
91 |
*/ |
|
92 |
protected TimeSupportException(String message, Throwable cause, |
|
93 |
String key, long code) { |
|
94 |
super(message, cause, key, code); |
|
95 |
} |
|
96 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/RelativeInstant.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.timesupport; |
|
23 |
|
|
24 |
import java.util.Date; |
|
25 |
|
|
26 |
import org.gvsig.tools.lang.Cloneable; |
|
27 |
|
|
28 |
/** |
|
29 |
* <p> |
|
30 |
* A relative instant is defined like an instant in the datetime continuum |
|
31 |
* specified as a number of milliseconds from 1970-01-01T00:00Z. This definition |
|
32 |
* of milliseconds is consistent with that of the JDK in Date or Calendar. |
|
33 |
* </p> |
|
34 |
* <p>It contains also a Chronology which determines how the millisecond |
|
35 |
* instant value is converted into the date time fields. The default Chronology |
|
36 |
* can be set using the {@link TimeSupportManager} class. (e.g: 1st January 2010) |
|
37 |
* </p> |
|
38 |
* <p> |
|
39 |
* A huge part of the documentation of this class has been retrieved |
|
40 |
* from the joda-time library. |
|
41 |
* </p> |
|
42 |
* |
|
43 |
* @see http://joda-time.sourceforge.net |
|
44 |
* @see https://gvsig.org/web/projects/gvsig-desktop/docs/devel/org-gvsig-sensors/1-0.0/analysis-and-design/detailed-view/time-support/libraries/org-gvsig-timesupport-lib |
|
45 |
* |
|
46 |
* @author gvSIG team |
|
47 |
* @version $Id$ |
|
48 |
*/ |
|
49 |
public interface RelativeInstant extends Instant, Cloneable{ |
|
50 |
|
|
51 |
/** |
|
52 |
* Get the date time as a <code>java.util.Date</code>. |
|
53 |
* <p> |
|
54 |
* The <code>Date</code> object created has exactly the same millisecond |
|
55 |
* instant as this object. |
|
56 |
* </p> |
|
57 |
* |
|
58 |
* @return |
|
59 |
* a Date initialised with this relative instant |
|
60 |
*/ |
|
61 |
public Date toDate(); |
|
62 |
|
|
63 |
/** |
|
64 |
* Compares this object with the specified object for ascending |
|
65 |
* millisecond instant order. This ordering is inconsistent with |
|
66 |
* equals, as it ignores the Chronology. |
|
67 |
* |
|
68 |
* @param instant |
|
69 |
* a readable instant to check against |
|
70 |
* @return |
|
71 |
* negative value if this is less, 0 if equal, or positive |
|
72 |
* value if greater |
|
73 |
*/ |
|
74 |
public int compareTo(Instant instant); |
|
75 |
|
|
76 |
/** |
|
77 |
* Gets the milliseconds of the datetime instant from the Java epoch |
|
78 |
* of 1970-01-01T00:00:00Z. |
|
79 |
* |
|
80 |
* @return |
|
81 |
* the number of milliseconds since 1970-01-01T00:00:00Z |
|
82 |
*/ |
|
83 |
public long toMillis(); |
|
84 |
|
|
85 |
/** |
|
86 |
* Get the year field value. |
|
87 |
* |
|
88 |
* @return |
|
89 |
* the year |
|
90 |
*/ |
|
91 |
public int getYear(); |
|
92 |
|
|
93 |
/** |
|
94 |
* Get the month of year field value. |
|
95 |
* |
|
96 |
* @return |
|
97 |
* the month of year |
|
98 |
*/ |
|
99 |
public int getMonthOfYear(); |
|
100 |
|
|
101 |
/** |
|
102 |
* Get the day of month field value. |
|
103 |
* |
|
104 |
* @return |
|
105 |
* the day of month |
|
106 |
*/ |
|
107 |
public int getDayOfMonth(); |
|
108 |
|
|
109 |
/** |
|
110 |
* Get the hour of day field value. |
|
111 |
* |
|
112 |
* @return |
|
113 |
* the hour of month |
|
114 |
*/ |
|
115 |
public int getHourOfDay(); |
|
116 |
|
|
117 |
/** |
|
118 |
* Get the minute of day field value. |
|
119 |
* |
|
120 |
* @return |
|
121 |
* the minute of day |
|
122 |
*/ |
|
123 |
public int getMinuteOfDay(); |
|
124 |
|
|
125 |
/** |
|
126 |
* Get the minute of hour field value. |
|
127 |
* |
|
128 |
* @return |
|
129 |
* the minute of hour |
|
130 |
*/ |
|
131 |
public int getMinuteOfHour(); |
|
132 |
|
|
133 |
/** |
|
134 |
* Get the second of day field value. |
|
135 |
* |
|
136 |
* @return |
|
137 |
* the second of day |
|
138 |
*/ |
|
139 |
public int getSecondOfDay(); |
|
140 |
|
|
141 |
/** |
|
142 |
* Get the second of minute field value. |
|
143 |
* |
|
144 |
* @return |
|
145 |
* the second of minute |
|
146 |
*/ |
|
147 |
public int getSecondOfMinute(); |
|
148 |
|
|
149 |
/** |
|
150 |
* Get the millis of second field value. |
|
151 |
* |
|
152 |
* @return |
|
153 |
* the millis of second |
|
154 |
*/ |
|
155 |
public int getMillisOfSecond(); |
|
156 |
|
|
157 |
/** |
|
158 |
* Get an editable copy used to edit other instance of |
|
159 |
* a relative instant. The new copy is initialized with |
|
160 |
* the values of this intant. |
|
161 |
* |
|
162 |
* @return |
|
163 |
* a copy to edit the instant |
|
164 |
*/ |
|
165 |
public EditableRelativeInstant getEditableCopy(); |
|
166 |
|
|
167 |
/** |
|
168 |
* Output the instant using the specified format pattern. |
|
169 |
* |
|
170 |
* @param |
|
171 |
* pattern the pattern specification, null means |
|
172 |
* use <code>toString</code> |
|
173 |
*/ |
|
174 |
public String toString(String pattern); |
|
175 |
} |
|
176 |
|
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.timesupport package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>TimeSupport library API.</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
It allows to get new TimeSupport and get their text. |
|
14 |
</p> |
|
15 |
|
|
16 |
</body> |
|
17 |
</html> |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/TimeSupportLocator.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.timesupport; |
|
23 |
|
|
24 |
import org.gvsig.tools.locator.BaseLocator; |
|
25 |
import org.gvsig.tools.locator.Locator; |
|
26 |
import org.gvsig.tools.locator.LocatorException; |
|
27 |
|
|
28 |
/** |
|
29 |
* This locator is the entry point for the TimeSupport library, providing |
|
30 |
* access to all TimeSupport services through the {@link TimeSupportManager} |
|
31 |
* . |
|
32 |
* |
|
33 |
* @author gvSIG team |
|
34 |
* @version $Id$ |
|
35 |
*/ |
|
36 |
public class TimeSupportLocator extends BaseLocator { |
|
37 |
|
|
38 |
/** |
|
39 |
* TimeSupport manager name. |
|
40 |
*/ |
|
41 |
public static final String MANAGER_NAME = "TimeSupport.manager"; |
|
42 |
|
|
43 |
/** |
|
44 |
* TimeSupport manager description. |
|
45 |
*/ |
|
46 |
public static final String MANAGER_DESCRIPTION = "TimeSupport Manager"; |
|
47 |
|
|
48 |
private static final String LOCATOR_NAME = "TimeSupport.locator"; |
|
49 |
|
|
50 |
/** |
|
51 |
* Unique instance. |
|
52 |
*/ |
|
53 |
private static final TimeSupportLocator INSTANCE = |
|
54 |
new TimeSupportLocator(); |
|
55 |
|
|
56 |
/** |
|
57 |
* Return the singleton instance. |
|
58 |
* |
|
59 |
* @return the singleton instance |
|
60 |
*/ |
|
61 |
public static TimeSupportLocator getInstance() { |
|
62 |
return INSTANCE; |
|
63 |
} |
|
64 |
|
|
65 |
/** |
|
66 |
* Return the Locator's name. |
|
67 |
* |
|
68 |
* @return a String with the Locator's name |
|
69 |
*/ |
|
70 |
public final String getLocatorName() { |
|
71 |
return LOCATOR_NAME; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Return a reference to the TimeSupportManager. |
|
76 |
* |
|
77 |
* @return a reference to the TimeSupportManager |
|
78 |
* @throws LocatorException |
|
79 |
* if there is no access to the class or the class cannot be |
|
80 |
* instantiated |
|
81 |
* @see Locator#get(String) |
|
82 |
*/ |
|
83 |
public static TimeSupportManager getManager() throws LocatorException { |
|
84 |
return (TimeSupportManager) getInstance().get(MANAGER_NAME); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* Registers the Class implementing the TimeSupportManager interface. |
|
89 |
* |
|
90 |
* @param clazz |
|
91 |
* implementing the TimeSupportManager interface |
|
92 |
*/ |
|
93 |
public static void registerManager( |
|
94 |
Class<? extends TimeSupportManager> clazz) { |
|
95 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
96 |
} |
|
97 |
|
|
98 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/AbsoluteInstant.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.timesupport; |
|
23 |
|
|
24 |
import org.gvsig.tools.lang.Cloneable; |
|
25 |
|
|
26 |
|
|
27 |
/** |
|
28 |
* <p> |
|
29 |
* It defines a partial time that does not support every datetime field, |
|
30 |
* and is thus a local time. It cannot be compared to a {@link RelativeInstant}, |
|
31 |
* as it does not fully specify an instant in time. |
|
32 |
* </p> |
|
33 |
* <p> |
|
34 |
* The time it does specify is a local time, and does not include a time zone. |
|
35 |
* An AbsoluteInstant supports a subset of the fields on the chronology. |
|
36 |
* </p> |
|
37 |
* <p> |
|
38 |
* A huge part of the documentation of this class has been retrieved |
|
39 |
* from the joda-time library. |
|
40 |
* </p> |
|
41 |
* |
|
42 |
* @see http://joda-time.sourceforge.net |
|
43 |
* @see https://gvsig.org/web/projects/gvsig-desktop/docs/devel/org-gvsig-sensors/1-0.0/analysis-and-design/detailed-view/time-support/libraries/org-gvsig-timesupport-lib |
|
44 |
* |
|
45 |
* @author gvSIG team |
|
46 |
* @version $Id$ |
|
47 |
*/ |
|
48 |
public interface AbsoluteInstant extends Instant, Cloneable{ |
|
49 |
|
|
50 |
/** |
|
51 |
* Gets the number of fields in this absolute instant. |
|
52 |
* @return |
|
53 |
* the field count |
|
54 |
*/ |
|
55 |
public int size(); |
|
56 |
|
|
57 |
/** |
|
58 |
* Gets the field type at the specified index. |
|
59 |
* @param index |
|
60 |
* the index to retrieve |
|
61 |
* @return |
|
62 |
* the field at the specified index |
|
63 |
*/ |
|
64 |
public AbsoluteInstantType getFieldType(int index); |
|
65 |
|
|
66 |
/** |
|
67 |
* Gets the value of the field at the specifed index. |
|
68 |
* @param index |
|
69 |
* the index |
|
70 |
* @return the value |
|
71 |
* @throws IndexOutOfBoundsException if the index is invalid |
|
72 |
*/ |
|
73 |
public int getValue(int index); |
|
74 |
|
|
75 |
/** |
|
76 |
* Gets the number of years of this absolute instant. |
|
77 |
* @return |
|
78 |
* the number of years |
|
79 |
*/ |
|
80 |
public int getYears(); |
|
81 |
|
|
82 |
/** |
|
83 |
* Gets the number of months of this absolute instant. |
|
84 |
* @return |
|
85 |
* the number of months |
|
86 |
*/ |
|
87 |
public int getMonths(); |
|
88 |
|
|
89 |
/** |
|
90 |
* Gets the number of weeks of this absolute instant. |
|
91 |
* @return |
|
92 |
* the number of weeks |
|
93 |
*/ |
|
94 |
public int getWeeks(); |
|
95 |
|
|
96 |
/** |
|
97 |
* Gets the number of days of this absolute instant. |
|
98 |
* @return |
|
99 |
* the number of days |
|
100 |
*/ |
|
101 |
public int getDays(); |
|
102 |
|
|
103 |
/** |
|
104 |
* Gets the number of hours of this absolute instant. |
|
105 |
* @return |
|
106 |
* the number of hours |
|
107 |
*/ |
|
108 |
public int getHours(); |
|
109 |
|
|
110 |
/** |
|
111 |
* Gets the number of minutes of this absolute instant. |
|
112 |
* @return |
|
113 |
* the number of minutes |
|
114 |
*/ |
|
115 |
public int getMinutes(); |
|
116 |
|
|
117 |
/** |
|
118 |
* Gets the number of seconds of this absolute instant. |
|
119 |
* @return |
|
120 |
* the number of seconds |
|
121 |
*/ |
|
122 |
public int getSeconds(); |
|
123 |
|
|
124 |
/** |
|
125 |
* Gets the number of millis of this absolute instant. |
|
126 |
* @return |
|
127 |
* the number of millis |
|
128 |
*/ |
|
129 |
public int getMillis(); |
|
130 |
|
|
131 |
/** |
|
132 |
* Gets the duration of the instant. It returns a duration assuming a 365 |
|
133 |
* days year, 12 months year, 30 days month, 7 day week, 24 hour day, 60 minute hour, |
|
134 |
* 60 second minute and 1000 millis second. |
|
135 |
* @return |
|
136 |
* a duration equivalent to this instant from the time 0 |
|
137 |
*/ |
|
138 |
public Duration toStandardDuration(); |
|
139 |
|
|
140 |
/** |
|
141 |
* Gets a copy of this instance with the specified period take away. |
|
142 |
* If the amount is zero or null, then <code>this</code> is returned. * |
|
143 |
* @param period |
|
144 |
* the period to reduce this instant by |
|
145 |
* @return |
|
146 |
* a copy of this instance with the period taken away |
|
147 |
* @throws ArithmeticException if the new instant exceeds the capacity of a long |
|
148 |
*/ |
|
149 |
public AbsoluteInstant minus(AbsoluteInterval interval); |
|
150 |
|
|
151 |
/** |
|
152 |
* Gets a copy of this instance with the specified period added. |
|
153 |
* If the amount is zero or null, then <code>this</code> is returned. |
|
154 |
* |
|
155 |
* @param period |
|
156 |
* the duration to add to this one, null means zero |
|
157 |
* @return |
|
158 |
* a copy of this instance with the period added |
|
159 |
* @throws ArithmeticException if the new instant exceeds the capacity of a long |
|
160 |
*/ |
|
161 |
public AbsoluteInstant plus(AbsoluteInterval interval); |
|
162 |
} |
|
163 |
|
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/TimeSupportLibrary.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.timesupport; |
|
23 |
|
|
24 |
import org.gvsig.tools.ToolsLocator; |
|
25 |
import org.gvsig.tools.dataTypes.DataTypesManager; |
|
26 |
import org.gvsig.tools.library.AbstractLibrary; |
|
27 |
import org.gvsig.tools.library.LibraryException; |
|
28 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
29 |
|
|
30 |
/** |
|
31 |
* Library for API initialization and configuration. |
|
32 |
* |
|
33 |
* @author gvSIG team |
|
34 |
* @version $Id$ |
|
35 |
*/ |
|
36 |
public class TimeSupportLibrary extends AbstractLibrary { |
|
37 |
|
|
38 |
@Override |
|
39 |
protected void doInitialize() throws LibraryException { |
|
40 |
// Do nothing |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
protected void doPostInitialize() throws LibraryException { |
|
45 |
// Validate there is any implementation registered. |
|
46 |
TimeSupportManager manager = TimeSupportLocator.getManager(); |
|
47 |
if (manager == null) { |
|
48 |
throw new ReferenceNotRegisteredException( |
|
49 |
TimeSupportLocator.MANAGER_NAME, TimeSupportLocator |
|
50 |
.getInstance()); |
|
51 |
} |
|
52 |
|
|
53 |
} |
|
54 |
|
|
55 |
} |
tags/org.gvsig.desktop-2.0.210/org.gvsig.desktop.library/org.gvsig.timesupport/org.gvsig.timesupport.lib/org.gvsig.timesupport.lib.api/src/main/java/org/gvsig/timesupport/Instant.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.timesupport; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* <p> |
|
27 |
* An Instant represents a position in a time scale. In practice, |
|
28 |
* an instant is an interval whose duration is less than the resolution |
|
29 |
* of the time scale. |
|
30 |
* </p> |
|
31 |
* <p>All the Instant subclasses have to be immutable and have to |
|
32 |
* provide a Chronology as well. All standard Chronology classes are |
|
33 |
* also immutable. |
|
34 |
* </p> |
|
35 |
* <p> |
|
36 |
* A huge part of the documentation of this class has been retrieved |
Also available in: Unified diff