Revision 37350
tags/v2_0_0_Build_2041/applications/appGazetteer/design/config/ApplicationContextAlone.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> |
|
3 |
|
|
4 |
<beans> |
|
5 |
|
|
6 |
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
|
7 |
<property name="location"><value>config/TestContext.properties</value></property> |
|
8 |
</bean> |
|
9 |
|
|
10 |
<!-- ========================= GENERAL DEFINITIONS ========================= --> |
|
11 |
|
|
12 |
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> |
|
13 |
<property name="basename"><value>messages</value></property> |
|
14 |
</bean> |
|
15 |
|
|
16 |
|
|
17 |
<!-- ========================= PERSISTENCE DEFINITIONS ========================= --> |
|
18 |
|
|
19 |
<!-- ========================= BUSINESS DEFINITIONS ========================= --> |
|
20 |
|
|
21 |
<bean id="OIDRegister" class="org.jzkit.a2j.codec.util.OIDRegister"> |
|
22 |
<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/a2j.properties</value></constructor-arg> |
|
23 |
</bean> |
|
24 |
|
|
25 |
<!-- conversion rules --> |
|
26 |
<bean id="RPNToInternalRules" class="org.jzkit.util.PropsHolder"> |
|
27 |
<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalAttrTypes.properties</value></constructor-arg> |
|
28 |
</bean> |
|
29 |
|
|
30 |
<bean id="InternalToType1ConversionRules" class="org.jzkit.z3950.QueryModel.PropsBasedInternalToType1ConversionRules"> |
|
31 |
<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalToType1Rules.properties</value></constructor-arg> |
|
32 |
</bean> |
|
33 |
|
|
34 |
</beans> |
|
0 | 35 |
tags/v2_0_0_Build_2041/applications/appGazetteer/design/config/ApplicationContext.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> |
|
3 |
<beans> |
|
4 |
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
|
5 |
<property name="location"><value>gvSIG/extensiones/es.gva.cit.gvsig.catalogClient/config/TestContext.properties</value></property> |
|
6 |
</bean> |
|
7 |
<!-- ========================= GENERAL DEFINITIONS ========================= --> |
|
8 |
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> |
|
9 |
<property name="basename"><value>messages</value></property> |
|
10 |
</bean> |
|
11 |
<!-- ========================= PERSISTENCE DEFINITIONS ========================= --> |
|
12 |
|
|
13 |
<!-- ========================= BUSINESS DEFINITIONS ========================= --> |
|
14 |
|
|
15 |
<bean id="OIDRegister" class="org.jzkit.a2j.codec.util.OIDRegister"> |
|
16 |
<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/a2j.properties</value></constructor-arg> |
|
17 |
</bean> |
|
18 |
|
|
19 |
<!-- conversion rules --> |
|
20 |
<bean id="RPNToInternalRules" class="org.jzkit.util.PropsHolder"> |
|
21 |
<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalAttrTypes.properties</value></constructor-arg> |
|
22 |
</bean> |
|
23 |
|
|
24 |
<bean id="InternalToType1ConversionRules" class="org.jzkit.z3950.QueryModel.PropsBasedInternalToType1ConversionRules"> |
|
25 |
<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalToType1Rules.properties</value></constructor-arg> |
|
26 |
</bean> |
|
27 |
</beans> |
|
0 | 28 |
tags/v2_0_0_Build_2041/applications/appGazetteer/servers/GazetteerServers.txt | ||
---|---|---|
1 |
http://inspire.cop.gva.es/deegree/wfsg |
|
0 | 2 |
tags/v2_0_0_Build_2041/applications/appGazetteer/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 |
|
5 |
http://maven.apache.org/maven-v4_0_0.xsd"> |
|
6 |
|
|
7 |
<modelVersion>4.0.0</modelVersion> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.gazetteer</artifactId> |
|
10 |
<packaging>jar</packaging> |
|
11 |
<version>2.0-SNAPSHOT</version> |
|
12 |
<name>appGazetteer</name> |
|
13 |
<description>Web Gazetteer Service client (geographic names locating)</description> |
|
14 |
<url>http://maven.apache.org</url> |
|
15 |
<parent> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>gvsig-base-library-pom</artifactId> |
|
18 |
<version>2.0-SNAPSHOT</version> |
|
19 |
</parent> |
|
20 |
<distributionManagement> |
|
21 |
<site> |
|
22 |
<id>gvsig-repository</id> |
|
23 |
<url>${site-repository}/</url> |
|
24 |
</site> |
|
25 |
</distributionManagement> |
|
26 |
<dependencies> |
|
27 |
<dependency> |
|
28 |
<groupId>org.slf4j</groupId> |
|
29 |
<artifactId>slf4j-api</artifactId> |
|
30 |
<scope>compile</scope> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
35 |
<scope>compile</scope> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.i18n</artifactId> |
|
40 |
<scope>compile</scope> |
|
41 |
</dependency> |
|
42 |
<dependency> |
|
43 |
<groupId>org.gvsig</groupId> |
|
44 |
<artifactId>org.gvsig.utils</artifactId> |
|
45 |
<scope>compile</scope> |
|
46 |
</dependency> |
|
47 |
<dependency> |
|
48 |
<groupId>org.gvsig</groupId> |
|
49 |
<artifactId>org.gvsig.remoteclient</artifactId> |
|
50 |
<scope>compile</scope> |
|
51 |
</dependency> |
|
52 |
<dependency> |
|
53 |
<groupId>org.gvsig</groupId> |
|
54 |
<artifactId>org.gvsig.catalog</artifactId> |
|
55 |
<scope>compile</scope> |
|
56 |
</dependency> |
|
57 |
<dependency> |
|
58 |
<groupId>org.gvsig</groupId> |
|
59 |
<artifactId>org.gvsig.gpe.extension</artifactId> |
|
60 |
<classifier>fmap</classifier> |
|
61 |
<version>2.0-SNAPSHOT</version> |
|
62 |
<scope>compile</scope> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>org.gvsig</groupId> |
|
66 |
<artifactId>org.gvsig.compat</artifactId> |
|
67 |
<scope>compile</scope> |
|
68 |
</dependency> |
|
69 |
<dependency> |
|
70 |
<groupId>com.vividsolutions</groupId> |
|
71 |
<artifactId>jts</artifactId> |
|
72 |
<scope>compile</scope> |
|
73 |
</dependency> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.gpe.lib.api</artifactId> |
|
77 |
<scope>compile</scope> |
|
78 |
</dependency> |
|
79 |
<dependency> |
|
80 |
<groupId>org.gvsig</groupId> |
|
81 |
<artifactId>org.gvsig.gpe.lib.impl</artifactId> |
|
82 |
<scope>compile</scope> |
|
83 |
</dependency> |
|
84 |
<dependency> |
|
85 |
<groupId>org.geonames</groupId> |
|
86 |
<artifactId>geonames</artifactId> |
|
87 |
<classifier>java5</classifier> |
|
88 |
<scope>compile</scope> |
|
89 |
</dependency> |
|
90 |
<dependency> |
|
91 |
<groupId>com.vividsolutions</groupId> |
|
92 |
<artifactId>jtsio</artifactId> |
|
93 |
<scope>compile</scope> |
|
94 |
</dependency> |
|
95 |
<dependency> |
|
96 |
<groupId>org.gvsig</groupId> |
|
97 |
<artifactId>org.gvsig.xmlschema.lib.api</artifactId> |
|
98 |
<scope>compile</scope> |
|
99 |
</dependency> |
|
100 |
<dependency> |
|
101 |
<groupId>commons-httpclient</groupId> |
|
102 |
<artifactId>commons-httpclient</artifactId> |
|
103 |
<scope>compile</scope> |
|
104 |
</dependency> |
|
105 |
</dependencies> |
|
106 |
<properties> |
|
107 |
<build-dir>${basedir}/../build</build-dir> |
|
108 |
<eclipse.project.name>appGazetteer</eclipse.project.name> |
|
109 |
</properties> |
|
110 |
<build> |
|
111 |
<sourceDirectory>src</sourceDirectory> |
|
112 |
<testSourceDirectory>src-test</testSourceDirectory> |
|
113 |
<resources> |
|
114 |
<resource> |
|
115 |
<directory>src</directory> |
|
116 |
<includes> |
|
117 |
<include>**/*.gif</include> |
|
118 |
<include>**/*.png</include> |
|
119 |
<include>**/*.PNG</include> |
|
120 |
<include> **/*.bmp</include> |
|
121 |
<include> **/*.jpg</include> |
|
122 |
<include> **/*.jpeg</include> |
|
123 |
<include> **/*.properties</include> |
|
124 |
</includes> |
|
125 |
</resource> |
|
126 |
<resource> |
|
127 |
<directory>${basedir}/resources</directory> |
|
128 |
</resource> |
|
129 |
</resources> |
|
130 |
|
|
131 |
<!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION --> |
|
132 |
<plugins> |
|
133 |
<plugin> |
|
134 |
<groupId>org.apache.maven.plugins</groupId> |
|
135 |
<artifactId>maven-surefire-plugin</artifactId> |
|
136 |
<configuration> |
|
137 |
<skipTests>true</skipTests> |
|
138 |
</configuration> |
|
139 |
</plugin> |
|
140 |
</plugins> |
|
141 |
|
|
142 |
</build> |
|
143 |
</project> |
|
0 | 144 |
tags/v2_0_0_Build_2041/applications/appGazetteer/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.gazetteer.GazetteerLibrary |
|
2 |
org.gvsig.gazetteer.impl.DefaultGazetteerLibrary |
tags/v2_0_0_Build_2041/applications/appGazetteer/text.properties | ||
---|---|---|
1 |
catalog_search=B\u00fasqueda de Geodatos |
|
2 |
gazetteer_search=Localizar por Nomencl\u00e1tor |
|
3 |
gazetteer_connect=Localizar por Nomencl\u00e1tor |
|
4 |
metadata_catalog=B\u00fasqueda de Geodatos - Conexi\u00f3n |
|
5 |
metadata_tree=\u00c1rbol del Metadato |
|
6 |
search_results=Resultados de la b\u00fasqueda |
|
7 |
resourceTypeColumn=Tipo |
|
8 |
resourceLinkColumn=Enlace |
|
9 |
resourceShowColumn=Ver |
|
10 |
concordancia=Concordancia |
|
11 |
exactSentence=Frase Exacta |
|
12 |
anyWord=Cualquier Palabra |
|
13 |
allWords=Todas las Palabras |
|
14 |
cathegoryAny=cualquiera |
|
15 |
cathegoryBiota=biota |
|
16 |
cathegoryBoundaries=boundaries |
|
17 |
cathegoryClimatologyMeteorologyAtmosphere=climatologyMeteorologyAtmosphere |
|
18 |
cathegoryEconomy=economy |
|
19 |
cathegoryElevation=elevation |
|
20 |
cathegoryEnvironment=environment |
|
21 |
cathegoryFarming=farming |
|
22 |
cathegoryGeoscientificInformation=geoscientificInformation |
|
23 |
cathegoryHealth=health |
|
24 |
cathegoryImageryBaseMapsEarthCover=imageryBaseMapsEarthCover |
|
25 |
cathegoryInlandWaters=inlandWaters |
|
26 |
cathegoryIntelligenceMilitary=intelligenceMilitary |
|
27 |
cathegoryLocation=location |
|
28 |
cathegoryOceans=oceans |
|
29 |
cathegoryPlanningCadastre=planningCadastre |
|
30 |
cathegorySociety=society |
|
31 |
cathegoryStructure=structure |
|
32 |
cathegoryTransportation=transportation |
|
33 |
cathegoryUtilitiesCommunication=utilitiesCommunication |
|
34 |
scaleAny=qualquiera |
|
35 |
scaleI=>1.000.000 |
|
36 |
scaleII=1.000.000 - 250.000 |
|
37 |
scaleIII=250.000 - 50.000 |
|
38 |
scaleIV=50.000 - 10.000 |
|
39 |
scaleV=10.000 - 5000 |
|
40 |
scaleVI=<5.000 |
|
41 |
scale=Escala |
|
42 |
provider=Proveedor |
|
43 |
from=De: |
|
44 |
to=A: |
|
45 |
upperCoordinates=Superiores |
|
46 |
lowerCoordinates=Inferiores |
|
47 |
ULX=ULX: |
|
48 |
ULY=ULY: |
|
49 |
BRX=BRX: |
|
50 |
BRY=BRY: |
|
51 |
abstract=Resumen |
|
52 |
coordinates=Coordenadas |
|
53 |
coordinatesEqual=igual |
|
54 |
coordinatesContains=contiene |
|
55 |
coordinatesEnclose=incluye |
|
56 |
coordinatesFullyOutsideOf=est\u00e1 totalmente fuera de |
|
57 |
title=Titulo |
|
58 |
restrictArea=Restringir el area de B\u00fasqueda |
|
59 |
protocolsGroup=Protocolos |
|
60 |
serverReply=Respuesta del servidor |
|
61 |
serverURL=Introduzca la direcci\u00f3n donde se encuentra el servidor de cat\u00e1logo |
|
62 |
serverURLCat=Introduzca la direcci\u00f3n donde se encuentra el servidor de nomencl\u00e1tor |
|
63 |
database=Nombre de la base de datos |
|
64 |
connectButton=Conectar |
|
65 |
searchButton=Buscar |
|
66 |
results=Resultados |
|
67 |
of=de |
|
68 |
description=Descripcion |
|
69 |
layer=A\u00f1adir Capa |
|
70 |
next=Siquiente |
|
71 |
last=Anterior |
|
72 |
close=Cerrar |
|
73 |
value=Valor |
|
74 |
attributes=Atributos |
|
75 |
keyWords=Palabras Clave |
|
76 |
cathegory=Categor\u00eda |
|
77 |
lastUpdateDate=Fecha de \u00faltima actualizaci\u00f3n |
|
78 |
purpose=Prop\u00f3sito |
|
79 |
errorServerNotFound=No se encuentra el servidor |
|
80 |
errorNotSupportedProtocol=El servidor no soporta el protocolo especificado |
|
81 |
errorNotSupportedCapabilities=Error al hacer un GetCapabilities.Esto puede ser debido a dos razones: O bien ha habido un error al intentar hacer la operaci\u00f3n, o bien el servidor no soporta el protocolo especificado |
|
82 |
errorNotParsedReply=Error al procesar la respuesta. Se ha encontrado el servidor, pero posiblemente no soporta el protocolo especificado |
|
83 |
name=Nombre |
|
84 |
resutsByPage=Resultados por p\u00e1gina |
|
85 |
type=Tipo |
|
86 |
localize=Localizar |
|
87 |
page=P\u00e1gina |
|
88 |
errorNotThesaurusSelected=El protocolo WFS no permite hacer b\u00fasquedas si no se elige un elemento del tesauro |
|
89 |
chooseAttribute=Elige un atributo para hacer la b\u00fasqueda |
|
90 |
errorGetRecords=Se ha producido un error al hacer el getRecords |
|
91 |
anyResult=La b\u00fasqueda no ha producido ning\u00fan resultado |
|
92 |
rootName=Ra\u00edz |
|
93 |
wcsColumn=Cobertura |
|
94 |
wmsColumn=Mapa |
|
95 |
wfsColumn=Feature |
|
96 |
postgisColumn=Postgis |
|
97 |
linkColumn=P\u00e1gina Web |
|
98 |
downloadColumn=Descarga |
|
99 |
errorNotCSWSupportedProtocol=Se ha encontrado el servidor, pero parece ser que no soporta el protocolo CS-W |
|
100 |
errorIsASRWServer=Es un servidor SRW! |
|
101 |
errorServerException=El servidor ha devuelto una excepci\u00f3n |
|
102 |
errorSOAPProtocol=Error en el protocolo SOAP |
|
103 |
errorFENotSupported=De momento solo se pueden hacer querys usando la codificaci\u00f3n FILTER ENCODING que no est\u00e1 soportada por el servidor |
|
104 |
mantainold=Eliminar las busquedas anteriores |
|
105 |
goto=Hacer un zoom a la b\u00fasqueda |
|
106 |
paint=Dibujar el resultado |
|
107 |
aspect=Configuracion de aspecto |
|
108 |
unknown=Desconocido |
|
109 |
cancelSearchButton=Cancelar |
|
110 |
wmsError=Ha ocurrido un error al cargar el mapa |
|
111 |
loadWMS=Carga de WMS |
|
112 |
wfsError=Ha ocurrido un error al cargar la feature |
|
113 |
wfsLoad=Carga de WFS |
|
114 |
wcsError=Ha ocurrido un error al cargar la cobertura |
|
115 |
wcsLoad=Carga de WCS |
|
116 |
postgisError=Ha ocurrido un error al cargar la base de datos |
|
117 |
postgisLoad=Carga de Postgis |
|
118 |
linkError=Ha ocurrido un error al cargar el enlace |
|
119 |
linkLoad=carga de un recurso web |
|
120 |
link=Enlace |
|
121 |
server=Servidor |
|
122 |
layer=Capa |
|
123 |
parameters=Par\u00e1metros |
|
124 |
pluginNotFound=No tienes ninguna extensi\u00f3n para cargar recursos de este tipo |
|
125 |
pluginNotFoundTitle=Carga de capas |
|
126 |
inteligentSearch=B\u00fasqueda inteligente |
|
127 |
inteligentSearchAscii=Todas las formas de la palabra |
|
128 |
reproyectar_aviso=La proyecci\u00F3n de la capa no es igual que la de la vista.\nAVISO\: Puede ser inexacto con algunas transformaciones.\nPor favor, lea la documentaci\u00F3n. |
|
129 |
reproyectar_pregunta=\u00BFDesea reproyectar? |
|
130 |
elementName=ElementName |
|
131 |
propertiesNameWindow=Ventana de propiedades |
tags/v2_0_0_Build_2041/applications/appGazetteer/src-test/org/gvsig/gazetteer/drivers/ExampleNewDriver.java | ||
---|---|---|
1 |
package org.gvsig.gazetteer.drivers; |
|
2 |
|
|
3 |
import java.awt.geom.Point2D; |
|
4 |
import java.net.URI; |
|
5 |
|
|
6 |
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities; |
|
7 |
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel; |
|
8 |
import org.gvsig.gazetteer.querys.Feature; |
|
9 |
import org.gvsig.gazetteer.querys.GazetteerQuery; |
|
10 |
|
|
11 |
|
|
12 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
13 |
* |
|
14 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
15 |
* |
|
16 |
* This program is free software; you can redistribute it and/or |
|
17 |
* modify it under the terms of the GNU General Public License |
|
18 |
* as published by the Free Software Foundation; either version 2 |
|
19 |
* of the License, or (at your option) any later version. |
|
20 |
* |
|
21 |
* This program is distributed in the hope that it will be useful, |
|
22 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
23 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
24 |
* GNU General Public License for more details. |
|
25 |
* |
|
26 |
* You should have received a copy of the GNU General Public License |
|
27 |
* along with this program; if not, write to the Free Software |
|
28 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
29 |
* |
|
30 |
* For more information, contact: |
|
31 |
* |
|
32 |
* Generalitat Valenciana |
|
33 |
* Conselleria d'Infraestructures i Transport |
|
34 |
* Av. Blasco Ib??ez, 50 |
|
35 |
* 46010 VALENCIA |
|
36 |
* SPAIN |
|
37 |
* |
|
38 |
* +34 963862235 |
|
39 |
* gvsig@gva.es |
|
40 |
* www.gvsig.gva.es |
|
41 |
* |
|
42 |
* or |
|
43 |
* |
|
44 |
* IVER T.I. S.A |
|
45 |
* Salamanca 50 |
|
46 |
* 46005 Valencia |
|
47 |
* Spain |
|
48 |
* |
|
49 |
* +34 963163400 |
|
50 |
* dac@iver.es |
|
51 |
*/ |
|
52 |
/* CVS MESSAGES: |
|
53 |
* |
|
54 |
* $Id: ExampleNewDriver.java 537 2007-07-26 11:21:10 +0000 (Thu, 26 Jul 2007) jpiera $ |
|
55 |
* $Log$ |
|
56 |
* Revision 1.1.2.1 2007/07/13 12:00:35 jorpiell |
|
57 |
* Add the posibility to add a new panel |
|
58 |
* |
|
59 |
* |
|
60 |
*/ |
|
61 |
/** |
|
62 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
63 |
*/ |
|
64 |
public class ExampleNewDriver extends AbstractGazetteerServiceDriver { |
|
65 |
|
|
66 |
/* |
|
67 |
* (non-Javadoc) |
|
68 |
* @see es.gva.cit.catalogClient.drivers.IDiscoveryServiceDriver#getCapabilities(java.net.URI) |
|
69 |
*/ |
|
70 |
public DiscoveryServiceCapabilities getCapabilities(URI uri) { |
|
71 |
return new GazetteerCapabilities(); |
|
72 |
} |
|
73 |
|
|
74 |
/* |
|
75 |
* (non-Javadoc) |
|
76 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#getFeature(java.net.URI, es.gva.cit.gazetteer.querys.Query) |
|
77 |
*/ |
|
78 |
public Feature[] getFeature(URI uri, GazetteerQuery query) throws Exception { |
|
79 |
String prop = (String)query.getProperty("PROP1"); |
|
80 |
Feature[] features = new Feature[1]; |
|
81 |
features[0] = new Feature("1","Result 1","description 1",new Point2D.Double(0,0)); |
|
82 |
return features; |
|
83 |
} |
|
84 |
|
|
85 |
/* |
|
86 |
* (non-Javadoc) |
|
87 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#getServiceName() |
|
88 |
*/ |
|
89 |
public String getServiceName() { |
|
90 |
return "My service"; |
|
91 |
} |
|
92 |
|
|
93 |
/* |
|
94 |
* (non-Javadoc) |
|
95 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#getAditionalSearchPanel() |
|
96 |
*/ |
|
97 |
public SearchAditionalPropertiesPanel getAditionalSearchPanel(){ |
|
98 |
return new ExampleNewPanel(); |
|
99 |
} |
|
100 |
|
|
101 |
} |
|
0 | 102 |
tags/v2_0_0_Build_2041/applications/appGazetteer/src-test/org/gvsig/gazetteer/drivers/ExampleNewDriverTest.java | ||
---|---|---|
1 |
package org.gvsig.gazetteer.drivers; |
|
2 |
|
|
3 |
import javax.swing.UIManager; |
|
4 |
import javax.swing.UnsupportedLookAndFeelException; |
|
5 |
|
|
6 |
import org.gvsig.gazetteer.GazetteerLocator; |
|
7 |
import org.gvsig.gazetteer.ui.serverconnect.ServerConnectDialog; |
|
8 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
9 |
|
|
10 |
|
|
11 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
12 |
* |
|
13 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
14 |
* |
|
15 |
* This program is free software; you can redistribute it and/or |
|
16 |
* modify it under the terms of the GNU General Public License |
|
17 |
* as published by the Free Software Foundation; either version 2 |
|
18 |
* of the License, or (at your option) any later version. |
|
19 |
* |
|
20 |
* This program is distributed in the hope that it will be useful, |
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
23 |
* GNU General Public License for more details. |
|
24 |
* |
|
25 |
* You should have received a copy of the GNU General Public License |
|
26 |
* along with this program; if not, write to the Free Software |
|
27 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
28 |
* |
|
29 |
* For more information, contact: |
|
30 |
* |
|
31 |
* Generalitat Valenciana |
|
32 |
* Conselleria d'Infraestructures i Transport |
|
33 |
* Av. Blasco Ib??ez, 50 |
|
34 |
* 46010 VALENCIA |
|
35 |
* SPAIN |
|
36 |
* |
|
37 |
* +34 963862235 |
|
38 |
* gvsig@gva.es |
|
39 |
* www.gvsig.gva.es |
|
40 |
* |
|
41 |
* or |
|
42 |
* |
|
43 |
* IVER T.I. S.A |
|
44 |
* Salamanca 50 |
|
45 |
* 46005 Valencia |
|
46 |
* Spain |
|
47 |
* |
|
48 |
* +34 963163400 |
|
49 |
* dac@iver.es |
|
50 |
*/ |
|
51 |
/* CVS MESSAGES: |
|
52 |
* |
|
53 |
* $Id: ExampleNewDriverTest.java 512 2007-07-24 11:25:43 +0000 (Tue, 24 Jul 2007) jorpiell $ |
|
54 |
* $Log$ |
|
55 |
* Revision 1.1.2.2 2007/07/24 11:25:42 jorpiell |
|
56 |
* The registers has been refactorized |
|
57 |
* |
|
58 |
* Revision 1.1.2.1 2007/07/13 12:00:35 jorpiell |
|
59 |
* Add the posibility to add a new panel |
|
60 |
* |
|
61 |
* |
|
62 |
*/ |
|
63 |
/** |
|
64 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
65 |
*/ |
|
66 |
public class ExampleNewDriverTest { |
|
67 |
|
|
68 |
/** |
|
69 |
* @param args |
|
70 |
*/ |
|
71 |
public static void main(String[] args) { |
|
72 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
73 |
|
|
74 |
GazetteerLocator.getGazetteerManager().register("example", ExampleNewDriver.class); |
|
75 |
//Get the currently installed look and feel |
|
76 |
UIManager.getLookAndFeel(); |
|
77 |
// Install a different look and feel; specifically, the Windows look and feel |
|
78 |
try { |
|
79 |
UIManager.setLookAndFeel( |
|
80 |
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); |
|
81 |
} catch (InstantiationException e) { |
|
82 |
} catch (ClassNotFoundException e) { |
|
83 |
} catch (UnsupportedLookAndFeelException e) { |
|
84 |
} catch (IllegalAccessException e) { |
|
85 |
} |
|
86 |
|
|
87 |
new ServerConnectDialog(); |
|
88 |
} |
|
89 |
|
|
90 |
} |
|
0 | 91 |
tags/v2_0_0_Build_2041/applications/appGazetteer/src-test/org/gvsig/gazetteer/drivers/ExampleNewPanel.java | ||
---|---|---|
1 |
package org.gvsig.gazetteer.drivers; |
|
2 |
|
|
3 |
import java.util.Properties; |
|
4 |
|
|
5 |
import javax.swing.JLabel; |
|
6 |
import javax.swing.JTextField; |
|
7 |
|
|
8 |
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel; |
|
9 |
|
|
10 |
|
|
11 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
12 |
* |
|
13 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
14 |
* |
|
15 |
* This program is free software; you can redistribute it and/or |
|
16 |
* modify it under the terms of the GNU General Public License |
|
17 |
* as published by the Free Software Foundation; either version 2 |
|
18 |
* of the License, or (at your option) any later version. |
|
19 |
* |
|
20 |
* This program is distributed in the hope that it will be useful, |
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
23 |
* GNU General Public License for more details. |
|
24 |
* |
|
25 |
* You should have received a copy of the GNU General Public License |
|
26 |
* along with this program; if not, write to the Free Software |
|
27 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
28 |
* |
|
29 |
* For more information, contact: |
|
30 |
* |
|
31 |
* Generalitat Valenciana |
|
32 |
* Conselleria d'Infraestructures i Transport |
|
33 |
* Av. Blasco Ib??ez, 50 |
|
34 |
* 46010 VALENCIA |
|
35 |
* SPAIN |
|
36 |
* |
|
37 |
* +34 963862235 |
|
38 |
* gvsig@gva.es |
|
39 |
* www.gvsig.gva.es |
|
40 |
* |
|
41 |
* or |
|
42 |
* |
|
43 |
* IVER T.I. S.A |
|
44 |
* Salamanca 50 |
|
45 |
* 46005 Valencia |
|
46 |
* Spain |
|
47 |
* |
|
48 |
* +34 963163400 |
|
49 |
* dac@iver.es |
|
50 |
*/ |
|
51 |
/* CVS MESSAGES: |
|
52 |
* |
|
53 |
* $Id: ExampleNewPanel.java 537 2007-07-26 11:21:10 +0000 (Thu, 26 Jul 2007) jpiera $ |
|
54 |
* $Log$ |
|
55 |
* Revision 1.1.2.1 2007/07/13 12:00:35 jorpiell |
|
56 |
* Add the posibility to add a new panel |
|
57 |
* |
|
58 |
* |
|
59 |
*/ |
|
60 |
/** |
|
61 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
62 |
*/ |
|
63 |
public class ExampleNewPanel extends SearchAditionalPropertiesPanel{ |
|
64 |
JLabel label = null; |
|
65 |
JTextField text = null; |
|
66 |
|
|
67 |
public ExampleNewPanel(){ |
|
68 |
label = new JLabel(); |
|
69 |
text = new JTextField(); |
|
70 |
setLayout(new java.awt.BorderLayout()); |
|
71 |
label.setText("Label"); |
|
72 |
add(label, java.awt.BorderLayout.WEST); |
|
73 |
add(text, java.awt.BorderLayout.CENTER); |
|
74 |
} |
|
75 |
|
|
76 |
/* |
|
77 |
* (non-Javadoc) |
|
78 |
* @see es.gva.cit.gazetteer.ui.search.SearchAditionalPropertiesPanel#getProperties() |
|
79 |
*/ |
|
80 |
public Properties getProperties() { |
|
81 |
Properties properties = new Properties(); |
|
82 |
properties.put("PROP1", text.getText()); |
|
83 |
return properties; |
|
84 |
} |
|
85 |
|
|
86 |
} |
|
0 | 87 |
tags/v2_0_0_Build_2041/applications/appGazetteer/src-test/org/gvsig/gazetteer/URIs.java | ||
---|---|---|
1 |
package org.gvsig.gazetteer; |
|
2 |
|
|
3 |
import java.net.URISyntaxException; |
|
4 |
|
|
5 |
|
|
6 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
7 |
* |
|
8 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
9 |
* |
|
10 |
* This program is free software; you can redistribute it and/or |
|
11 |
* modify it under the terms of the GNU General Public License |
|
12 |
* as published by the Free Software Foundation; either version 2 |
|
13 |
* of the License, or (at your option) any later version. |
|
14 |
* |
|
15 |
* This program is distributed in the hope that it will be useful, |
|
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 |
* GNU General Public License for more details. |
|
19 |
* |
|
20 |
* You should have received a copy of the GNU General Public License |
|
21 |
* along with this program; if not, write to the Free Software |
|
22 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
23 |
* |
|
24 |
* For more information, contact: |
|
25 |
* |
|
26 |
* Generalitat Valenciana |
|
27 |
* Conselleria d'Infraestructures i Transport |
|
28 |
* Av. Blasco Ib??ez, 50 |
|
29 |
* 46010 VALENCIA |
|
30 |
* SPAIN |
|
31 |
* |
|
32 |
* +34 963862235 |
|
33 |
* gvsig@gva.es |
|
34 |
* www.gvsig.gva.es |
|
35 |
* |
|
36 |
* or |
|
37 |
* |
|
38 |
* IVER T.I. S.A |
|
39 |
* Salamanca 50 |
|
40 |
* 46005 Valencia |
|
41 |
* Spain |
|
42 |
* |
|
43 |
* +34 963163400 |
|
44 |
* dac@iver.es |
|
45 |
*/ |
|
46 |
/* CVS MESSAGES: |
|
47 |
* |
|
48 |
* $Id: URIs.java 499 2007-07-10 11:18:10 +0000 (Tue, 10 Jul 2007) jorpiell $ |
|
49 |
* $Log$ |
|
50 |
* Revision 1.1.2.1 2007/07/10 11:18:03 jorpiell |
|
51 |
* Added the registers |
|
52 |
* |
|
53 |
* |
|
54 |
*/ |
|
55 |
/** |
|
56 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
57 |
*/ |
|
58 |
public class URIs { |
|
59 |
|
|
60 |
/** |
|
61 |
* @param args |
|
62 |
* @throws URISyntaxException |
|
63 |
*/ |
|
64 |
public static void main(String[] args) throws URISyntaxException { |
|
65 |
java.net.URI uri = new java.net.URI("www.upv.es"); |
|
66 |
System.out.println(uri.getHost()); |
|
67 |
System.out.println(uri.getPort()); |
|
68 |
System.out.println(uri.getScheme()); |
|
69 |
java.net.URI uri1 = new java.net.URI("z3950://www.upv.es"); |
|
70 |
System.out.println(uri1.getHost()); |
|
71 |
System.out.println(uri1.getPort()); |
|
72 |
System.out.println(uri1.getScheme()); |
|
73 |
} |
|
74 |
|
|
75 |
} |
|
0 | 76 |
tags/v2_0_0_Build_2041/applications/appGazetteer/src/org/gvsig/gazetteer/ui/serverconnect/ServerConnectDialog.java | ||
---|---|---|
1 |
|
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
package org.gvsig.gazetteer.ui.serverconnect; |
|
43 |
import org.gvsig.catalog.utils.Frames; |
|
44 |
|
|
45 |
/** |
|
46 |
* This class implements the JFrame for the server |
|
47 |
* connect panel that will be used when the gazetteer |
|
48 |
* client is runned without gvSIG. It also implements |
|
49 |
* the window listener that closes the application when |
|
50 |
* the window is closed. |
|
51 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
|
52 |
*/ |
|
53 |
public class ServerConnectDialog extends org.gvsig.catalog.ui.serverconnect.ServerConnectDialog{ |
|
54 |
private static final long serialVersionUID = -6457336150268592182L; |
|
55 |
|
|
56 |
public ServerConnectDialog() { |
|
57 |
super(); |
|
58 |
initialize(); |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* This method initializes jDialog |
|
63 |
*/ |
|
64 |
protected void initialize() { |
|
65 |
Frames.centerFrame(this, 625, 290); |
|
66 |
this.setTitle("Metadata catalog"); |
|
67 |
setResizable(false); |
|
68 |
setName("serverConnect"); |
|
69 |
getContentPane().add(new ServerConnectDialogPanel( |
|
70 |
this)); |
|
71 |
addWindowListener(this); |
|
72 |
setVisible(true); |
|
73 |
} |
|
74 |
} |
|
0 | 75 |
tags/v2_0_0_Build_2041/applications/appGazetteer/src/org/gvsig/gazetteer/ui/serverconnect/ServerConnectDialogPanel.java | ||
---|---|---|
1 |
|
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
package org.gvsig.gazetteer.ui.serverconnect; |
|
43 |
import java.awt.BorderLayout; |
|
44 |
import java.awt.Cursor; |
|
45 |
import java.awt.event.ActionEvent; |
|
46 |
import java.awt.event.ActionListener; |
|
47 |
import java.io.BufferedReader; |
|
48 |
import java.io.File; |
|
49 |
import java.io.FileNotFoundException; |
|
50 |
import java.io.FileReader; |
|
51 |
import java.io.IOException; |
|
52 |
import java.util.Iterator; |
|
53 |
import java.util.TreeMap; |
|
54 |
|
|
55 |
import javax.swing.JFrame; |
|
56 |
import javax.swing.JPanel; |
|
57 |
|
|
58 |
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities; |
|
59 |
import org.gvsig.catalog.utils.CatalogConstants; |
|
60 |
import org.gvsig.gazetteer.GazetteerClient; |
|
61 |
import org.gvsig.gazetteer.GazetteerLocator; |
|
62 |
import org.gvsig.gazetteer.GazetteerManager; |
|
63 |
import org.gvsig.gazetteer.drivers.IGazetteerServiceDriver; |
|
64 |
import org.gvsig.gazetteer.ui.search.SearchDialog; |
|
65 |
import org.gvsig.i18n.Messages; |
|
66 |
import org.gvsig.utils.swing.jcomboServer.ServerData; |
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
/** |
|
71 |
* It implements the Jpanel thas has the events control |
|
72 |
* for the connection panel. It is composed by some buttons |
|
73 |
* and a panel. |
|
74 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
|
75 |
*/ |
|
76 |
public class ServerConnectDialogPanel extends JPanel implements ActionListener { |
|
77 |
private static final GazetteerManager gazetteerManager = GazetteerLocator.getGazetteerManager(); |
|
78 |
private static final long serialVersionUID = 7022169996238047820L; |
|
79 |
private static TreeMap serverList = new TreeMap(); |
|
80 |
private ServerConnectPanel controlsPanel = null; |
|
81 |
private JFrame parent = null; |
|
82 |
protected GazetteerClient client = null; |
|
83 |
protected String serversFile = "servers/GazetteerServers.txt"; |
|
84 |
protected String currentServer = ""; |
|
85 |
private ConnectThread connectThread = null; |
|
86 |
|
|
87 |
/** |
|
88 |
* Constructor |
|
89 |
* @param parent |
|
90 |
*/ |
|
91 |
public ServerConnectDialogPanel(JFrame parent) { |
|
92 |
this.parent = parent; |
|
93 |
this.setLayout(new BorderLayout()); |
|
94 |
add(getControlsPanel(),BorderLayout.CENTER); |
|
95 |
//Loads the servers |
|
96 |
loadServerList(serversFile); |
|
97 |
//Load the protocols |
|
98 |
controlsPanel.loadDrivers( |
|
99 |
gazetteerManager.getDrivers()); |
|
100 |
//Load the first protocol |
|
101 |
controlsPanel.setProtocol(controlsPanel.getServer().getServiceSubType()); |
|
102 |
} |
|
103 |
|
|
104 |
/** |
|
105 |
* @return the main panel |
|
106 |
*/ |
|
107 |
public ServerConnectPanel getControlsPanel() { |
|
108 |
if (controlsPanel == null) { |
|
109 |
controlsPanel = new ServerConnectPanel(); |
|
110 |
controlsPanel.addActionListener(this); |
|
111 |
controlsPanel.enableSearchButton(false); |
|
112 |
} |
|
113 |
return controlsPanel; |
|
114 |
} |
|
115 |
|
|
116 |
/** |
|
117 |
* It adds a server in the TreeMap Object |
|
118 |
* @param server |
|
119 |
*/ |
|
120 |
protected static void addTreeMapServer(ServerData server) { |
|
121 |
if (ServerConnectDialogPanel.serverList == null) { |
|
122 |
ServerConnectDialogPanel.serverList = new TreeMap(); |
|
123 |
} |
|
124 |
serverList.put(server.getServerAddress(), server); |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* This method loads a server list in the combo |
|
129 |
* @param sfile |
|
130 |
*/ |
|
131 |
private void loadServerList(String sfile) { |
|
132 |
loadServersFromFile(sfile); |
|
133 |
Iterator iter = serverList.keySet().iterator(); |
|
134 |
while (iter.hasNext()) { |
|
135 |
ServerData server = (ServerData) serverList.get((String) iter.next()); |
|
136 |
controlsPanel.addServer(server); |
|
137 |
} |
|
138 |
} |
|
139 |
|
|
140 |
/** |
|
141 |
* It loads a server list from a text file |
|
142 |
* @param sfile |
|
143 |
* File that contains the rervers |
|
144 |
*/ |
|
145 |
private void loadServersFromFile(String sfile) { |
|
146 |
File file = null; |
|
147 |
try { |
|
148 |
file = new File(sfile); |
|
149 |
if (file.exists()) { |
|
150 |
BufferedReader fr = new BufferedReader(new FileReader(file)); |
|
151 |
String s; |
|
152 |
while ((s = fr.readLine()) != null) { |
|
153 |
addTreeMapServer(new ServerData(s,"","")); |
|
154 |
} |
|
155 |
} else { |
|
156 |
System.out.println("No se encuentra el fichero '" + |
|
157 |
file.getPath() + "'"); |
|
158 |
} |
|
159 |
} catch (FileNotFoundException e) { |
|
160 |
System.out.println("No se encuentra el fichero '" + file.getPath() + |
|
161 |
"'"); |
|
162 |
//e.printStackTrace(); |
|
163 |
} catch (IOException e) { |
|
164 |
System.out.println("Error de entrada salida en la lectura del fichero"); |
|
165 |
//e.printStackTrace(); |
|
166 |
} |
|
167 |
} |
|
168 |
|
|
169 |
/* |
|
170 |
* (non-Javadoc) |
|
171 |
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) |
|
172 |
*/ |
|
173 |
public void actionPerformed(ActionEvent e) { |
|
174 |
if (e.getActionCommand().compareTo(CatalogConstants.CONNECT_BUTTON_ACTION_COMMAND)==0) { |
|
175 |
connectButtonActionPerformed(); |
|
176 |
} |
|
177 |
if (e.getActionCommand().compareTo(CatalogConstants.SEARCH_BUTTON_ACTION_COMMAND)==0) { |
|
178 |
searchButtonActionPerformed(); |
|
179 |
} |
|
180 |
if (e.getActionCommand().compareTo(CatalogConstants.CLOSE_BUTTON_ACTION_COMMAND)==0) { |
|
181 |
closeButtonActionPerformed(); |
|
182 |
} |
|
183 |
if (e.getActionCommand().compareTo(CatalogConstants.PROTOCOL_COMBO_ACTION_COMMAND)==0){ |
|
184 |
|
|
185 |
} |
|
186 |
if (e.getActionCommand().compareTo(CatalogConstants.SERVER_COMBO_ACTION_COMMAND)==0) { |
|
187 |
controlsPanel.updateProtocol(); |
|
188 |
} |
|
189 |
} |
|
190 |
|
|
191 |
/** |
|
192 |
* Action when the search button is clicked |
|
193 |
*/ |
|
194 |
protected void searchButtonActionPerformed() { |
|
195 |
setEnabled(false); |
|
196 |
new SearchDialog(client,parent); |
|
197 |
} |
|
198 |
|
|
199 |
/** |
|
200 |
* It is thrown the the connect button is clicked |
|
201 |
*/ |
|
202 |
protected void connectButtonActionPerformed() { |
|
203 |
controlsPanel.enableSearchButton(false); |
|
204 |
//Create a new Gazetteer client |
|
205 |
client = new GazetteerClient(controlsPanel.getServerAddress(), |
|
206 |
(IGazetteerServiceDriver)controlsPanel.getDriver()); |
|
207 |
if (connectThread != null){ |
|
208 |
connectThread.stop(); |
|
209 |
} |
|
210 |
connectThread = new ConnectThread(); |
|
211 |
setCursor(new Cursor(Cursor.WAIT_CURSOR)); |
|
212 |
} |
|
213 |
|
|
214 |
/** |
|
215 |
* * It is thrown the the close button is clicked |
|
216 |
*/ |
|
217 |
protected void closeButtonActionPerformed() { |
|
218 |
parent.setVisible(false); |
|
219 |
System.exit(0); |
|
220 |
} |
|
221 |
|
|
222 |
/** |
|
223 |
* @return Returns the serversFile. |
|
224 |
*/ |
|
225 |
public String getServersFile() { |
|
226 |
return serversFile; |
|
227 |
} |
|
228 |
|
|
229 |
/** |
|
230 |
* @param serversFile The serversFile to set. |
|
231 |
*/ |
|
232 |
public void setServersFile(String serversFile) { |
|
233 |
this.serversFile = serversFile; |
|
234 |
} |
|
235 |
|
|
236 |
/** |
|
237 |
* @return Returns the currentServer. |
|
238 |
*/ |
|
239 |
public String getCurrentServer() { |
|
240 |
return currentServer; |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* @return Returns the client. |
|
245 |
*/ |
|
246 |
public GazetteerClient getCliente() { |
|
247 |
return client; |
|
248 |
} |
|
249 |
|
|
250 |
/** |
|
251 |
* This class is used to manage the searches. |
|
252 |
* It contains method to start and to stop a thread. It is |
|
253 |
* necessary to create because "stop" method (for the Thread class) |
|
254 |
* is deprecated. |
|
255 |
* |
|
256 |
* |
|
257 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
|
258 |
*/ |
|
259 |
private class ConnectThread implements Runnable { |
|
260 |
volatile Thread myThread = null; |
|
261 |
|
|
262 |
public ConnectThread() { |
|
263 |
myThread = new Thread(this); |
|
264 |
myThread.start(); |
|
265 |
} |
|
266 |
|
|
267 |
public void stop(){ |
|
268 |
myThread.stop(); |
|
269 |
} |
|
270 |
/* |
|
271 |
* (non-Javadoc) |
|
272 |
* @see java.lang.Runnable#run() |
|
273 |
*/ |
|
274 |
public void run() { |
|
275 |
try { |
|
276 |
DiscoveryServiceCapabilities capabilities = client.getCapabilities(); |
|
277 |
if (capabilities.isAvailable()){ |
|
278 |
controlsPanel.enableSearchButton(true); |
|
279 |
currentServer = controlsPanel.getServerAddress(); |
|
280 |
searchButtonActionPerformed(); |
|
281 |
} |
|
282 |
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
|
283 |
controlsPanel.setServerReply(capabilities.getServerMessage()); |
|
284 |
} catch (Exception e) { |
|
285 |
controlsPanel.setServerReply(Messages.getText(e.toString())); |
|
286 |
e.printStackTrace(); |
|
287 |
} |
|
288 |
} |
|
289 |
} |
|
290 |
} |
|
0 | 291 |
tags/v2_0_0_Build_2041/applications/appGazetteer/src/org/gvsig/gazetteer/ui/serverconnect/ServerConnectPanel.java | ||
---|---|---|
1 |
package org.gvsig.gazetteer.ui.serverconnect; |
|
2 |
|
|
3 |
import org.gvsig.gazetteer.GazetteerLocator; |
|
4 |
import org.gvsig.gazetteer.GazetteerManager; |
|
5 |
import org.gvsig.gazetteer.drivers.IGazetteerServiceDriver; |
|
6 |
|
|
7 |
|
|
8 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
9 |
* |
|
10 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
11 |
* |
|
12 |
* This program is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* This program is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
* GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
25 |
* |
|
26 |
* For more information, contact: |
|
27 |
* |
|
28 |
* Generalitat Valenciana |
|
29 |
* Conselleria d'Infraestructures i Transport |
|
30 |
* Av. Blasco Ib??ez, 50 |
|
31 |
* 46010 VALENCIA |
|
32 |
* SPAIN |
|
33 |
* |
|
34 |
* +34 963862235 |
|
35 |
* gvsig@gva.es |
|
36 |
* www.gvsig.gva.es |
|
37 |
* |
|
38 |
* or |
|
39 |
* |
|
40 |
* IVER T.I. S.A |
|
41 |
* Salamanca 50 |
|
42 |
* 46005 Valencia |
|
43 |
* Spain |
|
44 |
* |
|
45 |
* +34 963163400 |
|
46 |
* dac@iver.es |
|
47 |
*/ |
|
48 |
/* CVS MESSAGES: |
|
49 |
* |
|
50 |
* $Id: ServerConnectPanel.java 605 2007-10-18 10:57:03 +0000 (Thu, 18 Oct 2007) jpiera $ |
|
51 |
* $Log$ |
|
52 |
* Revision 1.1.2.5 2007/07/24 11:25:42 jorpiell |
|
53 |
* The registers has been refactorized |
|
54 |
* |
|
55 |
* Revision 1.1.2.4 2007/07/24 09:55:31 jorpiell |
|
56 |
* Add the default servers |
|
57 |
* |
|
58 |
* Revision 1.1.2.3 2007/07/13 12:00:35 jorpiell |
|
59 |
* Add the posibility to add a new panel |
|
60 |
* |
|
61 |
* Revision 1.1.2.2 2007/07/11 13:01:50 jorpiell |
|
62 |
* Catalog UI updated |
|
63 |
* |
|
64 |
* Revision 1.1.2.1 2007/07/10 11:18:04 jorpiell |
|
65 |
* Added the registers |
|
66 |
* |
|
67 |
* |
|
68 |
*/ |
|
69 |
/** |
|
70 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
71 |
*/ |
|
72 |
public class ServerConnectPanel extends org.gvsig.catalog.ui.serverconnect.ServerConnectPanel{ |
|
73 |
private static final GazetteerManager gazetteerManager = GazetteerLocator.getGazetteerManager(); |
|
74 |
|
|
75 |
public ServerConnectPanel(){ |
|
76 |
super(); |
|
77 |
setDatabaseVisible(false); |
|
78 |
setServerPropertiesButtonVisible(false); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* Select a concrete protocol |
|
83 |
* @param protocol |
|
84 |
* Protocol to select |
|
85 |
*/ |
|
86 |
public void setProtocol(String protocol){ |
|
87 |
IGazetteerServiceDriver driver = gazetteerManager.getDriver(protocol); |
|
88 |
if (driver != null){ |
|
89 |
protocolCombo.setSelectedItem(driver); |
|
90 |
} |
|
91 |
} |
|
92 |
} |
|
0 | 93 |
tags/v2_0_0_Build_2041/applications/appGazetteer/src/org/gvsig/gazetteer/ui/showresults/ShowResultsDialog.java | ||
---|---|---|
1 |
|
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
Also available in: Unified diff