Revision 26301

View differences:

tags/tmp_build/examples/exaExampleCenterViewToPoint/.settings/org.eclipse.jdt.ui.prefs
1
#Mon May 14 16:21:02 CEST 2007
2
eclipse.preferences.version=1
3
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
0 4

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/build.xml
1
<project name="extCenterViewToPoint" default="install-plugin" basedir=".">
2
    <description>
3
        Instala el plugin de Centrar la Vista sobre un punto en Andami.
4
    </description>
5
  <!-- set global properties for this build -->
6
	<property name="plugin" value="com.iver.gvsig.centerviewpoint"/>
7
	<!-- directories -->
8
	<!-- change the variable to point the _fwAndami project in your workspace,
9
	       or the bin directory of a gvSIG installation -->
10
	<!-- <property name="GVSIG_HOME" location="${user.home}/gvSIG_1.1_1009/bin"/> -->
11
	<property name="GVSIG_HOME" location="${user.home}/old_workspaces/workspace-branch-1.0/_fwAndami"/>
12
  	<property name="extensions-dir" location="${GVSIG_HOME}/bin/gvSIG/extensiones"/>
13
  	<property name="src" location="src"/>
14
 	<property name="build" location="bin"/>
15
  	<property name="doc"  location="doc"/>
16
  	<property name="dist"  location="dist"/>
17
	<!-- compilation flags -->
18
	<property name="JavaSourceVersion" value="1.4"/>
19
	<property name="JavaTargetVersion" value="1.4"/>
20
	<property name="encoding" value="ISO_8859_1"/>
21
	<property name="debug" value="on"/>
22
	<property name="debuglevel" value="lines, vars"/>
23
	<!-- output files -->
24
	<property name="zipplugin" value="${dist}/${plugin}-plugin.zip"/>
25
	<property name="jarName" value="com.iver.gvsig.centerviewpoint.jar"/>
26
	<!-- other dirs -->
27
	<property name="andami" location="${GVSIG_HOME}"/>
28
	<property name="andamiLibs" location="${GVSIG_HOME}/libs" />
29
	<property name="mainPlugin" location="${extensions-dir}/com.iver.cit.gvsig/lib/com.iver.cit.gvsig.jar"/>
30
	<property name="compile-classpath" value="${andami}/andami.jar:${andamiLibs}/beans.jar:${fmapLibs}/cms.jar:${fmapLibs}/fmap.jar:${mainPlugin}"/>
31
	<property name="installBaseDir" location="${andami}"/>
32
	<property name="installDir" location="${installBaseDir}/gvSIG/extensiones/${plugin}"/>
33

  
34

  
35
	<target name="install-plugin"
36
			description="prepares and installs the plugin to be used in Andami"
37
			depends="init,create-jar,copy-data-files,move-to-installDir">
38
	</target>
39

  
40
	<target name="batch-build"
41
			description="compile the sources, create the jar file, install it"
42
			depends="init,compile,create-jar,copy-data-files,move-to-installDir">
43
	</target>
44
	
45

  
46
	<target name="init">
47
		<!-- Create the time stamp -->
48
		<tstamp/>
49
		<echo>
50
			Compiling ${ant.project.name}...</echo>
51
	</target>
52

  
53
	<target name="compile" description="compile the source" >
54
		<!-- Compile the Java code from ${src} to ${build} -->
55
		<mkdir dir="${build}" />
56
		<javac  srcdir="${src}"
57
			destdir="${build}"
58
    		source="${JavaSourceVersion}"
59
			target="${JavaTargetVersion}"
60
			debug="${debug}"
61
			debuglevel="${debuglevel}"
62
			classpath="${compile-classpath}"
63
			encoding="${encoding}"/>
64
	</target>
65

  
66
	<target name="create-jar"
67
			description="Creates the plugin jar">
68
		<mkdir dir="${dist}/lib"/>
69
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}" />
70
	</target>
71

  
72
	<target name="copy-data-files">
73
	    <copy file="config/config.xml" todir="${dist}"/>
74
		<copy file="build.number" todir="${dist}"/>
75
		<copy todir="${dist}">
76
			<fileset dir="config" includes="text*.properties"/>
77
		</copy>
78
		<copy todir="${dist}/images">
79
			<fileset dir="images/" includes="*"/>
80
		</copy>
81
	    <copy file="config/about.htm" todir="${dist}"/>
82
	  	<loadproperties srcFile="build.number"/>
83
	  	<replace casesensitive="true"
84
	  	  		 file="${dist}/about.htm"
85
	  	  		 token="#build.number#"
86
	  	  		 value="${build.number}">
87
	  	 </replace>	
88
	  	<copy todir="${dist}/theme">
89
	  	   <fileset dir="theme/" includes="*"/>
90
	  	</copy>
91
	  	<copy todir="${dist}/data">
92
	  	   <fileset dir="data/" includes="*"/>
93
	  	</copy>
94

  
95
	</target>
96

  
97
	<target name="move-to-installDir">
98
		<move todir="${installDir}">
99
			<fileset dir="${dist}" includes="**/**"/>
100
		</move>
101
	</target>
102

  
103
	<target name="copy-to-installDir">
104
		<copy todir="${installDir}" overwrite="yes">
105
			<fileset dir="${dist}" includes="**/**"/>
106
		</copy>
107
	</target>
108
	
109
	<target name="dist" depends="clean,init,create-jar,copy-data-files"
110
		description="generate a ZIP file with the plugin distribution">
111
	    <mkdir dir="${dist}/src"/>
112
	    <!-- Copy necessary distribution files to dist dir -->
113
	    <copy todir="${dist}/src">
114
	      <fileset dir="${src}"/>
115
	    </copy>
116
	    <copy file="build.xml" todir="${dist}"/>
117
	    <!-- Zip distribution -->
118
	    <zip destfile="${zipplugin}"
119
	         basedir="${dist}"
120
	         update="true"
121
	    />
122
		<delete dir="${dist}" failonerror="false" excludes="${zipplugin}"/>
123
	</target>
124

  
125
	<target name="clean"
126
		description="clean dist directory" >
127
		<!-- Clean the distribution directory -->
128
		<delete dir="${dist}" failonerror="false"/>
129
	</target>
130
	
131
	
132
	<!-- specific targets to install the examples step by step -->
133
	<target name="install-about"
134
		description="installs the about extension">
135
		<mkdir dir="${dist}/lib"/>
136
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}"
137
	    	includes="org/gvsig/examples/example1/about/*"
138
	    	update="yes"/>
139
		<copy file="config/config-step1.xml" tofile="${dist}/config.xml" />
140
		<copy todir="${dist}">
141
			<fileset dir="config" includes="text*.properties"/>
142
		</copy>
143
		<copy todir="${dist}/images">
144
			<fileset dir="images/" includes="logoIver.png,logo_horiz_bicolor_gva.png"/>
145
		</copy>
146
	    <copy file="config/about.htm" todir="${dist}"/>
147
		<buildnumber/>
148
	  	<loadproperties srcFile="build.number"/>
149
	  	<replace casesensitive="true"
150
	  	  		 file="${dist}/about.htm"
151
	  	  		 token="#build.number#"
152
	  	  		 value="${build.number}">
153
	  	 </replace>	
154
		<copy file="build.number" todir="${dist}"/>
155
		<antcall target="copy-to-installDir"/>
156
	</target>
157
	
158
	<target name="step1" depends="install-about"/>	
159

  
160
	<target name="install-theme"
161
		description="installs a custom Andami theme">
162
		<copy todir="${andami}/theme/" overwrite="true">
163
			<fileset dir="theme" includes="andami-theme.xml"/>
164
		</copy>
165
		<copy todir="${dist}/theme/" overwrite="true">
166
			<fileset dir="theme" includes="*"/>
167
		</copy>
168
		<antcall target="copy-to-installDir"/>
169
	</target>
170
	
171
	<target name="step2" depends="install-about, install-theme"/>
172

  
173
	<target name="install-exclusiveui"
174
		description="installs the exclusiveUI extension">
175
		<mkdir dir="${dist}/lib"/>
176
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}"
177
	    	includes="org/gvsig/examples/example1/exclusiveUI/*"
178
	    	update="yes"/>
179
		<copy overwrite="yes" file="config/config-step3.xml" tofile="${dist}/config.xml" />
180
		<copy todir="${dist}">
181
			<fileset dir="config" includes="text*.properties"/>
182
		</copy>
183
		<antcall target="copy-to-installDir"/>
184
	</target>
185
	
186
	<target name="step3" depends="install-about, install-theme, install-exclusiveui"/>
187
	
188
	<target name="install-loadlayer"
189
		description="installs the load CSV layer extension">
190
		<mkdir dir="${dist}/lib"/>
191
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}"
192
	    	includes="org/gvsig/examples/example1/loadCSVLayer/*"
193
	    	update="yes"/>
194
		<copy overwrite="yes" file="config/config-step4.xml" tofile="${dist}/config.xml" />
195
		<copy todir="${dist}">
196
			<fileset dir="config" includes="text*.properties"/>
197
		</copy>
198
	  	<copy todir="${dist}/data">
199
	  	   <fileset dir="data/" includes="*"/>
200
	  	</copy>
201
		<antcall target="copy-to-installDir"/>
202
	</target>
203
	
204
	<target name="step4" depends="install-about, install-theme, install-exclusiveui, install-loadlayer"/>
205

  
206
	<target name="install-preferences"
207
		description="installs a preferences page">
208
		<mkdir dir="${dist}/lib"/>
209
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}"
210
	    	includes="org/gvsig/examples/example1/centerViewToPoint/CenterViewToPointPage.class org/gvsig/examples/example1/centerViewToPoint/PreferencePageExtension.class org/gvsig/examples/example1/centerViewToPoint/CenterViewToPointExtension.class"
211
	    	update="yes"/>
212
		<copy todir="${dist}/images">
213
			<fileset dir="images/" includes="CenterView.png"/>
214
		</copy>
215
		<copy overwrite="yes" file="config/config-step5.xml" tofile="${dist}/config.xml" />
216
		<copy todir="${dist}">
217
			<fileset dir="config" includes="text*.properties"/>
218
		</copy>
219
		<antcall target="copy-to-installDir"/>
220
	</target>
221

  
222
	<target name="step5" depends="install-about, install-theme, install-exclusiveui, install-loadlayer, install-preferences"/>
223

  
224
	<target name="install-centerViewToPoint"
225
		description="installs a tool to center the view to the provided point">
226
		<mkdir dir="${dist}/lib"/>
227
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}"
228
	    	includes="org/gvsig/examples/example1/centerViewToPoint/CenterViewToPointExtension.class org/gvsig/examples/example1/centerViewToPoint/InputCoordinatesPanel*.class"
229
	    	update="yes"/>
230
		<copy overwrite="yes" file="config/config-step6.xml" tofile="${dist}/config.xml" />
231
		<copy todir="${dist}">
232
			<fileset dir="config" includes="text*.properties"/>
233
		</copy>
234
		<copy todir="${dist}/images">
235
			<fileset dir="images/" includes="centerviewtopoint.png"/>
236
		</copy>
237
		<antcall target="copy-to-installDir"/>
238
	</target>
239

  
240
	<target name="step6" depends="install-about, install-theme, install-exclusiveui, install-loadlayer, install-preferences, install-centerViewToPoint"/>
241

  
242
	<target name="install-tocMenu"
243
		description="installs a tool to center the view to the provided point">
244
		<mkdir dir="${dist}/lib"/>
245
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}"
246
	    	includes="org/gvsig/examples/example1/centerViewToPoint/PropertiesTocMenuEntry.class org/gvsig/examples/example1/centerViewToPoint/TOCMenuExtension.class"
247
	    	update="yes"/>
248
		<copy overwrite="yes" file="config/config-step7.xml" tofile="${dist}/config.xml" />
249
		<copy todir="${dist}">
250
			<fileset dir="config" includes="text*.properties"/>
251
		</copy>
252
		<antcall target="copy-to-installDir"/>
253
	</target>
254

  
255
	<target name="step7" depends="install-about, install-theme, install-exclusiveui, install-loadlayer, install-preferences, install-centerViewToPoint, install-tocMenu"/>	
256

  
257
	<target name="install-infotool"
258
		description="installs a tool to center the view to the provided point">
259
		<mkdir dir="${dist}/lib"/>
260
	    <jar jarfile="${dist}/lib/${jarName}" basedir="${build}"
261
	    	includes="org/gvsig/examples/example1/infotool/**/*"
262
	    	update="yes"/>
263
		<copy overwrite="yes" file="config/config.xml" tofile="${dist}/config.xml" />
264
		<copy todir="${dist}">
265
			<fileset dir="config" includes="text*.properties"/>
266
		</copy>
267
		<copy todir="${dist}/images">
268
			<fileset dir="images/" includes="Identify.png"/>
269
		</copy>
270
		<antcall target="copy-to-installDir"/>
271
	</target>
272

  
273
	<target name="step8" depends="install-about, install-theme, install-exclusiveui, install-loadlayer, install-preferences, install-centerViewToPoint, install-tocMenu, install-infotool"/>	
274
</project>
275

  
0 276

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/.classpath
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5
	<classpathentry kind="var" path="GVSIG_HOME/gvSIG/extensiones/com.iver.cit.gvsig/lib/cms.jar"/>
6
	<classpathentry kind="var" path="GVSIG_HOME/gvSIG/extensiones/com.iver.cit.gvsig/lib/com.iver.cit.gvsig.jar"/>
7
	<classpathentry kind="var" path="GVSIG_HOME/gvSIG/extensiones/com.iver.cit.gvsig/lib/com.iver.gvsig.addeventtheme.jar"/>
8
	<classpathentry kind="var" path="GVSIG_HOME/gvSIG/extensiones/com.iver.cit.gvsig/lib/driver-manager-1.1.jar"/>
9
	<classpathentry kind="var" path="GVSIG_HOME/gvSIG/extensiones/com.iver.cit.gvsig/lib/fmap.jar"/>
10
	<classpathentry kind="var" path="GVSIG_HOME/gvSIG/extensiones/com.iver.cit.gvsig/lib/gdbms-0.8-SNAPSHOT.jar"/>
11
	<classpathentry kind="var" path="GVSIG_HOME/lib/beans.jar"/>
12
	<classpathentry kind="var" path="GVSIG_HOME/lib/castor-0.9.5.3-xml.jar"/>
13
	<classpathentry kind="var" path="GVSIG_HOME/lib/commons-codec-1.3.jar"/>
14
	<classpathentry kind="var" path="GVSIG_HOME/lib/commons-collections-3.1.zip"/>
15
	<classpathentry kind="var" path="GVSIG_HOME/lib/commons-dbcp-1.0-dev-20020806.zip"/>
16
	<classpathentry kind="var" path="GVSIG_HOME/lib/commons-pool-1.2.zip"/>
17
	<classpathentry kind="var" path="GVSIG_HOME/lib/crimson.jar"/>
18
	<classpathentry kind="var" path="GVSIG_HOME/lib/gvsig-i18n.jar"/>
19
	<classpathentry kind="var" path="GVSIG_HOME/lib/iver-utiles.jar"/>
20
	<classpathentry kind="var" path="GVSIG_HOME/lib/javaws.jar"/>
21
	<classpathentry kind="var" path="GVSIG_HOME/lib/jcalendar.jar"/>
22
	<classpathentry kind="var" path="GVSIG_HOME/lib/JUF-1.0.jar"/>
23
	<classpathentry kind="var" path="GVSIG_HOME/lib/JWizardComponent.jar"/>
24
	<classpathentry kind="var" path="GVSIG_HOME/lib/kxml2.jar"/>
25
	<classpathentry kind="var" path="GVSIG_HOME/lib/libs-linux.jar"/>
26
	<classpathentry kind="var" path="GVSIG_HOME/lib/libs-windows.jar"/>
27
	<classpathentry kind="var" path="GVSIG_HOME/lib/log4j-1.2.8.jar"/>
28
	<classpathentry kind="var" path="GVSIG_HOME/lib/looks-2.0.2.jar"/>
29
	<classpathentry kind="var" path="GVSIG_HOME/lib/tempFileManager.jar"/>
30
	<classpathentry kind="var" path="GVSIG_HOME/lib/xerces_2_5_0.jar"/>
31
	<classpathentry kind="var" path="GVSIG_HOME/lib/xml-apis.jar"/>
32
	<classpathentry kind="var" path="GVSIG_HOME/lib/xmlrpc-2.0.1.jar"/>
33
	<classpathentry kind="var" path="GVSIG_HOME/andami.jar" sourcepath="/GVSIG_HOME/src"/>
34
	<classpathentry kind="output" path="bin"/>
35
</classpath>
0 36

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/theme/andami-theme.xml
1
<AndamiProperties>
2
	<ApplicationImages>
3
		<SplashImages>
4
			<Splash path="gvSIG/extensiones/com.iver.gvsig.centerviewpoint/theme/logo_es.png" timer="1000"/>
5
			<Splash path="gvSIG/extensiones/com.iver.gvsig.centerviewpoint/theme/logo_personalizado.png" timer="100000"/>
6
		</SplashImages>
7
		<BackgroundImage path="gvSIG/extensiones/com.iver.gvsig.centerviewpoint/theme/logo_fondo_personalizado.png"/>
8
		<WallpaperType value="CENTERED"/>
9
		<Icon path="gvSIG/extensiones/com.iver.gvsig.centerviewpoint/theme/logoGVA.gif"/>
10
	</ApplicationImages>
11
	<ApplicationName value="gvSIG 1.0.2. Example center View to point"/>
12
</AndamiProperties>
0 13

  
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/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/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/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/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;
102
		    IProjectView model = vista.getModel();
103
		    MapContext mapa = model.getMapContext();
104
		    FLayers layers = mapa.getLayers();
105
		    for (int i=0;i < layers.getLayersCount();i++) {
106
               if (layers.getLayer(i).isAvailable()) return true;
107
		    }
108
		}
109
		return false;
110

  
111
    }
112

  
113
    /* (non-Javadoc)
114
     * @see com.iver.andami.plugins.Extension#isVisible()
115
     */
116
    public boolean isVisible() {
117
		com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager()
118
		 .getActiveWindow();
119
		if (f == null) {
120
		    return false;
121
		}
122
		if (f.getClass() == View.class) {
123
		    View vista = (View) f;
124
		    IProjectView model = vista.getModel();
125
		    MapContext mapa = model.getMapContext();
126
            if (mapa.getLayers().getLayersCount() > 0) {
127
                return true;
128
            }
129
            return false;
130
        }
131
		return false;
132
	}
133

  
134
}
0 135

  
tags/tmp_build/examples/exaExampleCenterViewToPoint/src/org/gvsig/examples/example1/centerViewToPoint/CenterViewToPointPage.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 javax.swing.ImageIcon;
48
import javax.swing.JPanel;
49

  
50
import com.iver.andami.PluginServices;
51
import com.iver.andami.preferences.AbstractPreferencePage;
52
import com.iver.andami.preferences.StoreException;
53
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
54
import com.iver.utiles.StringUtilities;
55

  
56

  
57
/**
58
 * References page of center view to point options.
59
 *
60
 * @author Vicente Caballero Navarro
61
 */
62
public class CenterViewToPointPage extends AbstractPreferencePage {
63
    private static Preferences prefs = Preferences.userRoot().node("centerviewtopoint");
64
    private ColorChooserPanel colorPoint;
65
    private ImageIcon icon;
66

  
67
    public CenterViewToPointPage() {
68
        super();
69
        icon = new ImageIcon(this.getClass().getClassLoader().getResource("images/CenterView.png"));
70
        addComponent(PluginServices.getText(this, "color_point") + ":",
71
            colorPoint = new ColorChooserPanel());
72
    }
73

  
74
    /* (non-Javadoc)
75
     * @see com.iver.andami.preferences.IPreference#initializeValues()
76
     */
77
    public void initializeValues() {
78
        String colorString = prefs.get("colorcenterviewtopoint",
79
                StringUtilities.color2String(CenterViewToPointExtension.COLOR));
80
        Color color = StringUtilities.string2Color(colorString);
81
        CenterViewToPointExtension.COLOR = color;
82
        colorPoint.setColor(color);
83
        colorPoint.setAlpha(255);
84
    }
85

  
86
    /* (non-Javadoc)
87
     * @see com.iver.andami.preferences.IPreference#getID()
88
     */
89
    public String getID() {
90
        return this.getClass().getName();
91
    }
92

  
93
    /* (non-Javadoc)
94
     * @see com.iver.andami.preferences.IPreference#getTitle()
95
     */
96
    public String getTitle() {
97
        return PluginServices.getText(this, "Centrar_la_Vista_sobre_un_punto");
98
    }
99

  
100
    /* (non-Javadoc)
101
     * @see com.iver.andami.preferences.IPreference#getPanel()
102
     */
103
    public JPanel getPanel() {
104
        return this;
105
    }
106

  
107
    /* (non-Javadoc)
108
     * @see com.iver.andami.preferences.AbstractPreferencePage#storeValues()
109
     */
110
    public void storeValues() throws StoreException {
111
        String colorString;
112
        colorString = StringUtilities.color2String(colorPoint.getColor());
113
        prefs.put("colorcenterviewtopoint", colorString);
114
        CenterViewToPointExtension.COLOR = colorPoint.getColor();
115
    }
116

  
117
    /* (non-Javadoc)
118
     * @see com.iver.andami.preferences.IPreference#initializeDefaults()
119
     */
120
    public void initializeDefaults() {
121
        colorPoint.setColor(CenterViewToPointExtension.COLOR);
122
    }
123

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff