Statistics
| Revision:

gvsig-raster / org.gvsig.raster.wmts / trunk / org.gvsig.raster.wmts / org.gvsig.raster.wmts.io / src / main / java / org / gvsig / raster / wmts / io / DefaultWMTSServerExplorerParameters.java @ 393

History | View | Annotate | Download (3.58 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.raster.wmts.io;
29

    
30
import org.gvsig.fmap.dal.DataTypes;
31
import org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorer;
32
import org.gvsig.fmap.dal.coverage.explorer.WMTSServerExplorerParameters;
33
import org.gvsig.tools.ToolsLocator;
34
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
35
import org.gvsig.tools.dynobject.DelegatedDynObject;
36
import org.gvsig.tools.dynobject.DynClass;
37
import org.gvsig.tools.dynobject.DynField;
38
import org.gvsig.tools.dynobject.DynObjectManager;
39

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

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

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

    
78
                        DYNCLASS = dynClass;
79
                }
80

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

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

    
103
        /*
104
         * (non-Javadoc)
105
         * @see org.gvsig.fmap.dal.DataStoreParameters#getDataStoreName()
106
         */
107
        public String getDataStoreName() {
108
                return WMTSProvider.NAME;
109
        }
110
        
111
        /*
112
         * (non-Javadoc)
113
         * @see org.gvsig.fmap.dal.DataStoreParameters#getDescription()
114
         */
115
        public String getDescription() {
116
                return WMTSProvider.DESCRIPTION;
117
        }
118
        
119
        /*
120
         * (non-Javadoc)
121
         * @see org.gvsig.fmap.dal.coverage.dataset.io.server.DefaultWMSServerExplorerParameters#getExplorerName()
122
         */
123
        public String getExplorerName() {
124
                return WMTSServerExplorer.NAME;
125
        }
126
}