Revision 727

View differences:

org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<groupId>org.gvsig</groupId>
5
	<artifactId>org.gvsig.netcdf3d</artifactId>
6
	<version>1.0.0-SNAPSHOT</version>
7
	<packaging>pom</packaging>
8
	<name>org.gvsig.netcdf3d</name>
9
	<parent>
10
		<groupId>org.gvsig</groupId>
11
		<artifactId>org.gvsig.desktop</artifactId>
12
		<version>2.0.153-SNAPSHOT</version>
13
	</parent>
14

  
15
	<modules>
16
		<module>org.gvsig.netcdf3d.app</module>
17
		<module>org.gvsig.netcdf3d.swing</module>
18
		<module>org.gvsig.netcdf3d.lib</module>
19
	</modules>
20

  
21
	<properties>
22
		<org.gvsig.view3d.version>1.0.21-SNAPSHOT</org.gvsig.view3d.version>
23
		<org.gvsig.raster.version>2.4.1-SNAPSHOT</org.gvsig.raster.version>
24
	</properties>
25

  
26
	<dependencyManagement>
27
		<dependencies>
28
			<dependency>
29
				<groupId>org.gvsig</groupId>
30
				<artifactId>org.gvsig.view3d</artifactId>
31
				<scope>import</scope>
32
				<type>pom</type>
33
				<version>${org.gvsig.view3d.version}</version>
34
			</dependency>
35
			<dependency>
36
				<groupId>org.gvsig</groupId>
37
				<artifactId>org.gvsig.raster</artifactId>
38
				<scope>import</scope>
39
				<type>pom</type>
40
				<version>${org.gvsig.raster.version}</version>
41
			</dependency>
42
			<dependency>
43
				<groupId>org.gvsig</groupId>
44
				<artifactId>org.gvsig.netcdf3d.lib.api</artifactId>
45
				<version>1.0.0-SNAPSHOT</version>
46
			</dependency>
47
			<dependency>
48
				<groupId>org.gvsig</groupId>
49
				<artifactId>org.gvsig.netcdf3d.lib.impl</artifactId>
50
				<version>1.0.0-SNAPSHOT</version>
51
			</dependency>
52
			<dependency>
53
				<groupId>org.gvsig</groupId>
54
				<artifactId>org.gvsig.netcdf3d.swing.api</artifactId>
55
				<version>1.0.0-SNAPSHOT</version>
56
			</dependency>
57
			<dependency>
58
				<groupId>org.gvsig</groupId>
59
				<artifactId>org.gvsig.netcdf3d.swing.impl</artifactId>
60
				<version>1.0.0-SNAPSHOT</version>
61
			</dependency>
62
		</dependencies>
63
	</dependencyManagement>
64
</project>
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.app/org.gvsig.netcdf3d.app.mainplugin/buildNumber.properties
1
#Mon Jul 25 23:09:07 CEST 2016
2
buildNumber=1
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.app/org.gvsig.netcdf3d.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
1
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 
2
	gvSIG Association. This program is free software; you can redistribute it 
3
	and/or modify it under the terms of the GNU General Public License as published 
4
	by the Free Software Foundation; either version 3 of the License, or (at 
5
	your option) any later version. This program is distributed in the hope that 
6
	it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
7
	of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 
8
	Public License for more details. You should have received a copy of the GNU 
9
	General Public License along with this program; if not, write to the Free 
10
	Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
11
	USA. For any additional information, do not hesitate to contact us at info 
12
	AT gvsig.com, or visit our website www.gvsig.com. -->
13
<assembly>
14
	<id>gvsig-plugin-package</id>
15
	<formats>
16
		<format>zip</format>
17
	</formats>
18
	<baseDirectory>${project.artifactId}</baseDirectory>
19
	<includeBaseDirectory>true</includeBaseDirectory>
20
	<files>
21
		<file>
22
			<source>target/${project.artifactId}-${project.version}.jar</source>
23
			<outputDirectory>lib</outputDirectory>
24
		</file>
25
		<file>
26
			<source>target/package.info</source>
27
		</file>
28
	</files>
29

  
30
	<fileSets>
31
		<fileSet>
32
			<directory>src/main/resources-plugin</directory>
33
			<outputDirectory>.</outputDirectory>
34
		</fileSet>
35
	</fileSets>
36

  
37

  
38
	<dependencySets>
39
		<dependencySet>
40
			<useProjectArtifact>false</useProjectArtifact>
41
			<useTransitiveDependencies>false</useTransitiveDependencies>
42
			<outputDirectory>lib</outputDirectory>
43
			<includes>
44
			    <include>org.gvsig:org.gvsig.netcdf3d.lib.api</include>
45
                <include>org.gvsig:org.gvsig.netcdf3d.lib.impl</include>
46
				<include>org.gvsig:org.gvsig.netcdf3d.swing.api</include>
47
				<include>org.gvsig:org.gvsig.netcdf3d.swing.impl</include>
48
			</includes>
49
		</dependencySet>
50
	</dependencySets>
51

  
52
</assembly>
53

  
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.app/org.gvsig.netcdf3d.app.mainplugin/src/main/java/org/gvsig/netcdf3d/app/mainplugin/NetCDFExtension.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.app.mainplugin;
24

  
25
import org.gvsig.andami.plugins.Extension;
26

  
27
/**
28
 * Extension of NetCDF plugin
29
 * 
30
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
31
 *
32
 */
33
public class NetCDFExtension extends Extension{
34

  
35
    @Override
36
    public void initialize() {
37
    }
38

  
39
    @Override
40
    public void execute(String actionCommand) {
41
    }
42

  
43
    @Override
44
    public boolean isEnabled() {
45
        return false;
46
    }
47

  
48
    @Override
49
    public boolean isVisible() {
50
        return false;
51
    }
52

  
53
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.app/org.gvsig.netcdf3d.app.mainplugin/src/main/resources-plugin/i18n/text.properties
1
variable = Variable
2
level = Nivel
3
initial_time = Tiempo inicial
4
final_time = Tiempo final
5
lapse_XxparenthesisxX_s_XxparenthesisxX = Periodo (s)
6
value_lapse_has_to_be_numeric = El valor del campo Periodo debe de ser num?rico
7
final_date_can_not_be_previous_initial_date = La fecha final no puede ser anterior a la fecha inicial
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.app/org.gvsig.netcdf3d.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
1
variable = Variable
2
level = Level
3
initial_time = Initial time
4
final_time = Final time
5
lapse_XxparenthesisxX_s_XxparenthesisxX = Lapse (s)
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.app/org.gvsig.netcdf3d.app.mainplugin/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 
3
	gvSIG Association. This program is free software; you can redistribute it 
4
	and/or modify it under the terms of the GNU General Public License as published 
5
	by the Free Software Foundation; either version 3 of the License, or (at 
6
	your option) any later version. This program is distributed in the hope that 
7
	it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
8
	of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 
9
	Public License for more details. You should have received a copy of the GNU 
10
	General Public License along with this program; if not, write to the Free 
11
	Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
12
	USA. For any additional information, do not hesitate to contact us at info 
13
	AT gvsig.com, or visit our website www.gvsig.com. -->
14
<plugin-config>
15
	<depends plugin-name="org.gvsig.app.mainplugin" />
16
	<depends plugin-name="org.gvsig.view3d.app" />
17
	<resourceBundle name="text" />
18
	<libraries library-dir="lib" />
19
	<extensions>
20

  
21
		<extension class-name="org.gvsig.netcdf3d.app.mainplugin.NetCDFExtension"
22
			description="" active="true" priority="1">
23

  
24
		</extension>
25

  
26
	</extensions>
27
</plugin-config>
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.app/org.gvsig.netcdf3d.app.mainplugin/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.netcdf3d.app</artifactId>
6
    <version>1.0.0-SNAPSHOT</version>
7
  </parent>
8
  <artifactId>org.gvsig.netcdf3d.app.mainplugin</artifactId>
9
  <name>org.gvsig.netcdf3d.app.mainplugin</name>
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<parent>
5
		<groupId>org.gvsig</groupId>
6
		<artifactId>org.gvsig.netcdf3d.app</artifactId>
7
		<version>1.0.0-SNAPSHOT</version>
8
	</parent>
9
	<artifactId>org.gvsig.netcdf3d.app.mainplugin</artifactId>
10
	<name>org.gvsig.netcdf3d.app.mainplugin</name>
11
	
12
	<dependencies>
13
		<dependency>
14
			<groupId>org.gvsig</groupId>
15
			<artifactId>org.gvsig.netcdf3d.lib.api</artifactId>
16
		</dependency>
17
		<dependency>
18
			<groupId>org.gvsig</groupId>
19
			<artifactId>org.gvsig.netcdf3d.lib.impl</artifactId>
20
		</dependency>
21
		<dependency>
22
			<groupId>org.gvsig</groupId>
23
			<artifactId>org.gvsig.netcdf3d.swing.api</artifactId>
24
		</dependency>
25
		<dependency>
26
			<groupId>org.gvsig</groupId>
27
			<artifactId>org.gvsig.netcdf3d.swing.impl</artifactId>
28
		</dependency>
29
	</dependencies>
10 30
</project>
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/src/main/java/org/gvsig/netcdf3d/lib/impl/DefaultNetCDFTiledImageLayer.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23

  
24
package org.gvsig.netcdf3d.lib.impl;
25

  
26
import gov.nasa.worldwind.WWObjectImpl;
27
import gov.nasa.worldwind.avlist.AVKey;
28
import gov.nasa.worldwind.layers.Layer;
29
import gov.nasa.worldwind.layers.TiledImageLayer;
30
import gov.nasa.worldwind.render.DrawContext;
31

  
32
import java.awt.Point;
33
import java.awt.event.ActionEvent;
34
import java.awt.event.ActionListener;
35
import java.beans.PropertyChangeEvent;
36

  
37
import javax.swing.Timer;
38

  
39
import org.gvsig.fmap.dal.raster.api.RasterQuery;
40
import org.gvsig.fmap.mapcontext.raster.api.RasterLayer;
41
import org.gvsig.netcdf3d.lib.api.NetCDFLoaderParameters;
42
import org.gvsig.view3d.lib.api.View3DLocator;
43
import org.gvsig.view3d.lib.api.View3DManager;
44
import org.gvsig.view3d.lib.api.exception.FactoryNotRegisteredException;
45
import org.gvsig.view3d.lib.api.exception.LoadException;
46
import org.gvsig.view3d.lib.api.loader.Loader;
47
import org.gvsig.view3d.lib.api.loader.LoaderFactory;
48
import org.gvsig.view3d.lib.api.loader.RasterLoaderParameters;
49

  
50
import org.slf4j.Logger;
51
import org.slf4j.LoggerFactory;
52

  
53
/**
54
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
55
 *
56
 */
57
public class DefaultNetCDFTiledImageLayer extends WWObjectImpl implements Layer {
58

  
59
    private static final Logger LOG = LoggerFactory.getLogger(DefaultNetCDFTiledImageLayer.class);
60

  
61
    private NetCDFLoaderParameters parameters;
62
    private TiledImageLayer rasterLayer;
63
    private Timer timer;
64

  
65
    /**
66
     *
67
     * @param parameters
68
     */
69
    public DefaultNetCDFTiledImageLayer(NetCDFLoaderParameters parameters) {
70
        this.parameters = parameters;
71

  
72
        // Create Raster tiled image layer
73
        try {
74
            this.createRaserTiledImageLayer();
75
        } catch (FactoryNotRegisteredException | LoadException e) {
76
            LOG.error("Can not create raster tiled image layer", e);
77
            return;
78
        }
79

  
80
        this.timer = new Timer((int)(this.parameters.getLapse() * 1000),  new DefaultNetCDFTimerTask(this, parameters));
81
        this.timer.start();
82
    }
83

  
84
    private void createRaserTiledImageLayer()
85
        throws FactoryNotRegisteredException, LoadException {
86
        View3DManager manager = View3DLocator.getManager();
87
        LoaderFactory loaderFactory = null;
88
        loaderFactory = manager.getLoaderFactory(RasterLoaderParameters.NAME);
89
        Loader rasterLoader = loaderFactory.createLoader();
90
        this.rasterLayer = (TiledImageLayer) rasterLoader.load(parameters);
91
        // this.rasterLayer.setForceLevelZeroLoads(true);
92
    }
93

  
94
    /**
95
     * @param rasterQuery
96
     *
97
     */
98
    public void setBaseQuery(RasterQuery rasterQuery) {
99
        RasterLayer rasterLayer =
100
            (RasterLayer) this.rasterLayer.getValue(View3DManager.GVSIG_LAYER);
101
        rasterLayer.setBaseQuery(rasterQuery);
102

  
103
        long timeMillis = System.currentTimeMillis();
104
        this.setExpiryTime(timeMillis);
105
        this.rasterLayer.setExpiryTime(timeMillis);
106
        this.propertyChange(new PropertyChangeEvent(this, AVKey.LAYER, null, this));
107
    }
108

  
109
    @Override
110
    public void dispose() {
111
        this.parameters = null;
112
        this.timer.stop();
113
        this.timer = null;
114
        this.rasterLayer.dispose();
115
    }
116

  
117
    @Override
118
    public String getRestorableState() {
119
        return this.rasterLayer.getRestorableState();
120
    }
121

  
122
    @Override
123
    public void restoreState(String stateInXml) {
124
        this.rasterLayer.restoreState(stateInXml);
125
    }
126

  
127
    @Override
128
    public boolean isEnabled() {
129
        return this.rasterLayer.isEnabled();
130
    }
131

  
132
    @Override
133
    public void setEnabled(boolean enabled) {
134
        this.rasterLayer.setEnabled(enabled);
135
    }
136

  
137
    @Override
138
    public String getName() {
139
        return this.rasterLayer.getName();
140
    }
141

  
142
    @Override
143
    public void setName(String name) {
144
        this.rasterLayer.setName(name);
145
    }
146

  
147
    @Override
148
    public double getOpacity() {
149
        return this.rasterLayer.getOpacity();
150
    }
151

  
152
    @Override
153
    public void setOpacity(double opacity) {
154
        this.rasterLayer.setOpacity(opacity);
155
    }
156

  
157
    @Override
158
    public boolean isPickEnabled() {
159
        return this.rasterLayer.isPickEnabled();
160
    }
161

  
162
    @Override
163
    public void setPickEnabled(boolean isPickable) {
164
        this.rasterLayer.setPickEnabled(isPickable);
165
    }
166

  
167
    @Override
168
    public void preRender(DrawContext dc) {
169
        this.rasterLayer.preRender(dc);
170
    }
171

  
172
    @Override
173
    public void render(DrawContext dc) {
174
        this.rasterLayer.render(dc);
175
    }
176

  
177
    @Override
178
    public void pick(DrawContext dc, Point pickPoint) {
179
        this.rasterLayer.pick(dc, pickPoint);
180
    }
181

  
182
    @Override
183
    public boolean isAtMaxResolution() {
184
        return this.rasterLayer.isAtMaxResolution();
185
    }
186

  
187
    @Override
188
    public boolean isMultiResolution() {
189
        return this.rasterLayer.isMultiResolution();
190
    }
191

  
192
    @Override
193
    public double getScale() {
194
        return this.rasterLayer.getScale();
195
    }
196

  
197
    @Override
198
    public boolean isNetworkRetrievalEnabled() {
199
        return this.rasterLayer.isNetworkRetrievalEnabled();
200
    }
201

  
202
    @Override
203
    public void setNetworkRetrievalEnabled(boolean networkRetrievalEnabled) {
204
        this.rasterLayer.setNetworkRetrievalEnabled(networkRetrievalEnabled);
205
    }
206

  
207
    @Override
208
    public void setExpiryTime(long expiryTime) {
209
        this.rasterLayer.setExpiryTime(expiryTime);
210
    }
211

  
212
    @Override
213
    public long getExpiryTime() {
214
        return this.rasterLayer.getExpiryTime();
215
    }
216

  
217
    @Override
218
    public double getMinActiveAltitude() {
219
        return this.rasterLayer.getMinActiveAltitude();
220
    }
221

  
222
    @Override
223
    public void setMinActiveAltitude(double minActiveAltitude) {
224
        this.rasterLayer.setMinActiveAltitude(minActiveAltitude);
225
    }
226

  
227
    @Override
228
    public double getMaxActiveAltitude() {
229
        return this.rasterLayer.getMaxActiveAltitude();
230
    }
231

  
232
    @Override
233
    public void setMaxActiveAltitude(double maxActiveAltitude) {
234
        this.rasterLayer.setMaxActiveAltitude(maxActiveAltitude);
235
    }
236

  
237
    @Override
238
    public boolean isLayerInView(DrawContext dc) {
239
        return this.rasterLayer.isLayerInView(dc);
240
    }
241

  
242
    @Override
243
    public boolean isLayerActive(DrawContext dc) {
244
        return this.rasterLayer.isLayerActive(dc);
245
    }
246

  
247
    @Override
248
    public Double getMaxEffectiveAltitude(Double radius) {
249
        return this.rasterLayer.getMaxEffectiveAltitude(radius);
250
    }
251

  
252
    @Override
253
    public Double getMinEffectiveAltitude(Double radius) {
254
        return this.rasterLayer.getMaxEffectiveAltitude(radius);
255
    }
256

  
257
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/src/main/java/org/gvsig/netcdf3d/lib/impl/DefaultNetCDFTimerTask.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23

  
24
package org.gvsig.netcdf3d.lib.impl;
25

  
26
import java.awt.event.ActionEvent;
27
import java.awt.event.ActionListener;
28
import java.util.Calendar;
29
import java.util.List;
30
import java.util.TimerTask;
31

  
32
import org.gvsig.fmap.dal.raster.api.BandAttributeDescriptor;
33
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
34
import org.gvsig.fmap.dal.raster.api.BandQuery;
35
import org.gvsig.fmap.dal.raster.api.RasterQuery;
36
import org.gvsig.fmap.dal.raster.api.RasterStore;
37
import org.gvsig.fmap.mapcontext.raster.api.RasterLayer;
38
import org.gvsig.netcdf3d.lib.api.NetCDFLoaderParameters;
39

  
40
/**
41
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
42
 *
43
 */
44
public class DefaultNetCDFTimerTask implements ActionListener {
45

  
46
    private NetCDFLoaderParameters parameters;
47
    private DefaultNetCDFTiledImageLayer netCDFTiledImageLayer;
48
    private Calendar time;
49

  
50
    /**
51
     *
52
     * @param netCDFTiledImageLayer
53
     * @param defaultNetCDFTiledImageLayer
54
     * @param parameters
55
     */
56
    public DefaultNetCDFTimerTask(DefaultNetCDFTiledImageLayer netCDFTiledImageLayer,
57
        NetCDFLoaderParameters parameters) {
58

  
59
        this.parameters = parameters;
60
        this.netCDFTiledImageLayer = netCDFTiledImageLayer;
61

  
62
        if (parameters.getStartDate() == null || parameters.getFinalDate() == null) {
63
            throw new IllegalArgumentException("Start date or final date can not be null");
64
        }
65
    }
66

  
67
    @Override
68
    public void actionPerformed(ActionEvent e) {
69

  
70
        RasterLayer layer = (RasterLayer) parameters.getLayer();
71
        RasterStore rasterStore = layer.getRasterStore();
72

  
73
        if (this.time == null) {
74
            this.time = parameters.getStartDate();
75
        } else {
76
            BandDescriptor bandDescriptor =
77
                layer.getRasterStore().getBandDescriptor(parameters.getBand());
78
            BandAttributeDescriptor bandAttributeDescriptor = bandDescriptor.get("time");
79

  
80
            if (bandAttributeDescriptor == null) {
81
                throw new IllegalArgumentException(String.format(
82
                    "Band descriptor of %1s band does not have \"time\" band attribute descriptor",
83
                    parameters.getVariable()));
84
            }
85

  
86
            List<Object> values = bandAttributeDescriptor.getValues();
87
            int index = values.indexOf(this.time);
88
            if (index == values.size() - 1) {
89
                this.time = parameters.getStartDate();
90
            } else {
91
                this.time = (Calendar) values.get(index + 1);
92
            }
93
        }
94

  
95
        int band = parameters.getBand();
96
        BandQuery bandQuery = rasterStore.createBandQuery(band);
97
        bandQuery.setValue("level", parameters.getLevel());
98
        bandQuery.setValue("time", time);
99

  
100
        RasterQuery rasterQuery = rasterStore.createRasterQuery();
101
        rasterQuery.addBand(bandQuery);
102
        netCDFTiledImageLayer.setBaseQuery(rasterQuery);
103
    }
104

  
105
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/src/main/java/org/gvsig/netcdf3d/lib/impl/DefaultNetCDFLibrary.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.lib.impl;
24

  
25
import org.gvsig.netcdf3d.lib.api.NetCDFLibrary;
26
import org.gvsig.netcdf3d.lib.api.NetCDFLoaderParameters;
27
import org.gvsig.tools.library.AbstractLibrary;
28
import org.gvsig.tools.library.LibraryException;
29
import org.gvsig.view3d.lib.api.View3DLibrary;
30
import org.gvsig.view3d.lib.api.View3DLocator;
31
import org.gvsig.view3d.lib.api.View3DManager;
32

  
33
/**
34
 * 
35
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
36
 *
37
 */
38
public class DefaultNetCDFLibrary extends AbstractLibrary {
39

  
40
    @Override
41
    public void doRegistration() {
42
        registerAsImplementationOf(NetCDFLibrary.class);
43
        require(View3DLibrary.class);
44
    }
45

  
46
    @Override
47
    protected void doInitialize() throws LibraryException {
48

  
49
        // Register persistence definition
50
        DefaultNetCDFLoaderParameters.registerPersistenceDefinition();
51

  
52
        // Register NetCDF loader factory
53
        View3DManager manager = View3DLocator.getManager();
54
        manager
55
            .registerLoaderFactory(NetCDFLoaderParameters.NAME, new DefaultNetCDFLoaderFactory());
56

  
57
    }
58

  
59
    @Override
60
    protected void doPostInitialize() throws LibraryException {
61
    }
62

  
63
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/src/main/java/org/gvsig/netcdf3d/lib/impl/DefaultNetCDFLoader.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.lib.impl;
24

  
25
import org.gvsig.netcdf3d.lib.api.NetCDFLoaderParameters;
26
import org.gvsig.view3d.lib.api.exception.LoadException;
27
import org.gvsig.view3d.lib.api.loader.Loader;
28
import org.gvsig.view3d.lib.api.loader.LoaderParameters;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
33
 *
34
 */
35
public class DefaultNetCDFLoader implements Loader {
36

  
37
    @Override
38
    public Object load(LoaderParameters parameters) throws LoadException {
39

  
40
        if (parameters instanceof NetCDFLoaderParameters) {
41
            NetCDFLoaderParameters netCDFParameters = (NetCDFLoaderParameters) parameters;
42
            return new DefaultNetCDFTiledImageLayer(netCDFParameters);
43
        }
44

  
45
        throw new IllegalArgumentException(
46
            "Illegal parameters, it must be an instance of NetCDFLoaderParameters");
47
    }
48

  
49
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/src/main/java/org/gvsig/netcdf3d/lib/impl/DefaultNetCDFLoaderParameters.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.lib.impl;
24

  
25
import java.util.Calendar;
26

  
27
import org.gvsig.fmap.mapcontext.layers.FLayer;
28
import org.gvsig.netcdf3d.lib.api.NetCDFLoaderParameters;
29
import org.gvsig.tools.ToolsLocator;
30
import org.gvsig.tools.dynobject.DynStruct;
31
import org.gvsig.tools.persistence.PersistenceManager;
32
import org.gvsig.tools.persistence.PersistentState;
33
import org.gvsig.tools.persistence.exception.PersistenceException;
34
import org.gvsig.view3d.lib.api.View3DLocator;
35
import org.gvsig.view3d.lib.api.exception.FactoryNotRegisteredException;
36
import org.gvsig.view3d.lib.api.loader.AbstractLoaderParameters;
37
import org.gvsig.view3d.lib.api.loader.LoaderFactory;
38
import org.gvsig.view3d.lib.api.loader.RasterLoaderParameters;
39
import org.slf4j.Logger;
40
import org.slf4j.LoggerFactory;
41

  
42
/**
43
 * Default implementation of {@link NetCDFLoaderParameters}
44
 * 
45
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
46
 *
47
 */
48
public class DefaultNetCDFLoaderParameters extends AbstractLoaderParameters implements
49
    NetCDFLoaderParameters {
50

  
51
    private static final Logger LOG = LoggerFactory.getLogger(DefaultNetCDFLoaderParameters.class);
52

  
53
    public static final String PERSISTENCE_DEFINITION_NAME = "NetCDFLoaderParameters";
54
    public static final String PERSISTENCE_DEFINITION_DESCRIPTION =
55
        "Parameters that defines NetCDF raster load mode";
56

  
57
    public static final String RASTER_LOADER_PARAMETERS_FIELD_NAME = "rasterLoaderParameters";
58
    public static final String VARIABLE_FIELD_NAME = "variable";
59
    public static final String BAND_FIELD_NAME = "band";
60
    public static final String LEVEL_FIELD_NAME = "level";
61
    public static final String LAPSE_FIELD_NAME = "lapse";
62
    public static final String START_DATE_FIELD_NAME = "startDate";
63
    public static final String FINAL_DATE_FIELD_NAME = "finalDate";
64

  
65
    private RasterLoaderParameters rasterParameters;
66
    private String variable;
67
    private int band;
68
    private double level = -1;
69
    private double lapse = 1;
70
    private Calendar startDate;
71
    private Calendar finalDate;
72

  
73
    /**
74
     * Default constructor
75
     */
76
    public DefaultNetCDFLoaderParameters() {
77

  
78
    }
79

  
80
    /**
81
     * 
82
     * @param layer
83
     */
84
    public DefaultNetCDFLoaderParameters(FLayer layer) {
85
        super(layer);
86
        try {
87
            LoaderFactory loaderFactory =
88
                View3DLocator.getManager().getLoaderFactory(RasterLoaderParameters.NAME);
89
            rasterParameters = (RasterLoaderParameters) loaderFactory.createParameters(layer);
90
        } catch (FactoryNotRegisteredException e) {
91
            LOG.error("Can not get RasterLoader parameters", e);
92
            throw new IllegalStateException(String.format(
93
                "To create NetCDF loader parameters, it is necessary that %1s is registered",
94
                RasterLoaderParameters.NAME));
95
        }
96
    }
97

  
98
    @Override
99
    public double getLevelZeroResolution() {
100
        return this.rasterParameters.getLevelZeroResolution();
101
    }
102

  
103
    @Override
104
    public void setLevelZeroResolution(double value) {
105
        this.rasterParameters.setLevelZeroResolution(value);
106
    }
107

  
108
    @Override
109
    public int getMaxLevel() {
110
        return this.rasterParameters.getMaxLevel();
111
    }
112

  
113
    @Override
114
    public void setMaxLevel(int level) {
115
        this.rasterParameters.setMaxLevel(level);
116
    }
117

  
118
    @Override
119
    public int getMinLevel() {
120
        return this.rasterParameters.getMinLevel();
121
    }
122

  
123
    @Override
124
    public void setMinLevel(int level) {
125
        this.rasterParameters.setMinLevel(level);
126
    }
127

  
128
    @Override
129
    public int getTileSize() {
130
        return this.rasterParameters.getTileSize();
131
    }
132

  
133
    @Override
134
    public void setTileSize(int size) {
135
        this.rasterParameters.setTileSize(size);
136
    }
137

  
138
    @Override
139
    public double getNoData() {
140
        return this.rasterParameters.getNoData();
141
    }
142

  
143
    @Override
144
    public void setNoData(double noData) {
145
        this.rasterParameters.setNoData(noData);
146
    }
147

  
148
    @Override
149
    public String getName() {
150
        return NetCDFLoaderParameters.NAME;
151
    }
152

  
153
    @Override
154
    public String getVariable() {
155
        return this.variable;
156
    }
157

  
158
    @Override
159
    public void setVariable(String variable) {
160
        this.variable = variable;
161
    }
162

  
163
    @Override
164
    public double getLevel() {
165
        return this.level;
166
    }
167

  
168
    @Override
169
    public void setLevel(double level) {
170
        this.level = level;
171
    }
172

  
173
    @Override
174
    public Calendar getStartDate() {
175
        return this.startDate;
176
    }
177

  
178
    @Override
179
    public void setStartDate(Calendar startDate) {
180
        this.startDate = startDate;
181

  
182
    }
183

  
184
    @Override
185
    public Calendar getFinalDate() {
186
        return this.finalDate;
187
    }
188

  
189
    @Override
190
    public void setFinalDate(Calendar finalDate) {
191
        this.finalDate = finalDate;
192
    }
193

  
194
    @Override
195
    public double getLapse() {
196
        return this.lapse;
197
    }
198

  
199
    @Override
200
    public void setLapse(double lapse) {
201
        this.lapse = lapse;
202
    }
203
    
204
    @Override
205
    public int getBand() {
206
        return this.band;
207
    }
208

  
209
    @Override
210
    public void setBand(int band) {
211
        this.band = band;
212
    }
213
    
214
    public static void registerPersistenceDefinition() {
215

  
216
        PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
217
        DynStruct definition = persistenceManager.getDefinition(PERSISTENCE_DEFINITION_NAME);
218
        if (definition == null) {
219

  
220
            definition =
221
                persistenceManager.addDefinition(DefaultNetCDFLoaderParameters.class,
222
                    PERSISTENCE_DEFINITION_NAME, PERSISTENCE_DEFINITION_DESCRIPTION, null, null);
223

  
224
            definition.addDynFieldObject(RASTER_LOADER_PARAMETERS_FIELD_NAME).setClassOfValue(
225
                RasterLoaderParameters.class);
226
            definition.addDynFieldString(VARIABLE_FIELD_NAME);
227
            definition.addDynFieldInt(BAND_FIELD_NAME);
228
            definition.addDynFieldString(LEVEL_FIELD_NAME);
229
            definition.addDynFieldDouble(LAPSE_FIELD_NAME);
230
            definition.addDynFieldObject(START_DATE_FIELD_NAME).setClassOfValue(Calendar.class);
231
            definition.addDynFieldObject(FINAL_DATE_FIELD_NAME).setClassOfValue(Calendar.class);;
232
        }
233
    }
234

  
235
    @Override
236
    protected void doSaveToState(PersistentState state) throws PersistenceException {
237
        state.set(RASTER_LOADER_PARAMETERS_FIELD_NAME, this.rasterParameters);
238
        state.set(VARIABLE_FIELD_NAME, this.variable);
239
        state.set(BAND_FIELD_NAME, this.band);
240
        state.set(LEVEL_FIELD_NAME, this.level);
241
        state.set(LAPSE_FIELD_NAME, this.lapse);
242
        state.set(START_DATE_FIELD_NAME, this.startDate);
243
        state.set(FINAL_DATE_FIELD_NAME, this.finalDate);
244
    }
245

  
246
    @Override
247
    protected void doLoadFromState(PersistentState state) throws PersistenceException {
248
        this.rasterParameters =
249
            (RasterLoaderParameters) state.get(RASTER_LOADER_PARAMETERS_FIELD_NAME);
250
        this.variable = state.getString(VARIABLE_FIELD_NAME);
251
        this.band = state.getInt(BAND_FIELD_NAME);
252
        this.level = state.getDouble(LEVEL_FIELD_NAME);
253
        this.lapse = state.getDouble(LAPSE_FIELD_NAME);
254
        this.startDate = (Calendar) state.get(START_DATE_FIELD_NAME);
255
        this.finalDate = (Calendar) state.get(FINAL_DATE_FIELD_NAME);
256
    }
257
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/src/main/java/org/gvsig/netcdf3d/lib/impl/DefaultNetCDFLoaderFactory.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.lib.impl;
24

  
25
import org.gvsig.fmap.mapcontext.layers.FLayer;
26
import org.gvsig.netcdf3d.lib.api.NetCDFLoaderParameters;
27
import org.gvsig.view3d.lib.api.loader.Loader;
28
import org.gvsig.view3d.lib.api.loader.LoaderFactory;
29
import org.gvsig.view3d.lib.api.loader.LoaderParameters;
30

  
31
/**
32
 * NetCDF loader factory to create NetCDF loaders and NetCDF loader parameters.
33
 * 
34
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
35
 *
36
 */
37
public class DefaultNetCDFLoaderFactory implements LoaderFactory {
38

  
39
    @Override
40
    public String getName() {
41
        return NetCDFLoaderParameters.NAME;
42
    }
43

  
44
    @Override
45
    public LoaderParameters createParameters(FLayer layer) {
46
        return new DefaultNetCDFLoaderParameters(layer);
47
    }
48

  
49
    @Override
50
    public Loader createLoader() {
51
        return new DefaultNetCDFLoader();
52
    }
53

  
54
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.netcdf3d.lib.impl.DefaultNetCDFLibrary
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.impl/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.netcdf3d.lib</artifactId>
6
    <version>1.0.0-SNAPSHOT</version>
7
  </parent>
8
  <artifactId>org.gvsig.netcdf3d.lib.impl</artifactId>
9
  <name>org.gvsig.netcdf3d.lib.impl</name>
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<parent>
5
		<groupId>org.gvsig</groupId>
6
		<artifactId>org.gvsig.netcdf3d.lib</artifactId>
7
		<version>1.0.0-SNAPSHOT</version>
8
	</parent>
9
	<artifactId>org.gvsig.netcdf3d.lib.impl</artifactId>
10
	<name>org.gvsig.netcdf3d.lib.impl</name>
11
	
12
	<dependencies>
13
		<dependency>
14
			<groupId>org.gvsig</groupId>
15
			<artifactId>org.gvsig.netcdf3d.lib.api</artifactId>
16
		</dependency>
17
		<dependency>
18
			<groupId>org.gvsig</groupId>
19
			<artifactId>org.gvsig.fmap.dal.raster.api</artifactId>
20
		</dependency>
21
		<dependency>
22
			<groupId>org.gvsig</groupId>
23
			<artifactId>org.gvsig.fmap.mapcontext.raster.api</artifactId>
24
		</dependency>
25
		<dependency>
26
			<groupId>org.gvsig</groupId>
27
			<artifactId>org.gvsig.raster.lib.legend.api</artifactId>
28
		</dependency>
29
		<dependency>
30
			<groupId>gov.nasa</groupId>
31
			<artifactId>worldwind</artifactId>
32
		</dependency>
33
	</dependencies>
10 34
</project>
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.netcdf3d.lib.api.NetCDFLibrary
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.api/src/main/java/org/gvsig/netcdf3d/lib/api/NetCDFLoaderParameters.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.lib.api;
24

  
25
import java.util.Calendar;
26

  
27
import org.gvsig.view3d.lib.api.loader.RasterLoaderParameters;
28

  
29
/**
30
 * NetCDF loader parameters defines the required parameters to load dynamic
31
 * NetCDF raster layers
32
 * 
33
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
34
 *
35
 */
36
public interface NetCDFLoaderParameters extends RasterLoaderParameters {
37

  
38
    public static final String NAME = "NetCDFLoader";
39

  
40
    /**
41
     * @return Gets NetCDF variable
42
     */
43
    public String getVariable();
44

  
45
    /**
46
     * Sets NetCDF variable
47
     * 
48
     * @param variable
49
     *            Name of NetCDF variable
50
     */
51
    public void setVariable(String variable);
52

  
53
    /**
54
     * Gets NetCDF band
55
     * 
56
     * @return Band of NetCDF
57
     */
58
    public int getBand();
59

  
60
    /**
61
     * Sets the specified band
62
     * 
63
     * @param band
64
     *            The specified band
65
     * 
66
     */
67
    public void setBand(int band);
68

  
69
    /**
70
     * @return Gets NetCDF level of variable
71
     */
72
    public double getLevel();
73

  
74
    /**
75
     * Set level of NetCDF variable
76
     * 
77
     * @param level
78
     *            Variable level
79
     */
80
    public void setLevel(double level);
81

  
82
    /**
83
     * 
84
     * @return Gets start date of NetCDF variable
85
     */
86
    public Calendar getStartDate();
87

  
88
    /**
89
     * Sets start date of NetCDF variable
90
     * 
91
     * @param startDate
92
     *            Start date of variable
93
     */
94
    public void setStartDate(Calendar startDate);
95

  
96
    /**
97
     * 
98
     * @return Gets final date of NetCDF variable
99
     */
100
    public Calendar getFinalDate();
101

  
102
    /**
103
     * Sets final date of NetCDF variable
104
     * 
105
     * @param finalDate
106
     *            Final date of variable
107
     */
108
    public void setFinalDate(Calendar finalDate);
109

  
110
    /**
111
     * @return Gets lapse of NetCDF in seconds
112
     */
113
    public double getLapse();
114

  
115
    /**
116
     * Set lapse of NetCDF in seconds
117
     * 
118
     * @param lapse
119
     */
120
    public void setLapse(double lapse);
121
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.api/src/main/java/org/gvsig/netcdf3d/lib/api/NetCDFLibrary.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.lib.api;
24

  
25
import org.gvsig.tools.library.AbstractLibrary;
26
import org.gvsig.tools.library.LibraryException;
27

  
28
/**
29
 * NetCDF library for API initialization and configuration.
30
 * 
31
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
32
 *
33
 */
34
public class NetCDFLibrary extends AbstractLibrary {
35
    
36
    @Override
37
    public void doRegistration() {
38
        registerAsAPI(NetCDFLibrary.class);
39
    }
40

  
41
    @Override
42
    protected void doInitialize() throws LibraryException {
43
    }
44

  
45
    @Override
46
    protected void doPostInitialize() throws LibraryException {
47
    }
48

  
49
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.lib/org.gvsig.netcdf3d.lib.api/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.netcdf3d.lib</artifactId>
6
    <version>1.0.0-SNAPSHOT</version>
7
  </parent>
8
  <artifactId>org.gvsig.netcdf3d.lib.api</artifactId>
9
  <name>org.gvsig.netcdf3d.lib.api</name>
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<parent>
5
		<groupId>org.gvsig</groupId>
6
		<artifactId>org.gvsig.netcdf3d.lib</artifactId>
7
		<version>1.0.0-SNAPSHOT</version>
8
	</parent>
9
	<artifactId>org.gvsig.netcdf3d.lib.api</artifactId>
10
	<name>org.gvsig.netcdf3d.lib.api</name>
11
	
12
	<dependencies>
13
		<dependency>
14
			<groupId>org.gvsig</groupId>
15
			<artifactId>org.gvsig.view3d.lib.api</artifactId>
16
		</dependency>
17
	</dependencies>
10 18
</project>
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.swing/org.gvsig.netcdf3d.swing.api/src/main/java/org/gvsig/netcdf3d/swing/api/NetCDFSwingLibrary.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.swing.api;
24

  
25
import org.gvsig.tools.library.AbstractLibrary;
26
import org.gvsig.tools.library.LibraryException;
27
import org.gvsig.view3d.swing.api.View3DSwingLibrary;
28

  
29
/**
30
 * 
31
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
32
 *
33
 */
34
public class NetCDFSwingLibrary extends AbstractLibrary {
35
    
36
    @Override
37
    public void doRegistration() {
38
        registerAsAPI(NetCDFSwingLibrary.class);
39
    }
40

  
41
    @Override
42
    protected void doInitialize() throws LibraryException {
43
    }
44

  
45
    @Override
46
    protected void doPostInitialize() throws LibraryException {
47
    }
48

  
49
}
org.gvsig.netcdf3d/trunk/org.gvsig.netcdf3d/org.gvsig.netcdf3d.swing/org.gvsig.netcdf3d.swing.api/src/main/java/org/gvsig/netcdf3d/swing/api/JNetCDFLoaderParameters.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.netcdf3d.swing.api;
24

  
25
import java.util.Date;
26

  
27
import org.gvsig.view3d.swing.api.loader.JLoaderParameters;
28

  
29
/**
30
 * 
31
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
32
 *
33
 */
34
public interface JNetCDFLoaderParameters extends JLoaderParameters {
35

  
36
    /**
37
     * Gets selected level. Can be <code>null</code>
38
     * 
39
     * @return Specified level
40
     */
41
    public String getLevel();
42

  
43
    /**
44
     * Gets selected netCDF variable
45
     * 
46
     * @return Specified netCDF variable
47
     */
48
    public String getVariable();
49

  
50
    /**
51
     * Gets selected start date. Can be <code>null</code>
52
     * 
53
     * @return Start date
54
     */
55
    public Date getStartDate();
56

  
57
    /**
58
     * Gets selected end date. Can be <code>null</code>
59
     * 
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff