Revision 30610

View differences:

tags/tmp_build/examples/exaExampleCenterViewToPoint/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>exaExampleCenterViewToPoint</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>de.loskutov.FileSync.FSBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
	</buildSpec>
19
	<natures>
20
		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
21
		<nature>org.eclipse.jdt.core.javanature</nature>
22
		<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
23
	</natures>
24
</projectDescription>
0 25

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text.properties
1
#Translations for language [es]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Centrar la vista sobre un punto
4
color_point=Color del punto
5
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Debe seleccionar las capas de las que quiera obtener informaci\u00f3n.
6
example_extension=Extensi?n ejemplo
7
formato_de_numero_incorrecto=Formato de n\u00famero incorrecto.
8
no_hay_ninguna_capa_seleccionada=No hay ninguna capa seleccionada
9
this_is_a_window_example=Esto es una ventana de ejemplo
10
Vista=Vista
0 11

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_ro.properties
1
#Translations for language [ro]
2
#Thu Mar 01 10:01:15 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Centrar atentia a un punct
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Trebuie selectionate crpetele de la care dorim obtine informati
5
formato_de_numero_incorrecto=
6
no_hay_ninguna_capa_seleccionada=nu ai ninguna capeta selectionata
7
Vista=Vedere
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_zh.properties
1
#Translations for language [zh]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=\u5411\u4e00\u70b9\u96c6\u4e2d
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=\u60a8\u5fc5\u987b\u9009\u5b9a\u60a8\u8981\u8bfb\u53d6\u4fe1\u606f\u7684\u56fe\u5c42
5
formato_de_numero_incorrecto=\u6570\u5b57\u683c\u5f0f\u65e0\u6548
6
no_hay_ninguna_capa_seleccionada=\u672a\u9009\u5b9a\u56fe\u5c42
7
Vista=\u89c6\u56fe
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_ca.properties
1
#Translations for language [ca]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Centrar la Vista sobre un punt
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Ha de seleccionar les capes de les quals vol obtindre informaci\u00f3
5
formato_de_numero_incorrecto=Format de n\u00famero incorrecte
6
no_hay_ninguna_capa_seleccionada=No hi ha cap capa seleccionada
7
Vista=Vista
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_pt.properties
1
#Translations for language [pt]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=
5
formato_de_numero_incorrecto=
6
no_hay_ninguna_capa_seleccionada=
7
Vista=Vista
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_de.properties
1
#Translations for language [de]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=
5
formato_de_numero_incorrecto=
6
no_hay_ninguna_capa_seleccionada=
7
Vista=Ansicht
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/config-step1.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<libraries library-dir="lib"/>
5
    <resourceBundle name="text"/>
6
	<extensions>
7
		<!-- about extensions -->
8
		<extension class-name="org.gvsig.examples.example1.about.AboutExtension"
9
			description="Extensi?n de ejemplo."
10
			active="true"
11
			priority="1" />
12

  
13
	</extensions>
14
</plugin-config>
0 15

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/config-step3.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<libraries library-dir="lib"/>
5
    <resourceBundle name="text"/>
6
	<extensions>
7
		<!-- about extensions -->
8
		<extension class-name="org.gvsig.examples.example1.about.AboutExtension"
9
			description="Extensi?n de ejemplo."
10
			active="true"
11
			priority="1" />
12

  
13
		<!-- exclusiveUI extensions -->
14
		<extension class-name="org.gvsig.examples.example1.exclusiveUI.ExclusiveUIExtension"
15
			description="Extensi?n de ejemplo."
16
			active="true"
17
			priority="1" />
18

  
19
	</extensions>
20
</plugin-config>
0 21

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/about.htm
1
<html>
2
  <head>
3
    <title>Extesi&oacute;n de ejemplo.</title>
4
    <meta content="">
5
    <style></style>
6
  </head>
7
  <body>
8
<table width="60%" border="0">
9
  <tr>
10
    <td width="64%"><img src="images/logo_horiz_bicolor_gva.png" width="329" height="50"></td>
11
    <td width="36%"><div align="right"><img src="images/logoIver.png" width="87" height="50"></div></td>
12
  </tr>
13
  <tr>
14
    <td colspan="2"><font face="Arial, Helvetica, sans-serif">&copy; Copyright
15
      Generalitat Valenciana, IVER T.I. 2007.</font></td>
16
  </tr>
17
</table>
18
  <h3>Extensi&oacute;n de ejemplo:</h3>
19
   <p> - Opciones men&uacute;</p>
20
   <p> - Informaci&oacute;n ToolBar</p>
21
   <p> - Modificar preferencias</p>
22
   <p> - Opci&oacute;n en el men&uacute; contextual</p>
23
   <p> - Posibilidad de visualizar las extensiones elegidas</p>
24
   <p> - Personalizaci&oacute;n del Splash</p>
25
   <p> - InfoTool personalizado para nuestra capa</p>
26
   <p> - Ventana de About</p>
27
   <p> - Crear extensi&oacute;n sin los fuentes de gvSIG</p>
28

  
29
  <p><br><br><b> Build Number: #build.number#</b></p>
30
  </body>
31
</html>
0 32

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/config-step4.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<libraries library-dir="lib"/>
5
    <resourceBundle name="text"/>
6
	<extensions>
7
		<!-- about extensions -->
8
		<extension class-name="org.gvsig.examples.example1.about.AboutExtension"
9
			description="Extensi?n de ejemplo."
10
			active="true"
11
			priority="1" />
12

  
13
		<!-- exclusiveUI extensions -->
14
		<extension class-name="org.gvsig.examples.example1.exclusiveUI.ExclusiveUIExtension"
15
			description="Extensi?n de ejemplo."
16
			active="true"
17
			priority="1" />
18

  
19
		<!-- load CSV layer extensions -->
20
		<extension class-name="org.gvsig.examples.example1.loadCSVLayer.OpenCSVToPointsExtension"
21
			description="Extensi?n encargada de abrir una vista con una cpa de puntos de una fichero CSV."
22
			active="true"
23
			priority="30">
24
		</extension>
25
	</extensions>
26
</plugin-config>
0 27

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_en.properties
1
#Translations for language [en]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Center view to point
4
color_point=Color point
5
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Select the layers you want to get information from
6
example_extension=Example extension
7
formato_de_numero_incorrecto=Incorrect number format
8
no_hay_ninguna_capa_seleccionada=No layer has been selected
9
this_is_a_window_example=This is a window example
10
Vista=View
0 11

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_gl.properties
1
#Translations for language [gl]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Centrar a vista sobre un punto
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Debe seleccionar as capas das que desexe obter informaci\u00f3n
5
formato_de_numero_incorrecto=Formato de n\u00famero incorrecto.
6
no_hay_ninguna_capa_seleccionada=Non hai ningunha capa seleccionada
7
Vista=Vista
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/config-step5.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<libraries library-dir="lib"/>
5
    <resourceBundle name="text"/>
6
	<extensions>
7
		<!-- about extensions -->
8
		<extension class-name="org.gvsig.examples.example1.about.AboutExtension"
9
			description="Extensi?n de ejemplo."
10
			active="true"
11
			priority="1" />
12

  
13
		<!-- exclusiveUI extensions -->
14
		<extension class-name="org.gvsig.examples.example1.exclusiveUI.ExclusiveUIExtension"
15
			description="Extensi?n de ejemplo."
16
			active="true"
17
			priority="1" />
18

  
19
		<!-- load CSV layer extensions -->
20
		<extension class-name="org.gvsig.examples.example1.loadCSVLayer.OpenCSVToPointsExtension"
21
			description="Extensi?n encargada de abrir una vista con una cpa de puntos de una fichero CSV."
22
			active="true"
23
			priority="30">
24
		</extension>
25

  
26
		<!-- preferences extensions -->
27
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.PreferencePageExtension"
28
			description="Extensi?n de ejemplo."
29
			active="true"
30
			priority="1" />
31
	</extensions>
32
</plugin-config>
0 33

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/config-step6.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<libraries library-dir="lib"/>
5
    <resourceBundle name="text"/>
6
	<extensions>
7
		<!-- about extensions -->
8
		<extension class-name="org.gvsig.examples.example1.about.AboutExtension"
9
			description="Extensi?n de ejemplo."
10
			active="true"
11
			priority="1" />
12

  
13
		<!-- exclusiveUI extensions -->
14
		<extension class-name="org.gvsig.examples.example1.exclusiveUI.ExclusiveUIExtension"
15
			description="Extensi?n de ejemplo."
16
			active="true"
17
			priority="1" />
18

  
19
		<!-- load CSV layer extensions -->
20
		<extension class-name="org.gvsig.examples.example1.loadCSVLayer.OpenCSVToPointsExtension"
21
			description="Extensi?n encargada de abrir una vista con una cpa de puntos de una fichero CSV."
22
			active="true"
23
			priority="30">
24
		</extension>
25
		
26
		<!-- preferences extensions -->
27
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.PreferencePageExtension"
28
			description="Extensi?n de ejemplo."
29
			active="true"
30
			priority="1" />
31

  
32
		<!-- centerViewToPoint extensions -->
33
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.CenterViewToPointExtension"
34
			description="Extensi?n que permite hacer zooms en funci?n de un par de coordenadas introducidas por el usuario."
35
			active="true"
36
			priority="2">
37
			<menu text="Vista/Centrar_la_Vista_sobre_un_punto" tooltip="Centrar_la_Vista_sobre_un_punto"
