Revision 688

View differences:

org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/LEEME.txt
1
===============
2
gvSIG Educa
3
===============
4

  
5
---------------------
6
Vistas Portables
7
---------------------
8

  
9
Descripci?n
10
==============
11

  
12
Este directorio contiene los fuentes de la funcionalidad Vistas Portables.
13

  
14
Requisitos
15
==============
16

  
17
* Maven 2.6 or higher
18

  
19
* Java JDK 1.5 or higher
20

  
21
Para trabajar con eclipse
22
--------------------------
23

  
24
Ver `Gu?a del desarrollador en gvSIG.org <https://gvsig.org/web/projects/gvsig-desktop/docs/devel/gvsig-devel-guide/2.0.0/>`_ y el fichero ``REAME-ECLIPSE.txt``
25

  
26
Contenido
27
==========
28

  
29
org.gvsig.educa.portableview.lib
30
---------------------------------
31

  
32
Fuentes de la funcionalidad. Estos proyectos contienen los procesos y l?gica principal sin dependencias de interface de usuario.
33

  
34
org.gvsig.educa.portableview.swing
35
-------------------------------------
36

  
37
Componentes de interface de usuario para gestionar los servicios que ofrece la librer??a.
38

  
39
org.gvsig.educa.portableview.main
40
-----------------------------------
41

  
42
Peque?a aplicaci?n que permite ejecutar las funcionalidades y realizar pruebas funcionales.
43

  
44
Ver `Ejecutar aplicaci?n de pruebas`_ para saber como arrancarla.
45

  
46
pom.xml
47
---------
48

  
49
Archivo de definici?n de proyecto Maven.
50

  
51
README.txt LEEME.txt
52
----------------------
53

  
54
Este fichero (en formato reStructureText, para mas informaci?n sobre este ver el `portal de gvSIG <https://gvsig.org/web/projects/gvsig-desktop/docs/devel/guia-para-documentar/el-formato-restructuredtext>`_  en la `referencia de docUtils  <http://docutils.sourceforge.net/rst.html>`_)
55

  
56

  
57
Compilaci?n
58
================
59

  
60
Desde el shell
61
----------------
62

  
63
Ejecute este comando::
64

  
65
    org.gvsig.educa.portablewview$ mvn clean install
66

  
67

  
68
Desde eclipse
69
--------------
70
Ver `Trabajar con un proyecto de la gu?a de desarrollador en gvSIG.org <https://gvsig.org/web/projects/gvsig-desktop/docs/devel/gvsig-devel-guide/2.0.0/trabajar-con-un-proyecto>`_
71

  
72
En algunos proyectos puede que sea necesario user el comando ``mvn eclipse:clean eclipse:eclipse`` e importar como *Standar/Import existing project...* en vez de cargar como *Maven Project*. Esto es debido a que, en algunas circunstancias, parece que el plugin de Maven del eclipse no prepara el *classpath* de forma correcta.
73

  
74

  
75
Empaquetado
76
===============
77

  
78
Esta funcionalidad no tiene ning?n proyecto pensado para empaquetar de forma independiente.
79

  
80
Versionado
81
--------------
82

  
83
Para cambiar el n?mero de versi?n de los plugins solo es necesario ajustar la etiqueta ``project/version`` del fichero *pom.xml*. Los subproyectos heredar?n el valor.
84

  
85
La pol??tica de versi?n es la est?ndar. Los cambios en los numeroso son:
86

  
87
* tercer n?mero: Arreglo de errores y mejoras menores. Sin cambios en el API.
88
* segundo n?mero: Arreglo de erroes y mejoras. Pueden haber cambios menores en el API. Los elementos marcados como *deprecated* en versiones anteriores pueden eliminarse. Sin cambios de arquitectura.
89
* primer n?mero: Cambios mayores.
90

  
91
Crear un tag
92
------------------
93

  
94
TODO: usar el plugin *release* de maven
95

  
96
Usar el comando *svn copy*. El proceso podr?a ser:
97

  
98
#. Comprobar que no hay cambios en la copia local::
99

  
100
   svn up ; svn status
101

  
102
#. Comprobar que los proyecto compilan y pasan todas las bater?as de test::
103

  
104
   mvn clean install
105

  
106
#. Actualizar el fichero *pom.xml* con la versi?n de tag (normalmente quitando el sufijo *-SNAPSHOT*)
107
#. Crear el directorio para el tag en el servidor::
108

  
109
   svn mkdir -m "Create {version} tag folder" https://devel.gvsig.org/svn/gvsig-educa/org.gvsig.educa.portablewview.app/tags/{version}
110

  
111
#. Subir la copia local al directorio del tag en el servidor::
112

  
113
   svn copy -m "Create {version} tag" * https://devel.gvsig.org/svn/gvsig-educa/org.gvsig.educa.portablewview.app/tags/{version}
114

  
115
#. Actualizar el *pom.xml* a la siguiente version (y a?adirle el sufijo *-SNAPSHOT*)
116
#. Subir los cambios del *pom.xml*::
117

  
118
   svn commit -m "Set new version {version}-SNAPSHOT" pom.xml
119

  
120

  
121
i18n
122
======
123

  
124
Los ficheros de internacionalizaci?n se pueden encontrar en los directorios:
125

  
126
+ */org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n*
127
+ *org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.impl/src/main/resources/org/gvsig/educa/portableview/impl/i18n*
128

  
129
La internacionalizaci?n est? basada en el mecanismo est?ndar de los *resource bundle*. Para a?adir un nuevo idioma es necesario a?adir el fichero de propiedades en todos los directorio con el codigo de idioma adecuado.
130

  
131
Ejecutar aplicaci?n de pruebas
132
=================================
133

  
134
Desde el Shell
135
----------------
136

  
137
Despu?s del proceso de `Compilaci?n`_ , ejecute estos comandos::
138

  
139
    org.gvsig.educa.portablewview$ cd org.gvsig.educa.portablewview.main
