root / org.gvsig.legend.urbanhorizontalsignage / trunk / org.gvsig.legend.urbanhorizontalsignage / org.gvsig.legend.urbanhorizontalsignage.lib / org.gvsig.legend.urbanhorizontalsignage.lib.impl / src / main / java / org / gvsig / legend / urbanhorizontalsignage / lib / impl / UrbanHorizontalSignageLibraryImpl.java @ 5143
History | View | Annotate | Download (3.9 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright ? 2007-2015 gvSIG Association
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
|
25 |
package org.gvsig.legend.urbanhorizontalsignage.lib.impl; |
26 |
|
27 |
import java.io.InputStream; |
28 |
import java.util.Map; |
29 |
import org.gvsig.fmap.mapcontext.MapContextLibrary; |
30 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
31 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
32 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageLibrary; |
33 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageLocator; |
34 |
import org.gvsig.legend.urbanverticalsignage.lib.impl.DefaultPictureMarkerSymbolTableLegend; |
35 |
import org.gvsig.symbology.impl.SymbologyDefaultImplLibrary; |
36 |
import org.gvsig.tools.ToolsLocator; |
37 |
import org.gvsig.tools.dynobject.DynStruct; |
38 |
import org.gvsig.tools.library.AbstractLibrary; |
39 |
import org.gvsig.tools.library.LibraryException; |
40 |
import org.gvsig.tools.persistence.PersistenceManager; |
41 |
|
42 |
public class UrbanHorizontalSignageLibraryImpl extends AbstractLibrary { |
43 |
|
44 |
@Override
|
45 |
public void doRegistration() { |
46 |
registerAsImplementationOf(UrbanHorizontalSignageLibrary.class); |
47 |
this.require(MapContextLibrary.class);
|
48 |
this.require(SymbologyDefaultImplLibrary.class);
|
49 |
} |
50 |
|
51 |
@Override
|
52 |
protected void doInitialize() throws LibraryException { |
53 |
UrbanHorizontalSignageLocator.registerUrbanHorizontalSignageManager(DefaultUrbanHorizontalSignageManager.class); |
54 |
MapContextManager mcmanager = MapContextLocator.getMapContextManager(); |
55 |
mcmanager.registerLegend("UrbanHorizontalSignageLegend", DefaultUrbanHorizontalSignageLegend.class);
|
56 |
} |
57 |
|
58 |
@Override
|
59 |
protected void doPostInitialize() throws LibraryException { |
60 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
61 |
InputStream is = this.getClass().getResourceAsStream("UrbanHorizontalSignagePersistence.xml"); |
62 |
Map<String,DynStruct> definitions; |
63 |
try {
|
64 |
definitions = ToolsLocator.getDynObjectManager().importDynClassDefinitions(is, this.getClass().getClassLoader());
|
65 |
} catch (Exception ex) { |
66 |
throw new LibraryException(this.getClass(), ex); |
67 |
} |
68 |
|
69 |
persistenceManager.addDefinition( |
70 |
DefaultUrbanHorizontalSignageLegend.class, |
71 |
"DefaultUrbanHorizontalSignageLegend",
|
72 |
definitions, |
73 |
null,
|
74 |
null);
|
75 |
persistenceManager.addDefinition( |
76 |
UrbanHorizontalSignageSymbol.class, |
77 |
"UrbanHorizontalSignageSymbol",
|
78 |
definitions, |
79 |
null,
|
80 |
null
|
81 |
); |
82 |
persistenceManager.addDefinition( |
83 |
DefaultUrbanHorizontalSignageConfig.class, |
84 |
"DefaultUrbanHorizontalSignageConfig",
|
85 |
definitions, |
86 |
null,
|
87 |
null
|
88 |
); |
89 |
persistenceManager.addDefinition( |
90 |
DefaultPictureMarkerSymbolTableLegend.class, |
91 |
"DefaultPictureMarkerSymbolTableLegend",
|
92 |
definitions, |
93 |
null,
|
94 |
null
|
95 |
); |
96 |
} |
97 |
|
98 |
} |