Personal tools
You are here: Home gvSIG Projects gvSIG Desktop Documentation Developers documentation org.gvsig.fmap.geom 2.0.0 Create a new manager
gvSIG Desktop
gvSIG Desktop

Cached time 11/21/13 17:25:19 Clear cache and reload

 
.. include-document:: org.gvsig.fmap.geom/reference-links
   :rest:

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:

.. code-block:: java

  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*:

.. code-block:: java

  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.

View source document


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: