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 @ 315

History | View | Annotate | Download (3.32 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.fill.impl.SimpleFill3DSymbol;
34
import org.gvsig.gvsig3d.impl.symbology3d.marker.impl.SimpleMarker3DSymbol;
35
import org.gvsig.gvsig3d.lib.spi.Gvsig3DProviderLocator;
36
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.SimpleMarkerSymbol;
37
import org.gvsig.symbology.impl.SymbologyDefaultImplLibrary;
38
import org.gvsig.tools.library.AbstractLibrary;
39
import org.gvsig.tools.library.LibraryException;
40
import org.gvsig.tools.util.Caller;
41
import org.gvsig.tools.util.impl.DefaultCaller;
42

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

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

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

    
61
                Gvsig3DManager manager = Gvsig3DLocator.getManager();
62

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

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

    
95
        }
96

    
97
}