Revision 1909
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatExplorerParameters.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 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 IVER T.I {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.raster.tilecache.io.tff; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
31 |
import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
|
32 |
import org.gvsig.tools.ToolsLocator; |
|
33 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
34 |
import org.gvsig.tools.dynobject.DynClass; |
|
35 |
import org.gvsig.tools.dynobject.DynObjectManager; |
|
36 |
|
|
37 |
/** |
|
38 |
* Parameters for the TileFileFormat explorer provider |
|
39 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
40 |
*/ |
|
41 |
public class TileFileFormatExplorerParameters extends AbstractDataParameters implements DataServerExplorerParameters { |
|
42 |
public static final String DYNCLASS_NAME = "TileFileFormatExplorerParameters"; |
|
43 |
protected static DynClass DYNCLASS = null; |
|
44 |
private DelegatedDynObject delegatedDynObject = null; |
|
45 |
|
|
46 |
|
|
47 |
public TileFileFormatExplorerParameters() { |
|
48 |
super(); |
|
49 |
initialize(); |
|
50 |
} |
|
51 |
|
|
52 |
protected void initialize() { |
|
53 |
this.delegatedDynObject = (DelegatedDynObject) ToolsLocator |
|
54 |
.getDynObjectManager().createDynObject( |
|
55 |
DYNCLASS); |
|
56 |
} |
|
57 |
|
|
58 |
public static void registerDynClass() { |
|
59 |
DynObjectManager dynman = ToolsLocator.getDynObjectManager(); |
|
60 |
DynClass dynClass; |
|
61 |
|
|
62 |
if(dynman == null) |
|
63 |
return; |
|
64 |
|
|
65 |
if (DYNCLASS == null) { |
|
66 |
dynClass = dynman.add(DYNCLASS_NAME); |
|
67 |
|
|
68 |
DYNCLASS = dynClass; |
|
69 |
} |
|
70 |
|
|
71 |
} |
|
72 |
|
|
73 |
protected DelegatedDynObject getDelegatedDynObject() { |
|
74 |
return delegatedDynObject; |
|
75 |
} |
|
76 |
|
|
77 |
public String getDataStoreName() { |
|
78 |
return TileFileFormatProvider.NAME; |
|
79 |
} |
|
80 |
|
|
81 |
public String getDescription() { |
|
82 |
return TileFileFormatProvider.DESCRIPTION; |
|
83 |
} |
|
84 |
|
|
85 |
public String getExplorerName() { |
|
86 |
return TileFileFormatProvider.NAME; |
|
87 |
} |
|
88 |
} |
|
0 | 89 |
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatProvider.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.raster.tilecache.io.tff; |
|
23 |
|
|
24 |
import java.awt.geom.Point2D; |
|
25 |
|
|
26 |
import org.gvsig.fmap.dal.DALFileLocator; |
|
27 |
import org.gvsig.fmap.dal.DALLocator; |
|
28 |
import org.gvsig.fmap.dal.DataStore; |
|
29 |
import org.gvsig.fmap.dal.coverage.RasterLocator; |
|
30 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
|
31 |
import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
|
32 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
|
33 |
import org.gvsig.fmap.dal.coverage.exception.BandAccessException; |
|
34 |
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException; |
|
35 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
|
36 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
|
37 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
|
38 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
39 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
|
40 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
41 |
import org.gvsig.fmap.dal.exception.OpenException; |
|
42 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
|
43 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
44 |
import org.gvsig.metadata.MetadataLocator; |
|
45 |
import org.gvsig.raster.cache.tile.Tile; |
|
46 |
import org.gvsig.raster.cache.tile.exception.TileGettingException; |
|
47 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
|
48 |
import org.gvsig.raster.cache.tile.provider.TileServer; |
|
49 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
|
50 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
|
51 |
import org.gvsig.raster.impl.provider.RasterProvider; |
|
52 |
import org.gvsig.raster.impl.provider.TiledRasterProvider; |
|
53 |
import org.gvsig.raster.impl.store.DefaultStoreFactory; |
|
54 |
import org.gvsig.tools.ToolsLocator; |
|
55 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
56 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
57 |
import org.gvsig.tools.task.TaskStatus; |
|
58 |
import org.slf4j.Logger; |
|
59 |
import org.slf4j.LoggerFactory; |
|
60 |
|
|
61 |
/** |
|
62 |
* Provider for <code>TileFileFormat</code> |
|
63 |
* |
|
64 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
65 |
*/ |
|
66 |
public class TileFileFormatProvider extends DefaultRasterProvider implements TiledRasterProvider { |
|
67 |
public static String NAME = "TileFileFormat Store"; |
|
68 |
public static String DESCRIPTION = "Tile file format Source"; |
|
69 |
public static final String METADATA_DEFINITION_NAME = "TileFileFormatStore"; |
|
70 |
private static final Logger logger = LoggerFactory.getLogger(TileFileFormatProvider.class); |
|
71 |
protected static String[] formatList = null; |
|
72 |
private boolean open = false; |
|
73 |
|
|
74 |
public static void register() { |
|
75 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
|
76 |
registerFormats(); |
|
77 |
|
|
78 |
ExtensionPoint point = extensionPoints.get("DefaultRasterProvider"); |
|
79 |
point.append("reader", TileFileFormatProvider.NAME, TileFileFormatProvider.class); |
|
80 |
|
|
81 |
DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager(); |
|
82 |
if (dataman != null && !dataman.getStoreProviders().contains(NAME)) { |
|
83 |
dataman.registerStoreProvider(NAME, |
|
84 |
TileFileFormatProvider.class, TileFileFormatDataParameters.class); |
|
85 |
} |
|
86 |
|
|
87 |
if(DALFileLocator.getFilesystemServerExplorerManager() != null) |
|
88 |
DALFileLocator.getFilesystemServerExplorerManager().registerProvider( |
|
89 |
NAME, DESCRIPTION, |
|
90 |
TileFileFormatFilesystemServerExplorer.class); |
|
91 |
|
|
92 |
dataman.registerStoreFactory(NAME, DefaultStoreFactory.class); |
|
93 |
} |
|
94 |
|
|
95 |
private static void registerFormats() { |
|
96 |
formatList = new String[] {"tff"}; |
|
97 |
for (int i = 0; i < formatList.length; i++) |
|
98 |
RasterLocator.getManager().getProviderServices().addFormat(formatList[i], TileFileFormatProvider.class); |
|
99 |
} |
|
100 |
|
|
101 |
public String[] getFormatList() { |
|
102 |
return formatList; |
|
103 |
} |
|
104 |
|
|
105 |
public boolean isExtensionSupported(String ext) { |
|
106 |
if(ext.indexOf(".") != -1) |
|
107 |
ext = ext.substring(ext.lastIndexOf(".") + 1, ext.length()); |
|
108 |
for (int i = 0; i < formatList.length; i++) { |
|
109 |
if(formatList[i].compareTo(ext) == 0) |
|
110 |
return true; |
|
111 |
} |
|
112 |
return false; |
|
113 |
} |
|
114 |
|
|
115 |
public TileFileFormatProvider() throws NotSupportedExtensionException { |
|
116 |
super(); |
|
117 |
} |
|
118 |
|
|
119 |
public TileFileFormatProvider(TileFileFormatDataParameters params, |
|
120 |
DataStoreProviderServices storeServices) throws InitializeException { |
|
121 |
super(params, storeServices, ToolsLocator.getDynObjectManager() |
|
122 |
.createDynObject( |
|
123 |
MetadataLocator.getMetadataManager().getDefinition( |
|
124 |
DataStore.METADATA_DEFINITION_NAME))); |
|
125 |
try { |
|
126 |
init(params, storeServices); |
|
127 |
} catch (OpenException e) { |
|
128 |
throw new InitializeException("Error open the source", e); |
|
129 |
} catch (NotSupportedExtensionException e) { |
|
130 |
throw new InitializeException("Not supported extension", e); |
|
131 |
} |
|
132 |
} |
|
133 |
|
|
134 |
/** |
|
135 |
* Build file references |
|
136 |
* @param proj Projection |
|
137 |
* @param param Load parameters |
|
138 |
* @throws NotSupportedExtensionException |
|
139 |
*/ |
|
140 |
public void init(TileFileFormatDataParameters params, |
|
141 |
DataStoreProviderServices storeServices) throws NotSupportedExtensionException, OpenException { |
|
142 |
|
|
143 |
openFromTff(); |
|
144 |
|
|
145 |
uri = getParameters().getURI(); |
|
146 |
|
|
147 |
super.init(); |
|
148 |
|
|
149 |
try { |
|
150 |
loadFromRmf(getRmfBlocksManager()); |
|
151 |
} catch (ParsingException e) { |
|
152 |
logger.debug("Problems reading from RMF", e); |
|
153 |
} |
|
154 |
|
|
155 |
open = true; |
|
156 |
} |
|
157 |
|
|
158 |
/** |
|
159 |
* Open from a .mff file. |
|
160 |
* This method loads all providers and adds these to the parameters |
|
161 |
* @throws OpenException |
|
162 |
*/ |
|
163 |
private void openFromTff() throws OpenException { |
|
164 |
|
|
165 |
} |
|
166 |
|
|
167 |
public TileFileFormatDataParameters getParameters() { |
|
168 |
try { |
|
169 |
return (TileFileFormatDataParameters)parameters; |
|
170 |
} catch (ClassCastException e) { |
|
171 |
return null; |
|
172 |
} |
|
173 |
} |
|
174 |
|
|
175 |
@Override |
|
176 |
public int getBlockSize() { |
|
177 |
return 0; |
|
178 |
} |
|
179 |
|
|
180 |
@Override |
|
181 |
public Object getData(int x, int y, int band) |
|
182 |
throws InvalidSetViewException, FileNotOpenException, |
|
183 |
RasterDriverException { |
|
184 |
return null; |
|
185 |
} |
|
186 |
|
|
187 |
@Override |
|
188 |
public double getHeight() { |
|
189 |
return 0; |
|
190 |
} |
|
191 |
|
|
192 |
@Override |
|
193 |
public int getOverviewHeight(int band, int overview) |
|
194 |
throws BandAccessException, RasterDriverException { |
|
195 |
return 0; |
|
196 |
} |
|
197 |
|
|
198 |
@Override |
|
199 |
public int getOverviewWidth(int band, int overview) |
|
200 |
throws BandAccessException, RasterDriverException { |
|
201 |
return 0; |
|
202 |
} |
|
203 |
|
|
204 |
@Override |
|
205 |
public Extent getView() { |
|
206 |
return null; |
|
207 |
} |
|
208 |
|
|
209 |
@Override |
|
210 |
public double getWidth() { |
|
211 |
return 0; |
|
212 |
} |
|
213 |
|
|
214 |
@Override |
|
215 |
protected Buffer getWindow(Extent extent, BandList bandList, |
|
216 |
Buffer rasterBuf, TaskStatus status) |
|
217 |
throws ProcessInterruptedException, RasterDriverException { |
|
218 |
return null; |
|
219 |
} |
|
220 |
|
|
221 |
@Override |
|
222 |
protected void getWindow(Extent ex, int bufWidth, int bufHeight, |
|
223 |
BandList bandList, TileListener listener, TaskStatus taskStatus) |
|
224 |
throws ProcessInterruptedException, RasterDriverException { |
|
225 |
|
|
226 |
} |
|
227 |
|
|
228 |
@Override |
|
229 |
protected Buffer getWindow(Extent extent, int bufWidth, int bufHeight, |
|
230 |
BandList bandList, Buffer rasterBuf, boolean adjustToExtent, |
|
231 |
TaskStatus status) throws ProcessInterruptedException, |
|
232 |
RasterDriverException { |
|
233 |
return null; |
|
234 |
} |
|
235 |
|
|
236 |
@Override |
|
237 |
protected Buffer getWindow(int x, int y, int w, int h, BandList bandList, |
|
238 |
Buffer rasterBuf, TaskStatus status) |
|
239 |
throws ProcessInterruptedException, RasterDriverException { |
|
240 |
return null; |
|
241 |
} |
|
242 |
|
|
243 |
@Override |
|
244 |
protected Buffer getWindow(double x, double y, double w, double h, |
|
245 |
BandList bandList, Buffer rasterBuf, boolean adjustToExtent, |
|
246 |
TaskStatus status) throws ProcessInterruptedException, |
|
247 |
RasterDriverException { |
|
248 |
return null; |
|
249 |
} |
|
250 |
|
|
251 |
@Override |
|
252 |
public boolean isOverviewsSupported() { |
|
253 |
return false; |
|
254 |
} |
|
255 |
|
|
256 |
@Override |
|
257 |
public RasterProvider load() { |
|
258 |
return null; |
|
259 |
} |
|
260 |
|
|
261 |
@Override |
|
262 |
public void setView(Extent e) { |
|
263 |
|
|
264 |
} |
|
265 |
|
|
266 |
public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h) { |
|
267 |
return null; |
|
268 |
} |
|
269 |
|
|
270 |
public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h) { |
|
271 |
return null; |
|
272 |
} |
|
273 |
|
|
274 |
public RasterProvider getInternalProvider() { |
|
275 |
return null; |
|
276 |
} |
|
277 |
|
|
278 |
public int getNearestLevel(double pixelSize) { |
|
279 |
return 0; |
|
280 |
} |
|
281 |
|
|
282 |
public Tile getTile(DefaultRasterQuery q) throws TileGettingException { |
|
283 |
return null; |
|
284 |
} |
|
285 |
|
|
286 |
public int getZoomLevels() { |
|
287 |
return 0; |
|
288 |
} |
|
289 |
|
|
290 |
public int getOverviewCount(int band) throws BandAccessException, |
|
291 |
RasterDriverException { |
|
292 |
return 0; |
|
293 |
} |
|
294 |
|
|
295 |
public TileServer getTileServer() { |
|
296 |
return null; |
|
297 |
} |
|
298 |
|
|
299 |
public boolean isOpen() { |
|
300 |
return open; |
|
301 |
} |
|
302 |
|
|
303 |
public Object readBlock(int pos, int blockHeight, double scale) |
|
304 |
throws InvalidSetViewException, FileNotOpenException, |
|
305 |
RasterDriverException, ProcessInterruptedException { |
|
306 |
return null; |
|
307 |
} |
|
308 |
|
|
309 |
public void setStatus(RasterProvider provider) { |
|
310 |
|
|
311 |
} |
|
312 |
|
|
313 |
public String getName() { |
|
314 |
return null; |
|
315 |
} |
|
316 |
|
|
317 |
} |
|
0 | 318 |
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatNewRasterStoreParameters.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.raster.tilecache.io.tff; |
|
23 |
|
|
24 |
import org.gvsig.raster.impl.store.AbstractNewRasterStoreParameters; |
|
25 |
|
|
26 |
/** |
|
27 |
* Parameters for creating a <code>TileFileFormat</code> store |
|
28 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
29 |
*/ |
|
30 |
public class TileFileFormatNewRasterStoreParameters extends AbstractNewRasterStoreParameters { |
|
31 |
|
|
32 |
public String getDataStoreName() { |
|
33 |
return TileFileFormatProvider.NAME; |
|
34 |
} |
|
35 |
|
|
36 |
public String getDescription() { |
|
37 |
return TileFileFormatProvider.DESCRIPTION; |
|
38 |
} |
|
39 |
|
|
40 |
} |
|
0 | 41 |
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatFilesystemServerExplorer.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 |
|
|
23 |
package org.gvsig.raster.tilecache.io.tff; |
|
24 |
|
|
25 |
import java.io.File; |
|
26 |
import java.util.List; |
|
27 |
|
|
28 |
import org.gvsig.fmap.dal.DALLocator; |
|
29 |
import org.gvsig.fmap.dal.DataManager; |
|
30 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
31 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
32 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
33 |
import org.gvsig.fmap.dal.NewDataStoreParameters; |
|
34 |
import org.gvsig.fmap.dal.coverage.RasterLocator; |
|
35 |
import org.gvsig.fmap.dal.exception.CreateException; |
|
36 |
import org.gvsig.fmap.dal.exception.DataException; |
|
37 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
38 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
39 |
import org.gvsig.fmap.dal.exception.RemoveException; |
|
40 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider; |
|
41 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices; |
|
42 |
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices; |
|
43 |
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters; |
|
44 |
|
|
45 |
public class TileFileFormatFilesystemServerExplorer extends AbstractFilesystemServerExplorerProvider { |
|
46 |
|
|
47 |
public TileFileFormatFilesystemServerExplorer() { |
|
48 |
|
|
49 |
} |
|
50 |
|
|
51 |
public TileFileFormatFilesystemServerExplorer( |
|
52 |
TileFileFormatExplorerParameters parameters, |
|
53 |
DataServerExplorerProviderServices services) |
|
54 |
throws InitializeException { |
|
55 |
System.out.println(); |
|
56 |
} |
|
57 |
|
|
58 |
public String getDataStoreProviderName() { |
|
59 |
return TileFileFormatProvider.NAME; |
|
60 |
} |
|
61 |
|
|
62 |
public String getDescription() { |
|
63 |
return TileFileFormatProvider.DESCRIPTION; |
|
64 |
} |
|
65 |
|
|
66 |
public DataStoreParameters getStoreParameters() { |
|
67 |
DataManager manager = DALLocator.getDataManager(); |
|
68 |
try { |
|
69 |
return manager.createStoreParameters(this.getDataStoreProviderName()); |
|
70 |
} catch (InitializeException e) { |
|
71 |
e.printStackTrace(); |
|
72 |
} catch (ProviderNotRegisteredException e) { |
|
73 |
e.printStackTrace(); |
|
74 |
} |
|
75 |
return null; |
|
76 |
} |
|
77 |
|
|
78 |
@SuppressWarnings("unchecked") |
|
79 |
public List getDataStoreProviderNames() { |
|
80 |
return null; |
|
81 |
} |
|
82 |
|
|
83 |
public String getProviderName() { |
|
84 |
return TileFileFormatProvider.NAME; |
|
85 |
} |
|
86 |
|
|
87 |
public DataServerExplorerProviderServices getServerExplorerProviderServices() { |
|
88 |
return null; |
|
89 |
} |
|
90 |
|
|
91 |
public boolean canCreate() { |
|
92 |
return false; |
|
93 |
} |
|
94 |
|
|
95 |
public boolean canCreate(NewDataStoreParameters parameters) { |
|
96 |
return false; |
|
97 |
} |
|
98 |
|
|
99 |
public void create(NewDataStoreParameters parameters, boolean overwrite) |
|
100 |
throws CreateException { |
|
101 |
throw new UnsupportedOperationException(); |
|
102 |
} |
|
103 |
|
|
104 |
public NewDataStoreParameters getCreateParameters() throws DataException { |
|
105 |
return null; |
|
106 |
} |
|
107 |
|
|
108 |
public void initialize( |
|
109 |
FilesystemServerExplorerProviderServices serverExplorer) { |
|
110 |
} |
|
111 |
|
|
112 |
public boolean accept(File pathname) { |
|
113 |
return RasterLocator.getManager().getProviderServices().isExtensionSupported( |
|
114 |
pathname.getAbsolutePath(), |
|
115 |
TileFileFormatProvider.class); |
|
116 |
} |
|
117 |
|
|
118 |
public void remove(DataStoreParameters parameters) throws RemoveException { |
|
119 |
throw new UnsupportedOperationException(); |
|
120 |
} |
|
121 |
|
|
122 |
public boolean add(String provider, NewDataStoreParameters parameters, |
|
123 |
boolean overwrite) throws DataException { |
|
124 |
return false; |
|
125 |
} |
|
126 |
|
|
127 |
public boolean canAdd() { |
|
128 |
return false; |
|
129 |
} |
|
130 |
|
|
131 |
public boolean canAdd(String storeName) throws DataException { |
|
132 |
return false; |
|
133 |
} |
|
134 |
|
|
135 |
public NewDataStoreParameters getAddParameters(String storeName) |
|
136 |
throws DataException { |
|
137 |
return null; |
|
138 |
} |
|
139 |
|
|
140 |
public DataStoreParameters getParameters(File file) throws DataException { |
|
141 |
DataManager manager = DALLocator.getDataManager(); |
|
142 |
AbstractRasterFileDataParameters params = (AbstractRasterFileDataParameters) manager |
|
143 |
.createStoreParameters(this.getDataStoreProviderName()); |
|
144 |
params.setFile(file); |
|
145 |
return params; |
|
146 |
} |
|
147 |
|
|
148 |
public DataServerExplorerParameters getParameters() { |
|
149 |
return null; |
|
150 |
} |
|
151 |
|
|
152 |
@SuppressWarnings("unchecked") |
|
153 |
public List list() throws DataException { |
|
154 |
return null; |
|
155 |
} |
|
156 |
|
|
157 |
@SuppressWarnings("unchecked") |
|
158 |
public List list(int mode) throws DataException { |
|
159 |
return null; |
|
160 |
} |
|
161 |
|
|
162 |
public void dispose() { |
|
163 |
} |
|
164 |
|
|
165 |
public int getMode() { |
|
166 |
return DataServerExplorer.MODE_RASTER; |
|
167 |
} |
|
168 |
|
|
169 |
} |
|
0 | 170 |
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatDataParameters.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 |
|
|
23 |
package org.gvsig.raster.tilecache.io.tff; |
|
24 |
|
|
25 |
import org.gvsig.raster.impl.store.AbstractRasterDataParameters; |
|
26 |
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters; |
|
27 |
import org.gvsig.tools.ToolsLocator; |
|
28 |
import org.gvsig.tools.dynobject.DynStruct; |
|
29 |
import org.gvsig.tools.persistence.PersistenceManager; |
|
30 |
import org.gvsig.tools.persistence.PersistentState; |
|
31 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
32 |
|
|
33 |
/** |
|
34 |
* Parameters for the <code>TileFileFormatProvider</code> |
|
35 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
36 |
*/ |
|
37 |
public class TileFileFormatDataParameters extends AbstractRasterFileDataParameters { |
|
38 |
|
|
39 |
public String getDataStoreName() { |
|
40 |
return TileFileFormatProvider.NAME; |
|
41 |
} |
|
42 |
|
|
43 |
public String getDescription() { |
|
44 |
return TileFileFormatProvider.DESCRIPTION; |
|
45 |
} |
|
46 |
|
|
47 |
public void loadFromState(PersistentState state) |
|
48 |
throws PersistenceException { |
|
49 |
super.loadFromState(state); |
|
50 |
} |
|
51 |
|
|
52 |
public void saveToState(PersistentState state) throws PersistenceException { |
|
53 |
super.saveToState(state); |
|
54 |
} |
|
55 |
|
|
56 |
public static void registerPersistence() { |
|
57 |
PersistenceManager manager = ToolsLocator.getPersistenceManager(); |
|
58 |
DynStruct definition = manager.getDefinition("TileFileFormatDataParameters_Persistent"); |
|
59 |
if( definition == null ) { |
|
60 |
definition = manager.addDefinition( |
|
61 |
TileFileFormatDataParameters.class, |
|
62 |
"TileFileFormatDataParameters_Persistent", |
|
63 |
"TileFileFormatDataParameters Persistent", |
|
64 |
null, |
|
65 |
null |
|
66 |
); |
|
67 |
AbstractRasterDataParameters.registerPersistence(definition); |
|
68 |
} |
|
69 |
} |
|
70 |
} |
|
0 | 71 |
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/TileServerExplorer.java | ||
---|---|---|
61 | 61 |
throws InitializeException { |
62 | 62 |
} |
63 | 63 |
|
64 |
/* |
|
65 |
* (non-Javadoc) |
|
66 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate() |
|
67 |
*/ |
|
68 | 64 |
public boolean canCreate() { |
69 | 65 |
return false; |
70 | 66 |
} |
71 | 67 |
|
72 |
/* |
|
73 |
* (non-Javadoc) |
|
74 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate(org.gvsig.fmap.dal.NewDataStoreParameters) |
|
75 |
*/ |
|
76 | 68 |
public boolean canCreate(NewDataStoreParameters parameters) { |
77 | 69 |
return false; |
78 | 70 |
} |
79 | 71 |
|
80 |
/* |
|
81 |
* (non-Javadoc) |
|
82 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#create(org.gvsig.fmap.dal.NewDataStoreParameters, boolean) |
|
83 |
*/ |
|
84 | 72 |
public void create(NewDataStoreParameters parameters, boolean overwrite) |
85 | 73 |
throws CreateException { |
86 | 74 |
throw new UnsupportedOperationException(); |
87 | 75 |
} |
88 | 76 |
|
89 |
/* |
|
90 |
* (non-Javadoc) |
|
91 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#getCreateParameters() |
|
92 |
*/ |
|
93 | 77 |
public NewDataStoreParameters getCreateParameters() throws DataException { |
94 | 78 |
return null; |
95 | 79 |
} |
96 | 80 |
|
97 |
/* |
|
98 |
* (non-Javadoc) |
|
99 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#initialize(org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices) |
|
100 |
*/ |
|
101 | 81 |
public void initialize( |
102 | 82 |
FilesystemServerExplorerProviderServices serverExplorer) { |
103 | 83 |
} |
104 | 84 |
|
105 |
/* |
|
106 |
* (non-Javadoc) |
|
107 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#remove(org.gvsig.fmap.dal.DataStoreParameters) |
|
108 |
*/ |
|
109 | 85 |
public void remove(DataStoreParameters parameters) throws RemoveException { |
110 | 86 |
throw new UnsupportedOperationException(); |
111 | 87 |
} |
112 | 88 |
|
113 |
/* |
|
114 |
* (non-Javadoc) |
|
115 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter#getDataStoreProviderName() |
|
116 |
*/ |
|
117 | 89 |
public String getDataStoreProviderName() { |
118 | 90 |
return TileProvider.NAME; |
119 | 91 |
} |
... | ... | |
161 | 133 |
TileProvider.class); |
162 | 134 |
} |
163 | 135 |
|
164 |
/* |
|
165 |
* (non-Javadoc) |
|
166 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter#getDescription() |
|
167 |
*/ |
|
168 | 136 |
public String getDescription() { |
169 | 137 |
return TileProvider.DESCRIPTION; |
170 | 138 |
} |
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/TileDataParametersImpl.java | ||
---|---|---|
42 | 42 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
43 | 43 |
|
44 | 44 |
/** |
45 |
* Parameters for the WMTS provider
|
|
45 |
* Parameters for the <code>TileProvider</code>
|
|
46 | 46 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
47 | 47 |
*/ |
48 | 48 |
public class TileDataParametersImpl extends AbstractRasterFileDataParameters implements TileDataParameters { |
org.gvsig.raster.multifile/trunk/org.gvsig.raster.multifile/org.gvsig.raster.multifile.io/src/main/java/org/gvsig/raster/multifile/io/MultiFileServerExplorer.java | ||
---|---|---|
65 | 65 |
System.out.println(); |
66 | 66 |
} |
67 | 67 |
|
68 |
/* |
|
69 |
* (non-Javadoc) |
|
70 |
* @see org.gvsig.fmap.dal.coverage.store.remote.RemoteServerExplorerProvider#getDataStoreProviderName() |
|
71 |
*/ |
|
72 | 68 |
public String getDataStoreProviderName() { |
73 | 69 |
return MultiFileProvider.NAME; |
74 | 70 |
} |
75 | 71 |
|
76 |
/* |
|
77 |
* (non-Javadoc) |
|
78 |
* @see org.gvsig.fmap.dal.coverage.store.remote.RemoteServerExplorerProvider#getDescription() |
|
79 |
*/ |
|
80 | 72 |
public String getDescription() { |
81 | 73 |
return MultiFileProvider.DESCRIPTION; |
82 | 74 |
} |
83 | 75 |
|
84 |
/* |
|
85 |
* (non-Javadoc) |
|
86 |
* @see org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer#getStoreParameters() |
|
87 |
*/ |
|
88 | 76 |
public DataStoreParameters getStoreParameters() { |
89 | 77 |
DataManager manager = DALLocator.getDataManager(); |
90 | 78 |
try { |
... | ... | |
106 | 94 |
return MultiFileProvider.NAME; |
107 | 95 |
} |
108 | 96 |
|
109 |
/* |
|
110 |
* (non-Javadoc) |
|
111 |
* @see org.gvsig.fmap.dal.spi.DataServerExplorerProvider#getServerExplorerProviderServices() |
|
112 |
*/ |
|
113 | 97 |
public DataServerExplorerProviderServices getServerExplorerProviderServices() { |
114 | 98 |
return null; |
115 | 99 |
} |
116 | 100 |
|
117 |
/* |
|
118 |
* (non-Javadoc) |
|
119 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate() |
|
120 |
*/ |
|
121 | 101 |
public boolean canCreate() { |
122 | 102 |
return false; |
123 | 103 |
} |
124 | 104 |
|
125 |
/* |
|
126 |
* (non-Javadoc) |
|
127 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate(org.gvsig.fmap.dal.NewDataStoreParameters) |
|
128 |
*/ |
|
129 | 105 |
public boolean canCreate(NewDataStoreParameters parameters) { |
130 | 106 |
return false; |
131 | 107 |
} |
132 | 108 |
|
133 |
/* |
|
134 |
* (non-Javadoc) |
|
135 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#create(org.gvsig.fmap.dal.NewDataStoreParameters, boolean) |
|
136 |
*/ |
|
137 | 109 |
public void create(NewDataStoreParameters parameters, boolean overwrite) |
138 | 110 |
throws CreateException { |
139 | 111 |
throw new UnsupportedOperationException(); |
140 | 112 |
} |
141 | 113 |
|
142 |
/* |
|
143 |
* (non-Javadoc) |
|
144 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#getCreateParameters() |
|
145 |
*/ |
|
146 | 114 |
public NewDataStoreParameters getCreateParameters() throws DataException { |
147 | 115 |
return null; |
148 | 116 |
} |
149 | 117 |
|
150 |
/* |
|
151 |
* (non-Javadoc) |
|
152 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#initialize(org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices) |
|
153 |
*/ |
|
154 | 118 |
public void initialize( |
155 | 119 |
FilesystemServerExplorerProviderServices serverExplorer) { |
156 | 120 |
} |
157 | 121 |
|
158 |
/* |
|
159 |
* (non-Javadoc) |
|
160 |
* @see java.io.FileFilter#accept(java.io.File) |
|
161 |
*/ |
|
162 | 122 |
public boolean accept(File pathname) { |
163 | 123 |
return RasterLocator.getManager().getProviderServices().isExtensionSupported( |
164 | 124 |
pathname.getAbsolutePath(), |
165 | 125 |
MultiFileProvider.class); |
166 | 126 |
} |
167 | 127 |
|
168 |
/* |
|
169 |
* (non-Javadoc) |
|
170 |
* @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#remove(org.gvsig.fmap.dal.DataStoreParameters) |
|
171 |
*/ |
|
172 | 128 |
public void remove(DataStoreParameters parameters) throws RemoveException { |
173 | 129 |
throw new UnsupportedOperationException(); |
174 | 130 |
} |
org.gvsig.raster.multifile/trunk/org.gvsig.raster.multifile/org.gvsig.raster.multifile.io/src/main/java/org/gvsig/raster/multifile/io/MultiFileServerExplorerParameters.java | ||
---|---|---|
74 | 74 |
return delegatedDynObject; |
75 | 75 |
} |
76 | 76 |
|
77 |
/* |
|
78 |
* (non-Javadoc) |
|
79 |
* @see org.gvsig.fmap.dal.DataStoreParameters#getDataStoreName() |
|
80 |
*/ |
|
81 | 77 |
public String getDataStoreName() { |
82 | 78 |
return MultiFileProvider.NAME; |
83 | 79 |
} |
84 | 80 |
|
85 |
/* |
|
86 |
* (non-Javadoc) |
|
87 |
* @see org.gvsig.fmap.dal.DataStoreParameters#getDescription() |
|
88 |
*/ |
|
89 | 81 |
public String getDescription() { |
90 | 82 |
return MultiFileProvider.DESCRIPTION; |
91 | 83 |
} |
92 | 84 |
|
93 |
/* |
|
94 |
* (non-Javadoc) |
|
95 |
* @see org.gvsig.fmap.dal.DataServerExplorerParameters#getExplorerName() |
|
96 |
*/ |
|
97 | 85 |
public String getExplorerName() { |
98 | 86 |
return MultiFileProvider.NAME; |
99 | 87 |
} |
Also available in: Unified diff