Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / applications / appgvSIG / src / com / iver / cit / gvsig / project / ProjectFactory.java @ 28861

History | View | Annotate | Download (3.45 KB)

1 1103 fjp
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41 312 fernando
package com.iver.cit.gvsig.project;
42
43 24759 jmvivo
import org.gvsig.fmap.dal.feature.FeatureStore;
44 24923 vcaballero
import org.gvsig.project.document.table.FeatureTableDocument;
45
import org.gvsig.project.document.table.FeatureTableDocumentFactory;
46 24956 jmvivo
import org.gvsig.tools.ToolsLocator;
47 20994 jmvivo
48 7343 caballero
import com.iver.cit.gvsig.project.documents.ProjectDocumentFactory;
49 7304 caballero
import com.iver.cit.gvsig.project.documents.layout.ProjectMap;
50 7379 caballero
import com.iver.cit.gvsig.project.documents.layout.ProjectMapFactory;
51 7304 caballero
import com.iver.cit.gvsig.project.documents.view.ProjectView;
52 7379 caballero
import com.iver.cit.gvsig.project.documents.view.ProjectViewFactory;
53 312 fernando
54
55
56
public class ProjectFactory {
57
        public static ProjectMap createMap(String baseName){
58 7343 caballero
                ProjectDocumentFactory pdf=null;
59
                try {
60 24956 jmvivo
                        pdf = (ProjectDocumentFactory) ToolsLocator
61
                                        .getExtensionPointManager().get("Documents").create(
62
                                                        ProjectMapFactory.registerName);
63
                } catch (Exception e) {
64
                        // FIXME Exception
65 7343 caballero
                        e.printStackTrace();
66
                }
67
                ProjectMap pm=(ProjectMap)pdf.create((Project)null);
68
                pm.setProjectDocumentFactory(pdf);
69
                pm.setName(baseName);
70
                return pm;
71 312 fernando
        }
72 3940 caballero
73 24923 vcaballero
        public static FeatureTableDocument createTable(String name, FeatureStore fs){
74 7759 jmvivo
                ProjectDocumentFactory pdf=null;
75
                try {
76 24956 jmvivo
                        pdf = (ProjectDocumentFactory) ToolsLocator
77
                                        .getExtensionPointManager().get("Documents").create(
78
                                                        FeatureTableDocumentFactory.registerName);
79
                } catch (Exception e) {
80
                        // FIXME Exception
81 7759 jmvivo
                        e.printStackTrace();
82
                }
83 10626 caballero
84 24923 vcaballero
                FeatureTableDocument pt = FeatureTableDocumentFactory.createTable(name, fs);
85 7759 jmvivo
                pt.setProjectDocumentFactory(pdf);
86
                return pt;
87 312 fernando
        }
88 3940 caballero
89 312 fernando
        //TODO implementar bien
90
/*        public static ProjectTable createTable(String viewName, FTable ftable){
91
                return Table.createTable(viewName, ftable);
92
        }
93 3940 caballero
*/
94 6801 fjp
        public static ProjectView createView(String viewName){
95 7343 caballero
                ProjectDocumentFactory pdf=null;
96
                try {
97 24956 jmvivo
                        pdf = (ProjectDocumentFactory) ToolsLocator
98
                                        .getExtensionPointManager().get("Documents").create(
99
                                                        ProjectViewFactory.registerName);
100
                } catch (Exception e) {
101
                        // FIXME Exception
102 7343 caballero
                        e.printStackTrace();
103
                }
104
                ProjectView pv=(ProjectView)pdf.create((Project)null);
105
                pv.setProjectDocumentFactory(pdf);
106
                pv.setName(viewName);
107
                return pv;
108 312 fernando
        }
109 3940 caballero
110 312 fernando
        public static Project createProject(){
111 412 vcaballero
                return new Project();
112 312 fernando
        }
113 3940 caballero
114 312 fernando
        public static ProjectExtent createExtent(){
115 412 vcaballero
                return new ProjectExtent();
116 312 fernando
        }
117 3940 caballero
118
119 10626 caballero
120 312 fernando
}