140
    org.gvsig.educa.portablewview/org.gvsig.educa.portablewview.main$ mvn exec:java
141

  
142
Desde el eclipse
143
------------------
144

  
145
Seleccione el proyecto ``org.gvsig.educa.portableview.main`` en el *Project tree* de la *Java perspective*, haga click con el bot?n derecho y seleccione ``Run as.../Java application``. Seleccione la clase ``Main`` del propio proyecto.
146

  
147
Si tiene problemas al ejecutar, compruebe la nota de la secci?n `Compilaci?n`_ sobre la importaci?n del proyecto.
148

  
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/text_it.properties
1
#text_it.properties
2
_problems_loading_portableview_file_data=Problemi nel caricamento della mappa tematica id\:%(id) ver\:%(version) bn\:%(buildNumber)
3
_portable_view_not_found_installed=Mappa tematica installata non trovata\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
4
comments=Commenti
5
install_portable_view=Installa mappa tematica
6
name_is_required=Il nome \u00E8 obbligatorio
7
open_portable_view=Apri mappa tematica
8
source_view=Vista di origine
9
portable_view_properties=Propriet\u00E0 della mappa tematica
10
portable_views_availables=Mappe tematiche disponibili
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/text.properties
1
#text.properties
2
_problems_loading_portableview_file_data=Se han encontrado problema al generar el Mapa tem\u00E1tico\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
3
_portable_view_not_found_installed=No se encontr\u00F3 el Mapa tem\u00E1tico instalado\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
4
comments=Comentarios
5
install_portable_view=Instalar mapas tem\u00E1ticos
6
name_is_required=El nombre es obligatorio
7
open_portable_view=Abrir mapas tem\u00E1ticos
8
source_view=Vista origen
9
portable_view_properties=Propiedades de la vista portable
10
portable_views_availables=Vistas portables disponibles
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/text_en.properties
1
#text_en.properties
2
_problems_loading_portableview_file_data=Problems loading Portable View\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
3
_portable_view_not_found_installed=Installed Portable View not found\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
4
comments=Comments
5
install_portable_view=Install Portable View
6
name_is_required=Name is required
7
open_portable_view=Open Portable Views
8
source_view=Source View
9
portable_view_properties=Portable View properties
10
portable_views_availables=Portable views available
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/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" />
4
	<resourceBundle name="text" />
5
	<label-set class-name="org.gvsig.educa.portableview.app.viewer.ui.PortableViewDocumentViewer">
6
		<label id="units" size="75"/>
7
		<label id="x" size="120"/>
8
		<label id="y" size="120"/>
9
		<label id="4" size="110"/>
10
		<label id="5" size="110"/>
11
		<label id="distancearea" size="30"/>
12
		<label id="projection" size="110"/>
13
	</label-set>
14
	<libraries library-dir="lib" />
15
	<extensions>
16
		<extension
17
			class-name="org.gvsig.educa.portableview.app.viewer.PortableViewExtension"
18
			description=""
19
			active="true"
20
			priority="1">
21
		</extension>
22

  
23
		<extension
24
			class-name="org.gvsig.educa.portableview.app.viewer.PortableViewBasicMapControlExtension"
25
			description="" active="true" priority="1">
26
			<combo-scale name="view-change-scale-portableview"
27
				label="1:"
28
				elements="1000;2000;5000;10000;25000;50000;100000;200000;500000;1000000;2000000;5000000"
29
				value="10000"
30
				action-command="view-change-scale" />
31

  
32
			<action
33
		        name="view-change-scale-portableview"
34
		        label="_Change_scale"
35
		        action-command="view-change-scale" />
36
            <action
37
		        name="view-navigation-pan-portableview"
38
		        label="_Move_the_map"
39
		        position="650100100"
40
		        action-command="view-navigation-pan"
41
		        icon="view-navigation-pan"
42
		        tooltip="_Move_the_map"
43
		        accelerator="" />
44
		  	<action
45
		        name="view-navigation-zoom-in-center-portableview"
46
		        label="_Zoom_in_center"
47
		        position="650100200"
48
		        action-command="view-navigation-zoom-in-center"
49
		        tooltip="_Zoom_in_center"
50
		        icon="view-navigation-zoom-in-center"
51
		        accelerator="" />
52
		    <action
53
		        name="view-navigation-zoom-out-center-portableview"
54
		        label="_Zoom_out_center"
55
		        position="650100300"
56
		        action-command="view-navigation-zoom-out-center"
57
		        tooltip="_Zoom_out_center"
58
		        icon="view-navigation-zoom-out-center"
59
		        accelerator="" />
60
		    <action
61
		        name="view-navigation-zoom-in-topoint-portableview"
62
		        label="_Zoom_in_to_point"
63
		        position="650100400"
64
		        action-command="view-navigation-zoom-in-topoint"
65
		        icon="view-navigation-zoom-in-topoint"
66
		        tooltip="_Zoom_in_to_point"
67
		        accelerator="" />
68
            <action
69
		        name="view-navigation-zoom-out-topoint-portableview"
70
		        label="_Zoom_out_to_point"
71
		        position="650100500"
72
		        action-command="view-navigation-zoom-out-topoint"
73
		        icon="view-navigation-zoom-out-topoint"
74
		        tooltip="_Zoom_out_to_point"
75
		        accelerator="" />
76
		    <action
77
		        name="view-navigation-zoom-back-portableview"
78
		        label="_zoom_back"
79
		        tooltip="_zoom_back"
80
		        action-command="view-navigation-zoom-back"
81
		        icon="view-navigation-zoom-back"
82
		        position="650100700"
83
		        accelerator=""/>
84
            <action
85
		        name="view-navigation-zoom-all-portableview"
86
		        label="_Zoom_all"
87
		        position="650100800"
88
		        action-command="view-navigation-zoom-all"
89
		        icon="view-navigation-zoom-all"
90
		        tooltip="_Zoom_all"
91
		        accelerator="" />
92

  
93
		    <menu
94
		        name="view-navigation-pan-portableview"
95
		        text="View/Navigation/Pan" />
