gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.impl / src / main / java / org / gvsig / raster / impl / store / AbstractRasterFileDataParameters.java @ 1356
History | View | Annotate | Download (3.04 KB)
1 | 178 | nbrodin | /* 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.impl.store; |
||
29 | |||
30 | import java.io.File; |
||
31 | |||
32 | 471 | nbrodin | import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters; |
33 | 178 | nbrodin | import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
34 | 234 | nbrodin | import org.gvsig.tools.ToolsLocator; |
35 | import org.gvsig.tools.dynobject.DelegatedDynObject; |
||
36 | import org.gvsig.tools.dynobject.DynClass; |
||
37 | import org.gvsig.tools.dynobject.DynObjectManager; |
||
38 | 178 | nbrodin | |
39 | /**
|
||
40 | * Base class for all kind of parameters in raster files
|
||
41 | *
|
||
42 | * @author Nacho Brodin (nachobrodin@gmail.com)
|
||
43 | */
|
||
44 | 234 | nbrodin | public abstract class AbstractRasterFileDataParameters extends AbstractRasterDataParameters implements |
45 | 178 | nbrodin | RasterFileStoreParameters, FilesystemStoreParameters { |
46 | 448 | nbrodin | public static final String DYNCLASS_NAME = "RasterFileDataParameters"; |
47 | protected DelegatedDynObject delegatedDynObject = null; |
||
48 | private static DynClass DYNCLASS = null; |
||
49 | 234 | nbrodin | |
50 | public static void registerDynClass() { |
||
51 | DynObjectManager dynman = ToolsLocator.getDynObjectManager(); |
||
52 | DynClass dynClass; |
||
53 | |||
54 | if(dynman == null) |
||
55 | return;
|
||
56 | |||
57 | if (DYNCLASS == null) { |
||
58 | dynClass = AbstractRasterDataParameters.registerDynClass(DYNCLASS_NAME); |
||
59 | //No hay par?metros especificos de fichero
|
||
60 | DYNCLASS = dynClass; |
||
61 | } |
||
62 | |||
63 | } |
||
64 | |||
65 | public AbstractRasterFileDataParameters() {
|
||
66 | super();
|
||
67 | initialize(); |
||
68 | } |
||
69 | |||
70 | protected void initialize() { |
||
71 | this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
|
||
72 | .getDynObjectManager().createDynObject( |
||
73 | DYNCLASS); |
||
74 | } |
||
75 | |||
76 | protected DelegatedDynObject getDelegatedDynObject() {
|
||
77 | return delegatedDynObject;
|
||
78 | } |
||
79 | |||
80 | 178 | nbrodin | /*
|
81 | * (non-Javadoc)
|
||
82 | * @see org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters#getFile()
|
||
83 | */
|
||
84 | public File getFile() { |
||
85 | 1356 | nbrodin | Object obj = this.getDynValue(FIELD_URI); |
86 | if(obj != null) |
||
87 | return new File((String)obj); |
||
88 | return null; |
||
89 | 178 | nbrodin | } |
90 | |||
91 | /*
|
||
92 | * (non-Javadoc)
|
||
93 | * @see org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters#setFile(java.io.File)
|
||
94 | */
|
||
95 | public void setFile(File aFile) { |
||
96 | this.setDynValue(FIELD_URI, aFile.getPath());
|
||
97 | } |
||
98 | 180 | nbrodin | |
99 | public boolean isOverridingHost() { |
||
100 | return false; |
||
101 | } |
||
102 | |||
103 | public void setOverrideHost(boolean over) { |
||
104 | |||
105 | } |
||
106 | 178 | nbrodin | |
107 | } |