The Tools library is an important part of gvSIG. It provides a number of utilities and services which support the other modules in gvSIG. The main functionality provided by this library relates to:
Although these are the most important services the library provides, it also provides other tools that can be considered structural to the application. These include:
Tip
You can find more detailed information on how the library mechanism works in gvSIG at org.gvsig.tools.library, on the use of locators you can consult org.gvsig.tools.locator, and for managers you can find documentation at org.gvsig.tools.service.
We will focus now on three basic concepts that are repeated throughout the code that we see, and that are linked to utilities that enable a strict separation of the API from the implementation:
These three components play a major role whenever we want to use or create new components, as they are the devices that allow us to access different parts of gvSIG
The Andami framework is used to compose the gvSIG application. It provides mainly two types of services, the management and loading of plugins, and the management of windows that make up the user interface.
At this point we will focus briefly on the management of plugins. Andami provides a launcher for the application that initializes the plugins system, and is responsible for loading the plugins that are installed in the application. A plugin is a functional unit that can provide:
Normally in a gvSIG installation you will find a folder gvSIG/extensions. This folder contains the different plugins installed in the application. Each plugin is contained in a folder, which always contains the files:
Config.xml, which describes:
Where to find this plugin's classes
Tip
More information on the structure and different labels that are allowed in this file can be found at config.xml file
Whether this plugin depends on some other plugin
What menu options the plugin added to the application
What toolbars and buttons the plugin added.
Package.info, which reports on the version, name, ID or description of the plugin. It is like a container for the plugin's metadata, and allows us to identify the plugin when updating or reinstalling it.
There is also a theme folder, which contains the configuration of the application's splash, window icons and background colors.
Although the mechanism for adding new functionality to gvSIG is also adding new plugins, these in turn contain one or more extensions that provide the functionality being added. So we will have a plugin containing extensions.
With respect to the management of plugins, the main components are:
We will examine the IExtension interface in more detail. This is the interface that we implement in order to add a new button or menu option. In this interface we find the methods:
Tip
Although there is currently no documentation related to this for version 2 of gvSIG, in general, existing documentation for gvSIG 1 should be valid. It can be found at Andami windows
Andami, in addition to providing a mechanism for loading and managing plugins, also provides an API for the management of the application's windows. Currently the MDI paradigm is used to manage windows. However, gvSIG's window manager itself can be replaced to provide other forms of display (SDI, tabs,...).
The main entities found in Andami related to windows management are:
In general if we do not need fine control over our windows we can use the ShowWindow method from MDIManager to display a window from a standard JPanel swing.
In gvSIG there are a number of plugins that provide the application's base functionality that have some relevance to the other plugins. These are:
org.gvsig.app. This plugin provides gvSIG with the bulk of the generic functionality of the application, as well as basic access to vector data. It provides:
This plugin, in addition to implementing these features, provides a manager and an important locator in order to develop other plugins:
org.gvsig.editing provides the functionality for editing tabular and vector data.
org.gvsig.geodb adds support for accessing databases such as PostgreSQL.
org.gvsig.i18n.extension adds support for internationalization of the application.
org.gvsig.crs.extension adds support for management of CRSs.
org.gvsig.rastertools adds raster support to gvSIG.
org.gvsig.app.extension adds support for managing add-ons.
org.gvsig.app.daltransform adds support for registration and implementation of transformations on data.
These are some of the most important plugins in gvSIG in the sense that they provide important basic functionality necessary for other plugins to function.
Besides these plugins there are many more plugins in the gvSIG distribution that may or may not be necessary depending on what we're going to do with gvSIG.
When developing with gvSIG it is useful to know the existing plugins, especially the functionality provided by the ApplicationManager. But the important thing is to control which of the libraries we will require in order to implement the functionality we need.
In version 2.0.0 of gvSIG major changes have been introduced, both in how to build gvSIG as well as in the nomenclature used to identify the projects and libraries that are generated. However, this is not a process that has taken place suddenly, it has been happening over a number of years. This has now resulted in a lack of uniformity in the nomenclature of existing components. When it comes to referring to a library we can use the Eclipse project name, the name of the generated jar, or the Maven artifact name. In projects generated recently the chosen rule is that these three names must match, with the name of the Maven artifact being used for all three. Prior to this decision projects had different names for each of these components. For a developer who intends using gvSIG, the important thing is to know the names of the Maven artifact, since they usually need to know for which artifacts dependencies should be set, with the eclipse project name associated with that artifact being less relevant.
The libraries that most meet our needs in gvSIG are: