Statistics
| Revision:

gvsig-3d / 2.0 / trunk / org.gvsig.gvsig3d / org.gvsig.gvsig3d.lib / org.gvsig.gvsig3d.lib.impl / src / main / java / org / gvsig / gvsig3d / impl / Gvsig3DDefaultImplLibrary.java @ 306

History | View | Annotate | Download (3.19 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
package org.gvsig.gvsig3d.impl;
24

    
25
import org.gvsig.gvsig3d.Gvsig3DLocator;
26
import org.gvsig.gvsig3d.Gvsig3DManager;
27
import org.gvsig.gvsig3d.impl.layers.FLayers3DImpl;
28
import org.gvsig.gvsig3d.impl.map3d.GraphicLayer3DImpl;
29
import org.gvsig.gvsig3d.impl.map3d.Layer3DPropsImpl;
30
import org.gvsig.gvsig3d.impl.map3d.MapContext3DImpl;
31
import org.gvsig.gvsig3d.impl.map3d.MapControl3DImpl;
32
import org.gvsig.gvsig3d.impl.map3d.Viewport3DImpl;
33
import org.gvsig.gvsig3d.impl.symbology3d.marker.impl.SimpleMarker3DSymbol;
34
import org.gvsig.gvsig3d.lib.spi.Gvsig3DProviderLocator;
35
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.SimpleMarkerSymbol;
36
import org.gvsig.symbology.impl.SymbologyDefaultImplLibrary;
37
import org.gvsig.tools.library.AbstractLibrary;
38
import org.gvsig.tools.library.LibraryException;
39
import org.gvsig.tools.util.Caller;
40
import org.gvsig.tools.util.impl.DefaultCaller;
41

    
42
/**
43
 * Library for default implementation initialization and configuration.
44
 * 
45
 * @author gvSIG team
46
 * @version $Id$
47
 */
48
public class Gvsig3DDefaultImplLibrary extends AbstractLibrary {
49

    
50
        @Override
51
        protected void doInitialize() throws LibraryException {
52
                Gvsig3DLocator.registerManager(DefaultGvsig3DManager.class);
53
                Gvsig3DProviderLocator
54
                                .registerManager(DefaultGvsig3DProviderManager.class);
55
        }
56

    
57
        @Override
58
        protected void doPostInitialize() throws LibraryException {
59

    
60
                Gvsig3DManager manager = Gvsig3DLocator.getManager();
61

    
62
                manager.registerDefaultGraphicsLayer3D(GraphicLayer3DImpl.class);
63
                manager.registerDefaultLayer3DProps(Layer3DPropsImpl.class);
64
                manager.registerDefaultMapContext3D(MapContext3DImpl.class);
65
                manager.registerDefaultMapControl3D(MapControl3DImpl.class);
66
                manager.registerDefaultViewPort3D(Viewport3DImpl.class);
67

    
68
                /*
69
                 * Add registry of symbols
70
                 */
71
                Caller caller = new DefaultCaller();
72
                caller.add(new SimpleMarker3DSymbol.RegisterSymbol());
73
                
74
                
75
                /*
76
                 * Add registry of persistence
77
                 */
78
                
79
                caller.add(new Layer3DPropsImpl.RegisterPersistence());
80
                caller.add(new FLayers3DImpl.RegisterPersistence());
81
                caller.add(new MapContext3DImpl.RegisterPersistence());
82
                caller.add(new SimpleMarker3DSymbol.RegisterPersistence());
83
                
84
                
85
                /*
86
                 * Do register of all
87
                 */
88
                if (!caller.call()) {
89
                        throw new LibraryException(SymbologyDefaultImplLibrary.class,
90
                                        caller.getExceptions());
91
                }
92

    
93
        }
94

    
95
}