38
				action-command="CENTERVIEWTOPOINT"
39
				icon="images/centerviewtopoint.png" />
40
			<tool-bar name="com.iver.cit.gvsig.Herramientas">
41
				<action-tool icon="images/centerviewtopoint.png"
42
					action-command="CENTERVIEWTOPOINT" tooltip="Centrar_la_Vista_sobre_un_punto"
43
					enable-text="deber?a de estar activada" last="true"/>
44
			</tool-bar>
45
		</extension>
46
	</extensions>
47
</plugin-config>
0 48

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/config-step7.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<libraries library-dir="lib"/>
5
    <resourceBundle name="text"/>
6
	<extensions>
7
		<!-- about extensions -->
8
		<extension class-name="org.gvsig.examples.example1.about.AboutExtension"
9
			description="Extensi?n de ejemplo."
10
			active="true"
11
			priority="1" />
12

  
13
		<!-- exclusiveUI extensions -->
14
		<extension class-name="org.gvsig.examples.example1.exclusiveUI.ExclusiveUIExtension"
15
			description="Extensi?n de ejemplo."
16
			active="true"
17
			priority="1" />
18

  
19
		<!-- load CSV layer extensions -->
20
		<extension class-name="org.gvsig.examples.example1.loadCSVLayer.OpenCSVToPointsExtension"
21
			description="Extensi?n encargada de abrir una vista con una cpa de puntos de una fichero CSV."
22
			active="true"
23
			priority="30">
24
		</extension>
25
		
26
		<!-- preferences extensions -->
27
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.PreferencePageExtension"
28
			description="Extensi?n de ejemplo."
29
			active="true"
30
			priority="1" />
31

  
32
		<!-- centerViewToPoint extensions -->
33
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.CenterViewToPointExtension"
34
			description="Extensi?n que permite hacer zooms en funci?n de un par de coordenadas introducidas por el usuario."
35
			active="true"
36
			priority="2">
37
			<menu text="Vista/Centrar_la_Vista_sobre_un_punto" tooltip="Centrar_la_Vista_sobre_un_punto"
38
				action-command="CENTERVIEWTOPOINT"
39
				icon="images/centerviewtopoint.png" />
40
			<tool-bar name="com.iver.cit.gvsig.Herramientas">
41
				<action-tool icon="images/centerviewtopoint.png"
42
					action-command="CENTERVIEWTOPOINT" tooltip="Centrar_la_Vista_sobre_un_punto"
43
					enable-text="deber?a de estar activada" last="true"/>
44
			</tool-bar>
45
		</extension>
46
		
47
		<!-- TOC menu entry -->
48
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.TOCMenuExtension"
49
			description="Extensi?n de ejemplo."
50
			active="true"
51
			priority="1" />
52
	</extensions>
53
</plugin-config>
0 54

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<libraries library-dir="lib"/>
5
    <resourceBundle name="text"/>
6
	<extensions>
7
		<!-- about extensions -->
8
		<extension class-name="org.gvsig.examples.example1.about.AboutExtension"
9
			description="Extensi?n de ejemplo."
10
			active="true"
11
			priority="1" />
12

  
13
		<!-- exclusiveUI extensions -->
14
		<extension class-name="org.gvsig.examples.example1.exclusiveUI.ExclusiveUIExtension"
15
			description="Extensi?n de ejemplo."
16
			active="true"
17
			priority="1" />
18

  
19
		<!-- load CSV layer extensions -->
20
		<extension class-name="org.gvsig.examples.example1.loadCSVLayer.OpenCSVToPointsExtension"
21
			description="Extensi?n encargada de abrir una vista con una cpa de puntos de una fichero CSV."
22
			active="true"
23
			priority="30">
24
		</extension>
25
		
26
		<!-- preferences extensions -->
27
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.PreferencePageExtension"
28
			description="Extensi?n de ejemplo."
29
			active="true"
30
			priority="1" />
31

  
32
		<!-- centerViewToPoint extensions -->
33
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.CenterViewToPointExtension"
34
			description="Extensi?n que permite hacer zooms en funci?n de un par de coordenadas introducidas por el usuario."
35
			active="true"
36
			priority="2">
37
			<menu text="Vista/Centrar_la_Vista_sobre_un_punto" tooltip="Centrar_la_Vista_sobre_un_punto"
38
				action-command="CENTERVIEWTOPOINT"
39
				icon="images/centerviewtopoint.png" />
40
			<tool-bar name="com.iver.cit.gvsig.Herramientas">
41
				<action-tool icon="images/centerviewtopoint.png"
42
					action-command="CENTERVIEWTOPOINT" tooltip="Centrar_la_Vista_sobre_un_punto"
43
					enable-text="deber?a de estar activada" last="true"/>
44
			</tool-bar>
45
		</extension>
46
		
47
		<!-- TOC menu entry -->
48
		<extension class-name="org.gvsig.examples.example1.centerViewToPoint.TOCMenuExtension"
49
			description="Extensi?n de ejemplo."
50
			active="true"
51
			priority="1" />
52

  
53
		<!-- info tool extensions -->
54
		<extension class-name="org.gvsig.examples.example1.infotool.InfoToolExampleExtension"
55
			description="Extensi?n encargada de gestionar la herramienta de info y centrar el extent al punto."
56
			active="true"
57
			priority="29">
58
			<menu text="Vista/consulta/informacion" action-command="CUSTOMINFO" icon="images/Identify.png"/>
59
			<tool-bar name="View_Tools_Query" position="5">
60
				<selectable-tool icon="images/Identify.png" action-command="CUSTOMINFO"  tooltip="informacion" position="1"/>
61
			</tool-bar>
62
		</extension>
63
	</extensions>
64
</plugin-config>
0 65

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_cs.properties
1
#Translations for language [cs]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Centruj pohled na st\u0159ed
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Ozna\u010dte vrstvy, ze kter\u00fdch chcete z\u00edskat informace
5
formato_de_numero_incorrecto=Neplatn\u00e9 \u010d\u00edslo form\u00e1tu
6
no_hay_ninguna_capa_seleccionada=Nebyla vybr\u00e1na \u017e\u00e1dn\u00e1 vrstva
7
Vista=Pohled
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_fr.properties
1
#Translations for language [fr]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Centrer la vue sur un point
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Vous devez s\u00e9lectionner les couches pour lesquelles vous souhaitez obtenir des informations.
5
formato_de_numero_incorrecto=Format incorrect
6
no_hay_ninguna_capa_seleccionada=
7
Vista=Vue
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_nl.properties
1
#Translations for language [nl]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=
5
formato_de_numero_incorrecto=
6
no_hay_ninguna_capa_seleccionada=
7
Vista=Kaartbeeld
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_eu.properties
1
#Translations for language [eu]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Zentratu bista puntu batekiko
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Geruzak hautatu behar dituzu horien gaineko informazioa jasotzeko.
5
formato_de_numero_incorrecto=Zenbakiaren formatua okerra da
6
no_hay_ninguna_capa_seleccionada=
7
Vista=Bista
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_pl.properties
1
#Translations for language [po]
2
#Mon Mar 12 10:04:20 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Wycentruj w punkcie
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Wybierz warstwy, z kt\u00f3rych chcesz pobra\u0107 informacje
5
formato_de_numero_incorrecto=Niew\u0142a\u015bciwy format liczbowy
6
no_hay_ninguna_capa_seleccionada=Nie wybrano warstwy
7
Vista=Widok
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/config/text_it.properties
1
#Translations for language [it]
2
#Mon Feb 26 16:06:24 CET 2007
3
Centrar_la_Vista_sobre_un_punto=Centra la visuale su un punto
4
debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion=Selezionare i layers di cui si desiderano informazioni.
5
formato_de_numero_incorrecto=Formato del numero errato.
6
no_hay_ninguna_capa_seleccionada=Nessun layer selezionato
7
Vista=Vista
0 8

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/build.number
1
#Build Number for ANT. Do not edit!
2
#Thu Apr 19 17:16:38 CEST 2007
3
build.number=910
0 4

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/src/org/gvsig/examples/example1/exclusiveUI/ExclusiveUIExtension.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41

  
42
package org.gvsig.examples.example1.exclusiveUI;
43

  
44
import java.util.HashSet;
45

  
46
import com.iver.andami.PluginServices;
47
import com.iver.andami.plugins.Extension;
48

  
49
/**
50
 * This extension shows how to use an ExclusiveUIExtension, an extension which
51
 * takes over the control of the GUI and decides which extensions will be
52
 * visible (or hidden).
53
 * 
54
 * @author Cesar Martinez Izquierdo <cesar.martinez@iver.es>
55
 * @author Vicente Caballero Navarro
56
 *
57
 */
58
public class ExclusiveUIExtension extends Extension {
59
	private HashSet goodExtensions = new HashSet();
60
	
61
	public void initialize() {
62

  
63
		goodExtensions.add("com.iver.core.Consola");
64
		goodExtensions.add("com.iver.core.StatusBar");
65
		goodExtensions.add("com.iver.core.PreferencesExtension");
66
		goodExtensions.add("com.iver.cit.gvsig.ViewControls");
67
		goodExtensions.add("com.iver.cit.gvsig.AddLayer");
68
		goodExtensions.add("com.iver.cit.gvsig.ProjectExtension");
69
		goodExtensions.add("com.iver.cit.gvsig.About");
70
		goodExtensions.add("com.iver.cit.gvsig.LayoutControls");
71
		goodExtensions.add("com.iver.cit.gvsig.ViewPropertiesExtension");
72
		goodExtensions.add("com.iver.cit.gvsig.ZoomPrev");
73
		goodExtensions.add("com.iver.cit.gvsig.ViewProjectWindow");
74
		goodExtensions.add("com.iver.cit.gvsig.Print");
75
		goodExtensions.add("com.iver.cit.gvsig.PrintProperties");
76
		goodExtensions.add("com.iver.cit.gvsig.LayoutEditableControls");
77
		goodExtensions.add("com.iver.cit.gvsig.LayoutUndoExtension");
78
		goodExtensions.add("com.iver.cit.gvsig.LayoutRedoExtension");
79
		goodExtensions.add("com.iver.cit.gvsig.LayoutInsertToolsExtension");
80
		goodExtensions.add("com.iver.cit.gvsig.LayoutGraphicControls");
81
		goodExtensions.add("com.iver.cit.gvsig.LayoutEditVertexExtension");
82
		goodExtensions.add("com.iver.cit.gvsig.ViewSelectionControls");
83
		goodExtensions.add("org.gvsig.examples.example1.extension.CenterViewToPointExtension");
84
		goodExtensions.add("org.gvsig.examples.example1.extension.InfoToolExampleExtension");
85
		goodExtensions.add("org.gvsig.examples.example1.extension.OpenCSVToPointsExtension");
86
		goodExtensions.add("org.gvsig.examples.example1.PreferencePageExtension");
87
		goodExtensions.add("org.gvsig.examples.example1.AboutExtension");
88
		goodExtensions.add("org.gvsig.examples.example1.PreferencePageExtension");
89
		goodExtensions.add("org.gvsig.examples.example1.TOCMenuExtension");
90

  
91
		PluginServices.setExclusiveUIExtension(this);
92
	}
93
	
94
	public boolean isVisible(Extension ext) {
95
		// if the extension is in our good list, ask the extension for visibility
96
		if (goodExtensions.contains(ext.getClass().getName())) {
97
			return ext.isVisible();	
98
		}
99
		return false;
100
	}
101

  
102

  
103
	public boolean isEnabled() {
104
		// TODO Auto-generated method stub
105
		return false;
106
	}
107

  
108
	public boolean isVisible() {
109
		// TODO Auto-generated method stub
110
		return false;
111
	}
112

  
113
	public void execute(String actionCommand) {
114
		// TODO Auto-generated method stub
115
		
116
	}
117

  
118
}
0 119

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/src/org/gvsig/examples/example1/centerViewToPoint/PropertiesTocMenuEntry.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2005 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

  
43
package org.gvsig.examples.example1.centerViewToPoint;
44

  
45
import com.iver.andami.PluginServices;
46
import com.iver.cit.gvsig.fmap.layers.FLayer;
47
import com.iver.cit.gvsig.project.documents.view.gui.View;
48
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction;
49
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
50

  
51

  
52

  
53
/**
54
 * Properties toc menu entry center view to point.
55
 *
56
 * @author Vicente Caballero Navarro
57
 */
58
public class PropertiesTocMenuEntry extends AbstractTocContextMenuAction {
59
    /* (non-Javadoc)
60
     * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getGroup()
61
     */
62
    public String getGroup() {
63
        return "examplegroup";
64
    }
65

  
66
    /* (non-Javadoc)
67
     * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getGroupOrder()
68
     */
69
    public int getGroupOrder() {
70
        return 1;
71
    }
72

  
73
    /* (non-Javadoc)
74
     * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getOrder()
75
     */
76
    public int getOrder() {
77
        return 1;
78
    }
79

  
80
    /* (non-Javadoc)
81
     * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getText()
82
     */
83
    public String getText() {
84
        return PluginServices.getText(this, "Centrar_la_Vista_sobre_un_punto");
85
    }
86

  
87
    /* (non-Javadoc)
88
     * @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#isEnabled(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
89
     */
90
    public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
91
        return true;
92
    }
93

  
94
    /* (non-Javadoc)
95
     * @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#isVisible(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
96
     */
97
    public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
98
        return (isTocItemBranch(item));
99
    }
100

  
101
    /* (non-Javadoc)
102
     * @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#execute(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
103
     */
104
    public void execute(ITocItem item, FLayer[] selectedItems) {
105
        View vista = (View) PluginServices.getMDIManager().getActiveWindow();
106
        InputCoordinatesPanel dataSelectionPanel = new InputCoordinatesPanel(vista);
107
        PluginServices.getMDIManager().addWindow(dataSelectionPanel);
108
    }
109
}
0 110

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/src/org/gvsig/examples/example1/centerViewToPoint/InputCoordinatesPanel.java
1
/*
2
 * Created on 08-nov-2005
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
21
 *
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
package org.gvsig.examples.example1.centerViewToPoint;
45

  
46
import java.awt.Color;
47
import java.awt.Component;
48
import java.awt.event.ActionEvent;
49
import java.awt.event.ActionListener;
50
import java.awt.event.MouseEvent;
51
import java.awt.geom.Point2D;
52
import java.awt.geom.Rectangle2D;
53

  
54
import javax.swing.JButton;
55
import javax.swing.JDialog;
56
import javax.swing.JLabel;
57
import javax.swing.JOptionPane;
58
import javax.swing.JPanel;
59
import javax.swing.JTextField;
60

  
61
import org.cresques.cts.IProjection;
62
import org.gvsig.gui.beans.AcceptCancelPanel;
63

  
64
import com.iver.andami.PluginServices;
65
import com.iver.andami.ui.mdiManager.IWindow;
66
import com.iver.andami.ui.mdiManager.WindowInfo;
67
import com.iver.cit.gvsig.fmap.MapControl;
68
import com.iver.cit.gvsig.fmap.core.IGeometry;
69
import com.iver.cit.gvsig.fmap.core.ShapeFactory;
70
import com.iver.cit.gvsig.fmap.core.v02.FConstant;
71
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
72
import com.iver.cit.gvsig.fmap.layers.GraphicLayer;
73
import com.iver.cit.gvsig.fmap.rendering.FGraphic;
74
import com.iver.cit.gvsig.fmap.tools.BehaviorException;
75
import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
76
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
77
import com.iver.cit.gvsig.project.documents.view.gui.View;
78
import com.iver.cit.gvsig.project.documents.view.toolListeners.InfoListener;
79

  
80

  
81
/**
82
 * The InputCoordinatesPanel class creates a JPanel where the
83
 * user can input the coordinates of the point of reference
84
 * for center the View.
85
 *
86
 * @author jmorell
87
 */
88
public class InputCoordinatesPanel extends JPanel implements IWindow {
89
    private static final long serialVersionUID = 1L;
90
    private JLabel labelX = null;
91
    private JTextField textX = null;
92
    private JLabel labelY = null;
93
    private JTextField textY = null;
94
    private MapControl mapControl;
95
    private WindowInfo viewInfo = null;
96
    private String firstCoordinate;
97
    private String secondCoordinate;
98
    private Point2D center;
99
    private GraphicLayer lyr;
100
    private ColorChooserPanel colorPanel;
101
	private AcceptCancelPanel okCancelPanel = null;
102
	private JButton bRemovePoint = null;
103
	private View view=null;
104
	/**
105
     * This is the default constructor
106
     */
107
    public InputCoordinatesPanel(View view) {
108
        super();
109
        this.view=view;
110
        this.mapControl = view.getMapControl();
111
        lyr=mapControl.getMapContext().getGraphicsLayer();
112
        initializeCoordinates();
113
        initialize();
114
    }
115

  
116
    private void initializeCoordinates() {
117
        IProjection proj = mapControl.getProjection();
118
        String projName = proj.getAbrev();
119
        if (projName.equals("EPSG:23030") || projName.equals("EPSG:27492") || projName.equals("EPSG:42101") || projName.equals("EPSG:42304")) {
120
            firstCoordinate = "X";
121
            secondCoordinate = "Y";
122
        } else if (projName.equals("EPSG:4230") || projName.equals("EPSG:4326")) {
123
            firstCoordinate = "Lon";
124
            secondCoordinate = "Lat";
125
        } else {
126
            System.out.println("Proyecci?n: " + projName);
127
            System.out.println("Proyecci?n no soportada.");
128
        }
129
    }
130

  
131
    private void zoomToCoordinates() throws Exception {
132
       try{
133
    	Rectangle2D oldExtent = mapControl.getViewPort().getAdjustedExtent();
134
        double oldCenterX = oldExtent.getCenterX();
135
        double oldCenterY = oldExtent.getCenterY();
136
        double centerX = (new Double((String)textX.getText())).doubleValue();
137
        double centerY = (new Double((String)textY.getText())).doubleValue();
138
        center=new Point2D.Double(centerX,centerY);
139
        double movX = centerX-oldCenterX;
140
        double movY = centerY-oldCenterY;
141
        double upperLeftCornerX = oldExtent.getMinX()+movX;
142
        double upperLeftCornerY = oldExtent.getMinY()+movY;
143
        double width = oldExtent.getWidth();
144
        double height = oldExtent.getHeight();
145
        Rectangle2D extent = new Rectangle2D.Double(upperLeftCornerX, upperLeftCornerY, width, height);
146
        mapControl.getViewPort().setExtent(extent);
147
       }catch (NumberFormatException e) {
148
    	   throw new Exception();
149
       }
150

  
151
    }
152

  
153
    /**
154
     * This method initializes this
155
     *
156
     * @return void
157
     */
158
    private void initialize() {
159
        labelY = new JLabel();
160
        labelY.setBounds(10, 35, 28, 20);
161
        labelY.setText(secondCoordinate + ":");
162
        labelX = new JLabel();
163
        labelX.setBounds(10, 10, 28, 20);
164
        labelX.setText(firstCoordinate + ":");
165
        this.setLayout(null);
166
        this.setSize(307, 111);
167
        this.add(labelX, null);
168
        this.add(getTextX(), null);
169
        this.add(labelY, null);
170
        this.add(getTextY(), null);
171
        this.add(getColorPanel());
172
        this.add(getOkCancelPanel(), null);
173
        this.add(getBRemovePoint(), null);
174
    }
175

  
176
    /**
177
     * This method initializes textX
178
     *
179
     * @return javax.swing.JTextField
180
     */
181
    private JTextField getTextX() {
182
    	if (textX == null) {
183
    		textX = new JTextField();
184
    		textX.setBounds(40, 10, 260, 20);
185
    		textX.addActionListener(new java.awt.event.ActionListener() {
186
    			public void actionPerformed(java.awt.event.ActionEvent e) {
187
    				textX.transferFocus();
188
    			}
189
    		});
190
    	}
191
    	return textX;
192
    }
193

  
194
    /**
195
     * This method initializes textY
196
     *
197
     * @return javax.swing.JTextField
198
     */
199
    private JTextField getTextY() {
200
    	if (textY == null) {
201
    		textY = new JTextField();
202
    		textY.setBounds(40, 35, 260, 20);
203
    		textY.addActionListener(new java.awt.event.ActionListener() {
204
    			public void actionPerformed(java.awt.event.ActionEvent e) {
205
    				textY.transferFocus();
206
    			}
207
    		});
208
    	}
209
    	return textY;
210
    }
211

  
212
    /* (non-Javadoc)
213
     * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
214
     */
215
    public WindowInfo getWindowInfo() {
216
        if (viewInfo == null) {
217
            viewInfo=new WindowInfo(WindowInfo.MODALDIALOG);
218
            viewInfo.setTitle(PluginServices.getText(this,"Centrar_la_Vista_sobre_un_punto"));
219
            viewInfo.setWidth(this.getWidth()+8);
220
            viewInfo.setHeight(this.getHeight());
221
        }
222
        return viewInfo;
223
    }
224
    private void openInfo(){
225
    	InfoListener infoListener=new InfoListener(mapControl);
226
    	MouseEvent e=new MouseEvent((Component)view,MouseEvent.BUTTON1,MouseEvent.ACTION_EVENT_MASK,MouseEvent.MOUSE_CLICKED,500,400,1,true);
227
    	Point2D centerPixels=mapControl.getViewPort().fromMapPoint(center.getX(),center.getY());
228
    	PointEvent pe=new PointEvent(centerPixels,e);
229
    	try {
230
			infoListener.point(pe);
231
		} catch (BehaviorException e1) {
232
			e1.printStackTrace();
233
		}
234
		if (mapControl.getMapContext().getLayers().getActives().length==0){
235
			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),PluginServices.getText(this,"no_hay_ninguna_capa_seleccionada")+" \n"+
236
					PluginServices.getText(this,"debe_seleccionar_las_capas_de_las_que_quiera_obtener_informacion"));
237
		}
238
    }
239
    private void drawPoint(Color color){
240
    	CenterViewToPointExtension.COLOR=color;
241
    	lyr.clearAllGraphics();
242
    	FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT,color);
243
        int idSymbol = lyr.addSymbol(theSymbol);
244
        IGeometry geom = ShapeFactory.createPoint2D(center.getX(),center.getY());
245
        FGraphic theGraphic = new FGraphic(geom, idSymbol);
246
        lyr.addGraphic(theGraphic);
247
        mapControl.drawGraphics();
248
	    mapControl.drawMap(false);
249

  
250
    }
251

  
252

  
253
	/**
254
	 * This method initializes jPanel
255
	 *
256
	 * @return javax.swing.JPanel
257
	 */
258
	private JPanel getColorPanel() {
259
		if (colorPanel==null){
260
		 	colorPanel=new ColorChooserPanel();
261
		 	colorPanel.setAlpha(250);
262
		 	colorPanel.setColor(CenterViewToPointExtension.COLOR);
263
		 	colorPanel.setBounds(new java.awt.Rectangle(40,59,123,24));
264
		}
265
		 	return colorPanel;
266
	}
267

  
268
	/**
269
	 * This method initializes okCancelPanel
270
	 *
271
	 * @return javax.swing.JPanel
272
	 */
273
	private AcceptCancelPanel getOkCancelPanel() {
274
		if (okCancelPanel == null) {
275
			ActionListener okAction, cancelAction;
276
			okAction = new java.awt.event.ActionListener() {
277
    			public void actionPerformed(java.awt.event.ActionEvent e) {
278
    				try{
279
    				zoomToCoordinates();
280
    				}catch (Exception e1) {
281
    					JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),PluginServices.getText(this,"formato_de_numero_incorrecto"));
282
    					return;
283
    				}
284
    				// y sale.
285
                    if (PluginServices.getMainFrame() == null)
286
                        ((JDialog) (getParent().getParent().getParent().getParent())).dispose();
287
                    else
288
                        PluginServices.getMDIManager().closeWindow(InputCoordinatesPanel.this);
289

  
290
                    openInfo();
291
                    drawPoint(((ColorChooserPanel)getColorPanel()).getColor());
292
    			}
293
    		};
294
    		cancelAction = new ActionListener() {
295
				public void actionPerformed(ActionEvent e) {
296
					closeThis();
297
				}
298
    		};
299
			okCancelPanel = new AcceptCancelPanel(okAction, cancelAction);
300
			okCancelPanel.setBounds(new java.awt.Rectangle(40, 88, 260, 30));
301
		}
302
		return okCancelPanel;
303
	}
304

  
305
	private void closeThis() {
306
		PluginServices.getMDIManager().closeWindow(this);
307

  
308
	}
309

  
310
	/**
311
	 * This method initializes bRemovePoint
312
	 *
313
	 * @return javax.swing.JButton
314
	 */
315
	private JButton getBRemovePoint() {
316
		if (bRemovePoint == null) {
317
			bRemovePoint = new JButton();
318
			bRemovePoint.setBounds(new java.awt.Rectangle(181,59,101,25));
319
			bRemovePoint.setText(PluginServices.getText(this,"remove"));
320
			bRemovePoint.addActionListener(new java.awt.event.ActionListener() {
321
				public void actionPerformed(java.awt.event.ActionEvent e) {
322
					lyr.clearAllGraphics();
323
					mapControl.drawMap(false);
324
				}
325
			});
326
		}
327
		return bRemovePoint;
328
	}
329

  
330

  
331
}  //  @jve:decl-index=0:visual-constraint="103,18"
0 332

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/src/org/gvsig/examples/example1/centerViewToPoint/CenterViewToPointExtension.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41

  
42
package org.gvsig.examples.example1.centerViewToPoint;
43

  
44
import java.awt.Color;
45
import java.util.prefs.Preferences;
46

  
47
import com.iver.andami.PluginServices;
48
import com.iver.andami.plugins.Extension;
49
import com.iver.cit.gvsig.fmap.MapContext;
50
import com.iver.cit.gvsig.fmap.layers.FLayers;
51
import com.iver.cit.gvsig.project.documents.view.IProjectView;
52
import com.iver.cit.gvsig.project.documents.view.gui.View;
53
import com.iver.utiles.StringUtilities;
54

  
55
/**
56
 * The CenterViewToPointExtension class allows to center the View over a
57
 * concrete point given by its coordinates.
58
 *
59
 * @author Vicente Caballero Navarro
60
 */
61
public class CenterViewToPointExtension extends Extension{
62

  
63
	private View vista;
64
	public static Color COLOR=Color.red;
65
	private static Preferences prefs = Preferences.userRoot().node( "centerviewtopoint" );
66

  
67
    /* (non-Javadoc)
68
     * @see com.iver.andami.plugins.Extension#inicializar()
69
     */
70
    public void initialize() {
71
    	String colorString=prefs.get("colorcenterviewtopoint",StringUtilities.color2String(CenterViewToPointExtension.COLOR));
72
		Color color=StringUtilities.string2Color(colorString);
73
		CenterViewToPointExtension.COLOR=color;
74

  
75
    }
76

  
77
    /* (non-Javadoc)
78
     * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
79
     */
80
    public void execute(String actionCommand) {
81
		if ("CENTERVIEWTOPOINT".equals(actionCommand)){
82
			vista = (View)PluginServices.getMDIManager().getActiveWindow();
83
			InputCoordinatesPanel dataSelectionPanel = new InputCoordinatesPanel(vista);
84
			PluginServices.getMDIManager().addWindow(dataSelectionPanel);
85
		}
86
    }
87

  
88
    public View getView(){
89
    	return vista;
90
    }
91
    /* (non-Javadoc)
92
     * @see com.iver.andami.plugins.Extension#isEnabled()
93
     */
94
    public boolean isEnabled() {
95
		com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager()
96
		 .getActiveWindow();
97
		if (f == null) {
98
		    return false;
99
		}
100
		if (f.getClass() == View.class) {
101
		    View vista = (View) f;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff