Personal tools
You are here: Home Development Documents gvSIG desktop 2.0 org.gvsig.fmap.geom Create a new manager

First of all, before using a new manager on gvSIG, it's necessary to create it. For that, we must create a class that inherits from GeometryManager (in the example is called MyGeometryManager), and later we must register it executing the line:

GeometryLocator.registerGeometryManager (MyGeometryManager.class);

The explanation of the manager methods is on the JavaDoc. Besides, this document is an example of the using of this methods and it must resolve any doubt about any method.

The registration of the new manager must be done at the beginning of the application in a class that inherits from the GeometryLibrary- In the method Initialize we must do the registration, in the same way we do on the example, where we have created the class MyGeometryLibrary:

public class MyGeometryLibrary extends GeometryLibrary  {
  
  public void initialize() throws ReferenceNotRegisteredException {
    super.initialize();
  
    //Register the default GeometryManager
    GeometryLocator.registerGeometryManager(MyGeometryManager.class);
  }

  public void postInitialize() {
    super.postInitialize();
 }
}

When it's done, if we access to the locator from another part of the application to recuperate the instance of the GeometryManager, we will obtain an instance of the manager that we have registered.


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: