Revision 44831 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/MapContextLibrary.java

View differences:

MapContextLibrary.java
42 42
import org.gvsig.fmap.mapcontext.tools.persistence.FontPersistenceFactory;
43 43
import org.gvsig.fmap.mapcontext.tools.persistence.Point2DPersistenceFactory;
44 44
import org.gvsig.fmap.mapcontext.tools.persistence.Rectangle2DPersistenceFactory;
45
import org.gvsig.raster.lib.legend.api.RasterLegendLocator;
45 46
import org.gvsig.tools.library.AbstractLibrary;
46 47
import org.gvsig.tools.library.LibraryException;
47 48
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
......
53 54
 * @author jmvivo
54 55
 */
55 56
public class MapContextLibrary extends AbstractLibrary {
56
	final static private Logger LOG = LoggerFactory.getLogger(FLyrDefault.class);
57
	final static private Logger LOGGER = LoggerFactory.getLogger(MapContextLibrary.class);
57 58

  
59
  @Override
58 60
    public void doRegistration() {
59 61
        registerAsAPI(MapContextLibrary.class);
60 62
        require(DALLibrary.class);
61 63
        require(CompatLibrary.class);
62 64
    }
63 65

  
66
  @Override
64 67
	protected void doInitialize() throws LibraryException {
65
		LayerFactory.getInstance().registerLayerToUseForStore(
66
				FeatureStore.class, FLyrVect.class);
67 68
	}
68 69

  
70
  @Override
69 71
	protected void doPostInitialize() throws LibraryException {
70 72
            Caller caller = new DefaultCaller();
71 73

  
......
87 89
            caller.add( new ReprojectDefaultGeometry.RegisterPersistence() );
88 90
            caller.add( new FLayerStatus.RegisterPersistence() );
89 91
            caller.add( new FLyrDefault.RegisterPersistence() );
90
            caller.add( new FLyrVect.RegisterPersistence() );
92
            caller.add( new FLyrVect.SelfRegister() );
91 93
            caller.add( new FLayers.RegisterPersistence() );
92 94

  
93 95
            caller.add( new ColorPersistenceFactory.RegisterPersistence() );
......
100 102
                    throw new LibraryException(MapContextLibrary.class, caller.getExceptions());
101 103
            }
102 104

  
105
        // Validate there is any implementation registered.
106
        if (!RasterLegendLocator.getInstance().exists(
107
                RasterLegendLocator.RASTER_LEGEND_MANAGER_NAME)) {
108
            throw new ReferenceNotRegisteredException(
109
                    RasterLegendLocator.RASTER_LEGEND_MANAGER_NAME, RasterLegendLocator.getInstance());
110
        }
103 111
	}
104 112

  
105 113
}

Also available in: Unified diff