Revision 403

View differences:

org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
 <modelVersion>4.0.0</modelVersion>
3
 <parent>
4
  <groupId>org.gvsig</groupId>
5
  <artifactId>org.gvsig.desktop</artifactId>
6
  <version>2.0.205</version>
7
 </parent>
8
 <artifactId>org.gvsig.busquedacatastral</artifactId>
9
 <version>1.0.5</version>
10
 <packaging>pom</packaging>
11
 <name>org.gvsig.busquedacatastral</name>
12
 <description>Busqueda catastral Plugin</description>
13

  
14
 <repositories>
15
  <repository>
16
   <id>gvsig-public-http-repository</id>
17
   <name>gvSIG maven public HTTP repository</name>
18
   <url>http://devel.gvsig.org/m2repo/j2se</url>
19
   <releases>
20
    <enabled>true</enabled>
21
    <updatePolicy>daily</updatePolicy>
22
    <checksumPolicy>warn</checksumPolicy>
23
   </releases>
24
   <snapshots>
25
    <enabled>true</enabled>
26
    <updatePolicy>daily</updatePolicy>
27
    <checksumPolicy>warn</checksumPolicy>
28
   </snapshots>
29
  </repository>
30
 </repositories>
31

  
32
 <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
33
 <scm>
34
  <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5</connection>
35
  <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5</developerConnection>
36
  <url>https://devel.gvsig.org/redmine/projects/gvsig-projects-pool/repository/show/org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5</url>
37
 </scm>
38

  
39
 <distributionManagement>
40
  <site>
41
   <id>gvsig-repository</id>
42
   <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
43
  </site>
44
 </distributionManagement>
45

  
46
 <build>
47
  <plugins>
48
   <plugin>
49
    <groupId>org.apache.maven.plugins</groupId>
50
    <artifactId>maven-release-plugin</artifactId>
51
    <configuration>
52
     <tagBase>https://devel.gvsig.org/svn/gvsig-projects-pool/${project.artifactId}/tags</tagBase>
53
    </configuration>
54
   </plugin>
55
  </plugins>
56
 </build>
57

  
58
 <dependencyManagement>
59
  <dependencies>
60
   <dependency>
61
    <groupId>org.gvsig</groupId>
62
    <artifactId>org.gvsig.busquedacatastral.app.mainplugin</artifactId>
63
    <version>${org.gvsig.busquedacatastral.version}</version>
64
   </dependency>
65
   <dependency>
66
    <groupId>org.gvsig</groupId>
67
    <artifactId>org.gvsig.busquedacatastral.lib.api</artifactId>
68
    <version>${org.gvsig.busquedacatastral.version}</version>
69
   </dependency>
70
   <dependency>
71
    <groupId>org.gvsig</groupId>
72
    <artifactId>org.gvsig.busquedacatastral.lib.impl</artifactId>
73
    <version>${org.gvsig.busquedacatastral.version}</version>
74
   </dependency>
75
   <dependency>
76
    <groupId>org.gvsig</groupId>
77
    <artifactId>org.gvsig.busquedacatastral.swing.api</artifactId>
78
    <version>${org.gvsig.busquedacatastral.version}</version>
79
   </dependency>
80
   <dependency>
81
    <groupId>org.gvsig</groupId>
82
    <artifactId>org.gvsig.busquedacatastral.swing.impl</artifactId>
83
    <version>${org.gvsig.busquedacatastral.version}</version>
84
   </dependency>
85

  
86
   <!--These dependencies are added to use the webservice and parse its response -->
87
   <dependency>
88
    <groupId>axis</groupId>
89
    <artifactId>axis-jaxrpc</artifactId>
90
    <version>1.4</version>
91
   </dependency>
92
   <dependency>
93
    <groupId>org.apache.axis</groupId>
94
    <artifactId>axis</artifactId>
95
    <version>1.4</version>
96
   </dependency>
97
   <dependency>
98
    <groupId>commons-logging</groupId>
99
    <artifactId>commons-logging</artifactId>
100
    <version>1.1.1</version>
101
   </dependency>
102
   <dependency>
103
    <groupId>commons-discovery</groupId>
104
    <artifactId>commons-discovery</artifactId>
105
    <version>0.4</version>
106
   </dependency>
107
   <dependency>
108
    <groupId>wsdl4j</groupId>
109
    <artifactId>wsdl4j</artifactId>
110
    <version>1.6.2</version>
111
   </dependency>
112

  
113
  </dependencies>
114
 </dependencyManagement>
115

  
116
 <modules>
117
  <module>org.gvsig.busquedacatastral.app</module>
118
  <module>org.gvsig.busquedacatastral.lib</module>
119
  <module>org.gvsig.busquedacatastral.swing</module>
120
 </modules>
121

  
122
 <properties>
123
  <org.gvsig.busquedacatastral.version>1.0.5</org.gvsig.busquedacatastral.version>
124
 </properties>
125
</project>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.busquedacatastral</artifactId>
6
    <version>1.0.5</version>
7
  </parent>
8
  <artifactId>org.gvsig.busquedacatastral.app</artifactId>
9
  <packaging>pom</packaging>
10
  <modules>
11
   <module>org.gvsig.busquedacatastral.app.mainplugin</module>
12
  </modules>
13
</project>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/buildNumber.properties
1
#Wed Sep 27 08:56:26 CEST 2017
2
buildNumber=8
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/resources-plugin/i18n/text.properties
1
#Translations for language [es]
2
#Mon Feb 26 16:06:24 CET 2007
3
#\u00e1 \u00e9 \u00ed \u00f3 \u00fa
4
_busqueda_catastral=B\u00fasqueda Catastral
5
_busqueda_municipios=B\u00fasqueda Municipios
6
_busqueda_vias=B\u00fasqueda V\u00edas
7
_busqueda_numeros=B\u00fasqueda N\u00fameros
8

  
9
_BusquedaCatastralGettingParametersException=Error obteniendo los par\u00e1metros
10
_BusquedaCatastralGettingDataException=Error obteniendo los datos solicitados
11
_BusquedaCatastralInvalidSRSException=El SRS usado no es v\u00e1lido para el catastro
12
_BusquedaCatastralCreatingPanelException=Error creando el panel
13
_BusquedaCatastralObtainingPointException=Error obteniendo el punto requerido
14
_BusquedaCatastralObtainingDataException=Error obteniendo los datos requeridos
15
_error_getting_parameters=Error en los par\u00e1metros introducidos
16
_error_needed_parameters=Falta par\u00e1metro necesario
17
_error_invalid_query=La consulta no es v\u00e1lida
18
_error_obtaining_data=Error obteniendo los datos
19
_error_creating_panel=Error creando el panel
20
_error_obtaining_point=Error obteniendo el punto
21
_error_getting_municipios=Error obteniendo los municipios
22
_error_getting_vias=Error obteniendo las v\u00edas
23
_error_getting_numeros=Error obteniendo los n\u00fameros
24
_numero_not_found_for_parameters=No se ha encontrado ning\u00fan n\u00famero para los par\u00e1metros indicados
25

  
26
_error_obtaining_catastro_webservice=Error obteniendo el servicio web del catastro
27
_error_reading_response_from_ws=Error leyendo la respuesta dada por el webservice
28
_no_hay_municipio_seleccionado=Debe de seleccionar un municipio.
29
_no_hay_via_seleccionada=Debe de seleccionar una v\u00eda.
30
_no_hay_numero_seleccionado=Debe de seleccionar un n\u00famero
31
_error_getting_feature_store=Error obteniendo almac\u00e9n de datos
32
_error_reading_feature_store=Error leyendo almac\u00e9n de datos
33
_error_getting_cache_file=Error obteniendo fichero de la cache
34
_error_borrando_cache=Error borrando la cache
35
_error_provincia_not_informed=Falta el campo Provincia
36
_error_municipio_not_informed=Falta el campo Municipio
37
_error_tipo_parcela_not_informed=Debe indicar el tipo de parcela
38
_error_tipo_via_not_informed=Falta el campo tipo de via
39
_error_via_not_informed=Falta el campo Via
40
_error_numero_not_informed=Falta el N\u00famero
41
_error_poligono_not_informed=Falta el Pol\u00edgono
42
_error_parcela_not_informed=Falta la Parcela
43
_error_rc_not_informed=Falta la referencia catastral
44
_error_refCatastral_not_informed=Referencia catastral no v\u00e1lida
45
_error_tipo_query_not_informed=Falta el tipo de consulta
46
_error_SRS=Error SRS no correcto
47
_error_creando_panel_busqueda_catastral=Se ha producido un error intentando crear el panel de B\u00fasqueda Catastral
48
_error_creando_panel_vias=Se ha producido un error intentando crear el panel de B\u00fasqueda V\u00edas
49
_error_creando_panel_municipios=Se ha producido un error intentando crear el panel de B\u00fasqueda Municipios
50
_cache_delete_ok=Cach\u00e9 borrada correctamente
51
_no_se_han_encontrado_resultados_para_estos_datos=No se han encontrado resultados para los datos indicados
52
_error_couldnt_get_coords=No se han encontrado coordenadas para esta referencia
53
_error_obteniendo_el_punto_para_ref_catastral=No se han encontrado coordenadas para la referencia
54
_errors_found_by_ws=El servicio web ha encontrado errores
55
_error_reprojecting_point=Se ha producido un error intentado reproyectar el punto a la vista seleccionada
56

  
57
_proyeccion_no_valida_se_usara_valor_por_defecto=Proyecci\u00f3n no admitida por el catastro. Se usar\u00e1 la proyecci\u00f3n por defecto
58
_provincia_vacia_en_busqueda_municipios=Provincia vac\u00eda en panel de b\u00fasqueda de municipios
59
_provincia_vacia_en_busqueda_vias=Provincia vac\u00eda en panel de b\u00fasqueda de v\u00edas
60
_municipio_vacio_en_busqueda_vias=Municipio vac\u00edo en panel de b\u00fasqueda de v\u00edas
61
_provincia_vacia_en_busqueda_numeros=Provincia vac\u00eda en panel de b\u00fasqueda de n\u00fameros
62
_municipio_vacio_en_busqueda_numeros=Municipio vac\u00edo en panel de b\u00fasqueda de n\u00fameros
63
_via_vacia_en_busqueda_numeros=V\u00eda vac\u00edo en panel de b\u00fasqueda de n\u00fameros
64

  
65
_referencia_catastral=Referencia Catastral
66
_localizacion=Localizaci\u00f3n
67
_provincia=Provincia
68
_municipio=Municipio
69
_municipios=Municipios
70
_urbanos=Urbanos
71
_via=Via
72
_vias=Vias
73
_numero=N\u00famero
74
_numeros=N\u00fameros
75
_bloque=Bloque
76
_escalera=Escalera
77
_planta=Planta
78
_puerta=Puerta
79
_rusticos=R\u00fasticos
80
_poligono=Pol\u00edgono
81
_parcela=Parcela
82
_borrar_cache=Borrar cach\u00e9
83
_buscar=Buscar
84
_ver_datos=Ver datos
85
_localizar=Localizar
86
_cancelar=Cancelar
87
_aceptar=Aceptar
88
_desde=Desde
89
_hasta=Hasta
90
_km=Km
91
_paraje=Paraje
92
_borrar_puntos=Borrar Puntos
93
_loading_data=Cargando datos
94

  
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
1
#Translations for language [en]
2
#Tue Jun 05 16:07:12 CEST 2007
3
_busqueda_catastral=Cadastral Search
4
_busqueda_municipios=Municipality Search
5
_busqueda_vias=Street Search
6
_busqueda_numeros=Number Search
7

  
8
_BusquedaCatastralGettingParametersException=Error getting parameters
9
_BusquedaCatastralGettingDataException=Error getting data
10
_BusquedaCatastralInvalidSRSException=SRS not valid for cadastre
11
_BusquedaCatastralCreatingPanelException=Error creating panel
12
_BusquedaCatastralObtainingPointException=Error getting point
13
_BusquedaCatastralObtainingDataException=Error getting data
14
_error_getting_parameters=Error getting parameters
15
_error_needed_parameters=Needed parameter
16
_error_invalid_query=Invalid query
17
_error_obtaining_data=Error getting data
18
_error_creating_panel=Error creating panel
19
_error_obtaining_point=Error getting point
20
_error_getting_municipios=Error getting municipalities
21
_error_getting_vias=Error getting streets
22
_error_getting_numeros=Error getting numbers
23
_numero_not_found_for_parameters=Number not found
24

  
25
_error_obtaining_catastro_webservice=Error getting cadastre webservice
26
_error_reading_response_from_ws=Error reding webservice response
27
_no_hay_municipio_seleccionado=A municipality must be selected
28
_no_hay_via_seleccionada=A street must be selected
29
_no_hay_numero_seleccionado=A number must be selected
30
_error_getting_feature_store=Error getting data store
31
_error_reading_feature_store=Error reading feature store
32
_error_getting_cache_file=Error getting cache file
33
_error_borrando_cache=Error deleting cache
34
_error_provincia_not_informed=Province not informed
35
_error_municipio_not_informed=Municipality not informed
36
_error_tipo_parcela_not_informed=Smallholding type not informed
37
_error_tipo_via_not_informed=Street type not informed
38
_error_via_not_informed=Street not informed
39
_error_numero_not_informed=Number not informed
40
_error_poligono_not_informed=Zone not informed
41
_error_parcela_not_informed=Smallholding not informed
42
_error_rc_not_informed=Cadastral reference not informed
43
_error_refCatastral_not_informed=Cadastral reference not valid
44
_error_tipo_query_not_informed=Query type not informed
45
_error_SRS=Invalid SRS
46
_error_creando_panel_busqueda_catastral=Error creating Cadastral Search Panel
47
_error_creando_panel_vias=Error creating Street Search Panel
48
_error_creando_panel_municipios=Error creating Municipality Search Panel
49
_cache_delete_ok=Cache deleted correctly
50
_no_se_han_encontrado_resultados_para_estos_datos=There is not data for these parameters
51
_error_couldnt_get_coords=Coordinates not found for this reference
52
_error_obteniendo_el_punto_para_ref_catastral=Coordinates not found for this reference
53
_errors_found_by_ws=Webservice has found errors
54
_error_reprojecting_point=Error reprojecting point
55

  
56
_proyeccion_no_valida_se_usara_valor_por_defecto=Projection not valid for Cadastre. Default projection will be used
57
_provincia_vacia_en_busqueda_municipios=Empty Province in Municipality Search Panel
58
_provincia_vacia_en_busqueda_vias=Empty Province in Street Search Panel
59
_municipio_vacio_en_busqueda_vias=Empty Municipality in Street Search Panel
60
_provincia_vacia_en_busqueda_numeros=Empty Province in Numbers Search Panel
61
_municipio_vacio_en_busqueda_numeros=Empty Municipality in Numbers Search Panel
62
_via_vacia_en_busqueda_numeros=Empty Street in Numbers Search Panel
63

  
64
_referencia_catastral=Cadastral reference
65
_localizacion=Location
66
_provincia=Province
67
_municipio=Municipality
68
_municipios=Municipalities
69
_urbanos=Urban
70
_via=Street
71
_vias=Streets
72
_numero=Number
73
_numeros=Numbers
74
_bloque=Block
75
_escalera=Stair
76
_planta=Floor
77
_puerta=Door
78
_rusticos=Rustic
79
_poligono=Zone
80
_parcela=Smallholding
81
_borrar_cache=Delete Cache
82
_buscar=Search
83
_ver_datos=View Data
84
_localizar=Locate
85
_cancelar=Cancel
86
_aceptar=Accept
87
_desde=From
88
_hasta=To
89
_km=Km
90
_paraje=Setting
91
_borrar_puntos=Delete points
92
_loading_data=Loading Data
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.app.mainplugin" />
4
	<libraries library-dir="lib"/>
5
	<resourceBundle name="text"/>
6
	<extensions>
7
		<extension class-name="org.gvsig.busquedacatastral.app.mainplugin.BusquedaCatastralExtension"
8
			description="Search by catastral info"
9
			active="true"
10
			priority="1">
11
   <action name="busqueda-catastral" label="_busqueda_catastral" tooltip="_busqueda_catastral"
12
        position="650101000" action-command="busqueda-catastral" icon="view-navigation-busqueda-catastral"
13
        accelerator="" />
14
      <menu text="View/Navigation/_busqueda_catastral" name="busqueda-catastral" />
15
      <tool-bar name="_busqueda_catastral" position="650101000">
16
        <action-tool name="busqueda-catastral" />
17
      </tool-bar>
18

  
19
		</extension>
20

  
21
	</extensions>
22
</plugin-config>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${project.artifactId}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>src/main/resources-plugin</directory>
21
      <outputDirectory>.</outputDirectory>
22
    </fileSet>
23
  </fileSets>
24

  
25
  <dependencySets>
26
    <dependencySet>
27
      <useProjectArtifact>false</useProjectArtifact>
28
      <useTransitiveDependencies>false</useTransitiveDependencies>
29
      <outputDirectory>lib</outputDirectory>
30
      <includes>
31
        <include>org.gvsig:org.gvsig.busquedacatastral.lib.api</include>
32
        <include>org.gvsig:org.gvsig.busquedacatastral.lib.impl</include>
33
        <include>org.gvsig:org.gvsig.busquedacatastral.swing.api</include>
34
        <include>org.gvsig:org.gvsig.busquedacatastral.swing.impl</include>
35
        <include>axis:axis-jaxrpc</include>
36
        <include>org.apache.axis:axis</include>
37
        <include>commons-logging:commons-logging</include>
38
        <include>commons-discovery:commons-discovery</include>
39
        <include>wsdl4j:wsdl4j</include>
40
      </includes>
41
    </dependencySet>
42
  </dependencySets>
43

  
44
</assembly>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/src/main/java/org/gvsig/busquedacatastral/app/mainplugin/BusquedaCatastralExtension.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.app.mainplugin;
24

  
25
import java.awt.Color;
26
import java.awt.event.ActionEvent;
27
import java.awt.event.ActionListener;
28
import java.io.File;
29

  
30
import javax.swing.JOptionPane;
31

  
32
import org.apache.commons.lang3.StringUtils;
33
import org.cresques.cts.IProjection;
34
import org.gvsig.andami.IconThemeHelper;
35
import org.gvsig.andami.Utilities;
36
import org.gvsig.andami.plugins.Extension;
37
import org.gvsig.app.ApplicationLocator;
38
import org.gvsig.app.ApplicationManager;
39
import org.gvsig.app.project.documents.view.ViewDocument;
40
import org.gvsig.app.project.documents.view.gui.IView;
41
import org.gvsig.busquedacatastral.lib.api.BusquedaCatastralLocator;
42
import org.gvsig.busquedacatastral.lib.api.ReferenciaCatastral;
43
import org.gvsig.busquedacatastral.swing.api.BusquedaCatastralConsultaCatastralPanel;
44
import org.gvsig.busquedacatastral.swing.api.BusquedaCatastralSwingLocator;
45
import org.gvsig.busquedacatastral.swing.api.exceptions.BusquedaCatastralCreatingPanelException;
46
import org.gvsig.busquedacatastral.swing.api.exceptions.BusquedaCatastralObtainingDataException;
47
import org.gvsig.busquedacatastral.swing.api.exceptions.BusquedaCatastralObtainingPointException;
48
import org.gvsig.fmap.geom.Geometry;
49
import org.gvsig.fmap.geom.GeometryLocator;
50
import org.gvsig.fmap.geom.GeometryManager;
51
import org.gvsig.fmap.geom.primitive.Envelope;
52
import org.gvsig.fmap.geom.primitive.Point;
53
import org.gvsig.fmap.mapcontext.MapContext;
54
import org.gvsig.fmap.mapcontext.MapContextLocator;
55
import org.gvsig.fmap.mapcontext.ViewPort;
56
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer;
57
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
58
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
59
import org.gvsig.symbology.SymbologyLocator;
60
import org.gvsig.symbology.SymbologyManager;
61
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
62
import org.gvsig.tools.ToolsLocator;
63
import org.gvsig.tools.dynobject.DynObject;
64
import org.gvsig.tools.i18n.I18nManager;
65
import org.gvsig.tools.locator.LocatorException;
66
import org.gvsig.tools.swing.api.ToolsSwingLocator;
67
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
68
import org.slf4j.Logger;
69
import org.slf4j.LoggerFactory;
70

  
71

  
72

  
73
/**
74
 * Extension for catastral data searchs
75
 * @author dmartinez (dmartinez@disid.com)
76
 */
77
public class BusquedaCatastralExtension extends Extension {
78
	private Logger              logger           = LoggerFactory.getLogger(BusquedaCatastralExtension.class);
79

  
80
	private static final String CACHEFOLDERNAME="BusquedaCatastral";
81

  
82
	public static final String SHOW_POINT_BUSQUEDACATASTRAL_ID = "ShowPointBusquedaCatastral";
83

  
84
	public void initialize() {
85
	    IconThemeHelper.registerIcon(null, "view-navigation-busqueda-catastral", this);
86
	    BusquedaCatastralLocator.getManager().setCacheFolder(new File(Utilities.TEMPDIRECTORYPATH, CACHEFOLDERNAME));
87
	}
88

  
89
	public void postInitialize() {
90

  
91
	}
92

  
93
	public void execute(String actionCommand) {
94
	    final WindowManager winManager = ToolsSwingLocator.getWindowManager();
95
	    final I18nManager i18nManager = ToolsLocator.getI18nManager();
96

  
97
	    if (StringUtils.equalsIgnoreCase(actionCommand, "busqueda-catastral")) {
98
	        //Create GUI to query catastro
99
	        BusquedaCatastralConsultaCatastralPanel panel;
100
            try {
101
                panel = BusquedaCatastralSwingLocator.getManager().createConsultaCatastralPanel();
102
            } catch (BusquedaCatastralCreatingPanelException
103
                | LocatorException e) {
104
                logger.error("Error creating panel", e);
105
                JOptionPane.showMessageDialog(
106
                    null,
107
                    new StringBuilder().append(i18nManager.getTranslation("_error_creating_panel"))
108
                        .append(":").append(e.getLocalizedMessage()),
109
                    i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
110
                return;
111
            }
112
            panel.addActionListener(new ActionListener() {
113

  
114
                public void actionPerformed(ActionEvent event) {
115
                    BusquedaCatastralConsultaCatastralPanel panel = (BusquedaCatastralConsultaCatastralPanel) event.getSource();
116
                    if (panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.CANCEL)) {
117
                        return;
118
                    }else if(panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.FOCUSTOPOINT)){
119
                        Point selectedPoint;
120
                        ReferenciaCatastral selectedRefCatastral;
121
                        try {
122
                            selectedPoint = panel.getPoint(getActiveViewProjection());
123
                            selectedRefCatastral=panel.getSelectedReferenciaCatastral();
124
                        } catch (BusquedaCatastralObtainingPointException e) {
125
                            logger.error("Error obtaining point", e);
126
                            JOptionPane.showMessageDialog(
127
                                null,
128
                                new StringBuilder().append(i18nManager.getTranslation("_error_obtaining_point"))
129
                                    .append(":").append(e.getLocalizedMessage()),
130
                                i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
131
                            return;
132
                        }
133
                        focusToPoint(selectedPoint);
134
                        showPoint(selectedPoint,selectedRefCatastral.getRC());
135
                    }else if(panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.DELETEPOINTS)){
136
                        deletePoints();
137
                    }else if(panel.isSelectedAction(BusquedaCatastralConsultaCatastralPanel.PanelAction.SHOWDATA)){
138
                        try {
139
                            DynObject datosCatastrales=panel.getDatosCatastrales();
140
                        } catch (BusquedaCatastralObtainingDataException e) {
141
                            logger.error("Error obtaining datos catastrales", e);
142
                            JOptionPane.showMessageDialog(
143
                                null,
144
                                new StringBuilder().append(i18nManager.getTranslation("_error_obtaining_data"))
145
                                    .append(":").append(e.getLocalizedMessage()),
146
                                i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
147
                            return;
148
                        }
149
                        //TODO Mostrar los datos obtenidos
150
                    }
151
                }
152
            });
153

  
154
            winManager.showWindow(panel.asJComponent(), i18nManager.getTranslation("_busqueda_catastral"),
155
                WindowManager.MODE.WINDOW);
156

  
157
	    }
158
	}
159

  
160

  
161

  
162
	public boolean isEnabled() {
163
	  //It needs an active view with a valid viewport
164
	    IView view = getActiveView();
165
        if (view != null) {
166
            ViewPort viewPort = view.getMapControl().getViewPort();
167
            Envelope viewPortEnvelope = viewPort.getEnvelope();
168
            if(viewPortEnvelope == null || viewPortEnvelope.isEmpty()){
169
                return false;
170
            }
171
            return true;
172
        }
173
        return false;
174
	}
175

  
176
	public boolean isVisible() {
177
	    //It needs an active view
178
	    IView view = getActiveView();
179
        if (view != null) {
180
            return true;
181
        }
182
        return false;
183
	}
184

  
185

  
186
    private IView getActiveView() {
187
        ApplicationManager application = ApplicationLocator.getManager();
188
        IView view = (IView) application.getActiveComponent(ViewDocument.class);
189
        return view;
190
    }
191

  
192
    private IProjection getActiveViewProjection(){
193
        if (getActiveView()!=null){
194
            return getActiveView().getMapControl().getViewPort().getProjection();
195
        }else{
196
            return null;
197
        }
198
    }
199

  
200
    /**
201
     * Focus the view centered in a selected Point
202
     * @param focusPoint
203
     */
204
    private void focusToPoint(Point focusPoint){
205
        IView activeView = getActiveView();
206
        if (activeView!=null){
207
            ViewPort viewPort =activeView.getMapControl().getViewPort();
208
            MapContext mapContext = activeView.getMapControl().getMapContext();
209
            Envelope envelope = viewPort.getAdjustedEnvelope();
210
            envelope.centerTo(focusPoint);
211
            mapContext.zoomToEnvelope(envelope);
212
        }
213
    }
214

  
215

  
216
    /**
217
     * Show the m in the point p on the graphicLayer
218
     *
219
     * @param m
220
     * @param ct
221
     */
222
    private void showPoint(Point p, String refCatastral) {
223
        IView activeView = getActiveView();
224
        if (activeView!=null){
225
            ViewPort viewPort =activeView.getMapControl().getViewPort();
226
            MapContext mapContext = activeView.getMapControl().getMapContext();
227
            GraphicLayer graphics = mapContext.getGraphicsLayer();
228
            GeometryManager geomManager = GeometryLocator.getGeometryManager();
229
            SymbolManager symbolManager = MapContextLocator.getSymbolManager();
230

  
231
            ISymbol markerSymbol = symbolManager.createSymbol(Geometry.TYPES.POINT, Color.RED);
232
            ISimpleTextSymbol textSymbol = getTextSymbol();
233
            textSymbol.setColor(Color.RED);
234
            textSymbol.setText(refCatastral);
235
            int idMarkerSymbol = graphics.addSymbol(markerSymbol);
236
            int idTextSymbol = graphics.addSymbol(textSymbol);
237
            Point clonedPoint = (Point) p.cloneGeometry();
238
            graphics.addGraphic(SHOW_POINT_BUSQUEDACATASTRAL_ID, clonedPoint, idTextSymbol);
239
            graphics.addGraphic(SHOW_POINT_BUSQUEDACATASTRAL_ID, clonedPoint, idMarkerSymbol);
240
            mapContext.invalidate();
241
        }
242
    }
243

  
244
    /*
245
     * Creates a text symbol to be used
246
     */
247
    private ISimpleTextSymbol getTextSymbol(){
248
        SymbologyManager symbologyManager = SymbologyLocator.getSymbologyManager();
249
        ISimpleTextSymbol textSymbol = symbologyManager.createSimpleTextSymbol();
250
        textSymbol.setFontSize(10);
251
        return textSymbol;
252
    }
253

  
254
    private void deletePoints(){
255
        IView activeView = getActiveView();
256
        if (activeView!=null){
257
            ViewPort viewPort =activeView.getMapControl().getViewPort();
258
            MapContext mapContext = activeView.getMapControl().getMapContext();
259
            GraphicLayer graphics = mapContext.getGraphicsLayer();
260
            graphics.removeGraphics(SHOW_POINT_BUSQUEDACATASTRAL_ID);
261
            mapContext.invalidate();
262
        }
263

  
264
    }
265

  
266
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.app/org.gvsig.busquedacatastral.app.mainplugin/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
 <modelVersion>4.0.0</modelVersion>
3
 <parent>
4
  <groupId>org.gvsig</groupId>
5
  <artifactId>org.gvsig.busquedacatastral.app</artifactId>
6
  <version>1.0.5</version>
7
 </parent>
8
 <artifactId>org.gvsig.busquedacatastral.app.mainplugin</artifactId>
9
 <name>${project.artifactId}</name>
10

  
11
 <dependencies>
12
  <dependency>
13
   <groupId>org.gvsig</groupId>
14
   <artifactId>org.gvsig.busquedacatastral.lib.api</artifactId>
15
  </dependency>
16
  <dependency>
17
   <groupId>org.gvsig</groupId>
18
   <artifactId>org.gvsig.busquedacatastral.lib.impl</artifactId>
19
  </dependency>
20
  <dependency>
21
   <groupId>org.gvsig</groupId>
22
   <artifactId>org.gvsig.busquedacatastral.swing.api</artifactId>
23
  </dependency>
24
  <dependency>
25
   <groupId>org.gvsig</groupId>
26
   <artifactId>org.gvsig.busquedacatastral.swing.impl</artifactId>
27
  </dependency>
28
  <dependency>
29
   <groupId>org.gvsig</groupId>
30
   <artifactId>org.gvsig.app.mainplugin</artifactId>
31
   <scope>compile</scope>
32
  </dependency>
33

  
34
  <!--These dependencies are added to use the webservice and parse its response -->
35
  <dependency>
36
   <groupId>axis</groupId>
37
   <artifactId>axis-jaxrpc</artifactId>
38
   <scope>compile</scope>
39
  </dependency>
40
  <dependency>
41
   <groupId>org.apache.axis</groupId>
42
   <artifactId>axis</artifactId>
43
   <scope>compile</scope>
44
  </dependency>
45
  <dependency>
46
   <groupId>commons-logging</groupId>
47
   <artifactId>commons-logging</artifactId>
48
   <scope>compile</scope>
49
  </dependency>
50
  <dependency>
51
   <groupId>commons-discovery</groupId>
52
   <artifactId>commons-discovery</artifactId>
53
   <scope>compile</scope>
54
  </dependency>
55
  <dependency>
56
   <groupId>wsdl4j</groupId>
57
   <artifactId>wsdl4j</artifactId>
58
   <scope>compile</scope>
59
  </dependency>
60

  
61

  
62
 </dependencies>
63

  
64
 <properties>
65
  <!-- Package info property values -->
66
  <gvsig.package.info.state>testing</gvsig.package.info.state>
67
  <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge
68
   2.1.0-A</gvsig.package.info.dependencies>
69
  <gvsig.package.info.official>true</gvsig.package.info.official>
70
  <gvsig.package.info.name>Tools: Buscador Catastro (Spain)"</gvsig.package.info.name>
71
  <gvsig.package.info.description>Searchs for catastro info</gvsig.package.info.description>
72
  <gvsig.package.info.categories>Remote Services,Catastro</gvsig.package.info.categories>
73
  <gvsig.package.info.javaVM>j1_8</gvsig.package.info.javaVM>
74
  <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-busquedacatastral/pool</gvsig.package.info.poolURL>
75
 </properties>
76
</project>
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/SRSCatastro.java
1
package org.gvsig.busquedacatastral.lib.api;
2

  
3
import org.gvsig.tools.ToolsLocator;
4

  
5
/**
6
 * Enumeracion con los SRS aceptados por Catastro
7
 * @author dmartinezizquierdo
8
 *
9
 */
10
public enum SRSCatastro {
11
    EPSG_4230("EPSG:4230","Geogr?ficas en ED 50"),
12
    EPSG_4326("EPSG:4326","Geogr?ficas en WGS 80",true),//default
13
    EPSG_4258("EPSG:4258","Geogr?ficas en ETRS89"),
14
    EPSG_32627("EPSG:32627","UTM huso 27N en WGS 84"),
15
    EPSG_32628("EPSG:32628","UTM huso 28N en WGS 84"),
16
    EPSG_32629("EPSG:32629","UTM huso 29N en WGS 84"),
17
    EPSG_32630("EPSG:32630","UTM huso 30N en WGS 84"),
18
    EPSG_32631("EPSG:32631","UTM huso 31N en WGS 84"),
19
    EPSG_25829("EPSG:25829","UTM huso 29N en ETRS89"),
20
    EPSG_25830("EPSG:25830","UTM huso 30N en ETRS89"),
21
    EPSG_25831("EPSG:25831","UTM huso 31N en ETRS89"),
22
    EPSG_23029("EPSG:23029","UTM huso 29N en ED50"),
23
    EPSG_23030("EPSG:23030","UTM huso 30N en ED50"),
24
    EPSG_23031("EPSG:23031","UTM huso 31N en ED50");
25

  
26

  
27
    private final String cod;
28
    private final String label;
29
    private final boolean isDefault;
30

  
31
    SRSCatastro(String cod, String label, boolean isDefault){
32
        this.cod = cod;
33
        this.label = label;
34
        this.isDefault=isDefault;
35
    }
36

  
37
    SRSCatastro(String cod, String label){
38
        this.cod = cod;
39
        this.label = label;
40
        this.isDefault=false;
41
    }
42

  
43
    /**
44
     * Gets SRS codigo
45
     * @return String
46
     */
47
    public String getCod(){
48
        return this.cod;
49
    }
50

  
51
    /**
52
     * Gets SRS label
53
     * @return String
54
     */
55
    public String getLabel(){
56
        return this.label;
57
    }
58

  
59
    /**
60
     * gets the default SRS for Catastro
61
     * @return
62
     */
63
    public static SRSCatastro getDefaultSRS(){
64
        for (SRSCatastro srs:SRSCatastro.values()){
65
            if(srs.isDefault){
66
                return srs;
67
            }
68
        }
69
        return null;
70
    }
71

  
72
    /**
73
     * gets the default SRS for Catastro
74
     * @return
75
     */
76
    public static SRSCatastro getCatastroByCod(String cod){
77
        for (SRSCatastro srs:SRSCatastro.values()){
78
            if(srs.getCod().equals(cod)){
79
                return srs;
80
            }
81
        }
82
        return null;
83
    }
84
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/TipoVia.java
1
package org.gvsig.busquedacatastral.lib.api;
2

  
3
import org.gvsig.tools.ToolsLocator;
4

  
5
/**
6
 * Enumeracion con los tipos de vias
7
 * @author dmartinezizquierdo
8
 *
9
 */
10
public enum TipoVia {
11
    BLANK("","-----"),
12
    ACCESO("AC","ACCESO"),
13
    AGREGADO("AG","AGREGADO"),
14
    ALDEA_ALAMEDA("AL","ALDEA, ALAMEDA"),
15
    ANDADOR("AN","ANDADOR"),
16
    AREA_ARRABAL("AR","AREA, ARRABAL"),
17
    AUTOPISTA("AU","AUTOPISTA"),
18
    AVENIDA("AV","AVENIDA"),
19
    ARROYO("AY","ARROYO"),
20
    BAJADA("BJ","BAJADA"),
21
    BLOQUE("BL","BLOQUE"),
22
    BARRIO("BO","BARRIO"),
23
    BARRANQUIL("BQ","BARRANQUIL"),
24
    BARRANCO("BR","BARRANCO"),
25
    CA?ADA("CA","CA?ADA"),
26
    COLEGIO_CIGARRAL("CG","COLEGIO, CIGARRAL"),
27
    CHALET("CH","CHALET"),
28
    CINTURON("CI","CINTURON"),
29
    CALLEJA_CALLEJON("CJ","CALLEJA, CALLEJON"),
30
    CALLE("CL","CALLE"),
31
    CAMINO_CARMEN("CM","CAMINO, CARMEN"),
32
    COLONIA("CN","COLONIA"),
33
    CONCEJO_COLEGIO("CO","CONCEJO, COLEGIO"),
34
    CAMPA_CAMPO("CP","CAMPA, CAMPO"),
35
    CARRETERA_CARRERA("CR","CARRETERA, CARRERA"),
36
    CASERIO("CS","CASERIO"),
37
    CUESTA_COSTANILLA("CT","CUESTA, COSTANILLA"),
38
    CONJUNTO("CU","CONJUNTO"),
39
    CALEYA("CY","CALEYA"),
40
    CALLIZO("CZ","CALLIZO"),
41
    DETR?S("DE","DETR?S"),
42
    DIPUTACION("DP","DIPUTACION"),
43
    DISEMINADOS("DS","DISEMINADOS"),
44
    EDIFICIOS("ED","EDIFICIOS"),
45
    EXTRAMUROS("EM","EXTRAMUROS"),
46
    ENTRADA_ENSANCHE("EN","ENTRADA, ENSANCHE"),
47
    ESPALDA("EP","ESPALDA"),
48
    EXTRARRADIO("ER","EXTRARRADIO"),
49
    ESCALINATA("ES","ESCALINATA"),
50
    EXPLANADA("EX","EXPLANADA"),
51
    FERROCARRIL("FC","FERROCARRIL"),
52
    FINCA("FN","FINCA"),
53
    GLORIETA("GL","GLORIETA"),
54
    GRUPO("GR","GRUPO"),
55
    GRAN_VIA("GV","GRAN VIA"),
56
    HUERTA_HUERTO("HT","HUERTA, HUERTO"),
57
    JARDINES("JR","JARDINES"),
58
    LAGO("LA","LAGO"),
59
    LADO_LADERA("LD","LADO, LADERA"),
60
    LUGAR("LG","LUGAR"),
61
    MALECON("MA","MALECON"),
62
    MERCADO("MC","MERCADO"),
63
    MUELLE("ML","MUELLE"),
64
    MUNICIPIO("MN","MUNICIPIO"),
65
    MASIAS("MS","MASIAS"),
66
    MONTE("MT","MONTE"),
67
    MANZANA("MZ","MANZANA"),
68
    POBLADO("PB","POBLADO"),
69
    PLACETA("PC","PLACETA"),
70
    PARTIDA("PD","PARTIDA"),
71
    PARTICULAR("PI","PARTICULAR"),
72
    PASAJE_PASADIZO("PJ","PASAJE, PASADIZO"),
73
    POLIGONO("PL","POLIGONO"),
74
    PARAMO("PM","PARAMO"),
75
    PARROQUIA_PARQUE("PQ","PARROQUIA, PARQUE"),
76
    PROLONGACION_CONTINUAC("PR","PROLONGACION, CONTINUAC."),
77
    PASEO("PS","PASEO"),
78
    PUENTE("PT","PUENTE"),
79
    PASADIZO("PU","PASADIZO"),
80
    PLAZA("PZ","PLAZA"),
81
    QUINTA("QT","QUINTA"),
82
    RACONADA("RA","RACONADA"),
83
    RAMBLA("RB","RAMBLA"),
84
    RINCON_RINCONA("RC","RINCON, RINCONA"),
85
    RONDA("RD","RONDA"),
86
    RAMAL("RM","RAMAL"),
87
    RAMPA("RP","RAMPA"),
88
    RIERA("RR","RIERA"),
89
    RUA("RU","RUA"),
90
    SALIDA("SA","SALIDA"),
91
    SECTOR("SC","SECTOR"),
92
    SENDA("SD","SENDA"),
93
    SOLAR("SL","SOLAR"),
94
    SALON("SN","SALON"),
95
    SUBIDA("SU","SUBIDA"),
96
    TERRENOS("TN","TERRENOS"),
97
    TORRENTE("TO","TORRENTE"),
98
    TRAVESIA("TR","TRAVESIA"),
99
    URBANIZACION("UR","URBANIZACION"),
100
    VALLE("VA","VALLE"),
101
    VIADUCTO("VD","VIADUCTO"),
102
    VIA("VI","VIA"),
103
    VIAL("VL","VIAL"),
104
    VEREDA("VR","VEREDA");
105

  
106

  
107
    private final String abrev;
108
    private final String label;
109

  
110
    TipoVia(String abrev, String label){
111
        this.abrev = abrev;
112
        this.label = label;
113
    }
114

  
115
    /**
116
     * Gets Tipo via codigo
117
     * @return String
118
     */
119
    public String getAbrev(){
120
        return this.abrev;
121
    }
122

  
123
    /**
124
     * Gets Tipo via label
125
     * @return String
126
     */
127
    public String getLabel(){
128
        return this.label;
129
    }
130

  
131
    /**
132
     * gets the tipoVia for the given cod
133
     * @return
134
     */
135
    public static TipoVia getTipoViaByAbrev(String abrev){
136
        for (TipoVia tipoVia:TipoVia.values()){
137
            if(tipoVia.getAbrev().equals(abrev)){
138
                return tipoVia;
139
            }
140
        }
141
        return null;
142
    }
143
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/BusquedaCatastralLocator.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.api;
24

  
25
import org.gvsig.tools.locator.BaseLocator;
26
import org.gvsig.tools.locator.Locator;
27
import org.gvsig.tools.locator.LocatorException;
28

  
29
/**
30
 * This locator is the entry point for the BusquedaCatastral library,
31
 * providing access to all services through the
32
 * {@link BusquedaCatastralManager} .
33
 *
34
 * @author gvSIG team
35
 * @version $Id$
36
 */
37
public class BusquedaCatastralLocator extends BaseLocator {
38

  
39
    private static final String LOCATOR_NAME = "BusquedaCatastral.locator";
40

  
41
    /**
42
     * WebMap manager name.
43
     */
44
    public static final String MANAGER_NAME = "BusquedaCatastral.manager";
45

  
46
    /**
47
     * WebMap manager description.
48
     */
49
    public static final String MANAGER_DESCRIPTION = "BusquedaCatastral Manager";
50

  
51

  
52
    /**
53
     * Unique instance.
54
     */
55
    private static final BusquedaCatastralLocator INSTANCE =
56
        new BusquedaCatastralLocator();
57

  
58
    /**
59
     * Return the singleton instance.
60
     *
61
     * @return the singleton instance
62
     */
63
    public static BusquedaCatastralLocator getInstance() {
64
        return INSTANCE;
65
    }
66

  
67
    /**
68
     * Return the Locator's name.
69
     *
70
     * @return a String with the Locator's name
71
     */
72
    public final String getLocatorName() {
73
        return LOCATOR_NAME;
74
    }
75

  
76
    /**
77
     * Return a reference to the Manager.
78
     *
79
     * @return a reference to the Manager
80
     * @throws LocatorException
81
     *             if there is no access to the class or the class cannot be
82
     *             instantiated
83
     * @see Locator#get(String)
84
     */
85
    public static BusquedaCatastralManager getManager() throws LocatorException {
86
        return (BusquedaCatastralManager) getInstance().get(MANAGER_NAME);
87
    }
88

  
89
    /**
90
     * Registers the Class implementing the WebMapManager interface.
91
     *
92
     * @param clazz
93
     *            implementing the WebMapManager interface
94
     */
95
    public static void registerManager(
96
        Class<? extends BusquedaCatastralManager> clazz) {
97
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
98
    }
99

  
100
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/BusquedaCatastralLibrary.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.api;
24

  
25
import org.gvsig.tools.library.AbstractLibrary;
26
import org.gvsig.tools.library.LibraryException;
27
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
28

  
29
/**
30
 * Library for search by catastral data initialization and configuration.
31
 *
32
 * @author gvSIG team
33
 * @version $Id$
34
 */
35
public class BusquedaCatastralLibrary extends AbstractLibrary {
36

  
37
    @Override
38
    public void doRegistration() {
39
        registerAsAPI(BusquedaCatastralLibrary.class);
40
    }
41

  
42
    @Override
43
    protected void doInitialize() throws LibraryException {
44
        // Do nothing
45
    }
46

  
47
    @Override
48
    protected void doPostInitialize() throws LibraryException {
49
        // Validate there is any implementation registered.
50
        BusquedaCatastralManager manager = BusquedaCatastralLocator.getManager();
51
        if (manager == null) {
52
            throw new ReferenceNotRegisteredException(
53
                BusquedaCatastralLocator.MANAGER_NAME, BusquedaCatastralLocator.getInstance());
54
        }
55
    }
56

  
57
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/exceptions/BusquedaCatastralGettingParamsException.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.api.exceptions;
24

  
25
public class BusquedaCatastralGettingParamsException extends BusquedaCatastralException {
26

  
27

  
28
    /**
29
     *
30
     */
31
    private static final long serialVersionUID = 8201868527295813900L;
32

  
33
    private static final String MESSAGE =
34
        "An error has been produced getting busqueda catastral parameters.";
35

  
36
    private static final String KEY = "_BusquedaCatastralGettingParametersException";
37

  
38
    public BusquedaCatastralGettingParamsException(Throwable ex) {
39
        super(MESSAGE, ex, KEY, serialVersionUID);
40
    }
41

  
42
    public BusquedaCatastralGettingParamsException(String message, Throwable ex) {
43
        super(message, ex, KEY, serialVersionUID);
44
    }
45

  
46
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/exceptions/BusquedaCatastralGettingDataException.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.api.exceptions;
24

  
25
public class BusquedaCatastralGettingDataException extends BusquedaCatastralException {
26

  
27

  
28
    /**
29
     *
30
     */
31
    private static final long serialVersionUID = 8201868527295813900L;
32

  
33
    private static final String MESSAGE =
34
        "An error has been produced getting busqueda catastral data.";
35

  
36
    private static final String KEY = "_BusquedaCatastralGettingDataException";
37

  
38
    public BusquedaCatastralGettingDataException(Throwable ex) {
39
        super(MESSAGE, ex, KEY, serialVersionUID);
40
    }
41

  
42
    public BusquedaCatastralGettingDataException(String message, Throwable ex) {
43
        super(message, ex, KEY, serialVersionUID);
44
    }
45

  
46
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/exceptions/BusquedaCatastralInvalidQueryException.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.api.exceptions;
24

  
25
public class BusquedaCatastralInvalidQueryException extends BusquedaCatastralException {
26

  
27

  
28
    /**
29
     *
30
     */
31
    private static final long serialVersionUID = 8201868527295813900L;
32

  
33
    private static final String MESSAGE =
34
        "Invalid query for busqueda catastral";
35

  
36
    private static final String KEY = "_BusquedaCatastralInvalidQueryException";
37

  
38
    public BusquedaCatastralInvalidQueryException(Throwable ex) {
39
        super(MESSAGE, ex, KEY, serialVersionUID);
40
    }
41

  
42
    public BusquedaCatastralInvalidQueryException(String message, Throwable ex) {
43
        super(message, ex, KEY, serialVersionUID);
44
    }
45

  
46
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/exceptions/BusquedaCatastralInvalidSRSException.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.api.exceptions;
24

  
25
public class BusquedaCatastralInvalidSRSException extends BusquedaCatastralException {
26

  
27

  
28
    /**
29
     *
30
     */
31
    private static final long serialVersionUID = 8201868527295813900L;
32

  
33
    private static final String MESSAGE =
34
        "An error has been produced using an invalid SRS for Busqueda Catastral.";
35

  
36
    private static final String KEY = "_BusquedaCatastralInvalidSRSException";
37

  
38
    public BusquedaCatastralInvalidSRSException(Throwable ex) {
39
        super(MESSAGE, ex, KEY, serialVersionUID);
40
    }
41

  
42
    public BusquedaCatastralInvalidSRSException(String message, Throwable ex) {
43
        super(message, ex, KEY, serialVersionUID);
44
    }
45

  
46
}
org.gvsig.busquedacatastral/tags/org.gvsig.busquedacatastral-1.0.5/org.gvsig.busquedacatastral.lib/org.gvsig.busquedacatastral.lib.api/src/main/java/org/gvsig/busquedacatastral/lib/api/exceptions/BusquedaCatastralException.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.busquedacatastral.lib.api.exceptions;
24

  
25

  
26
import org.gvsig.tools.exception.BaseException;
27

  
28
/**
29
 *
30
 * @author gvSIG team.
31
 *
32
 */
33
public class BusquedaCatastralException extends BaseException {
34

  
35
    /**
36
     *
37
     */
38
    private static final long serialVersionUID = -1043709801185809443L;
39

  
40
    private static final String MESSAGE =
41
        "An error has been produced in the Busqueda Catastral library";
42

  
43
    private static final String KEY = "_WasteException";
44

  
45
    /**
46
     * Constructor to be used in rare cases, usually you must create a new child
47
     * exception class for each case.
48
     * <strong>Don't use this constructor in child classes.</strong>
49
     */
50
    public BusquedaCatastralException() {
51
        super(MESSAGE, KEY, serialVersionUID);
52
    }
53

  
54
    /**
55
     * Constructor to be used in rare cases, usually you must create a new child
56
     * exception class for each case.
57
     * <p>
58
     * <strong>Don't use this constructor in child classes.</strong>
59
     * </p>
60
     *
61
     * @param cause
62
     *            the original cause of the exception
63
     */
64
    public BusquedaCatastralException(Exception cause) {
65
        super(MESSAGE, cause, KEY, serialVersionUID);
66
    }
67

  
68
    /**
69
     * @see BaseException#BaseException(String, String, long).
70
     * @param message
71
     *            the default messageFormat to describe the exception
72
     * @param key
73
     *            the key to use to search a localized messageFormnata
74
     * @param code
75
     *            the unique code to identify the exception
76
     */
77
    protected BusquedaCatastralException(String message, String key, long code) {
78
        super(message, key, code);
79
    }
80

  
81
    /**
82
     * @see BaseException#BaseException(String, Throwable, String, long).
83
     * @param message
84
     *            the default messageFormat to describe the exception
85
     * @param cause
86
     *            the original cause of the exception
87
     * @param key
88
     *            the key to use to search a localized messageFormnata
89
     * @param code
90
     *            the unique code to identify the exception
91
     */
92
    protected BusquedaCatastralException(String message, Throwable cause,
93
        String key, long code) {
94
        super(message, cause, key, code);
95
    }
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff