Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extPublish / src / com / iver / cit / gvsig / publish / layers / LayerFactory.java @ 7102

History | View | Annotate | Download (2.36 KB)

1
package com.iver.cit.gvsig.publish.layers;
2

    
3
import org.gvsig.remoteservices.conf.mapserver.MapServer;
4
import org.gvsig.remoteservices.conf.mapserver.MapServer.MapLayer;
5
import org.gvsig.remoteservices.conf.mapserver.MapServer.ShpLayer;
6

    
7
import com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGisDriver;
8
import com.iver.cit.gvsig.fmap.drivers.shp.IndexedShpDriver;
9
import com.iver.cit.gvsig.fmap.layers.FLayer;
10
import com.iver.cit.gvsig.fmap.layers.FLyrRaster;
11
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
12

    
13
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
14
 *
15
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
16
 *
17
 * This program is free software; you can redistribute it and/or
18
 * modify it under the terms of the GNU General Public License
19
 * as published by the Free Software Foundation; either version 2
20
 * of the License, or (at your option) any later version.
21
 *
22
 * This program is distributed in the hope that it will be useful,
23
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
 * GNU General Public License for more details.
26
 *
27
 * You should have received a copy of the GNU General Public License
28
 * along with this program; if not, write to the Free Software
29
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
30
 *
31
 * For more information, contact:
32
 *
33
 *  Generalitat Valenciana
34
 *   Conselleria d'Infraestructures i Transport
35
 *   Av. Blasco Ib??ez, 50
36
 *   46010 VALENCIA
37
 *   SPAIN
38
 *
39
 *      +34 963862235
40
 *   gvsig@gva.es
41
 *      www.gvsig.gva.es
42
 *
43
 *    or
44
 *
45
 *   IVER T.I. S.A
46
 *   Salamanca 50
47
 *   46005 Valencia
48
 *   Spain
49
 *
50
 *   +34 963163400
51
 *   dac@iver.es
52
 */
53
/* CVS MESSAGES:
54
 *
55
 * $Id: LayerFactory.java 7102 2006-09-07 12:52:03Z jorpiell $
56
 * $Log$
57
 * Revision 1.1  2006-09-07 12:51:54  jorpiell
58
 * Enganchada la interfaz gr?fica con el generador de ficheros
59
 *
60
 *
61
 */
62
/**
63
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
64
 */
65
public class LayerFactory {
66
        
67
        public static MapLayer getMapLayer(FLayer lyr){
68
                if (lyr instanceof FLyrVect){
69
                        FLyrVect lyrVect = (FLyrVect) lyr;
70
                        if (lyrVect.getSource().getDriver() instanceof IndexedShpDriver){
71
                                return new MapServer.ShpLayer();
72
                        }else if(lyrVect.getSource().getDriver() instanceof PostGisDriver){
73
                                return new MapServer.PostgisLayer();
74
                        }
75
                }else if (lyr instanceof FLyrRaster){
76
                        return new MapServer.RasterLayer();
77
                }
78
                return null;
79
        }
80
        
81
}