svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dalfile / src / org / gvsig / fmap / dal / store / shp / SHPLibrary.java @ 28676
History | View | Annotate | Download (2.73 KB)
1 | 24452 | jmvivo | /* 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 | * 2008 IVER T.I. S.A. {{Task}}
|
||
26 | */
|
||
27 | |||
28 | 24498 | jmvivo | package org.gvsig.fmap.dal.store.shp; |
29 | 24452 | jmvivo | |
30 | 24893 | jmvivo | import org.gvsig.fmap.dal.DALFileLocator; |
31 | 24498 | jmvivo | import org.gvsig.fmap.dal.DALLocator; |
32 | import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
||
33 | import org.gvsig.fmap.dal.store.dbf.DBFLibrary; |
||
34 | 25548 | cordinyana | import org.gvsig.tools.ToolsLocator; |
35 | import org.gvsig.tools.dynobject.DynObjectManager; |
||
36 | 24452 | jmvivo | import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
37 | |||
38 | |||
39 | public class SHPLibrary extends DBFLibrary { |
||
40 | |||
41 | 26359 | jmvivo | |
42 | 24452 | jmvivo | public void postInitialize() throws ReferenceNotRegisteredException { |
43 | super.postInitialize();
|
||
44 | 25789 | jmvivo | |
45 | SHPStoreParameters.registerDynClass(); |
||
46 | SHPNewStoreParameters.registerDynClass(); |
||
47 | SHPStoreProvider.registerDynClass(); |
||
48 | |||
49 | 25548 | cordinyana | DynObjectManager dynObjectManager = ToolsLocator.getDynObjectManager(); |
50 | |||
51 | 25551 | cordinyana | // DynClass dbfDynClass = dynObjectManager.get("DBFStoreParameters");
|
52 | // DynClass shpDynClass = dynObjectManager.add("SHPStoreParameters",
|
||
53 | // "Shape File Store parameters");
|
||
54 | // shpDynClass.addDynField("shpfilename");
|
||
55 | // shpDynClass.addDynField("shxfilename");
|
||
56 | // shpDynClass.extend(dbfDynClass);
|
||
57 | //
|
||
58 | // shpDynClass = dynObjectManager.add("SHPNewStoreParameters",
|
||
59 | // "Shape File New Store parameters");
|
||
60 | // shpDynClass.addDynField("shpfilename");
|
||
61 | // shpDynClass.addDynField("shxfilename");
|
||
62 | // shpDynClass.extend(dbfDynClass);
|
||
63 | 25548 | cordinyana | |
64 | 24452 | jmvivo | DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator |
65 | .getDataManager(); |
||
66 | |||
67 | if (!dataman.getStoreProviders().contains(SHPStoreProvider.NAME)) {
|
||
68 | dataman.registerStoreProvider(SHPStoreProvider.NAME, |
||
69 | SHPStoreProvider.class, SHPStoreParameters.class); |
||
70 | } |
||
71 | |||
72 | 24918 | jmvivo | DALFileLocator.getFilesystemServerExplorerManager().registerProvider( |
73 | 24959 | jmvivo | SHPStoreProvider.NAME, SHPStoreProvider.DESCRIPTION, |
74 | 24918 | jmvivo | SHPFilesystemServerProvider.class); |
75 | 24452 | jmvivo | } |
76 | |||
77 | } |