96
		    <menu
97
		        name="view-navigation-zoom-in-center-portableview"
98
		        text="View/Navigation/Zoom_in_to_center"/>
99
		    <menu
100
		        name="view-navigation-zoom-out-center-portableview"
101
		        text="View/Navigation/Zoom_out_to_center"/>
102
			<menu
103
		        name="view-navigation-zoom-in-topoint-portableview"
104
		        text="View/Navigation/Zoom_in" />
105
		    <menu
106
		        name="view-navigation-zoom-out-topoint-portableview"
107
		        text="View/Navigation/Zoom_out" />
108
		    <menu
109
		        name="view-navigation-zoom-all-portableview"
110
		        text="View/Navigation/Zoom_all" />
111
			<menu
112
		        name="view-navigation-zoom-back-portableview"
113
		        text="View/Navigation/Zoom_back" />
114

  
115
      		<tool-bar name="view_navigation" position="3">
116
		        <selectable-tool name="view-navigation-zoom-in-topoint-portableview" is-default="true" />
117
		        <selectable-tool name="view-navigation-zoom-out-topoint-portableview" />
118
		        <action-tool name="view-navigation-zoom-all-portableview"  />
119
		        <action-tool name="view-navigation-zoom-in-center-portableview"  />
120
		        <action-tool name="view-navigation-zoom-out-center-portableview"  />
121
        		<action-tool name="view-navigation-zoom-back-portableview"/>
122
		    </tool-bar>
123

  
124
		    <tool-bar name="view_navigation" position="4">
125
		        <selectable-tool name="view-navigation-pan-portableview"/>
126
		    </tool-bar>
127
		</extension>
128
		<extension class-name="org.gvsig.educa.portableview.app.viewer.PortableViewMeasureToolsExtension"
129
			description="Extensi?n encargada de gestionar las operaciones de medir sobre los ThemtaticMap."
130
			active="true" priority="30">
131

  
132
			<action
133
		        name="view-query-distance-portableview"
134
		        label="_Query_distance"
135
		        position="650700200"
136
		        action-command="view-query-distance"
137
		        icon="view-query-distance"
138
		        tooltip="_Query_distance"
139
		        accelerator="" />
140
		    <action
141
		        name="view-query-area-portableview"
142
		        label="_Query_area"
143
		        position="650700100"
144
		        action-command="view-query-area"
145
		        icon="view-query-area"
146
		        tooltip="_Query_area"
147
		        accelerator="" />
148

  
149
			<menu
150
		        name="view-query-distance-portableview"
151
		        text="View/Query/Distance" />
152
	        <menu
153
		        name="view-query-area-portableview"
154
		        text="View/Query/Area" />
155

  
156
		    <tool-bar name="view_tools_query" position="5">
157
		        <selectable-tool name="view-query-distance-portableview" />
158
		        <selectable-tool name="view-query-area-portableview" />
159
		    </tool-bar>
160
		</extension>
161

  
162
		<extension class-name="org.gvsig.educa.portableview.app.viewer.PortableViewInfoByPointToolsExtension"
163
			description="Extensi?n encargada de gestionar la herramienta de info en los mapas tematicos."
164
			active="true"
165
			priority="29">
166

  
167
			<action
168
		        name="layer-info-by-point-portableview"
169
		        label="_point_information"
170
		        tooltip="_Show_point_information"
171
		        action-command="layer-info-by-point"
172
		        icon="layer-info-by-point"
173
		        position="600200000"
174
		        accelerator="" />
175
		    <menu
176
		        name="layer-info-by-point-portableview"
177
		        text="View/Query/Information" />
178
		    <tool-bar name="view_tools_query" position="5">
179
		        <selectable-tool name="layer-info-by-point-portableview" />
180
		    </tool-bar>
181
		</extension>
182
	</extensions>
183
</plugin-config>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/text_pt_BR.properties
1
#text_pt_br.properties
2
_problems_loading_portableview_file_data=Problemas ao carregar dados de arquivo do mapa tem\u00E1tico
3
_portable_view_not_found_installed=Mapa tem\u00E1tico instalado n\u00E3o encontrado
4
comments=Coment\u00E1rios
5
install_portable_view=Instalar mapa tem\u00E1tico
6
name_is_required=Nome \u00E9 obrigat\u00F3rio
7
open_portable_view=Abrir mapa tem\u00E1tico
8
source_view=Vista de origem
9
portable_view_properties=Propriedades do mapa tem\u00E1tico
10
portable_views_availables=Mapas tem\u00E1ticos dispon\u00EDveis
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/text_ru.properties
1
#text_ru.properties
2
_problems_loading_portableview_file_data=\u041E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B\:  id\:%(id) ver\:%(version) bn\:%(buildNumber)
3
_portable_view_not_found_installed=\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u0430\u044F \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u043A\u0430\u0440\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
4
comments=\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438
5
install_portable_view=\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u043A\u0430\u0440\u0442\u0443
6
name_is_required=\u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0432\u0432\u0435\u0441\u0442\u0438 \u0438\u043C\u044F
7
open_portable_view=\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u043A\u0430\u0440\u0442\u0443
8
source_view=\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0412\u0438\u0434
9
portable_view_properties=\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B
10
portable_views_availables=\u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043A\u0430\u0440\u0442\u044B \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/text_de.properties
1
#text_de.properties
2
_problems_loading_portableview_file_data=Problem beim Laden der Thematischen Karte\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
3
_portable_view_not_found_installed=Installierte Thematische Karte nicht gefunden\: id\:%(id) ver\:%(version) bn\:%(buildNumber)
4
comments=Kommentare
5
install_portable_view=Thematische Karte installieren
6
name_is_required=Ein Name ist erforderlich
7
open_portable_view=Thematische Karte \u00F6ffnen
8
source_view=Quelldaten-Ansicht
9
portable_view_properties=Eigenschaften der Thematischen Karte
10
portable_views_availables=Verf\u00FCgbare Thematische Karten
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/about/disid.html
1
<html>
2
<body>
3

  
4
<img src="disid-logo.jpeg"><br>
5

  
6
<h2>DiSiD Technologies</h2>
7
<br>
8
<p>
9
<a href="http://www.disid.com/">http://www.disid.com/</a>
10
</p>
11
<p>Empresa de ingenier&iacute;a inform&aacute;tica especializada en tecnolog&iacute;a Java.</p>
12
<p>Nuestro objetivo es proveer soluciones software enfocadas a resolver problemas y necesidades con
13
el objetivo de ofrecer s&oacute;lo lo que los clientes necesitan, evitando gestiones innecesarias.</p>
14
<br>
15
<p>Especializados en:
16
<ul>
17
<li>Sistemas de informaci&oacute;n geogr&aacute;fica (gvSIG)</li>
18
<li>Reconocimiento y trazabilidad de personas y Activos con representaci&oacute;n gr&aacute;fica</li>
19
<li>e-business y Tiendas virtuales</li>
20
<li>Portales corporativos y Marketing on-line</li>
21
<li>Consultor&iacute;a tecnol&oacute;gica, desarrollo, soporte y formaci&oacute;n Java</li>
22
</ul>
23
<br>
24
<img src="gvsig-logo1-association.jpg">
25
<p><em>Miembro de la <a href="http://www.gvsig.com/">Asociaci&oacute;n gvSIG</a></em>
26
</body>
27
</html>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/about/MTOP.html
1
<html>
2
<body>
3

  
4
	<img src="MTOP.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
5
	<img src="MTOP-TOPOGRAFIA.png">
6

  
7
	<h2>Ministerio de Transporte y Obras P&uacute;blicas (Uruguay)</h2>
8
	<h3>Direcci&oacute;n Nacional de Topograf&iacute;a</h3>
9
	<br>
10
	<p>
11
		<a
12
			href="http://www.mtop.gub.uy/gxpsites/hgxpp001?1,6,18,O,S,0,MNU;E;2;6;7;1;21;3;MNU;,">http://www.mtop.gub.uy</a>
13
	</p>
14

  
15
	<h4>
16
		Misi&oacute;n
17
		</h2>
18
		<p>Posibilitar y conseguir el espacio necesario para el
19
			emplazamiento geom&eacute;trico y legal, para que hagan posible la
20
			realizaci&oacute;n de emprendimientos de inter&eacute;s nacional,
21
			armonizando el inter&eacute;s individual con el colectivo,
22
			minimizando los impactos negativos ambientales y sociales, debiendo
23
			adem&aacute;s conservar, custodiar y administrar datos de
24
			geograf&iacute;a b&aacute;sica territorial del Pa&iacute;s,
25
			promoviendo la uniformizaci&oacute;n de una cartograf&iacute;a
26
			b&aacute;sica para el Estado.</p>
27

  
28
		<h4>
29
			Visi&oacute;n
30
			</h2>
31
			<p>Obtener a tiempo, geom&eacute;trica y legalmente, el espacio
32
				para el inicio y concreci&oacute;n planificada de las obras y
33
				actividades de inter&eacute;s p&uacute;blico previstas, en
34
				cumplimiento de sus cometidos. Concretar un sistema de
35
				informaci&oacute;n georreferenciable general b&aacute;sico para el
36
				Pa&iacute;s, que permita el intercambio de la informaci&oacute;n
37
				existente, tanto p&uacute;blica como privada, en lo relativo con su
38
				georreferenciamiento, buscando la creaci&oacute;n de la
39
				Infraestructura Nacional de datos Espaciales (INDE) compatible con
40
				una Infraestructura Regional de Datos (MERCOSUR) y con la
41
				Infraestructura de Datos Espaciales para las Am&eacute;ricas (IDEPA)
42
				en desarrollo.</p>
43
</body>
44
</html>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/resources-plugin/about/universidad.edu.uy.html
1
<html>
2
<body>
3

  
4
	<img src="universidad.edu.uy.jpg">
5
	<br>
6
	<br>
7
	<img src="LOGO-FING-rgb.jpg">
8

  
9
	<br>
10
	<p>
11
		<a href="http://www.universidad.edu.uy">http://www.universidad.edu.uy</a>
12
	</p>
13
	<p>La Universidad de la Rep&uacute;blica (UdelaR) es la principal
14
		instituci&oacute;n de educaci&oacute;n superior y de investigaci&oacute;n del Uruguay. En
15
		colaboraci&oacute;n con una amplia gama de actores institucionales y
16
		sociales, realiza tambi&eacute;n m&uacute;ltiples actividades orientadas al uso
17
		socialmente valioso del conocimiento y a la difusi&oacute;n de la cultura. Es
18
		una instituci&oacute;n p&uacute;blica, aut&oacute;noma y cogobernada por sus docentes,
19
		estudiantes y egresados.</p>
20
	<p>La Universidad Mayor de la Rep&uacute;blica surge a la vida p&uacute;blica el
21
		18 de julio de 1849, sin embargo, el proceso de su fundaci&oacute;n comienza
22
		diecis&eacute;is a&ntilde;os antes, el 11 de junio de 1833, cuando la ley propuesta
23
		es aprobada.</p>
24
</body>
25
</html>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/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.educa.portableview.lib.api</include>
32
		<include>org.gvsig:org.gvsig.educa.portableview.lib.impl</include>
33
		<include>org.gvsig:org.gvsig.educa.portableview.lib.prov.installer</include>
34
		<include>org.gvsig:org.gvsig.educa.portableview.swing.api</include>
35
		<include>org.gvsig:org.gvsig.educa.portableview.swing.impl</include>
36
      </includes>
37
    </dependencySet>
38
  </dependencySets>
39

  
40
</assembly>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/java/org/gvsig/educa/portableview/app/viewer/exception/PortableViewLoadingException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.educa.portableview.app.viewer.exception;
23

  
24
import org.gvsig.tools.persistence.exception.PersistenceException;
25

  
26
/**
27
 * @author gvSIG Team
28
 * @version $Id$
29
 *
30
 */
31
public class PortableViewLoadingException extends PersistenceException {
32

  
33
    /**
34
     *
35
     */
36
    private static final long serialVersionUID = -844975560187082835L;
37

  
38
    private final static String MESSAGE_FORMAT =
39
        "Problems loading PortableView: id:%(id) ver:%(version) bn:%(bn)";
40
    private final static String MESSAGE_KEY =
41
        "_problems_loading_portableview_file_data";
42

  
43
    private final String id;
44

  
45
    private final int version;
46

  
47
    private final int buildNumber;
48

  
49
    /**
50
     *
51
     */
52
    public PortableViewLoadingException(Exception ex, String id, int version,
53
        int buildNumber) {
54
        super(MESSAGE_FORMAT, ex, MESSAGE_KEY, serialVersionUID);
55
        this.id = id;
56
        this.version = version;
57
        this.buildNumber = buildNumber;
58
        setValue("id", id);
59
        setValue("version", version);
60
        setValue("buildNumber", buildNumber);
61
    }
62

  
63
    protected String getId() {
64
        return id;
65
    }
66

  
67
    protected int getVersion() {
68
        return version;
69
    }
70

  
71
    protected int getBuildNumber() {
72
        return buildNumber;
73
    }
74

  
75
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/java/org/gvsig/educa/portableview/app/viewer/exception/PortableViewNotFoundException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.educa.portableview.app.viewer.exception;
23

  
24
import org.gvsig.tools.persistence.exception.PersistenceException;
25

  
26
/**
27
 * Exception occurs when a project is opening and a Portable view registered on
28
 * it is not installed
29
 *
30
 * @author gvSIG Team
31
 * @version $Id$
32
 *
33
 */
34
public class PortableViewNotFoundException extends PersistenceException {
35

  
36
    /**
37
     *
38
     */
39
    private static final long serialVersionUID = 5394324158268756432L;
40

  
41
    private final static String MESSAGE_FORMAT =
42
        "Portable View not found installed: id:%(id) ver:%(version) bn:%(buildNumber)";
43
    private final static String MESSAGE_KEY =
44
        "_portable_view_not_found_installed";
45

  
46
    private final String id;
47

  
48
    private final int version;
49

  
50
    private final int buildNumber;
51

  
52
    /**
53
     *
54
     */
55
    public PortableViewNotFoundException(String id, int version, int buildNumber) {
56
        super(MESSAGE_FORMAT, MESSAGE_KEY, serialVersionUID);
57
        this.id = id;
58
        this.version = version;
59
        this.buildNumber = buildNumber;
60
        setValue("id", id);
61
        setValue("version", version);
62
        setValue("buildNumber", buildNumber);
63
    }
64

  
65
    protected String getId() {
66
        return id;
67
    }
68

  
69
    protected int getVersion() {
70
        return version;
71
    }
72

  
73
    protected int getBuildNumber() {
74
        return buildNumber;
75
    }
76

  
77
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/java/org/gvsig/educa/portableview/app/viewer/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.educa.portableview package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>PortableView gvSIG viewer plugin</p>
11

  
12
	<p>
13
	Shows PortableView into gvSIG.
14
	</p>
15

  
16
</body>
17
</html>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/java/org/gvsig/educa/portableview/app/viewer/PortableViewExtension.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.educa.portableview.app.viewer;
23

  
24
import java.io.File;
25
import java.util.ArrayList;
26
import java.util.List;
27

  
28
import org.gvsig.about.AboutManager;
29
import org.gvsig.about.AboutParticipant;
30
import org.gvsig.andami.PluginServices;
31
import org.gvsig.andami.plugins.Extension;
32
import org.gvsig.app.ApplicationLocator;
33
import org.gvsig.app.ApplicationManager;
34
import org.gvsig.educa.portableview.PortableViewLocator;
35
import org.gvsig.educa.portableview.PortableViewManager;
36
import org.gvsig.educa.portableview.app.viewer.ui.TocImageProvider;
37
import org.gvsig.educa.portableview.swing.PortableViewSwingLocator;
38
import org.gvsig.educa.portableview.swing.PortableViewSwingManager;
39
import org.gvsig.installer.lib.api.InstallerLocator;
40
import org.gvsig.installer.lib.api.InstallerManager;
41

  
42
/**
43
 * Andami extension to show PortableView in the application.
44
 *
45
 * @author gvSIG Team
46
 * @version $Id$
47
 */
48
public class PortableViewExtension extends Extension {
49

  
50
    private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory
51
        .getLogger(PortableViewExtension.class);
52

  
53
    private PortableViewManager manager;
54
    private PortableViewSwingManager swingManager;
55

  
56
    public void initialize() {
57
        // Do nothing
58
    }
59

  
60
    @Override
61
    public void postInitialize() {
62
        super.postInitialize();
63
        manager = PortableViewLocator.getManager();
64
        swingManager = PortableViewSwingLocator.getSwingManager();
65
        InstallerManager installerManager = InstallerLocator.getInstallerManager();
66

  
67
        // Register the document's manager
68
        PortableViewDocumentManager.register();
69

  
70
        File appUserFolder =
71
            PluginServices.getPluginServices(this).getPluginHomeFolder();
72
        File portableViewIntallFolder = new File(appUserFolder, "portableViews");
73
        LOG.debug("Try Portable View instalation folder: '{}'",
74
            portableViewIntallFolder.getAbsolutePath());
75
        if (!portableViewIntallFolder.exists()) {
76
            LOG.debug("Creating Portable View instalation folder: '{}'",
77
                portableViewIntallFolder.getAbsolutePath());
78

  
79
            if (!portableViewIntallFolder.mkdirs()) {
80
                LOG.warn("Cant create Portable View folder: '{}'");
81
            }
82

  
83
        }
84
        LOG.info("Using Portable View instalation folder: '{}'",
85
            portableViewIntallFolder.getAbsolutePath());
86
        manager.setInstallationMapFolder(portableViewIntallFolder
87
            .getAbsolutePath());
88

  
89
        swingManager.setDefaultTocImageProvider(new TocImageProvider());
90

  
91
        installerManager.setDefaultLocalAddonRepository(
92
                new File(manager.getInstallationMapFolder()),
93
                PortableViewManager.INSTALLER_PROVIDER_NAME
94
        );
95
        
96
        registerAbout();
97

  
98
    }
99

  
100
    /**
101
     *
102
     */
103
    private void registerAbout() {
104
        // Register the about panel
105
        ApplicationManager application = ApplicationLocator.getManager();
106

  
107
        AboutManager about = application.getAbout();
108

  
109
        List<AboutParticipant> participants = new ArrayList<AboutParticipant>();
110

  
111
        participants.add(about.addDeveloper("DISID", this.getClass()
112
            .getClassLoader().getResource("about/disid.html"), 1));
113

  
114
        participants.add(about.addDeveloper("UdelaR.uy", this.getClass()
115
            .getClassLoader().getResource("about/universidad.edu.uy.html"), 1));
116

  
117
        participants.add(about.addSponsor("MTOP.gub.uy", this.getClass()
118
            .getClassLoader().getResource("about/MTOP.html"), 1));
119

  
120
        for (AboutParticipant participant : participants) {
121
            participant
122
                .addContribution(
123
                    "PortableViewExtension",
124
                    "Portable View document: read-only views which could share in packages (installed from standard gvSIG add-on installer)",
125
                    2011, 11, 1, 2012, 2, 29);
126
        }
127

  
128
    }
129

  
130
    public void execute(String actionCommand) {
131
        // TODO
132
    }
133

  
134
    public boolean isEnabled() {
135
        return true;
136
    }
137

  
138
    public boolean isVisible() {
139
        return true;
140
    }
141

  
142
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/java/org/gvsig/educa/portableview/app/viewer/PortableViewBasicMapControlExtension.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.educa.portableview.app.viewer;
23

  
24
import org.gvsig.andami.PluginServices;
25
import org.gvsig.andami.plugins.Extension;
26
import org.gvsig.andami.ui.mdiManager.IWindow;
27
import org.gvsig.app.project.documents.view.toolListeners.PanListener;
28
import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
29
import org.gvsig.app.project.documents.view.toolListeners.ZoomInListener;
30
import org.gvsig.app.project.documents.view.toolListeners.ZoomOutListener;
31
import org.gvsig.educa.portableview.app.viewer.ui.PortableViewDocumentViewer;
32
import org.gvsig.educa.portableview.swing.PortableViewSwingLocator;
33
import org.gvsig.educa.portableview.swing.viewer.MapControlToolRegistrant;
34
import org.gvsig.educa.portableview.swing.viewer.PortableViewViewer;
35
import org.gvsig.fmap.mapcontext.MapContext;
36
import org.gvsig.fmap.mapcontext.ViewPort;
37
import org.gvsig.fmap.mapcontrol.MapControl;
38
import org.gvsig.fmap.mapcontrol.tools.ZoomOutRightButtonListener;
39
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
40
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
41
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseWheelBehavior;
42
import org.gvsig.fmap.mapcontrol.tools.Behavior.MoveBehavior;
43
import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
44
import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior;
45

  
46
/**
47
 * Register and manage basic navigation tools to {@link PortableViewViewer}
48
 *
49
 * @author gvSIG Team
50
 * @version $Id$
51
 *
52
 */
53
public class PortableViewBasicMapControlExtension extends Extension implements
54
    MapControlToolRegistrant {
55

  
56
    private static final String VIEW_NAVIGATION_ZOOM_BACK = "view-navigation-zoom-back";
57
	private static final String VIEW_NAVIGATION_ZOOM_ALL = "view-navigation-zoom-all";
58
	private static final String VIEW_NAVIGATION_ZOOM_OUT_TOPOINT = "view-navigation-zoom-out-topoint";
59
	private static final String VIEW_NAVIGATION_ZOOM_IN_TOPOINT = "view-navigation-zoom-in-topoint";
60
	private static final String VIEW_NAVIGATION_ZOOM_OUT_CENTER = "view-navigation-zoom-out-center";
61
	private static final String VIEW_NAVIGATION_ZOOM_IN_CENTER = "view-navigation-zoom-in-center";
62
	private static final String VIEW_NAVIGATION_PAN = "view-navigation-pan";
63
	private static final String VIEW_CHANGE_SCALE = "view-change-scale";
64
	public static final String TOOL_PAN_ID = "pan";
65
    public static final String TOOL_ZOOM_IN_ID = "zoomIn";
66
    public static final String TOOL_ZOOM_OUT_ID = "zoomOut";
67

  
68
    public void initialize() {
69
        // Nothing to do
70

  
71
    }
72

  
73
    @Override
74
    public void postInitialize() {
75

  
76
        // Register tools
77
        PortableViewSwingLocator.getSwingManager().addMapControlRegistrant(this);
78
    }
79

  
80
    @Override
81
    public void execute(String actionCommand, Object[] args) {
82
        MapControl mapCtrl = getCurrentMapControl();
83
        if (mapCtrl == null) {
84
        	return;
85
        }
86
        MapContext mapa = mapCtrl.getMapContext();
87
    	if (actionCommand.equals(VIEW_CHANGE_SCALE)) {
88
            long scale = ((Number)args[0]).longValue();
89
            mapa.setScaleView(scale);
90
            return;
91
        }
92
    }
93

  
94
    public void execute(String actionCommand) {
95
        MapControl mapCtrl = getCurrentMapControl();
96
        if (mapCtrl == null) {
97
        	return;
98
        }
99
        MapContext mapa = mapCtrl.getMapContext();
100

  
101
        if (actionCommand.equals(VIEW_NAVIGATION_ZOOM_ALL)) {
102
            mapa.getViewPort().setEnvelope(mapa.getLayers().getFullEnvelope());
103
            return;
104
        }
105
        if (actionCommand.equals(VIEW_NAVIGATION_PAN)) {
106
            mapCtrl.setTool(TOOL_PAN_ID);
107
            return;
108
        }
109
        if (actionCommand.equals(VIEW_NAVIGATION_ZOOM_IN_TOPOINT)) {
110
            mapCtrl.setTool(TOOL_ZOOM_IN_ID);
111
            return;
112
        }
113
        if (actionCommand.equals(VIEW_NAVIGATION_ZOOM_OUT_TOPOINT)) {
114
            mapCtrl.setTool(TOOL_ZOOM_OUT_ID);
115
            return;
116
        }
117
        if (actionCommand.equals(VIEW_NAVIGATION_ZOOM_IN_CENTER)) {
118
            mapCtrl.zoomIn();
119
            return;
120
        }
121
        if (actionCommand.equals(VIEW_NAVIGATION_ZOOM_OUT_CENTER)) {
122
            mapCtrl.zoomOut();
123
            return;
124
        }
125
        if (actionCommand.equals(VIEW_NAVIGATION_ZOOM_BACK)) {
126
            ViewPort vp = mapCtrl.getViewPort();
127
            if (vp.getEnvelopes().hasPrevious()) {
128
                vp.setPreviousEnvelope();
129
            } else {
130
                // Zoom Full
131
                vp.setEnvelope(mapa.getLayers().getFullEnvelope());
132
            }
133
        }
134

  
135
    }
136

  
137
	private MapControl getCurrentMapControl() {
138
		IWindow window = PluginServices.getMDIManager().getActiveWindow();
139
        if (!(window instanceof PortableViewDocumentViewer)) {
140
            return null;
141
        }
142
        PortableViewDocumentViewer tmDocViewer =
143
            (PortableViewDocumentViewer) window;
144
        MapControl mapCtrl = tmDocViewer.getViewer().getMapControl();
145
		return mapCtrl;
146
	}
147

  
148
    public boolean isEnabled() {
149
        return true;
150
    }
151

  
152
    public boolean isVisible() {
153
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
154
        return window instanceof PortableViewDocumentViewer;
155
    }
156

  
157
    public void registerTools(MapControl mapControl) {
158

  
159
        // Adds tools to mapControl
160
        // mouseWhell
161
        mapControl.addCombinedBehavior(new MouseWheelBehavior());
162

  
163
        // From
164
        // org.gvsig.app.project.documents.view.gui.DefaultViewPanel#initComponents()
165

  
166
        // Listener de eventos de movimiento que pone las coordenadas del rat?n
167
        // en la barra de estado
168
        StatusBarListener sbl = new StatusBarListener(mapControl);
169

  
170
        // Zoom out (pinchas y el mapa se centra y te muestra m?s).
171
        // No es dibujando un rect?ngulo, es solo pinchando.
172

  
173
        ZoomOutListener zol = new ZoomOutListener(mapControl);
174

  
175
        mapControl.addBehavior(TOOL_ZOOM_OUT_ID, new Behavior[] {
176
            new PointBehavior(zol), new MouseMovementBehavior(sbl) });
177

  
178
        // pan
179
        PanListener pl = new PanListener(mapControl);
180
        mapControl.addBehavior(TOOL_PAN_ID, new Behavior[] {
181
            new MoveBehavior(pl), new MouseMovementBehavior(sbl) });
182

  
183
        // Zoom por rect?ngulo
184
        ZoomOutRightButtonListener zoil =
185
            new ZoomOutRightButtonListener(mapControl);
186
        ZoomInListener zil = new ZoomInListener(mapControl);
187
        mapControl.addBehavior(TOOL_ZOOM_IN_ID, new Behavior[] {
188
            new RectangleBehavior(zil), new PointBehavior(zoil),
189
            new MouseMovementBehavior(sbl) });
190

  
191
        // Medici?n
192

  
193
    }
194

  
195
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/java/org/gvsig/educa/portableview/app/viewer/PortableViewDocument.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.educa.portableview.app.viewer;
23

  
24
import java.beans.PropertyChangeEvent;
25
import java.beans.PropertyChangeListener;
26
import java.io.IOException;
27

  
28
import org.apache.commons.lang3.ObjectUtils;
29
import org.apache.commons.lang3.StringUtils;
30
import org.gvsig.app.project.Project;
31
import org.gvsig.app.project.ProjectManager;
32
import org.gvsig.app.project.documents.AbstractDocument;
33
import org.gvsig.app.project.documents.DocumentManager;
34
import org.gvsig.app.project.documents.view.ViewDocument;
35
import org.gvsig.educa.portableview.PortableViewLocator;
36
import org.gvsig.educa.portableview.PortableViewManager;
37
import org.gvsig.educa.portableview.app.viewer.exception.PortableViewLoadingException;
38
import org.gvsig.educa.portableview.app.viewer.exception.PortableViewNotFoundException;
39
import org.gvsig.educa.portableview.map.CantLoadContextException;
40
import org.gvsig.educa.portableview.map.InvalidPortableViewFormatException;
41
import org.gvsig.educa.portableview.map.PortableView;
42
import org.gvsig.educa.portableview.map.PortableViewInformation;
43
import org.gvsig.fmap.mapcontext.MapContext;
44
import org.gvsig.tools.persistence.PersistentState;
45
import org.gvsig.tools.persistence.exception.PersistenceException;
46

  
47
/**
48
 * PortableView document
49
 *
50
 * @author gvSIG Team
51
 * @version $Id$
52
 *
53
 */
54
public class PortableViewDocument extends AbstractDocument implements
55
    PropertyChangeListener {
56

  
57
    /**
58
     *
59
     */
60
    private static final long serialVersionUID = 1241724510305853337L;
61

  
62
    private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory
63
        .getLogger(PortableViewDocument.class);
64

  
65
    private final PortableViewManager thMapManager;
66

  
67
    private PortableView portableView;
68
    private ViewDocument sourceView;
69

  
70
    public PortableViewDocument() {
71
        this(null);
72
    }
73

  
74
    public PortableViewDocument(DocumentManager factory) {
75
        super(factory);
76
        thMapManager = PortableViewLocator.getManager();
77
        portableView = null;
78
    }
79

  
80
    public PortableViewDocument(DocumentManager factory, PortableView map) {
81
        this(factory);
82
        setPortableView(map);
83
    }
84

  
85
    /**
86
     * @param map
87
     */
88
    protected void setPortableView(PortableView map) {
89
        if (portableView != null) {
90
            throw new IllegalStateException("Portable view already set");
91
        }
92
        portableView = map;
93
        super.setName(map.getInformation().getName());
94
    }
95

  
96
    public PortableView getPortableView() {
97
        return portableView;
98
    }
99

  
100
    public void reloadPortableView() throws InvalidPortableViewFormatException,
101
        CantLoadContextException, IOException {
102
        if (portableView == null) {
103
            throw new IllegalStateException("Portable not set");
104
        }
105

  
106
        try {
107
            portableView.close();
108
        } catch (IOException ex) {
109
            // TODO
110
        }
111
        PortableView newMap =
112
            thMapManager.getMapById(portableView.getInformation().getId());
113

  
114
        newMap.open();
115

  
116
        // TODO raise a propertyChange event (need access to supper
117
        // propertySupport
118
        portableView = newMap;
119

  
120
    }
121

  
122
    @Override
123
    public void setCreationDate(String string) {
124
        throw new UnsupportedOperationException();
125
    }
126

  
127
    @Override
128
    public String getCreationDate() {
129
        if (portableView == null) {
130
            return null;
131
        }
132
        return portableView.getInformation().getCreationTimestamp().toString();
133
    }
134

  
135
    @Override
136
    public void setOwner(String string) {
137
        throw new UnsupportedOperationException();
138
    }
139

  
140
    @Override
141
    public String getOwner() {
142
        return null;
143
    }
144

  
145
    /**
146
     *
147
     */
148
    @Override
149
    public void loadFromState(PersistentState state)
150
        throws PersistenceException {
151
        String id = state.getString("id");
152
        String name = state.getString("name");
153
        String comment = state.getString("comment");
154
        int version = state.getInt("version");
155
        ViewDocument sourceView = (ViewDocument) state.get("sourceView");
156
        int bn = state.getInt("buildNumber");
157

  
158
        PortableView map;
159
        try {
160
            map = thMapManager.getMapById(id);
161
        } catch (Exception ex) {
162
            throw new PortableViewLoadingException(ex, id, version, bn);
163
        }
164
        if (map == null) {
165
            throw new PortableViewNotFoundException(id, version, bn);
166
        }
167
        PortableViewInformation info = map.getInformation();
168

  
169
        if (info.getVersion() != version) {
170
            // XXX Make anything else
171
            LOG.warn(
172
                "Version number of PortableView {} no match: in project '{}', installed '{}'",
173
                new Object[] { id, version, info.getVersion() });
174

  
175
        } else
176
            if (info.getBuildNumber() != bn) {
177
                LOG.warn(
178
                    "Version number of PortableView {} no match: in project '{}', installed '{}'",
179
                    new Object[] { id, bn, info.getBuildNumber() });
180
            }
181

  
182
        this.portableView = map;
183
        this.sourceView = sourceView;
184
        listenProjectChanges(sourceView != null);
185
        super.setName(name);
186
        super.setComment(comment);
187
    }
188

  
189
    @Override
190
    public void saveToState(PersistentState state) throws PersistenceException {
191
        state.set("id", portableView.getInformation().getId());
192
        state.set("name", getName());
193
        state.set("comment", getComment());
194
        state.set("version", portableView.getInformation().getVersion());
195
        state.set("buildNumber", portableView.getInformation().getBuildNumber());
196
        state.set("sourceView", sourceView);
197
    }
198

  
199
    /**
200
     * @param map
201
     * @return
202
     */
203
    public boolean isMap(PortableView map) {
204
        return ObjectUtils.equals(portableView, map);
205
    }
206

  
207
    public MapContext getMapContext() {
208
        if (portableView == null) {
209
            return null;
210
        }
211
        return portableView.getMapContext();
212
    }
213

  
214
    /**
215
     * @param sourceView
216
     *            the sourceView to set
217
     */
218
    public void setSourceView(ViewDocument sourceView) {
219
        // TODO raise a propertyChange event
220
        this.sourceView = sourceView;
221
        listenProjectChanges(sourceView != null);
222
    }
223

  
224
    /**
225
     * Start or left to listen project changes (to get notify if related
226
     * document has been removed)
227
     *
228
     * @param listen
229
     */
230
    private void listenProjectChanges(boolean listen) {
231
        if (listen) {
232
            ProjectManager.getInstance().getCurrentProject()
233
                .addPropertyChangeListener(this);
234
        } else {
235
            // TODO remove this instance from project listener (NO API
236
            // TO DO IT)
237

  
238
        }
239
    }
240

  
241
    /**
242
     * @return the sourceView
243
     */
244
    public ViewDocument getSourceView() {
245
        return sourceView;
246
    }
247

  
248
    public void propertyChange(PropertyChangeEvent evt) {
249
        if (evt.getSource() instanceof Project) {
250
            // Check if removed related view
251
            if (sourceView == null) {
252
                listenProjectChanges(false);
253
                return;
254
            }
255
            if (StringUtils.equals(evt.getPropertyName(), "delDocument")) {
256
                if (ObjectUtils.equals(evt.getOldValue(), sourceView)) {
257
                    sourceView = null;
258
                    listenProjectChanges(false);
259
                }
260
            }
261
        }
262
    }
263

  
264
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.80/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.viewer/src/main/java/org/gvsig/educa/portableview/app/viewer/PortableViewInfoByPointToolsExtension.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.educa.portableview.app.viewer;
23

  
24
import org.gvsig.andami.PluginServices;
25
import org.gvsig.andami.plugins.Extension;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff