Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.io / org.gvsig.raster.io.base / src / main / java / org / gvsig / fmap / dal / coverage / dataset / io / server / DefaultWMSServerExplorerParameters.java @ 211

History | View | Annotate | Download (3.52 KB)

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.fmap.dal.coverage.dataset.io.server;
29

    
30
import org.gvsig.fmap.dal.DataTypes;
31
import org.gvsig.fmap.dal.coverage.dataset.io.wms.WMSProvider;
32
import org.gvsig.fmap.dal.coverage.explorer.WMSServerExplorer;
33
import org.gvsig.fmap.dal.coverage.explorer.WMSServerExplorerParameters;
34
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
35
import org.gvsig.tools.ToolsLocator;
36
import org.gvsig.tools.dynobject.DelegatedDynObject;
37
import org.gvsig.tools.dynobject.DynClass;
38
import org.gvsig.tools.dynobject.DynField;
39
import org.gvsig.tools.dynobject.DynObjectManager;
40

    
41
/**
42
 * Parameters for the WMS provider
43
 * @author Nacho Brodin (nachobrodin@gmail.com)
44
 */
45
public class DefaultWMSServerExplorerParameters extends AbstractDataParameters implements WMSServerExplorerParameters {
46
        protected static final String  FIELD_HOST          = "host";
47
        protected static DynClass      DYNCLASS            = null;
48
        private DelegatedDynObject     delegatedDynObject  = null;
49
        
50
        public DefaultWMSServerExplorerParameters() {
51
                super();
52
                initialize();
53
        }
54

    
55
        protected void initialize() {
56
                this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
57
                                .getDynObjectManager().createDynObject(
58
                                                DYNCLASS);
59
        }
60
        
61
        @SuppressWarnings("deprecation")
62
        public static void registerDynClass() {
63
                DynObjectManager dynman = ToolsLocator.getDynObjectManager();
64
                DynClass dynClass;
65
                DynField field;
66
                
67
                if(dynman == null)
68
                        return;
69
                
70
                if (DYNCLASS == null) {
71
                        dynClass = dynman.add(DYNCLASS_NAME);
72

    
73
                        field = dynClass.addDynField(FIELD_HOST);
74
                        field.setTheTypeOfAvailableValues(DynField.ANY);
75
                        field.setDescription("Uniform Resource Identifier (File name or URL)");
76
                        field.setType(DataTypes.STRING);
77
                        field.setMandatory(true);
78

    
79
                        DYNCLASS = dynClass;
80
                }
81

    
82
        }
83
        
84
        protected DelegatedDynObject getDelegatedDynObject() {
85
                return delegatedDynObject;
86
        }
87
        
88
        /*
89
         * (non-Javadoc)
90
         * @see org.gvsig.fmap.dal.coverage.explorer.WMSServerExplorerParameters#getHost()
91
         */
92
        public String getHost() {
93
                return (String) this.getDynValue(FIELD_HOST);
94
        }
95

    
96
        /*
97
         * (non-Javadoc)
98
         * @see org.gvsig.fmap.dal.coverage.explorer.WMSServerExplorerParameters#setHost(java.lang.String)
99
         */
100
        public void setHost(String host) {
101
                this.setDynValue(FIELD_HOST, host);
102
        }
103

    
104
        /*
105
         * (non-Javadoc)
106
         * @see org.gvsig.fmap.dal.DataStoreParameters#getDataStoreName()
107
         */
108
        public String getDataStoreName() {
109
                return WMSProvider.NAME;
110
        }
111
        
112
        /*
113
         * (non-Javadoc)
114
         * @see org.gvsig.fmap.dal.DataStoreParameters#getDescription()
115
         */
116
        public String getDescription() {
117
                return WMSProvider.DESCRIPTION;
118
        }
119

    
120
        public String getExplorerName() {
121
                return WMSServerExplorer.NAME;
122
        }
123
}