Index: tags/Anotaciones_Build_3/extensions/extAnnotations/build.number
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/build.number	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/build.number	(revision 11783)
@@ -0,0 +1,3 @@
+#Build Number for ANT. Do not edit!
+#Thu May 24 09:13:31 CEST 2007
+build.number=3

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/build.number
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/install.xml
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/install.xml	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/install.xml	(revision 11783)
@@ -0,0 +1,81 @@
+<installation version="1.0">
+	<info>
+		<!--<appname>gvSIG_1.0_alpha</appname>-->
+		<appname>gvSIG_annotations_0.1</appname>
+		<appversion>0.1</appversion>
+		<authors>
+			<author name="Generalitat Valenciana. Conselleria d'Infraestructures i Transport" email="" />
+			<author name="Iver Tecnologías de la Información S.A." email="" />
+		</authors>
+		<url>http://www.gvsig.gva.es/</url>
+		<javaversion>1.4</javaversion>
+	</info>
+
+	<guiprefs height="600" resizable="yes" width="800">
+		<laf name="liquid">
+			<os family="unix" />
+		</laf>
+		<laf name="liquid">
+			<os family="windows" />
+		</laf>
+	</guiprefs>
+
+	<locale>
+		<langpack iso3="spa"/>
+		<langpack iso3="val"/>
+		<langpack iso3="eng"/>
+		<langpack iso3="cat"/>
+		<langpack iso3="chn"/>
+		<langpack iso3="cze"/>
+		<langpack iso3="dan"/>
+		<langpack iso3="deu"/>
+		<langpack iso3="fin"/>
+		<langpack iso3="fra"/>
+		<langpack iso3="glg"/>
+		<langpack iso3="hun"/>
+		<langpack iso3="ita"/>
+		<langpack iso3="jpn"/>
+		<langpack iso3="mys"/>
+		<langpack iso3="ned"/>
+		<langpack iso3="nor"/>
+		<langpack iso3="pol"/>
+		<langpack iso3="por"/>
+		<langpack iso3="rom"/>
+		<langpack iso3="rus"/>
+		<langpack iso3="scg"/>
+		<langpack iso3="svk"/>
+		<langpack iso3="swe"/>
+		<langpack iso3="ukr"/>
+	</locale>
+
+	<resources>
+		<res src="resources/gpl.txt" id="LicencePanel.licence"/>
+		<res src="resources/LEEME.html" id="HTMLInfoPanel.info"/>
+		<res src="resources/images/Logo_gvsig_gva.jpg" id="Installer.image"/>
+		<res src="resources/userInputSpec.xml" id="userInputSpec.xml"/>
+                <parsable os="linux" targetfile="resources/userInputSpec.xml"/>
+                <res src="resources/userInputLang.xml_val" id="userInputLang.xml_val" />
+                <res src="resources/userInputLang.xml_spa" id="userInputLang.xml_spa" />
+	</resources>
+
+	<panels>
+		<panel classname="HTMLInfoPanel"/>
+		<panel classname="LicencePanel"/>
+		<panel classname="PacksPanel"/>
+		<panel classname="UserInputPanel"/>
+		<panel classname="InstallPanel"/>
+		<panel classname="SimpleFinishPanel"/>
+	</panels>
+
+	<packs>
+
+		<pack name="Extensión Anotaciones" required="yes">
+			<description>Extensión para el manejo de capas de anotaciones.</description>
+			<file targetdir="$INSTALL_PATH/bin/gvSIG/extensiones/" src="extensiones/com.iver.cit.gvsig.annotation" override="true"/>
+			<file targetdir="$INSTALL_PATH/bin/gvSIG/extensiones/com.iver.cit.gvsig/lib" src="extensiones/com.iver.cit.gvsig/lib/gvsig-annotation.jar" override="true"/>
+		</pack>
+
+
+	</packs>
+
+</installation>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/install.xml
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/distribucion.sh
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/distribucion.sh	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/distribucion.sh	(revision 11783)
@@ -0,0 +1,235 @@
+#!/bin/bash
+
+# Si se produce un error, salimos inmediatamente
+set -e
+
+
+# Obtenemos el locale
+LOC=`echo $LANG | sed 's/_.*//'`
+
+# Comprobar que estamos en el directorio adecuado
+if [ "$LOC" = "es" ] ; then
+  ERROR_BASEDIR="Este script debe invocarse desde el directorio  \'install\' del proyecto"
+else
+  ERROR_BASEDIR="This script must be run from the \'install\' directory of the project"
+fi
+if [ ! -d ../../install/instalador-gvSIG-lin ] || [ ! -d ../../install/instalador-gvSIG-win ] || [ ! -d ../../_fwAndami ] ; then
+        echo $ERROR_BASEDIR
+        exit 1 ;
+fi
+
+DIR_BASE=`pwd`
+GVSIG_INSTALLDIR=`readlink -f ../../install`
+ANDAMI_DIR=`readlink -f ../../_fwAndami`
+
+source variables.sh
+# Get a version with format 1_0_alpha
+UNDERSCORE_VERSION=`echo $FULLVERSION | sed 'y/./_/'`
+# Get a version with format 10_alpha
+BRIEFVERSION=`echo $FULLVERSION | sed 's/\.//'`
+# The name of the dir which will be ZIPed, containing the resulting installer
+INSTALLER_DIR="$APPNAME"-$FULLVERSION\_installer
+JARNAME="$APPNAME"-"$FULLVERSION".jar
+# The extension targets on the this version of gvSIG:
+GVSIG_VERSION=1.0
+
+BUILDNUMBER=`sed -n 's/build.number=//p' "$ANDAMI_DIR"/gvSIG/extensiones/"$MAIN_INSTALL_PLUGIN"/build.number`
+
+#ZIPNAME="$APPNAME"-"$UNDERSCORE_VERSION"\_"$BUILDNUMBER".zip
+DIR_LIN=.
+DIR_WIN=.
+
+DIR_LIN_GVSIG="$GVSIG_INSTALLDIR"/instalador-gvSIG-lin
+DIR_WIN_GVSIG="$GVSIG_INSTALLDIR"/instalador-gvSIG-win
+
+
+WINDOWSZIP="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-windows-i586.7z
+LINUXZIP="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-linux-i586.tgz
+
+LINUXBIN="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-linux-i586.bin
+
+WINDOWSEXE="$APPNAME"-"$BRIEFVERSION"\_"$BUILDNUMBER"-windows-i586.exe
+
+#Directorios
+#OUTPUT_DIR=/mnt/sercartlin/grupo-sig-ca/Testing/Versiones/v"$FULLVERSION"\_"$BUILDNUMBER"
+OUTPUT_DIR="$TARGET_DIR"/v"$FULLVERSION"\_"$BUILDNUMBER"
+PATH_SOURCE_EXT="$ANDAMI_DIR"/gvSIG/extensiones
+
+
+echo "*****************"
+echo "      BASE       "
+echo "*****************"
+
+cd "$DIR_BASE"/
+rm bin -rf
+mkdir -p bin/gvSIG/extensiones
+#cp "$DIR_WIN_GVSIG"/installer_files/LEEME "$DIR_WIN_GVSIG"installer_files/LLIG-ME "$DIR_WIN_GVSIG"installer_files/README bin
+cp resources/gpl.txt bin
+# No enlazamos directamente el directorio lib para no incluir el directorio CVS
+mkdir -p bin/lib
+cd "$DIR_BASE"/bin/lib
+for i in "$ANDAMI_DIR"/lib/*.jar ; do
+  ln -s "$i" .
+done
+for i in "$ANDAMI_DIR"/lib/*.zip ; do
+  ln -s "$i" .
+done
+cd "$DIR_BASE"/
+ln -s "$ANDAMI_DIR"/andami.jar bin/
+ln -s "$ANDAMI_DIR"/castor.properties bin/
+#cp resources/andami-config.xml bin
+echo OK.
+
+
+# Para Windows
+#Copiamos el lanzador y sus tracuciones al tmpResources
+rm -Rf tmpResources
+mkdir tmpResources
+cp -R "$GVSIG_INSTALLDIR"/launcher/izpack-launcher-1.3/dist/* ./tmpResources
+mv ./tmpResources/launcher-Win32.exe ./tmpResources/gvSIG.exe
+#Quitamos el ini, manifest y los CVS
+rm ./tmpResources/*.ini ./tmpResources/*.manifest
+find ./tmpResources -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true
+echo OK.
+
+# Estas extensiones se copian directamente al directorio destino, ya que no vamos a dar
+# opcion a no instalarlas, son obligatorias
+cd "$DIR_BASE"
+i=0
+while [ ! -z ${MANDATORY_EXTENSIONS[$i]} ]
+do
+  echo ln -s "$PATH_SOURCE_EXT"/${MANDATORY_EXTENSIONS[$i]} bin/gvSIG/extensiones
+  ln -s "$PATH_SOURCE_EXT"/${MANDATORY_EXTENSIONS[$i]} bin/gvSIG/extensiones
+  i=`expr $i + 1`
+done
+
+echo "*****************"
+[ $LOC = "es" ] && echo "   EXTENSIONES   "
+[ $LOC != "es" ] && echo "   EXTENSIONS   "
+echo "*****************"
+
+rm -rf extensiones
+mkdir extensiones
+
+i=0
+while [ ! -z ${EXTENSIONS[$i]} ]
+do
+  [ $LOC = "es" ] && echo "Enlazando "${EXTENSIONS[$i]}
+  [ $LOC != "es" ] && echo "Linking "${EXTENSIONS[$i]}
+  echo ln -s "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} extensiones
+  ln -s "$PATH_SOURCE_EXT"/${EXTENSIONS[$i]} extensiones
+  i=`expr $i + 1`
+done
+
+echo "*****************"
+echo "    INST     "
+echo "*****************"
+# Generar el instalador (jar)
+cd "$DIR_BASE"/
+rm "$JARNAME" -f
+ant -DJARNAME="$JARNAME" -DGVSIG_VERSION="$GVSIG_VERSION" -DAPPNAME="$APPNAME"
+
+
+echo "******************"
+[ $LOC = "es" ] && echo " GENERAR DISTRIB "
+[ $LOC != "es" ] && echo " GENERATE DISTRIB "
+echo "******************"
+# Generar el tar.gz para Linux y el EXE para Windows
+
+mkdir -p "$OUTPUT_DIR"
+echo "- Linux"
+## Nueva instalacion para linux
+rm -Rf "$INSTALLER_DIR"
+mkdir -p "$INSTALLER_DIR"/tmp_gvSIGInstall
+cp "$JARNAME" "$INSTALLER_DIR"/tmp_gvSIGInstall
+cd "$INSTALLER_DIR"
+chmod u+x "$GVSIG_INSTALLDIR"/launcher/izpack-launcher-1.3_linux/dist/launcher-Linux
+cp -R "$GVSIG_INSTALLDIR"/launcher/izpack-launcher-1.3_linux/dist/* ./tmp_gvSIGInstall
+chmod a+x ./tmp_gvSIGInstall/launcher-Linux
+find . -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true
+
+sed "s/%JARNAME%/$JARNAME/" ./tmp_gvSIGInstall/launcher.ini > ./tmp_gvSIGInstall/launcher.ini.bak
+mv ./tmp_gvSIGInstall/launcher.ini.bak ./tmp_gvSIGInstall/launcher.ini;
+
+tar -cvzf ./tmp.tgz ./tmp_gvSIGInstall
+echo '#!/bin/sh' > xx.tmp
+lcount=`cat xx.tmp "$GVSIG_INSTALLDIR"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh | wc -l`
+lcount=$(($lcount+2)) # sumamos dos: uno por la linea siguiente y otro para el inicio
+echo "lcount=$lcount" >> xx.tmp
+cat xx.tmp "$GVSIG_INSTALLDIR"/launcher/izpack-launcher-1.3_linux/h_gvSIG-install.sh ./tmp.tgz  > "$LINUXBIN"
+rm xx.tmp
+chmod a+x "$LINUXBIN"
+mv "$LINUXBIN" "$OUTPUT_DIR"
+cd "$DIR_BASE"/
+rm -Rf "$INSTALLER_DIR"
+## Fin Nueva instalacion para linux
+
+## Para Windows
+echo "- Windows"
+#set -x
+cd "$DIR_BASE"
+rm -Rf "$INSTALLER_DIR"
+
+mkdir "$INSTALLER_DIR"
+cp -aR "$GVSIG_INSTALLDIR"/launcher/izpack-launcher-1.3/dist/* "$INSTALLER_DIR"
+rm -f "$INSTALLER_DIR"/install.bat
+
+find "$INSTALLER_DIR" -name CVS -type d -exec rm -rf {} 2> /dev/null ';' || true
+
+## hacemos las sustituciones de la variable
+sed "s/%JARNAME%/$JARNAME/" "$INSTALLER_DIR"/launcher-Win32.ini > "$INSTALLER_DIR"/launcher-Win32.ini.bak
+mv "$INSTALLER_DIR"/launcher-Win32.ini.bak "$INSTALLER_DIR"/launcher-Win32.ini;
+
+
+mv "$JARNAME" "$INSTALLER_DIR"
+cd "$INSTALLER_DIR"
+
+if [ -f  "$DIR_BASE"/"$WINDOWSZIP" ] ; then
+	rm -f "$DIR_BASE"/"$WINDOWSZIP"
+fi
+chmod u+x "$GVSIG_INSTALLDIR"/launcher/7z/7za
+"$GVSIG_INSTALLDIR"/launcher/7z/7za a -r "$DIR_BASE"/"$WINDOWSZIP" *
+cd -
+sed "s/%TITLE%/$APPNAME-$BRIEFVERSION\_$BUILDNUMBER/" "$GVSIG_INSTALLDIR"/launcher/7z/dist_config.txt > dist_config.txt
+cat "$GVSIG_INSTALLDIR"/launcher/7z/7zS.sfx  dist_config.txt "$WINDOWSZIP" > "$WINDOWSEXE"
+
+###
+
+
+rm dist_config.txt
+rm "$WINDOWSZIP"
+
+rm -Rf "$INSTALLER_DIR"
+
+mv "$WINDOWSEXE" "$OUTPUT_DIR"
+
+# Limpiamos tmpResources
+cd "$DIR_BASE"/
+rm -r ./tmpResources
+cd -
+
+## Limpiamos
+
+rm -rf extensiones
+rm -rf bin
+
+echo "******************"
+[ $LOC = "es" ] && echo " GENERAR FUENTES "
+[ $LOC != "es" ] && echo " GENERATE SOURCES "
+echo "******************"
+
+cd ..
+ant generate-source-package
+mv dist-src/gv*-src.zip "$OUTPUT_DIR"
+cd -
+
+
+echo "*****************"
+echo "    FIN     "
+echo "*****************"
+
+echo ""
+echo "Generados los ficheros:"
+echo "$OUTPUT_DIR"
+ls -lh "$OUTPUT_DIR"
+cd "$DIR_BASE"

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/distribucion.sh
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:executable
   + *
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_fra
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_fra	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_fra	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Path to gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_fra
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_eng
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_eng	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_eng	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Path to gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_eng
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputSpec.xml
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputSpec.xml	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputSpec.xml	(revision 11783)
@@ -0,0 +1,21 @@
+<userInput>
+	<panel order="0">
+		<field 	type="search" 
+				variable="INSTALL_PATH"
+				size="45">
+  			<description align="left" />
+  			<spec 	txt="Path to gvSIG:" 
+		  			id="text.label"
+  					checkfilename="bin/andami.jar"
+        			type="directory" 
+        			result="directory">
+  			<choice value="/usr/local/gvSIG_1.0" os="unix" />
+  			<choice value="/opt/gvSIG_1.0" os="unix" />
+  			<choice value="$USER_HOME/gvSIG_1.0" os="unix" />
+  			<choice value="C:\Archivos de Programa\gvSIG_1.0" os="windows" />
+  			<choice value="C:\Program Files\gvSIG_1.0" os="windows" />
+  			</spec>
+		</field>
+	</panel>
+</userInput>
+

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputSpec.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/LEEME.html
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/LEEME.html	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/LEEME.html	(revision 11783)
@@ -0,0 +1,66 @@
+<html>
+<head>
+<style type="text/css">
+html, body, h1, h2, h3, h4, div, p, ul, li, input {
+   font-family: Arial, Helvetica, sans-serif;
+}
+
+h1 {
+   font-size: large;
+}
+
+h2 {
+   font-size: large;
+}
+
+h3 {
+   font-size: medium;
+}
+</style>
+</head>
+<body>
+<h1>gvSIG, el SIG en software libre de la Generalitat Valenciana
+(http://www.gvsig.gva.es).</h1>
+
+<h2>Autores:</h2>
+<ul>
+<li>Generalitat Valenciana
+ (Conselleria d'Infraestructures i Transport).</li>
+<li>Iver Tecnolog&iacute;as de la Informaci&oacute;n S.A.</li>
+</ul>
+
+<p>Software con licencia GNU/GPL
+(http://www.fsf.org/licensing/licenses/gpl.html)</p>
+
+<p>Contacto:
+	gvsig@gva.es<p>
+
+<h2>Requisitos de la aplicaci&oacute;n:</h2>
+<h3>Sistema</h3>
+<ul>
+<li>M&iacute;nimos: Pentium III / 256 MB RAM.</li>
+<li>Recomendables: Pentium IV / 512 MB RAM.</li>
+<li>Sistemas operativos: plataformas Windows y Linux.
+ Probado en Win98/XP, Linux Suse 8.2/9.0/9.2 y Linux Debian (Lliurex).</li>
+</ul>
+
+<h3>Software instalado</h3> (disponible en http://www.gvsig.gva.es o en http://java.sun.com)
+<ul>
+<li>M&aacute;quina Virtual Java 1.4.2 (06 o superior).</li>
+<li>JAI (Java Advanced Imaging).</li>
+<li>JAI Image I/O.</li>
+</ul>
+
+<p style="text-align:justify">Nota: Las librer&iacute;as JAI y JAI Image I/O deben estar instaladas sobre la M&aacute;quina Virtual Java que gvSIG utilice en su ejecuci&oacute;n. Si se instala una nueva JVM en el sistema y se usa para ejecutar gvSIG ser&aacute; indispensable instalar las librer&iacute;as sobre &eacute;sta (gvSIG se ejecuta con la JVM que tenga por defecto el sistema operativo; para saber cu&aacute;l es, ejecutar <span style="monospace">"java&nbsp;-version"</span> en un interfaz de comandos o consola).</p>
+
+<h2>M&aacute;s informaci&oacute;n y soporte en:</h2>
+<h3> Web oficial del proyecto:</h3>
+	http://www.gvsig.gva.es
+
+<h3>Listas de distribuci&oacute;n:</h3>
+<span style="monospace"> http://runas.cap.gva.es/mailman/listinfo/gvsig_usuarios</span> (soporte para usuarios).
+<span style="monospace"> http://runas.cap.gva.es/mailman/listinfo/gvsig_desarrolladores</span> (soporte para desarrolladores).
+<span style="monospace"> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional</span> (soporte para desarrolladores o usuarios de habla no hispana).
+
+</body>
+</html>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/LEEME.html
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_deu
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_deu	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_deu	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Path to gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_deu
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_ita
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_ita	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_ita	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Path to gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_ita
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Leeme-Annotation.txt
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Leeme-Annotation.txt	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Leeme-Annotation.txt	(revision 11783)
@@ -0,0 +1,30 @@
+Plugin Anotaciones versi�n 1.0 (Build Number #build.number#):
+
+Antes de comenzar compruebe los siguientes puntos:
+
+1.- Descargue los fuentes de la v1.0.2 de gvSIG. Siga los pasos all� indicados en el archivo 'Leeme.txt' para obtener un entorno de desarrollo funcional.
+
+*** Compilaci�n
+
+1.- Descomprima este paquete dentro del directorio de fuentes que acaba de preparar ( gvSIG-1_0_2-src).
+
+2.- (S�lo si usa eclipse) Importe los proyectos que acaba de descomprimir:
+  *1: Men� File/Import.
+  *2: Seleccione 'Existing Projects into workspace' y 'Next'
+  *3: Con la opci�n 'Select root directory' pulse 'Browse...'
+  *4: Sit�ese en el directorio del workspace (normalmente el dialogo ya se encuentra en �l) y pulse 'Aceptar'.
+  *5: Pulse 'Deselect All'
+  *6: Marque los siguientes proyectos de la lista: extAnnotations.
+  *7: Pulse 'Finish'.
+
+3.- Ejecute el 'build.xml' del proyecto 'extAnnotations' (usando ant o eclipse).
+
+Ante cualquier problema:
+
+Apuntese a la lista de desarrolladores de gvSIG y pregunte all� (http://www.gvsig.gva.es).
+
+Gracias por desarrollar sobre gvSIG.
+
+Un saludo.
+
+Equipo gvSIG.

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Leeme-Annotation.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_por
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_por	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_por	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Path to gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_por
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/gpl.txt
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/gpl.txt	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/gpl.txt	(revision 11783)
@@ -0,0 +1,125 @@
+	GNU GENERAL PUBLIC LICENSE
+	Version 2, June 1991
+
+	 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+		Preamble
+
+	The licenses for most software are designed to take away your freedom to share and change it.  By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.  This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it.  (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.)  You can apply it to your programs, too.
+
+	When we speak of free software, we are referring to freedom, not price.  Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+	To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+	For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have.  You must make sure that they, too, receive or can get the source code.  And you must show them these terms so they know their
+rights.
+
+	We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+	Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software.  If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+	Finally, any free program is threatened constantly by software	patents.  We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary.  To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+	The precise terms and conditions for copying, distribution and modification follow.
+
+				GNU GENERAL PUBLIC LICENSE
+	TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+	0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License.  The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.  (Hereinafter, translation is included without limitation in the term "modification".)  Each licensee is addressed as "you".
+
+	Activities other than copying, distribution and modification are not covered by this License; they are outside its scope.  The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1.	You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2.	You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+
+c)	If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.  (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works.  But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3.	You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+c)	Accompany it with the information you received as to the offer to distribute corresponding source code.  (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for making modifications to it.  For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable.  However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4.	You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License.  Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5.	You are not required to accept this License, since you have not signed it.  However, nothing else grants you permission to modify or distribute the Program or its derivative works.  These actions are prohibited by law if you do not accept this License.  Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6.	Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions.  You may not impose any further restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to this License.
+
+7.	If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License.  If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all.  For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices.  Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8.	If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded.  In such case, this License incorporates the limitation as if written in the body of this License.
+
+9.	The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time.  Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation.  If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10.	If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission.  For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this.  Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11.	BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12.	IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program.  It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year>  <name of author>
+
+This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License.  Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary.  Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+<signature of Ty Coon>, 1 April 1989
+Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into proprietary programs.  If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library.  If this is what you want to do, use the GNU Library General Public License instead of this License.
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/gpl.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cze
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cze	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cze	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Path to gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cze
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_val
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_val	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_val	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Ruta a gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_val
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_spa
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_spa	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_spa	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Ruta a gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_spa
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Readme-Annotation.txt
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Readme-Annotation.txt	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Readme-Annotation.txt	(revision 11783)
@@ -0,0 +1,28 @@
+Annotations Plugin version 1.0 (Build number #build.number#):
+
+Before starting, check the following points:
+
+1.- Download the sources for gvSIG v1.0.2. Follow the procedure described in the �Readme.txt� file to setup a working development environment.
+
+*** Compilation
+
+1.- Uncompress the pilot package into the source folder just created (gvSIG-1_0_2-src). Note: some files in the  'binaries' folder must be overwritten.
+
+2.- (Only if using Eclipse) Import the projects:
+  *1: Pick the the File/Import menu command.
+  *2: Choose 'Existing Projects into workspace' and hit 'Next'
+  *3: With the option 'Select root directory' press 'Browse...'
+  *4: Locate the workspace folder (normally, this should be the default) and hit 'Accept'.
+  *5: Click on 'Deselect All'
+  *6: Mark the following project from the list: extAnnotations.
+  *7: Click on 'Finish'.
+
+3.- Run the 'build.xml' in the project 'extAnnotations' (using  Ant or Eclipse).
+
+For further assistance, please subscribe to the gvSIG developer list and send your questions there (see in http://www.gvsig.gva.es).
+
+Thanks for developing on gvSIG.
+
+Regards,
+
+The gvSIG Team
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/Readme-Annotation.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/Logo_gvsig_gva.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/Logo_gvsig_gva.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall1.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG16x16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG16x16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/Logo-gvSIG.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/Logo-gvSIG.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help16x16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help16x16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.GIF
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.GIF
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/help.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall16x16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/uninstall16x16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.JPG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.JPG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/papelera.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/papelera.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/images/ico-gvSIG.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cat
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cat	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cat	(revision 11783)
@@ -0,0 +1,3 @@
+<langpack>
+  <str id="text.label" txt="Ruta a gvSIG:"/>
+</langpack>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/resources/userInputLang.xml_cat
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/HOWTO-BUILD.txt
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/HOWTO-BUILD.txt	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/HOWTO-BUILD.txt	(revision 11783)
@@ -0,0 +1,11 @@
+ C�MO GENERAR EL INSTALADOR:
+ ===========================
+- Solo ejecutable desde Linux
+- gvSIG debe estar correctamente construido en ../_fwAndami/bin
+- El plugin principal debe dejar un fichero 'build.number' dentro de su directorio de andami, que indicara el numero del build para la distribuci�n.
+- Lanzar el target 'distribucion' del build.xml del plugin principal (solo para plugins).
+- El proyecto 'install' debe estar presente en la ra�z del workspace (contiene el Izpack, entre otras cosas)
+- En el fichero variables.sh hay algunas variables que nos pueden interesar, que permiten personalizar el nombre del plugin, la versi�n, el directorio destino, las extensiones incluidas, etc. La variable  APPNAME normalmente valdr� "gvSIG", pero puede tiener nombre si estamos empaquetando una extensi�n (por ejemplo,  "nomenclatorIGN").
+- Definir los packs adecuados en el fichero XML de configuraci�n (install.xml), y revisar el fichero en general.
+- En el fichero resources/userInputSpec.xml modificar los directorios candidatos, si se ha producido un cambio de la versi�n de gvSIG sobre la que queremos instalar
+- Lanzar el script distribucion.sh desde el directorio donde se encuentra (ejemplo: "cd workspace/extXXX/install ; ./distribucion.sh ").

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/HOWTO-BUILD.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/build.xml
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/build.xml	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/build.xml	(revision 11783)
@@ -0,0 +1,35 @@
+<project name="instalador-gvSIG" default="init" basedir=".">
+	<!--
+	<property name="dir_inst" location="C:\Archivos de programa"/>
+	<property name="base_dir" location="./"/>		
+	<property name="dir_libs" location="C:\Archivos de programa\IzPack\lib"/>
+	<property name="vers" location="0.6"/>
+	<property name="izpack_dir" location="C:\Archivos de programa\IzPack"/>
+	-->
+	
+	<property name="dir_inst" location="/usr/local"/>
+	<property name="base_dir" location="./"/>		
+	<property name="izpack_dir" location="../../install/IzPack"/>
+	<property name="dir_libs" location="${izpack_dir}/lib"/>
+	
+	<taskdef name="izpack" classpath="${dir_libs}/compiler.jar" classname="com.izforge.izpack.ant.IzPackTask"/>
+	
+	<target name="init">
+		<izpack input="install.xml" 
+				output="${JARNAME}" 
+				installerType="standard" 
+				basedir="${base_dir}" 
+				izPackDir="${izpack_dir}/"/>
+	</target>
+	
+	<target name="clean">
+		<delete>
+			<fileset dir=".">
+			    <include name="**.zip"/>
+			</fileset>
+		</delete>
+		<delete dir="bin" />
+		<delete dir="extensions" />
+	</target>
+	
+</project>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/build.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/install/variables.sh
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/install/variables.sh	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/install/variables.sh	(revision 11783)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+export APPNAME=gvsig_annotations
+export FULLVERSION='0.1'
+#export FULLVERSION='1.0'
+export TARGET_DIR=/tmp/"$APPNAME"/versiones
+#export TARGET_DIR=/mnt/sercartlin/grupo-sig-ca/Testing/Versiones/
+export MAIN_INSTALL_PLUGIN=com.iver.cit.gvsig.annotation #Nombre del plugin que proporciona el 'build.nuber' para la distribucion
+
+## estas extensiones se muestran en los packs, y se puede elegir instalarlos o no
+## (el fichero install.xml tambien debe estar actualizado para reflejar esto)
+EXTENSIONS=(
+"$MAIN_INSTALL_PLUGIN"
+com.iver.cit.gvsig
+)

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/install/variables.sh
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/rendering/Annotation_Legend.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/rendering/Annotation_Legend.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/rendering/Annotation_Legend.java	(revision 11783)
@@ -0,0 +1,395 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+package com.iver.cit.gvsig.fmap.rendering;
+
+import java.awt.Color;
+import java.util.ArrayList;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.instruction.FieldNotFoundException;
+import com.hardcode.gdbms.engine.values.Value;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.core.IFeature;
+import com.iver.cit.gvsig.fmap.core.ISymbol;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.utiles.XMLEntity;
+
+/**
+ * Leyenda vectorial para labels.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Legend implements VectorialLegend {
+	private String fieldName;
+
+	protected int fieldId = -1;
+
+	private String labelFieldName;
+
+	private String labelFieldHeight;
+
+	private String labelFieldRotation;
+
+	private FSymbol defaultSymbol = new FSymbol(
+			FConstant.SYMBOL_TYPE_TEXT);
+
+	private int shapeType;
+
+	private boolean useDefaultSymbol = false;
+
+	private boolean overwrite=true;
+
+	public Annotation_Legend() {
+		defaultSymbol.setFontSizeInPixels(true);
+		defaultSymbol.setFontColor(Color.black);
+		defaultSymbol.setRotation(0);
+		defaultSymbol.setFontSize(10);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.UniqueValueLegend#addSymbol(java.lang.Object,
+	 *      ISymbol)
+	 */
+	public void addSymbol(Object key, ISymbol symbol) {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.ClassifiedLegend#clear()
+	 */
+	public void clear() {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.ClassifiedLegend#getDescriptions()
+	 */
+	public String[] getDescriptions() {
+		return null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.ClassifiedLegend#getSymbols()
+	 */
+	public ISymbol[] getSymbols() {
+		return null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.ClassifiedLegend#getFieldName()
+	 */
+	public String getFieldName() {
+		return fieldName;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#setDefaultSymbol(ISymbol)
+	 */
+	public void setDefaultSymbol(ISymbol s) {
+		defaultSymbol = (FSymbol) s;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#getLabelField()
+	 */
+	public String getLabelField() {
+		return labelFieldName;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.Legend#setLabelField(int)
+	 */
+	public void setLabelField(String fieldName) {
+		labelFieldName = fieldName;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.ClassifiedLegend#setField()
+	 */
+	public void setFieldName(String str) {
+		fieldName = str;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#getSymbol(int)
+	 */
+	public ISymbol getSymbol(int recordIndex) throws DriverException {
+		return null;
+	}
+
+	/**
+	 * Devuelve un s�mbolo a partir de una IFeature. OJO!! Cuando usamos un
+	 * feature iterator de base de datos el �nico campo que vendr� rellenado es
+	 * el de fieldID. Los dem�s vendr�n a nulos para ahorra tiempo de creaci�n.
+	 *
+	 * @param feat
+	 *            IFeature
+	 *
+	 * @return S�mbolo.
+	 */
+	public ISymbol getSymbolByFeature(IFeature feat) {
+		return null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.Legend#getDefaultSymbol()
+	 */
+	public ISymbol getDefaultSymbol() {
+		return defaultSymbol;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.UniqueValueLegend#getValues()
+	 */
+	public Object[] getValues() {
+		// return symbols.keySet().toArray(new Object[0]);
+		return null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.Legend#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className", this.getClass().getName());
+		xml.putProperty("fieldName", fieldName);
+		xml.putProperty("labelfield", labelFieldName);
+		xml.putProperty("labelFieldHeight", labelFieldHeight);
+		xml.putProperty("labelFieldRotation", labelFieldRotation);
+		xml.putProperty("overwrite",overwrite);
+
+		xml.putProperty("useDefaultSymbol", useDefaultSymbol);
+		xml.addChild(getDefaultSymbol().getXMLEntity());
+		return xml;
+	}
+
+	/**
+	 * Inserta el XMLEntity.
+	 *
+	 * @param xml
+	 *            XMLEntity.
+	 */
+	public void setXMLEntity03(XMLEntity xml) {
+
+	}
+
+	/**
+	 * Inserta el XMLEntity.
+	 *
+	 * @param xml
+	 *            XMLEntity.
+	 */
+	public void setXMLEntity(XMLEntity xml) {
+		clear();
+		setFieldName(xml.getStringProperty("fieldName"));
+		setLabelField(xml.getStringProperty("labelfield"));
+
+		if (xml.contains("labelFieldHeight")) {
+			setLabelHeightField(xml.getStringProperty("labelFieldHeight"));
+		}
+
+		if (xml.contains("labelFieldRotation")) {
+			setLabelRotationField(xml.getStringProperty("labelFieldRotation"));
+		}
+
+		useDefaultSymbol = xml.getBooleanProperty("useDefaultSymbol");
+		if (xml.contains("overwrite")){
+			overwrite=xml.getBooleanProperty("overwrite");
+		}
+		defaultSymbol = FSymbol.createFromXML(xml.getChild(0));
+
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.rendering.Legend#cloneLegend()
+	 */
+	public Legend cloneLegend() throws XMLException {
+		return LegendFactory.createFromXML(getXMLEntity());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#setDataSource(com.hardcode.gdbms.engine.data.DataSource)
+	 */
+	public void setDataSource(DataSource ds) throws FieldNotFoundException,
+			DriverException {
+		// try {
+		// dataSource = ds;
+		// ds.start();
+		// fieldId = ds.getFieldIndexByName(fieldName);
+		// ds.stop();
+		// } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+		// throw new DriverException(e);
+		// }
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see com.iver.cit.gvsig.fmap.rendering.UniqueValueLegend#getSymbolByValue(com.hardcode.gdbms.engine.values.Value)
+	 */
+	public ISymbol getSymbolByValue(Value key) {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#getShapeType()
+	 */
+	public int getShapeType() {
+		return shapeType;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#getLabelHeightField()
+	 */
+	public String getLabelHeightField() {
+		return labelFieldHeight;
+	}
+
+	/**
+	 * Inserta el alto de campo.
+	 *
+	 * @param str
+	 *            alto.
+	 */
+	public void setLabelHeightField(String str) {
+		labelFieldHeight = str;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#getLabelRotationField()
+	 */
+	public String getLabelRotationField() {
+		return labelFieldRotation;
+	}
+
+	/**
+	 * Inserta rotaci�n.
+	 *
+	 * @param str
+	 *            Rotaci�n.
+	 */
+	public void setLabelRotationField(String str) {
+		labelFieldRotation = str;
+	}
+
+	/**
+	 * Introduce si se tiene que representar el resto de valores o no.
+	 *
+	 * @param b
+	 *            True si se utiliza el resto de valores.
+	 */
+	public void useDefaultSymbol(boolean b) {
+		useDefaultSymbol = b;
+	}
+
+	/**
+	 * Devuelve si se utiliza o no el resto de valores para representarse.
+	 *
+	 * @return True si se utiliza el resto de valores.
+	 */
+	public boolean isUseDefaultSymbol() {
+		return useDefaultSymbol;
+	}
+
+	/**
+	 * Elimina el s�mbolo que tiene como clave el valor que se pasa como
+	 * par�metro.
+	 *
+	 * @param key
+	 *            clave.
+	 */
+	public void delSymbol(Object key) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#getUsedFields()
+	 */
+	public String[] getUsedFields() {
+		ArrayList usedFields = new ArrayList();
+		if (getFieldName() != null)
+			usedFields.add(getFieldName());
+		if (getLabelField() != null)
+			usedFields.add(getLabelField());
+		if (getLabelHeightField() != null)
+			usedFields.add(getLabelHeightField());
+		if (getLabelRotationField() != null)
+			usedFields.add(getLabelRotationField());
+
+		return (String[]) usedFields.toArray(new String[0]);
+
+	}
+
+	public void setShapeType(int shapeType) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public String getSLDString(String layerName) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void setInPixels(boolean b) {
+		defaultSymbol.setFontSizeInPixels(b);
+
+	}
+
+	public void setIsOverWrite(boolean b) {
+		overwrite=b;
+
+	}
+
+	public boolean isOverWrite() {
+		return overwrite;
+	}
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/rendering/Annotation_Legend.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Mapping.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Mapping.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Mapping.java	(revision 11783)
@@ -0,0 +1,265 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.fmap.layers;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.sql.Types;
+
+
+/**
+ * Mapping of annotation's layers.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Mapping {
+    public static String DEFAULTTEXT = "";
+    public static String DEFAULTTYPEFONT = "Arial";
+    public static int DEFAULTROTATE = 0;
+    public static int DEFAULTSTYLEFONT = Font.PLAIN;
+    public static int DEFAULTHEIGHT = 10;
+    public static int DEFAULTCOLOR = Color.black.getRGB();
+    public static String TEXT = "Text";
+    public static String ROTATE = "Rotate";
+    public static String COLOR = "Color";
+    public static String HEIGHT = "Height";
+    public static String TYPEFONT = "TypeFont";
+    public static String STYLEFONT = "StyleFont";
+    private static int TYPETEXT = Types.VARCHAR;
+    private static int TYPEROTATE = Types.DOUBLE;
+    private static int TYPECOLOR = Types.INTEGER;
+    private static int TYPEHEIGHT = Types.DOUBLE;
+    private static int TYPETYPEFONT = Types.VARCHAR;
+    private static int TYPESTYLEFONT = Types.INTEGER;
+    public static int NUMCOLUMNS = 6;
+    private int columnText = -1;
+    private int columnRotate = -1;
+    private int columnColor = -1;
+    private int columnHeight = -1;
+    private int columnTypeFont = -1;
+    private int columnStyleFont = -1;
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public int getColumnColor() {
+        return columnColor;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param columnColor DOCUMENT ME!
+     */
+    public void setColumnColor(int columnColor) {
+        this.columnColor = columnColor;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public int getColumnHeight() {
+        return columnHeight;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param columnHeight DOCUMENT ME!
+     */
+    public void setColumnHeight(int columnHeight) {
+        this.columnHeight = columnHeight;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public int getColumnRotate() {
+        return columnRotate;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param columnRotate DOCUMENT ME!
+     */
+    public void setColumnRotate(int columnRotate) {
+        this.columnRotate = columnRotate;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public int getColumnStyleFont() {
+        return columnStyleFont;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param columnStyleFont DOCUMENT ME!
+     */
+    public void setColumnStyleFont(int columnStyleFont) {
+        this.columnStyleFont = columnStyleFont;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public int getColumnText() {
+        return columnText;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param columnText DOCUMENT ME!
+     */
+    public void setColumnText(int columnText) {
+        this.columnText = columnText;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public int getColumnTypeFont() {
+        return columnTypeFont;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param columnTypeFont DOCUMENT ME!
+     */
+    public void setColumnTypeFont(int columnTypeFont) {
+        this.columnTypeFont = columnTypeFont;
+    }
+
+    // public XMLEntity getXMLEntity() {
+    // XMLEntity xml=new XMLEntity();
+    // xml.putProperty("className",this.getClass().getName());
+    // xml.putProperty("columnText",columnText);
+    // xml.putProperty("columnRotate",columnRotate);
+    // xml.putProperty("columnColor",columnColor);
+    // xml.putProperty("columnHeight",columnHeight);
+    // xml.putProperty("columnTypeFont",columnTypeFont);
+    // xml.putProperty("columnStyleFont",columnStyleFont);
+    // return xml;
+    // }
+    // public static Annotation_Mapping createFromXML(XMLEntity xml) {
+    // Annotation_Mapping m=new Annotation_Mapping();
+    // m.setColumnText(xml.getIntProperty("columnText"));
+    // m.setColumnRotate(xml.getIntProperty("columnRotate"));
+    // m.setColumnColor(xml.getIntProperty("columnColor"));
+    // m.setColumnHeight(xml.getIntProperty("columnHeight"));
+    // m.setColumnTypeFont(xml.getIntProperty("columnTypeFont"));
+    // m.setColumnStyleFont(xml.getIntProperty("columnStyleFont"));
+    // return m;
+    // }
+    public static int getType(String column) {
+        if (column.equals(TEXT)) {
+            return TYPETEXT;
+        } else if (column.equals(COLOR)) {
+            return TYPECOLOR;
+        } else if (column.equals(ROTATE)) {
+            return TYPEROTATE;
+        } else if (column.equals(COLOR)) {
+            return TYPECOLOR;
+        } else if (column.equals(HEIGHT)) {
+            return TYPEHEIGHT;
+        } else if (column.equals(TYPEFONT)) {
+            return TYPETYPEFONT;
+        } else if (column.equals(STYLEFONT)) {
+            return TYPESTYLEFONT;
+        }
+
+        return Types.VARCHAR;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param al DOCUMENT ME!
+     *
+     * @throws com.hardcode.gdbms.engine.data.driver.DriverException DOCUMENT
+     *         ME!
+     */
+    public static void addAnnotationMapping(Annotation_Layer al)
+        throws com.hardcode.gdbms.engine.data.driver.DriverException {
+        Annotation_Mapping am = new Annotation_Mapping();
+        SelectableDataSource sds = al.getSource().getRecordset();
+        int numFields = sds.getFieldCount();
+
+        for (int i = 0; i < numFields; i++) {
+            String nameField = sds.getFieldName(i);
+
+            if (nameField.equalsIgnoreCase(COLOR)) {
+                am.setColumnColor(i);
+            } else if (nameField.equalsIgnoreCase(HEIGHT)) {
+                am.setColumnHeight(i);
+            } else if (nameField.equalsIgnoreCase(ROTATE)) {
+                am.setColumnRotate(i);
+            } else if (nameField.equalsIgnoreCase(STYLEFONT)) {
+                am.setColumnStyleFont(i);
+            } else if (nameField.equalsIgnoreCase(TEXT)) {
+                am.setColumnText(i);
+            } else if (nameField.equalsIgnoreCase(TYPEFONT)) {
+                am.setColumnTypeFont(i);
+            }
+        }
+
+        al.setMapping(am);
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Mapping.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Layer.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Layer.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Layer.java	(revision 11783)
@@ -0,0 +1,1103 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.fmap.layers;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.print.attribute.PrintRequestAttributeSet;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+
+import com.hardcode.driverManager.Driver;
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.instruction.FieldNotFoundException;
+import com.hardcode.gdbms.engine.values.Value;
+import com.hardcode.gdbms.engine.values.ValueFactory;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.core.FPoint2D;
+import com.iver.cit.gvsig.fmap.core.FPolygon2D;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.ISymbol;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FLabel;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.crs.CRSFactory;
+import com.iver.cit.gvsig.fmap.drivers.BoundedShapes;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
+import com.iver.cit.gvsig.fmap.edition.Annotation_EditableAdapter;
+import com.iver.cit.gvsig.fmap.edition.EditionEvent;
+import com.iver.cit.gvsig.fmap.edition.EditionException;
+import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter;
+import com.iver.cit.gvsig.fmap.operation.strategies.Annotation_Strategy;
+import com.iver.cit.gvsig.fmap.operations.strategies.Strategy;
+import com.iver.cit.gvsig.fmap.operations.strategies.StrategyManager;
+import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
+import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend;
+import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
+import com.iver.cit.gvsig.fmap.spatialindex.QuadtreeJts;
+import com.iver.utiles.XMLEntity;
+import com.iver.utiles.swing.threads.Cancellable;
+
+
+/**
+ * Annotation's layer.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Layer extends FLyrVect {
+    private Annotation_Mapping mapping = null;
+
+    // private ArrayList m_labels;
+    private int indexEditing = -1;
+
+    //private boolean inPixels = false;
+    private Annotation_Legend aLegend;
+    private Strategy strategy = null;
+
+    /**
+     * Crea un nuevo FLyrAnnotation.
+     */
+    public Annotation_Layer() {
+        super();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param mapping DOCUMENT ME!
+     */
+    public void setMapping(Annotation_Mapping mapping) {
+        this.mapping = mapping;
+        aLegend = new Annotation_Legend();
+
+        // try {
+        setLegend();
+
+        // createLabels();
+        // } catch (DriverException e) {
+        // e.printStackTrace();
+        // JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),
+        // PluginServices.getText(this,"Este fichero no es posible abirlo como
+        // capa de anotaciones"));
+        // }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public Annotation_Mapping getAnnotatonMapping() {
+        return mapping;
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage,
+     *      java.awt.Graphics2D, ISymbol)
+     */
+    public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort,
+        Cancellable cancel, double scale) throws DriverException {
+        if (isWithinScale(scale)) {
+            // Las que solo tienen etiquetado sin pintar el shape,
+            // no pasamos por ellas
+            boolean bDrawShapes = true;
+
+            if (bDrawShapes) {
+                if (strategy == null) {
+                    strategy = new Annotation_Strategy(this);
+                }
+
+                try {
+                    g.setColor(Color.black);
+
+                    ReadableVectorial adapter = getSource();
+                    adapter.start();
+
+                    strategy.draw(image, g, viewPort, cancel);
+                    adapter.stop();
+
+                    // if (getISpatialIndex()==null && !isEditing()) {
+                    // createSpatialIndex();
+                    // }
+                } catch (DriverException e) {
+                    this.setVisible(false);
+                    this.setActive(false);
+                    throw e;
+                } catch (DriverIOException e) {
+                    this.setVisible(false);
+                    this.setActive(false);
+                    throw new DriverException(e);
+                }
+            }
+
+            if (getVirtualLayers() != null) {
+                getVirtualLayers().draw(image, g, viewPort, cancel, scale);
+            }
+        }
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.fmap.layers.LayerOperations#getFullExtent()
+     */
+    public Rectangle2D getFullExtent() throws DriverException {
+        try {
+            Rectangle2D rAux;
+
+            // logger.debug("source.start()");
+            getSource().start();
+            rAux = getSource().getFullExtent();
+
+            // logger.debug("source.stop()");
+            getSource().stop();
+
+            // Si existe reproyecci�n, reproyectar el extent
+            ICoordTrans ct = getCoordTrans();
+
+            if (ct != null) {
+                Point2D pt1 = new Point2D.Double(rAux.getMinX(), rAux.getMinY());
+                Point2D pt2 = new Point2D.Double(rAux.getMaxX(), rAux.getMaxY());
+                pt1 = ct.convert(pt1, null);
+                pt2 = ct.convert(pt2, null);
+                rAux = new Rectangle2D.Double();
+                rAux.setFrameFromDiagonal(pt1, pt2);
+            }
+
+            return rAux;
+        } catch (DriverIOException e) {
+            throw new DriverException(e);
+        }
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D,
+     *      com.iver.cit.gvsig.fmap.ViewPort,
+     *      com.iver.utiles.swing.threads.Cancellable)
+     */
+    public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
+        double scale, PrintRequestAttributeSet properties)
+        throws DriverException {
+        if (isVisible() && isWithinScale(scale)) {
+            Strategy strategy = StrategyManager.getStrategy(this);
+            strategy.print(g, viewPort, cancel, properties);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.iver.cit.gvsig.fmap.layers.layerOperations.RandomVectorialData#queryByRect(java.awt.geom.Rectangle2D)
+     */
+    public FBitSet queryByRect(Rectangle2D rect) throws DriverException {
+        Strategy s = StrategyManager.getStrategy(this);
+
+        return s.queryByRect(rect);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param p DOCUMENT ME!
+     * @param tolerance DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws DriverException DOCUMENT ME!
+     */
+    public FBitSet queryByPoint(Point2D p, double tolerance)
+        throws DriverException {
+        Strategy s = StrategyManager.getStrategy(this);
+
+        return s.queryByPoint(p, tolerance);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param g DOCUMENT ME!
+     * @param relationship DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws DriverException DOCUMENT ME!
+     * @throws VisitException DOCUMENT ME!
+     */
+    public FBitSet queryByShape(IGeometry g, int relationship)
+        throws DriverException, VisitException {
+        Strategy s = StrategyManager.getStrategy(this);
+
+        return s.queryByShape(g, relationship);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws XMLException
+     *
+     * @see com.iver.cit.gvsig.fmap.layers.FLayer#getProperties()
+     */
+    public XMLEntity getXMLEntity() throws XMLException {
+        XMLEntity xml = super.getXMLEntity();
+
+        // xml.addChild(mapping.getXMLEntity());
+        //		xml.putProperty("isInPixels", isInPixels());
+        return xml;
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.fmap.layers.FLyrDefault#setXMLEntity(com.iver.utiles.XMLEntity)
+     */
+    public void setXMLEntity(XMLEntity xml) throws XMLException {
+        // Iterator
+        // iter=xml.findChildren("className",Annotation_Mapping.class.getName());
+        // if (iter.hasNext())
+        // mapping = Annotation_Mapping.createFromXML((XMLEntity)iter.next());
+        // else{
+        // //Este else para versiones anteriores a la 1.0.2.(908)
+        // if (xml.getChildrenCount()==3)
+        // mapping = Annotation_Mapping.createFromXML(xml.getChild(2));
+        // else
+        // mapping = Annotation_Mapping.createFromXML(xml.getChild(3));
+        // }
+        IProjection proj = null;
+
+        if (xml.contains("proj")) {
+            proj = CRSFactory.getCRS(xml.getStringProperty("proj"));
+        } else {
+            proj = this.getMapContext().getViewPort().getProjection();
+        }
+
+        if (xml.contains("file")) {
+            Driver d;
+
+            try {
+                d = LayerFactory.getDM().getDriver(xml.getStringProperty(
+                            "driverName"));
+            } catch (DriverLoadException e1) {
+                throw new XMLException(e1);
+            }
+
+            FLyrVect lv = (FLyrVect) LayerFactory.createLayer(xml.getName(),
+                    (VectorialFileDriver) d,
+                    new File(xml.getStringProperty("file")), proj);
+
+            try {
+                this.setSource(lv.getSource());
+                this.setRecordset(lv.getRecordset());
+                this.setProjection(lv.getProjection());
+                this.setLegend((VectorialLegend) lv.getLegend());
+                Annotation_Mapping.addAnnotationMapping(this);
+            } catch (DriverException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            } catch (FieldNotFoundException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+
+        //		setInPixels(xml.getBooleanProperty("isInPixels"));
+        // IProjection proj = null;
+        //
+        // if (xml.contains("proj")) {
+        // proj = CRSFactory.getCRS(xml.getStringProperty("proj"));
+        // }
+        // VectorialAdapter adapter=null;
+        // if (xml.contains("file")){
+        // adapter = new VectorialFileAdapter(new File(xml
+        // .getStringProperty("file")));
+        // }else if (xml.contains("db")){
+        // adapter = new VectorialDBAdapter();
+        // }
+        // Driver d;
+        //
+        // try {
+        // d = LayerFactory.getDM().getDriver(
+        // xml.getStringProperty("driverName"));
+        // } catch (DriverLoadException e1) {
+        // throw new XMLException(e1);
+        // }
+        //
+        // adapter.setDriver((VectorialDriver) d);
+        // // TODO Meter esto dentro de la comprobaci�n de si hay memoria
+        // if (false) {
+        // } else {
+        // setSource(adapter);
+        // setProjection(proj);
+        // }
+        // Le asignamos tambi�n una legenda por defecto acorde con
+        // el tipo de shape que tenga. Tampoco s� si es aqu� el
+        // sitio adecuado, pero en fin....
+        /*
+         * if (d instanceof WithDefaultLegend) { WithDefaultLegend aux =
+         * (WithDefaultLegend) d; adapter.start(); setLegend((VectorialLegend)
+         * aux.getDefaultLegend()); adapter.stop(); } else {
+         * setLegend(LegendFactory.createSingleSymbolLegend(getShapeType())); }
+         */
+        super.setXMLEntity(xml);
+
+        // try {
+        // createLabels();
+        // } catch (DriverException e) {
+        // // TODO Auto-generated catch block
+        // e.printStackTrace();
+        // }
+    }
+
+    /**
+     * Esto tiene el fallo de que obligas a una etiqueta por entidad, para
+     * poder evitar esto, una posible soluci�n ser�a que un FLabel pudiera ser
+     * una colecci�n de FLabel (Patr�n Composite)
+     *
+     * @param i
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws com.hardcode.gdbms.engine.data.driver.DriverException DOCUMENT
+     *  ME!
+     * @throws DriverException
+     */
+
+    // private void createLabels() throws DriverException {
+    // SelectableDataSource ds = getRecordset();
+    // FSymbol symbol;
+    // try {
+    // ReadableVectorial adapter = getSource();
+    // adapter.start();
+    // if (isJoined()){
+    // ds.start();
+    // }
+    // int sc;
+    // // El mapping[0] es el text
+    // int fieldId = mapping.getColumnText();
+    // // El mapping[1] es el �ngulo
+    // int idFieldRotationText = mapping.getColumnRotate();
+    // // El mapping[2] es el color
+    // int idFieldColorText = mapping.getColumnColor();
+    // // El mapping[3] es el alto
+    // int idFieldHeightText = mapping.getColumnHeight();
+    // // El mapping[4] es el tipo de fuente
+    // int idFieldTypeFontText = mapping.getColumnTypeFont();
+    // // El mapping[5] es el estilo de fuente
+    // int idFieldStyleFontText = mapping.getColumnStyleFont();
+    //
+    // sc = (int) ds.getRowCount();
+    // m_labels = new ArrayList(sc);
+    // DriverAttributes attr = adapter.getDriverAttributes();
+    // boolean bMustClone = false;
+    // if (attr != null) {
+    // if (attr.isLoadedInMemory()) {
+    // bMustClone = attr.isLoadedInMemory();
+    // }
+    // }
+    // ICoordTrans ct = getCoordTrans();
+    // FSymbol defaultSym = (FSymbol) getLegend().getDefaultSymbol();
+    // for (int i = 0; i < sc; i++) {
+    // IGeometry geom = adapter.getShape(i);
+    //
+    // if (geom == null) {
+    // m_labels.add(null);
+    // continue;
+    // }
+    // if (ct != null) {
+    // if (bMustClone)
+    // geom = geom.cloneGeometry();
+    // geom.reProject(ct);
+    // }
+    //
+    // // TODO: El m�todo contenedor (createLabelLayer) debe recoger
+    // // los par�metros de posicionamiento y de allowDuplicates
+    // // if (i >= 328)
+    // // System.out.println("i= " + i + " " + val.toString());
+    // //ArrayList values=new ArrayList(4);
+    // // String t=new String();
+    // Value val = ds.getFieldValue(i, fieldId);
+    //
+    // //Value total=ValueFactory.createValue((Value[])values.toArray(new
+    // Value[0]));
+    // Value total=getSymbolKey(i);//ValueFactory.createValue(t);
+    // if ((val instanceof NullValue) || (val == null)) {
+    // m_labels.add(null);
+    // continue;
+    // }
+    // FLabel[] lbls = geom.createLabels(0, true);
+    // for (int j = 0; j < lbls.length; j++) {
+    // if (lbls[j] != null) {
+    // lbls[j].setString(val.toString());
+    // if (idFieldRotationText != -1) {
+    // NumericValue rotation = (NumericValue) ds
+    // .getFieldValue(i, idFieldRotationText);
+    // lbls[j].setRotation(rotation.doubleValue());
+    // } else {
+    // lbls[j].setRotation(defaultSym.getRotation());
+    // }
+    //
+    // float height;
+    // if (idFieldHeightText != -1) {
+    // NumericValue h = (NumericValue) ds
+    // .getFieldValue(i, idFieldHeightText);
+    // height=h.floatValue();
+    // lbls[j].setHeight(height);
+    // } else {
+    // height=defaultSym.getFontSize();
+    // lbls[j].setHeight(height);
+    // }
+    //
+    //
+    //
+    // if (aLegend.getSymbolByValue(total)==null){
+    // Color color;
+    // if (idFieldColorText != -1) {
+    // NumericValue c = (NumericValue) ds.getFieldValue(
+    // i, idFieldColorText);
+    // color=new Color(c.intValue());
+    // } else {
+    // color=defaultSym.getFontColor();
+    // }
+    // String typeFont;
+    // if (idFieldTypeFontText != -1) {
+    // StringValue tf = (StringValue) ds
+    // .getFieldValue(i, idFieldTypeFontText);
+    // typeFont=tf.getValue();
+    // } else {
+    // typeFont=defaultSym.getFont().getFontName();
+    // }
+    // int style;
+    // if (idFieldStyleFontText != -1) {
+    // NumericValue sf = (NumericValue) ds
+    // .getFieldValue(i, idFieldStyleFontText);
+    // style=sf.intValue();
+    // } else {
+    // style=defaultSym.getFont().getStyle();
+    // }
+    // symbol=new FSymbol(FConstant.SYMBOL_TYPE_TEXT);
+    // symbol.setFontSizeInPixels(isInPixels());
+    // symbol.setFont(new Font(typeFont,style,(int)height));
+    // symbol.setDescription(lbls[j].getString());
+    // symbol.setFontColor(color);
+    // aLegend.addSymbol(total,symbol);
+    // }
+    //
+    // }
+    // m_labels.add(lbls[j]);
+    //
+    // }
+    // }
+    //
+    // if (this.isJoined()){
+    // ds.stop();
+    // }
+    // adapter.stop();
+    // } catch (DriverIOException e) {
+    // e.printStackTrace();
+    // throw new DriverException(e);
+    // } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+    // e.printStackTrace();
+    // throw new DriverException(e);
+    // }
+    //
+    // }
+    public Value getSymbolKey(int i)
+        throws com.hardcode.gdbms.engine.data.driver.DriverException,
+            DriverException {
+        SelectableDataSource ds = getRecordset();
+        String t = new String();
+        Value val = ds.getFieldValue(i, mapping.getColumnText());
+        t = val.toString();
+
+        // values.add(val);
+        if (mapping.getColumnColor() != -1) {
+            Value valColor = ds.getFieldValue(i, mapping.getColumnColor());
+            t = t.concat(valColor.toString());
+
+            // values.add(valColor);
+        }
+
+        if (mapping.getColumnTypeFont() != -1) {
+            Value valTypeFont = ds.getFieldValue(i, mapping.getColumnTypeFont());
+            t = t.concat(valTypeFont.toString());
+
+            // values.add(valTypeFont);
+        }
+
+        if (mapping.getColumnStyleFont() != -1) {
+            Value valStyleFont = ds.getFieldValue(i,
+                    mapping.getColumnStyleFont());
+            t = t.concat(valStyleFont.toString());
+
+            // values.add(valStyleFont);
+        }
+
+        // Value total=ValueFactory.createValue((Value[])values.toArray(new
+        // Value[0]));
+        Value total = ValueFactory.createValue(t);
+
+        return total;
+    }
+
+    // public FLabel getLabel(int numReg) {
+    // if (m_labels == null || numReg == -1)
+    // return null;
+    // if (getSource() instanceof Annotation_EditableAdapter){
+    // Annotation_EditableAdapter aea=((Annotation_EditableAdapter)getSource());
+    // return aea.getLabel(numReg,false);
+    // }
+    // return (FLabel)m_labels.get(numReg);
+    // }
+    // private FLabel getLabelNew(int numReg) throws DriverException{
+    // SelectableDataSource ds = getRecordset();
+    // FSymbol symbol;
+    // try {
+    // ReadableVectorial adapter = getSource();
+    // adapter.start();
+    // if (isJoined()){
+    // ds.start();
+    // }
+    // int sc;
+    // // El mapping[0] es el text
+    // int fieldId = mapping.getColumnText();
+    // // El mapping[1] es el �ngulo
+    // int idFieldRotationText = mapping.getColumnRotate();
+    // // El mapping[2] es el color
+    // int idFieldColorText = mapping.getColumnColor();
+    // // El mapping[3] es el alto
+    // int idFieldHeightText = mapping.getColumnHeight();
+    // // El mapping[4] es el tipo de fuente
+    // int idFieldTypeFontText = mapping.getColumnTypeFont();
+    // // El mapping[5] es el estilo de fuente
+    // int idFieldStyleFontText = mapping.getColumnStyleFont();
+    //
+    // // sc = (int) ds.getRowCount();
+    // // m_labels = new ArrayList(sc);
+    // // DriverAttributes attr = adapter.getDriverAttributes();
+    // boolean bMustClone = false;
+    // // if (attr != null) {
+    // // if (attr.isLoadedInMemory()) {
+    // // bMustClone = attr.isLoadedInMemory();
+    // // }
+    // // }
+    // ICoordTrans ct = getCoordTrans();
+    // FSymbol defaultSym = (FSymbol) getLegend().getDefaultSymbol();
+    // // for (int i = 0; i < sc; i++) {
+    // IGeometry geom = adapter.getShape(numReg);
+    //
+    // if (geom == null) {
+    // // m_labels.add(null);
+    // return null;
+    // }
+    // if (ct != null) {
+    // if (bMustClone)
+    // geom = geom.cloneGeometry();
+    // geom.reProject(ct);
+    // }
+    //
+    // // TODO: El m�todo contenedor (createLabelLayer) debe recoger
+    // // los par�metros de posicionamiento y de allowDuplicates
+    // // if (i >= 328)
+    // // System.out.println("i= " + i + " " + val.toString());
+    // //ArrayList values=new ArrayList(4);
+    // String t=new String();
+    // Value val = ds.getFieldValue(numReg, fieldId);
+    // t=val.toString();
+    // //values.add(val);
+    // if (idFieldColorText!=-1){
+    // Value valColor=ds.getFieldValue(numReg,idFieldColorText);
+    // t=t.concat(valColor.toString());
+    // //values.add(valColor);
+    // }
+    // if (idFieldTypeFontText!=-1){
+    // Value valTypeFont=ds.getFieldValue(numReg,idFieldTypeFontText);
+    // t=t.concat(valTypeFont.toString());
+    // //values.add(valTypeFont);
+    // }
+    //
+    // if (idFieldStyleFontText!=-1){
+    // Value valStyleFont=ds.getFieldValue(numReg,idFieldStyleFontText);
+    // t=t.concat(valStyleFont.toString());
+    // //values.add(valStyleFont);
+    // }
+    // //Value total=ValueFactory.createValue((Value[])values.toArray(new
+    // Value[0]));
+    // Value total=ValueFactory.createValue(t);
+    // if ((val instanceof NullValue) || (val == null)) {
+    // return null;
+    // }
+    // FLabel[] lbls = geom.createLabels(0, true);
+    // for (int j = 0; j < lbls.length; j++) {
+    // if (lbls[j] != null) {
+    // lbls[j].setString(val.toString());
+    // if (idFieldRotationText != -1) {
+    // NumericValue rotation = (NumericValue) ds
+    // .getFieldValue(numReg, idFieldRotationText);
+    // lbls[j].setRotation(rotation.doubleValue());
+    // } else {
+    // lbls[j].setRotation(defaultSym.getRotation());
+    // }
+    //
+    // float height;
+    // if (idFieldHeightText != -1) {
+    // NumericValue h = (NumericValue) ds
+    // .getFieldValue(numReg, idFieldHeightText);
+    // height=h.floatValue();
+    // lbls[j].setHeight(height);
+    // } else {
+    // height=defaultSym.getFontSize();
+    // lbls[j].setHeight(height);
+    // }
+    //
+    //
+    //
+    // if (aLegend.getSymbolByValue(total)==null){
+    // Color color;
+    // if (idFieldColorText != -1) {
+    // NumericValue c = (NumericValue) ds.getFieldValue(
+    // numReg, idFieldColorText);
+    // color=new Color(c.intValue());
+    // } else {
+    // color=defaultSym.getFontColor();
+    // }
+    // String typeFont;
+    // if (idFieldTypeFontText != -1) {
+    // StringValue tf = (StringValue) ds
+    // .getFieldValue(numReg, idFieldTypeFontText);
+    // typeFont=tf.getValue();
+    // } else {
+    // typeFont=defaultSym.getFont().getFontName();
+    // }
+    // int style;
+    // if (idFieldStyleFontText != -1) {
+    // NumericValue sf = (NumericValue) ds
+    // .getFieldValue(numReg, idFieldStyleFontText);
+    // style=sf.intValue();
+    // } else {
+    // style=defaultSym.getFont().getStyle();
+    // }
+    // symbol=new FSymbol(FConstant.SYMBOL_TYPE_TEXT);
+    // symbol.setFontSizeInPixels(isInPixels());
+    // symbol.setFont(new Font(typeFont,style,(int)height));
+    // symbol.setDescription(lbls[j].getString());
+    // symbol.setFontColor(color);
+    // aLegend.addSymbol(total,symbol);
+    // }
+    //
+    // }
+    // return lbls[j];
+    //
+    // }
+    // // }
+    //
+    // if (this.isJoined()){
+    // ds.stop();
+    // }
+    // adapter.stop();
+    // } catch (DriverIOException e) {
+    // e.printStackTrace();
+    // throw new DriverException(e);
+    // } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+    // e.printStackTrace();
+    // throw new DriverException(e);
+    // }
+    // return null;
+    // }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.iver.cit.gvsig.fmap.layers.layerOperations.RandomVectorialData#createIndex()
+     */
+    public void createSpatialIndex() {
+        // FJP: ESTO HABR� QUE CAMBIARLO. PARA LAS CAPAS SECUENCIALES, TENDREMOS
+        // QUE ACCEDER CON UN WHILE NEXT. (O mejorar lo de los FeatureVisitor
+        // para que acepten recorrer sin geometria, solo con rectangulos.
+        // AZABALA: Como no tengo claro de donde se crean las capas de textos
+        // el �ndice espacial creado seguir� siendo el Quadtree en memoria
+        // de JTS (QuadtreeJts es un adapter a nuestra api de indices)
+        spatialIndex = new QuadtreeJts();
+
+        ReadableVectorial va = getSource();
+        ICoordTrans ct = getCoordTrans();
+        BoundedShapes shapeBounds = (BoundedShapes) va.getDriver();
+
+        try {
+            va.start();
+
+            for (int i = 0; i < va.getShapeCount(); i++) {
+                Rectangle2D r = null;
+                IGeometry geom = va.getShape(i);
+
+                // FSymbol symbol=(FSymbol)aLegend.getSymbol(i);
+                // IGeometry geom=aLegend.getTextWrappingGeometry(symbol,i);
+                // FLabel label=getLabel(i);
+                if (geom != null) {
+                    r = geom.getBounds2D();
+                } else {
+                    r = shapeBounds.getShapeBounds(i);
+                }
+
+                // TODO: MIRAR COMO SE TRAGAR�A ESTO LO DE LAS REPROYECCIONES
+                if (ct != null) {
+                    r = ct.convert(r);
+                }
+
+                if (r != null) {
+                    // Coordinate c1 = new Coordinate(r.getMinX(), r.getMinY());
+                    // Coordinate c2 = new Coordinate(r.getMaxX(), r.getMaxY());
+                    // Envelope env = new Envelope(c1, c2);
+                    // spatialIndex.insert(env, new Integer(i));
+                    spatialIndex.insert(r, i);
+                }
+            } // for
+
+            va.stop();
+        } catch (DriverIOException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @throws DriverException DOCUMENT ME!
+     */
+    public void setSelectedEditing() throws DriverException {
+        FBitSet bitSet = getRecordset().getSelection();
+
+        if (bitSet.cardinality() == 0) {
+            return;
+        }
+
+        indexEditing = bitSet.nextSetBit(0);
+    }
+
+    //	public void setInPixels(boolean b) {
+    //		inPixels = b;
+    //		if (aLegend != null)
+    //			aLegend.setInPixels(b);
+    //	}
+    //
+    //	public boolean isInPixels() {
+    //		return inPixels;
+    //	}
+    public void setInEdition(int i) {
+        indexEditing = i;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public int getInEdition() {
+        return indexEditing;
+    }
+
+    // public ArrayList getLabels() {
+    // return m_labels;
+    // }
+    public void setLegend() {
+        try {
+            getSource().getRecordset().start();
+            aLegend.setFieldName(getSource().getRecordset().getFieldName(mapping.getColumnText()));
+
+            // aLegend.setDefaultSymbol(new
+            // FSymbol(FConstant.SYMBOL_TYPE_TEXT));
+            setLegend(aLegend);
+            getSource().getRecordset().stop();
+        } catch (FieldNotFoundException e) {
+            e.printStackTrace();
+        } catch (DriverException e) {
+            e.printStackTrace();
+        } catch (DriverLoadException e) {
+            e.printStackTrace();
+        } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public Strategy getStrategy() {
+        return strategy;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param b DOCUMENT ME!
+     *
+     * @throws EditionException DOCUMENT ME!
+     */
+    public void setEditing(boolean b) throws EditionException {
+        super.setEditing(b);
+
+        try {
+            if (b) {
+                Annotation_EditableAdapter aea = new Annotation_EditableAdapter(this);
+                aea.setOriginalVectorialAdapter(((VectorialEditableAdapter) super.getSource()).getOriginalAdapter());
+                ((VectorialEditableAdapter) super.getSource()).cancelEdition(EditionEvent.GRAPHIC);
+                aea.start();
+
+                // CHEMA
+                aea.startEdition(EditionEvent.GRAPHIC);
+                setSource(aea);
+                getRecordset().setSelectionSupport(aea.getOriginalAdapter()
+                                                      .getRecordset()
+                                                      .getSelectionSupport());
+            } else {
+                // createLabels();
+            }
+        } catch (DriverIOException e) {
+            throw new EditionException();
+        } catch (DriverLoadException e) {
+            throw new EditionException();
+        } catch (DriverException e) {
+            throw new EditionException();
+        } catch (IOException e) {
+            throw new EditionException();
+        }
+
+        deleteSpatialIndex();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param layer DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws DriverException DOCUMENT ME!
+     * @throws FieldNotFoundException DOCUMENT ME!
+     */
+    public static FLayer createLayerFromVect(FLyrVect layer)
+        throws DriverException, FieldNotFoundException {
+        Annotation_Layer la = new Annotation_Layer();
+        la.setSource(layer.getSource());
+        la.setRecordset(layer.getRecordset());
+        la.setProjection(layer.getProjection());
+        la.setLegend((VectorialLegend) layer.getLegend());
+
+        return la;
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void removingThisLayer() {
+        super.removingThisLayer();
+
+        // m_labels.clear();
+        spatialIndex = null;
+        aLegend = null;
+        strategy = null;
+        System.gc();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param height DOCUMENT ME!
+     * @param description DOCUMENT ME!
+     * @param rotation DOCUMENT ME!
+     * @param numReg DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws DriverIOException DOCUMENT ME!
+     */
+    public IGeometry getTextWrappingGeometry(float height, String description,
+        double rotation, int numReg) throws DriverIOException {
+        ReadableVectorial adapter = getSource();
+
+        // adapter.start();
+        ICoordTrans ct = getCoordTrans();
+        IGeometry geom = adapter.getShape(numReg);
+        boolean bMustClone = false;
+
+        if (geom == null) {
+            return null;
+        }
+
+        if (ct != null) {
+            if (bMustClone) {
+                geom = geom.cloneGeometry();
+            }
+
+            geom.reProject(ct);
+        }
+        Point2D p = null;
+        // FLabel[] lbls = geom.createLabels(0, true);
+        Rectangle2D r=geom.getBounds2D();
+        if (geom.getInternalShape() instanceof FPolygon2D){
+        	r=new Rectangle2D.Double(r.getX()-r.getWidth()/2,r.getY()-r.getHeight()/2,r.getWidth(),r.getHeight());
+        }
+        p=new Point2D.Double(r.getCenterX(),r.getCenterY());
+
+        // assuming FShape is a point with the starting position of the text
+        // Font font = symbol.getFont();
+        double h = height;
+
+        if (((FSymbol) getLegend().getDefaultSymbol()).isFontSizeInPixels()) {
+            h = getMapContext().getViewPort().toMapDistance((int) (height));
+        }
+
+        // else
+        // h=h*FConstant.FONT_HEIGHT_SCALE_FACTOR;
+        Font font = new Font("Arial", 0,
+                (int) (h * FConstant.FONT_HEIGHT_SCALE_FACTOR));
+        FontRenderContext frc = new FontRenderContext(new AffineTransform(),
+                false, true); // g.getFontRenderContext();
+        GlyphVector gv = font.createGlyphVector(frc, description);
+
+        /* p.transform(affineTransform); */
+        Shape shape = gv.getOutline((float) p.getX(), (float) (p.getY() + h));
+
+        IGeometry geomResult = ShapeFactory.createPolygon2D(new GeneralPathX(
+                    shape.getBounds2D()));
+
+        // IGeometry geomResult2 = ShapeFactory.createPolygon2D(new
+        // GeneralPathX(
+        // shape.getBounds2D()));
+        // geomResult2.transform(layer.getMapContext().getViewPort().getAffineTransform());
+        // Rectangle r = geomResult2.getBounds();
+        if (rotation != 0) {
+            geomResult.transform(AffineTransform.getRotateInstance(rotation,
+                    p.getX(), p.getY()));
+        }
+
+        // adapter.stop();
+        // geomResult.transform(layer.getMapContext().getViewPort().getAffineTransform());
+        return geomResult;
+    }
+    public IGeometry getTextWrappingGeometryInPixels(float height, String description,
+            double rotation, int numReg) throws DriverIOException {
+            ReadableVectorial adapter = getSource();
+
+            // adapter.start();
+            ICoordTrans ct = getCoordTrans();
+            IGeometry geom = adapter.getShape(numReg);
+            geom.transform(getMapContext().getViewPort().getAffineTransform());
+            boolean bMustClone = false;
+
+            if (geom == null) {
+                return null;
+            }
+
+            if (ct != null) {
+                if (bMustClone) {
+                    geom = geom.cloneGeometry();
+                }
+
+                geom.reProject(ct);
+            }
+            Point2D p = null;
+            // FLabel[] lbls = geom.createLabels(0, true);
+            Rectangle2D r=geom.getBounds2D();
+            if (geom.getInternalShape() instanceof FPolygon2D){
+            	r=new Rectangle2D.Double(r.getX()-r.getWidth()/2,r.getY()-r.getHeight()/2,r.getWidth(),r.getHeight());
+            }
+            p=new Point2D.Double(r.getCenterX(),r.getCenterY());
+
+            // assuming FShape is a point with the starting position of the text
+            // Font font = symbol.getFont();
+            double h = height;
+
+            if (!((FSymbol) getLegend().getDefaultSymbol()).isFontSizeInPixels()) {
+                h = getMapContext().getViewPort().fromMapDistance((int) (height));
+            }
+
+            // else
+            // h=h*FConstant.FONT_HEIGHT_SCALE_FACTOR;
+            Font font = new Font("Arial", 0,
+                    (int) (h * FConstant.FONT_HEIGHT_SCALE_FACTOR));
+            FontRenderContext frc = new FontRenderContext(new AffineTransform(),
+                    false, true); // g.getFontRenderContext();
+            GlyphVector gv = font.createGlyphVector(frc, description);
+
+            /* p.transform(affineTransform); */
+            Shape shape = gv.getOutline((float) p.getX(), (float) (p.getY() + h));
+
+            IGeometry geomResult = ShapeFactory.createPolygon2D(new GeneralPathX(
+            		shape.getBounds2D()));
+
+            // IGeometry geomResult2 = ShapeFactory.createPolygon2D(new
+            // GeneralPathX(
+            // shape.getBounds2D()));
+            // geomResult2.transform(layer.getMapContext().getViewPort().getAffineTransform());
+            // Rectangle r = geomResult2.getBounds();
+            if (rotation != 0) {
+                geomResult.transform(AffineTransform.getRotateInstance(rotation,
+                        p.getX(), p.getY()));
+            }
+
+            // adapter.stop();
+            // geomResult.transform(layer.getMapContext().getViewPort().getAffineTransform());
+            return geomResult;
+        }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Layer.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/operation/strategies/Annotation_Strategy.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/operation/strategies/Annotation_Strategy.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/operation/strategies/Annotation_Strategy.java	(revision 11783)
@@ -0,0 +1,923 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.fmap.operation.strategies;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.util.List;
+
+import javax.print.attribute.PrintRequestAttributeSet;
+
+import org.cresques.cts.ICoordTrans;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.values.NullValue;
+import com.hardcode.gdbms.engine.values.NumericValue;
+import com.hardcode.gdbms.engine.values.StringValue;
+import com.hardcode.gdbms.engine.values.Value;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.core.FPoint2D;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FConverter;
+import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
+import com.iver.cit.gvsig.fmap.core.v02.FLabel;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.drivers.DriverAttributes;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLyrVect;
+import com.iver.cit.gvsig.fmap.layers.ReadableVectorial;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.fmap.operations.strategies.DefaultStrategy;
+import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
+import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend;
+import com.iver.cit.gvsig.project.documents.view.legend.CreateSpatialIndexMonitorableTask;
+import com.iver.utiles.swing.threads.Cancellable;
+import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.geom.IntersectionMatrix;
+
+
+/**
+ * Esta clase se encargar� de dibujar de la forma m�s eficiente los temas de
+ * anotaciones.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Strategy extends DefaultStrategy {
+    private FSymbol symbolPoint = new FSymbol(FShape.POINT, Color.black);
+    private Annotation_Layer capa;
+    private Geometry geometry;
+    private AffineTransform ati=new AffineTransform();
+    /**
+     * Crea un nuevo AnotationStrategy.
+     *
+     * @param layer
+     */
+    public Annotation_Strategy(FLayer layer) {
+        super(layer);
+        capa = (Annotation_Layer) getCapa();
+        symbolPoint.setSize(5);
+    }
+
+    // /**
+    // * @see
+    // com.iver.cit.gvsig.fmap.operations.LayerOperations#draw(java.awt.image.BufferedImage,
+    // * java.awt.Graphics2D, ISymbol)
+    // */
+    // public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort,
+    // Cancellable cancel) throws DriverException {
+    // Annotation_Legend l = (Annotation_Legend) capa.getLegend();
+    // FSymbol sym = (FSymbol) l.getDefaultSymbol();
+    //
+    // Rectangle2D elExtent = viewPort.getAdjustedExtent();
+    // List lstIndexes=null;
+    //
+    // try {
+    // int sc;
+    // ReadableVectorial source = capa.getSource();
+    // sc=source.getShapeCount();
+    //
+    // SelectableDataSource recordSet = source.getRecordset();
+    // FBitSet bitSet=recordSet.getSelection();
+    // // If area of needed extent is less than fullExtent / 4,
+    // // it will be worthy to use SpatialIndex.
+    // // Otherwhise, we will not use it.
+    // boolean bUseSpatialIndex = false;
+    // if(capa.getISpatialIndex() != null)
+    // {
+    // if(isSpatialIndexNecessary(elExtent)){
+    // lstIndexes = capa.getISpatialIndex().query(elExtent);
+    // sc = lstIndexes.size();
+    // System.out.println("LISTA DEL SPATIALINDEX.SIZE = " + sc);
+    // bUseSpatialIndex = true;
+    // }//if
+    // }//if
+    // FontMetrics metrics = g.getFontMetrics();
+    // Annotation_Mapping mapping = ((Annotation_Layer) capa)
+    // .getMapping();
+    // int idHeightField = mapping.getColumnHeight();
+    // int idFontName = mapping.getColumnTypeFont();
+    // int idFontStyle = mapping.getColumnStyleFont();
+    // int idRotationField = mapping.getColumnRotate();
+    // int idFontColor = mapping.getColumnColor();
+    // int idTextField = mapping.getColumnText();
+    //
+    // double rotation = 0D;
+    // double size = sym.getFont().getSize();
+    // sym.setFontSizeInPixels(((Annotation_Layer)capa).isInPixels());
+    // String fontName = "Dialog";
+    // int fontStyle = sym.getFont().getStyle();
+    // int fontColor = sym.getFontColor().getRGB();
+    // SpatialCache cache = capa.getSpatialCache();
+    // cache.clearAll();
+    // int numOriginal;
+    // for (int numReg = 0; numReg < sc; numReg++) {
+    // if (cancel.isCanceled()){
+    // break;
+    // }
+    // if (bUseSpatialIndex){
+    // Integer idRec = (Integer) lstIndexes.get(numReg);
+    // numOriginal = idRec.intValue();
+    // }else{
+    // numOriginal = numReg;
+    // }
+    // Value[] vv = recordSet.getRow(numOriginal);
+    // if (idHeightField != -1) {
+    // // text size is defined in the table
+    // try {
+    // size = ((NumericValue) vv[idHeightField]).doubleValue()
+    // * FConstant.FONT_HEIGHT_SCALE_FACTOR;
+    // } catch (ClassCastException ccEx) {
+    // if (!NullValue.class.equals(vv[idHeightField]
+    // .getClass())) {
+    // // throw new ReadDriverException("Unknown", ccEx);
+    // }
+    // // a null value
+    // // Logger.getAnonymousLogger().
+    // // warning("Null text height value for text
+    // // '"+vv[idTextField].toString()+"'");
+    // continue;
+    // }
+    // } else {
+    // // otherwise will use the size in the symbol
+    //
+    // }
+    //
+    // // size = CartographicSupportToolkit.
+    // // toScreenUnitYAxis(size,
+    // // unit,
+    // // viewPort
+    // // );
+    //
+    // // if (size <= 3) {
+    // // // label is too small to be readable, will be skipped
+    // // // this speeds up the rendering in wider zooms
+    // // continue;
+    // // }
+    //
+    //
+    // if (idFontName != -1) {
+    // fontName = ((StringValue) vv[idFontName]).toString();
+    // }
+    //
+    //
+    // if (idFontStyle != -1) {
+    // fontStyle = ((NumericValue) vv[idFontStyle]).intValue();
+    // }
+    //
+    //
+    //
+    // if (idRotationField != -1) {
+    // // text rotation is defined in the table
+    // rotation = ((NumericValue) vv[idRotationField])
+    // .doubleValue();
+    // }
+    //
+    //
+    // if (idFontColor != -1) {
+    // // text rotation is defined in the table
+    // fontColor = ((NumericValue) vv[idFontColor]).intValue();
+    // sym.setFontColor(new Color(fontColor));
+    // }
+    //
+    // if (bitSet.get(numOriginal)){
+    // sym = (FSymbol)sym.getSymbolForSelection();
+    // }
+    // IGeometry geom = source.getShape(numOriginal);
+    //
+    // sym.setFont(new Font(fontName, fontStyle, (int) size));
+    //
+    //
+    // // sym.setDescription(vv[idTextField].toString());
+    // // sym.setRotation((int) rotation);
+    // FLabel[] aux = geom.createLabels(0, true);
+    // aux[0].setHeight(size);
+    // aux[0].setRotation((int) rotation);
+    // aux[0].setString(vv[idTextField].toString());
+    // symbolPoint.draw((Graphics2D)g,viewPort.getAffineTransform(),new
+    // FPoint2D(viewPort.fromMapPoint(aux[0].getOrig())));
+    // FGraphicUtilities.DrawAnnotation(g, viewPort
+    // .getAffineTransform(), sym, aux[0], metrics, false);
+    // }
+    //
+    // // System.out.println("..................Fin del dibujado
+    // ..............");
+    // } catch (DriverIOException e) {
+    // e.printStackTrace();
+    // } catch (DriverException e) {
+    // // TODO Auto-generated catch block
+    // e.printStackTrace();
+    // }
+    // heightDefault=-1;
+    // }
+    public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort,
+        Cancellable cancel) {
+//        geometry=null;
+        BufferedImage bi=new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB);
+        Graphics2D gBi=(Graphics2D)bi.getGraphics();
+        // Copia draw AttrInTableLabeling
+        Annotation_Legend l = (Annotation_Legend) capa.getLegend();
+        FSymbol sym = (FSymbol) l.getDefaultSymbol();
+
+        try {
+            ReadableVectorial source = capa.getSource();
+
+            // limit the labeling to the visible extent
+            FBitSet bs = capa.queryByRect(viewPort.getAdjustedExtent());
+
+            SelectableDataSource recordSet = source.getRecordset();
+            FBitSet bitSet = recordSet.getSelection();
+            FontMetrics metrics = g.getFontMetrics();
+            Annotation_Mapping mapping = ((Annotation_Layer) capa).getAnnotatonMapping();
+            int idHeightField = mapping.getColumnHeight();
+            int idFontName = mapping.getColumnTypeFont();
+            int idFontStyle = mapping.getColumnStyleFont();
+            int idRotationField = mapping.getColumnRotate();
+            int idFontColor = mapping.getColumnColor();
+            int idTextField = mapping.getColumnText();
+
+            double rotation = 0D;
+            float size = sym.getFont().getSize();
+
+            //			sym.setFontSizeInPixels(((Annotation_Layer) capa).isInPixels());
+            String fontName = "Dialog";
+            int fontStyle = sym.getFont().getStyle();
+            int fontColor = sym.getFontColor().getRGB();
+            long t1 = System.currentTimeMillis();
+            for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
+                if (cancel.isCanceled()) {
+                    break;
+                }
+
+                Value[] vv = recordSet.getRow(i);
+
+                if (idHeightField != -1) {
+                    // text size is defined in the table
+                    try {
+                        size = (float)(((NumericValue) vv[idHeightField]).doubleValue() * FConstant.FONT_HEIGHT_SCALE_FACTOR);
+                    } catch (ClassCastException ccEx) {
+                        if (!NullValue.class.equals(
+                                    vv[idHeightField].getClass())) {
+                            // throw new ReadDriverException("Unknown", ccEx);
+                        }
+
+                        // a null value
+                        // Logger.getAnonymousLogger().
+                        // warning("Null text height value for text
+                        // '"+vv[idTextField].toString()+"'");
+                        continue;
+                    }
+                } else {
+                    // otherwise will use the size in the symbol
+                }
+
+                // size = CartographicSupportToolkit.
+                // toScreenUnitYAxis(size,
+                // unit,
+                // viewPort
+                // );
+                // if (size <= 3) {
+                // // label is too small to be readable, will be skipped
+                // // this speeds up the rendering in wider zooms
+                // continue;
+                // }
+                if (idFontName != -1) {
+                    fontName = ((StringValue) vv[idFontName]).toString();
+                }
+
+                if (idFontStyle != -1) {
+                    fontStyle = ((NumericValue) vv[idFontStyle]).intValue();
+                }
+
+                if (idRotationField != -1) {
+                    // text rotation is defined in the table
+                    rotation = ((NumericValue) vv[idRotationField]).doubleValue();
+                }
+
+                if (idFontColor != -1) {
+                    // text rotation is defined in the table
+                    fontColor = ((NumericValue) vv[idFontColor]).intValue();
+                    sym.setFontColor(new Color(fontColor));
+                }
+
+                if (bitSet.get(i)) {
+                    sym = (FSymbol) sym.getSymbolForSelection();
+                }
+
+                sym.setFont(new Font(fontName, fontStyle, (int) size));
+
+                if (!sym.isFontSizeInPixels()){
+                	Rectangle2D r=capa.getTextWrappingGeometry(size,vv[idTextField].toString(),rotation,i).getBounds2D();
+	                Rectangle2D rPixels=viewPort.fromMapRectangle(r);
+	                FPoint2D fp=new FPoint2D(r.getX(),r.getY());
+	                FPoint2D fpPixels=new FPoint2D(rPixels.getX(),rPixels.getY());
+	                rPixels.setRect(rPixels.getX(),rPixels.getY()-rPixels.getHeight(),rPixels.getWidth(),rPixels.getHeight());
+	                if (l.isOverWrite() || isTrasparent(bi,rPixels)){
+	                    FLabel[] aux = new FLabel[]{new FLabel()};//geom.createLabels(0, true);
+	                    aux[0].setOrig(new Point2D.Double(fp.getX(),fp.getY()));
+	                    aux[0].setHeight(size);
+	                    aux[0].setRotation((int) rotation);
+	                    aux[0].setString(vv[idTextField].toString());
+
+	                    if (sym.isShapeVisible()) {
+	                        symbolPoint.draw(gBi,
+	                               viewPort.getAffineTransform(),
+	                               fpPixels);
+	                    }
+//	                    g.drawRect((int)rPixels.getX(),(int)rPixels.getY(),(int)rPixels.getWidth(),(int)rPixels.getHeight());
+	                    FGraphicUtilities.DrawAnnotation(gBi,
+	                            viewPort.getAffineTransform(), sym, aux[0], metrics, false);
+	                }
+                }else{
+	                Rectangle2D r=capa.getTextWrappingGeometryInPixels(size,vv[idTextField].toString(),rotation,i).getBounds2D();
+	                Rectangle2D rPixels=r;//capa.getMapContext().getViewPort().fromMapRectangle(r);
+	                FPoint2D fp=new FPoint2D(rPixels.getX(),rPixels.getY());
+	                rPixels.setRect(rPixels.getX(),rPixels.getY()-rPixels.getHeight(),rPixels.getWidth(),rPixels.getHeight());
+	                if (l.isOverWrite() || isTrasparent(bi,rPixels)){
+	                    FLabel[] aux = new FLabel[]{new FLabel()};//geom.createLabels(0, true);
+	                    aux[0].setOrig(new Point2D.Double(fp.getX(),fp.getY()));
+	                    aux[0].setHeight(size);
+	                    aux[0].setRotation((int) rotation);
+	                    aux[0].setString(vv[idTextField].toString());
+
+	                    if (sym.isShapeVisible()) {
+	                        symbolPoint.draw(gBi,
+	                               ati,
+	                               fp);
+	                    }
+//	                    g.drawRect((int)rPixels.getX(),(int)rPixels.getY(),(int)rPixels.getWidth(),(int)rPixels.getHeight());
+	                    FGraphicUtilities.DrawAnnotation(gBi,
+	                            ati, sym, aux[0], metrics, false);
+
+	                }
+                }
+                //Al dibujar esta imagen sobre el graphics la trasparencia no puede existir.
+                if (i%1000==0){
+                	 g.drawImage(bi,0,0,null);
+                }
+            }
+            g.drawImage(bi,0,0,null);
+            System.err.println(System.currentTimeMillis()-t1+"millis");
+
+        } catch (Exception e) {
+            // Logger.getAnonymousLogger().log(Level.SEVERE, "Could not get the
+            // layer extent.\n" +
+            // e.getMessage());
+            e.printStackTrace();
+        }
+
+        // }
+    }
+
+    // /**
+    // * @see
+    // com.iver.cit.gvsig.fmap.operations.LayerOperations#draw(java.awt.image.BufferedImage,
+    // * java.awt.Graphics2D, ISymbol)
+    // */
+    // public void print(BufferedImage image, Graphics2D g, ViewPort viewPort,
+    // Cancellable cancel) throws DriverException {
+    //
+    // // Rectangle2D elExtent = viewPort.getAdjustedExtent();
+    // // graphics=g;
+    // // Annotation_Layer lyrAnnotation=(Annotation_Layer)capa;
+    // // List lstIndexes=null;
+    // //
+    // // VectorialLegend l=(VectorialLegend)lyrAnnotation.getLegend();
+    // // FBitSet bitSet=lyrAnnotation.getRecordset().getSelection();
+    // //
+    // // boolean inPixels=lyrAnnotation.isInPixels();
+    // // FSymbol theSymbol = (FSymbol) l.getDefaultSymbol();
+    // // theSymbol.setFontSizeInPixels(inPixels);
+    // // this.viewPort=viewPort;//capa.getFMap().getViewPort();
+    // // AffineTransform at=viewPort.getAffineTransform();
+    // // try {
+    // // int sc;
+    // // sc=lyrAnnotation.getSource().getShapeCount();
+    // // // If area of needed extent is less than fullExtent / 4,
+    // // // it will be worthy to use SpatialIndex.
+    // // // Otherwhise, we will not use it.
+    // // boolean bUseSpatialIndex = false;
+    // // if(lyrAnnotation.getISpatialIndex() != null)
+    // // {
+    // // if(isSpatialIndexNecessary(elExtent)){
+    // // lstIndexes = lyrAnnotation.getISpatialIndex().query(elExtent);
+    // // sc = lstIndexes.size();
+    // // bUseSpatialIndex = true;
+    // // }//if
+    // // }//if
+    // //
+    // // FontMetrics metrics = g.getFontMetrics();
+    // // //SpatialCache cache = lyrAnnotation.createSpatialCache();
+    // // int numOriginal;
+    // // for (int numReg = 0; numReg < sc; numReg++) {
+    // // if (cancel.isCanceled()){
+    // // break;
+    // // }
+    // // if (bUseSpatialIndex){
+    // // Integer idRec = (Integer) lstIndexes.get(numReg);
+    // // numOriginal = idRec.intValue();
+    // // }else{
+    // // numOriginal = numReg;
+    // // }
+    // // /* if (lyrAnnotation.getSource() instanceof EditableAdapter)
+    // //
+    // numOriginal=((EditableAdapter)lyrAnnotation.getSource()).getCalculatedIndex(numOriginal);*/
+    // //
+    // // FLabel theLabel = lyrAnnotation.getLabel(numOriginal);
+    // // if ((theLabel == null) || (theLabel.getOrig() == null))
+    // // continue;
+    // //
+    // //
+    // // Rectangle2D r=null;
+    // // if (inPixels && lyrAnnotation.getMapping().getColumnHeight()==-1) {
+    // //
+    // r=getDefaultBoundBoxinPixels(metrics,theLabel.getOrig(),theLabel.getString());
+    // // }else {
+    // // r=getBoundBox(theLabel.getOrig(),(float)theLabel.getHeight(),
+    // theLabel.getJustification(),theLabel.getString());
+    // // }
+    // // theLabel.setBoundBox(r);
+    // //
+    // // if (elExtent.intersects(r))
+    // // {
+    // // FPoint2D p=new FPoint2D(viewPort.fromMapPoint(new
+    // Point2D.Double(r.getX(),r.getY())));
+    // // FGraphicUtilities.DrawShape(g,at,p,symbolPoint);
+    // // if (bitSet.get(numOriginal)) {
+    // // FGraphicUtilities.DrawAnnotation(g, at, theSymbol,
+    // theLabel,metrics,true);
+    // // }else{
+    // // FGraphicUtilities.DrawAnnotation(g, at, theSymbol,
+    // theLabel,metrics,false);
+    // // }
+    // //
+    // //
+    // // } // XIntersects
+    // //
+    // //
+    // // }
+    // //
+    // // } catch (DriverIOException e) {
+    // // e.printStackTrace();
+    // // }
+    // // heightDefault=-1;
+    // }
+    // public Rectangle2D getDefaultBoundBoxinPixels(FontMetrics metrics,
+    // Point2D p, String s) {
+    // int w = metrics.stringWidth(s);
+    // double width = viewPort.toMapDistance(w);
+    // if (heightDefault == -1) {
+    // int h = metrics.getMaxAscent();
+    // heightDefault = viewPort.toMapDistance(h);
+    // }
+    // return new Rectangle2D.Double(p.getX(), p.getY(), width, heightDefault);
+    //
+    // }
+
+    private boolean isTrasparent(BufferedImage bi, Rectangle2D rPixels) {
+        for (int i=(int)rPixels.getX();i<rPixels.getMaxX();i++){
+            for (int j=(int)rPixels.getY();j<rPixels.getMaxY();j++){
+                if (i<0 || j<0 || bi.getWidth()<i+1 || bi.getHeight()<j+1)
+                    continue;
+//                try{
+                if (bi.getRGB(i,j)!=0){
+                    return false;
+                }
+//                }catch (Exception e) {
+//					System.err.println("X= "+i+", Y= "+j);
+//				}
+            }
+        }
+//        System.err.println("imageX= "+bi.getWidth()+", imageY= "+bi.getHeight());
+//    	if (bi.getRGB((int)rPixels.getX(),(int)rPixels.getY())!=0){
+//			return false;
+//		}
+//		if (bi.getRGB((int)rPixels.getCenterX(),(int)rPixels.getCenterY())!=0){
+//			return false;
+//		}
+//		if (bi.getRGB((int)rPixels.getMaxX(),(int)rPixels.getMaxY())!=0){
+//			return false;
+//		}
+//		if (bi.getRGB((int)rPixels.getMaxX(),(int)rPixels.getMinY())!=0){
+//			return false;
+//		}
+//		if (bi.getRGB((int)rPixels.getMinX(),(int)rPixels.getMaxY())!=0){
+//			return false;
+//		}
+
+        return true;
+    }
+
+    /**
+     * Construcci�n del rect�ngulo
+     *
+     * @param g DOCUMENT ME!
+     * @param relationship
+     *
+     * @return
+     *
+     * @throws DriverException DOCUMENT ME!
+     * @throws VisitException DOCUMENT ME!
+     */
+
+    // public Rectangle2D getBoundBox(Point2D p, float hp,
+    // int justification,String s) {
+    // //Rectangle2D bounding=null;
+    // if (((Annotation_Layer)capa).isInPixels()){
+    // graphics.setFont(graphics.getFont().deriveFont(hp));
+    // }else{
+    // float alturaPixels = (float) ((hp *
+    // viewPort.getAffineTransform().getScaleX())*FConstant.FONT_HEIGHT_SCALE_FACTOR);
+    // graphics.setFont(graphics.getFont().deriveFont(alturaPixels));
+    // }
+    // FontMetrics metrics = graphics.getFontMetrics();
+    // int w = metrics.stringWidth(s);
+    // double width = viewPort.toMapDistance(w);
+    // int h = metrics.getMaxAscent();
+    // double height = viewPort.toMapDistance(h);
+    // //double dist = viewPort.toMapDistance(3);
+    // return new Rectangle2D.Double(p.getX(), p.getY(), width, height);
+    // /* switch (justification) {
+    // case FLabel.LEFT_BOTTOM:
+    // bounding=justification(p, width,height, 0, 0);
+    //
+    // break;
+    //
+    // case FLabel.LEFT_CENTER:
+    // bounding=justification(p, width,height, 0, -(height / 2));
+    //
+    // break;
+    //
+    // case FLabel.LEFT_TOP:
+    // bounding=justification(p,width,height, 0, -height);
+    //
+    // break;
+    //
+    // case FLabel.CENTER_BOTTOM:
+    // bounding=justification(p, width,height, -(width / 2), -dist);
+    //
+    // break;
+    //
+    // case FLabel.CENTER_CENTER:
+    // bounding=justification(p, width,height, -(width / 2), -(height / 2));
+    //
+    // break;
+    //
+    // case FLabel.CENTER_TOP:
+    // bounding=justification(p, width,height, -(width / 2), -height);
+    //
+    // break;
+    //
+    // case FLabel.RIGHT_BOTTOM:
+    // bounding=justification(p, width,height, -width, -dist);
+    //
+    // break;
+    //
+    // case FLabel.RIGHT_CENTER:
+    // bounding=justification(p, width,height, -width, -(height / 2));
+    //
+    // break;
+    //
+    // case FLabel.RIGHT_TOP:
+    // bounding=justification(p, width,height, -width, -height);
+    //
+    // break;
+    // }
+    //
+    // return bounding;
+    // */
+    // }
+
+    /*
+     * private Rectangle2D justification(Point2D p, double w,double h, double x,
+     * double y) { Rectangle2D r=new Rectangle2D.Double(p.getX() + x, p.getY() -
+     * y, w, h); return r; }
+     */
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#queryByShape(com.iver.cit.gvsig.fmap.core.IGeometry,
+     *      int)
+     */
+    public FBitSet queryByShape(IGeometry g, int relationship)
+        throws DriverException, VisitException {
+        // Si hay un �ndice espacial, lo usamos para hacer el query.
+        FLyrVect lyr = (FLyrVect) capa;
+
+        // if (lyr.getSpatialIndex() == null)
+        if (lyr.getISpatialIndex() == null) {
+            return super.queryByShape(g, relationship);
+        }
+
+        long t1 = System.currentTimeMillis();
+        ReadableVectorial va = lyr.getSource();
+        ICoordTrans ct = lyr.getCoordTrans();
+        Rectangle2D bounds = g.getBounds2D();
+
+        // Coordinate c1 = new Coordinate(bounds.getMinX(), bounds.getMinY());
+        // Coordinate c2 = new Coordinate(bounds.getMaxX(), bounds.getMaxY());
+        // Envelope env = new Envelope(c1, c2);
+        // List lstRecs = lyr.getSpatialIndex().query(env);
+        List lstRecs = lyr.getISpatialIndex().query(bounds);
+        Integer idRec;
+        FBitSet bitset = new FBitSet();
+        Geometry jtsShape = g.toJTSGeometry();
+        IntersectionMatrix m;
+        int index;
+
+        try {
+            va.start();
+
+            // Annotation_Legend aLegend=(Annotation_Legend)capa.getLegend();
+            for (int i = 0; i < lstRecs.size(); i++) {
+                idRec = (Integer) lstRecs.get(i);
+                index = idRec.intValue();
+
+                IGeometry geom = va.getShape(index);
+
+                // FSymbol symbol=(FSymbol)aLegend.getSymbol(index);
+                // IGeometry geom=aLegend.getTextWrappingGeometry(symbol,index);
+                // IGeometry
+                // geom=getGeometry(((Annotation_Layer)capa).getLabel(index).getBoundBox());
+                if (ct != null) {
+                    geom.reProject(ct);
+                }
+
+                Geometry jtsGeom = geom.toJTSGeometry();
+
+                switch (relationship) {
+                case CONTAINS:
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isContains()) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+
+                case CROSSES:
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isCrosses(jtsGeom.getDimension(),
+                                jtsShape.getDimension())) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+
+                case DISJOINT:
+
+                    // TODO: CREO QUE EL DISJOINT NO SE PUEDE METER AQUI
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isDisjoint()) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+
+                case EQUALS:
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isEquals(jtsGeom.getDimension(),
+                                jtsShape.getDimension())) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+
+                case INTERSECTS:
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isIntersects()) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+
+                case OVERLAPS:
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isOverlaps(jtsGeom.getDimension(),
+                                jtsShape.getDimension())) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+
+                case TOUCHES:
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isTouches(jtsGeom.getDimension(),
+                                jtsShape.getDimension())) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+
+                case WITHIN:
+                    m = jtsShape.relate(jtsGeom);
+
+                    if (m.isWithin()) {
+                        bitset.set(index, true);
+                    }
+
+                    break;
+                }
+            }
+
+            va.stop();
+        } catch (DriverIOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        long t2 = System.currentTimeMillis();
+
+        // logger.debug("queryByShape optimizado sobre la capa " + lyr.getName()
+        // + ". " + (t2-t1) + " mseg.");
+        return bitset;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param rect DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws DriverException DOCUMENT ME!
+     */
+    public FBitSet queryByRect(Rectangle2D rect) throws DriverException {
+        // Si hay un �ndice espacial, lo usamos para hacer el query.
+        Annotation_Layer lyr = (Annotation_Layer) capa;
+        ReadableVectorial va = lyr.getSource();
+        ICoordTrans ct = lyr.getCoordTrans();
+        Rectangle2D bounds = rect;
+        // if (lyr.getSpatialIndex() == null)
+        if (lyr.getISpatialIndex() == null) {
+            return super.queryByRect(rect);
+        }
+        // Coordinate c1 = new Coordinate(bounds.getMinX(), bounds.getMinY());
+        // Coordinate c2 = new Coordinate(bounds.getMaxX(), bounds.getMaxY());
+        // Envelope env = new Envelope(c1, c2);
+        //
+        // List lstRecs = lyr.getSpatialIndex().query(env);
+        // azabala
+        List lstRecs = lyr.getISpatialIndex().query(bounds);
+        Integer idRec;
+        FBitSet bitset = new FBitSet();
+        int index;
+
+        try {
+            va.start();
+
+            DriverAttributes attr = va.getDriverAttributes();
+            boolean bMustClone = false;
+
+            if (attr != null) {
+                if (attr.isLoadedInMemory()) {
+                    bMustClone = attr.isLoadedInMemory();
+                }
+            }
+
+            // Annotation_Legend aLegend=(Annotation_Legend)capa.getLegend();
+            for (int i = 0; i < lstRecs.size(); i++) {
+                idRec = (Integer) lstRecs.get(i);
+                index = idRec.intValue();
+
+                Annotation_Mapping mapping = ((Annotation_Layer) capa).getAnnotatonMapping();
+                NumericValue vRotation = (NumericValue) va.getRecordset()
+                                                          .getFieldValue(index,
+                        mapping.getColumnRotate());
+                NumericValue vHeight = (NumericValue) va.getRecordset()
+                                                        .getFieldValue(index,
+                        mapping.getColumnHeight());
+                Value vText = va.getRecordset().getFieldValue(index,
+                        mapping.getColumnText());
+                IGeometry geom = ((Annotation_Layer) capa).getTextWrappingGeometry(vHeight.floatValue(),
+                        vText.toString(), vRotation.doubleValue(), index);
+
+                if (ct != null) {
+                    if (bMustClone) {
+                        geom = geom.cloneGeometry();
+                    }
+
+                    geom.reProject(ct);
+                }
+
+                if (geom.intersects(rect)) {
+                    bitset.set(index, true);
+                }
+            }
+
+            va.stop();
+        } catch (DriverIOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (DriverLoadException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        return bitset;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#queryByPoint(java.awt.geom.Point2D,
+     *      double)
+     */
+    public FBitSet queryByPoint(Point2D p, double tolerance)
+        throws DriverException {
+        // TODO: OJO!!!!. Est� implementado como un rectangulo.
+        // Lo correcto deber�a ser calculando las distancias reales
+        // es decir, con un c�rculo.
+        Rectangle2D recPoint = new Rectangle2D.Double(p.getX() -
+                (tolerance / 2), p.getY() - (tolerance / 2), tolerance,
+                tolerance);
+
+        return queryByRect(recPoint);
+    }
+
+    // private IGeometry getGeometry(Rectangle2D r){
+    // GeneralPathX resul = new GeneralPathX();
+    // Point2D[] vs=new Point2D[4];
+    // vs[0]=new Point2D.Double(r.getX(),r.getY());
+    // vs[1]=new Point2D.Double(r.getMaxX(),r.getY());
+    // vs[2]=new Point2D.Double(r.getMaxX(),r.getMaxY());
+    // vs[3]=new Point2D.Double(r.getX(),r.getMaxY());
+    // //vs[4]=new Point2D.Double(r.getX(),r.getY());
+    // for (int i = 0; i < vs.length; i++) {
+    // if (i == 0) {
+    // resul.moveTo(vs[i].getX(),vs[i].getY());
+    // } else {
+    // resul.lineTo(vs[i].getX(),vs[i].getY());
+    // }
+    // }
+    // resul.closePath();
+    // return ShapeFactory.createPolygon2D(resul);
+    // }
+    public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
+        PrintRequestAttributeSet properties) throws DriverException {
+        capa.beforePrinting(properties);
+        draw(null, g, viewPort, cancel);
+        capa.afterPrinting();
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/operation/strategies/Annotation_Strategy.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/edition/Annotation_EditableAdapter.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/edition/Annotation_EditableAdapter.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/edition/Annotation_EditableAdapter.java	(revision 11783)
@@ -0,0 +1,741 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.fmap.edition;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.values.NumericValue;
+import com.hardcode.gdbms.engine.values.Value;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.DriverIOExceptionType;
+import com.iver.cit.gvsig.fmap.DriverNotLoadedExceptionType;
+import com.iver.cit.gvsig.fmap.core.DefaultFeature;
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.IFeature;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.IRow;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.core.v02.FConverter;
+import com.iver.cit.gvsig.fmap.core.v02.FLabel;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.fmap.rendering.Legend;
+import com.vividsolutions.jts.geom.Envelope;
+
+
+/**
+ * Annotation Editable Adapter
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_EditableAdapter extends VectorialEditableAdapter {
+    private ArrayList labels;
+    private Annotation_Mapping mapping;
+    private Legend legend;
+
+    //	private boolean isInPixels = true;
+    private Annotation_Layer lyrAnnotation;
+    private LabelExpansion labelExpansion = new LabelExpansion();
+    private boolean isToSave = false;
+
+    // public int doAddRow(IRow feat, int sourceType) throws DriverIOException,
+    // IOException {
+    // boolean cancel = fireBeforeRowAdded(sourceType);
+    // if (cancel)
+    // return -1;
+    // Value[] values=feat.getAttributes();
+    // values[mapping.getColumnText()]=ValueFactory.createValue("New");
+    // FLabel label=createLabel(feat);
+    // //Rectangle2D r=((DefaultFeature)feat).getGeometry().getBounds2D();
+    // //r.setRect(r.getX()-r.getWidth()*4,r.getY()-r.getHeight()*4,r.getWidth()*10,r.getHeight()*4);
+    // //label.setBoundBox(r);
+    // Annotation_Strategy strategy =
+    // (Annotation_Strategy)lyrAnnotation.getStrategy();
+    // Rectangle2D
+    // r=strategy.getBoundBox(label.getOrig(),(float)label.getHeight(),label.getJustification(),label.getString());
+    // label.setBoundBox(r);
+    // IGeometry geom=getGeometry(label.getBoundBox());
+    // feat=new DefaultFeature(geom,values,feat.getID());
+    //
+    // ///lyrAnnotation.deleteSpatialIndex();
+    //
+    // int calculatedIndex = -1;
+    // calculatedIndex = (int) getRowCount()+delRows.cardinality() ;
+    //
+    // int pos = expansionFile.addRow(feat, IRowEdited.STATUS_ADDED,
+    // actualIndexFields);
+    // labelExpansion.addLabel(label);
+    // relations.put(new Integer(calculatedIndex), new Integer(pos));
+    // numAdd++;
+    //
+    // index.insert(new Envelope(r.getX(), r.getX() + r.getWidth(), r.getY(),
+    // r.getY() + r.getHeight()), new Integer(calculatedIndex));
+    // //lyrAnnotation.getFMap().invalidate();
+    // fireAfterRowAdded(feat,calculatedIndex, sourceType);
+    // return calculatedIndex;
+    // }
+    // public int doModifyRow(int calculatedIndex, IRow feat,int sourceType)
+    // throws IOException, DriverIOException {
+    // boolean cancel = fireBeforeModifyRow(feat,calculatedIndex, sourceType);
+    // if (cancel)
+    // return -1;
+    // int posAnteriorInExpansionFile = -1;
+    // Integer integer = new Integer(calculatedIndex);
+    //
+    // // System.err.println("Modifica una Row en la posici�n: "
+    // // + calculatedIndex);
+    // // Si la geometr�a no ha sido modificada
+    // if (!relations.containsKey(integer)) {
+    // FLabel label=(FLabel)getLabel(calculatedIndex,true).clone();
+    // Value value=feat.getAttribute(mapping.getColumnText());
+    // Rectangle2D rLabelAnt=(Rectangle2D)label.getBoundBox().clone();
+    // label.setString(value.toString());
+    //
+    // if (mapping.getColumnRotate()==mapping.getColumnText()){
+    // label.setRotation(((NumericValue)value).doubleValue());
+    // } //Aqu� hay que comprobar, si se quiere, el resto de columnas, si son
+    // iguales a la de Texto.
+    //
+    //
+    // int newPosition = expansionFile.addRow(feat, IRowEdited.STATUS_MODIFIED,
+    // actualIndexFields);
+    // relations.put(integer, new Integer(newPosition));
+    //
+    // // Se actualiza el �ndice espacial
+    // IGeometry g=((IFeature) feat).getGeometry();
+    // double[] d=new double[4];
+    // //Rectangle2D r = g.getBounds2D();
+    // g.getPathIterator(null).currentSegment(d);
+    // Point2D p=new Point2D.Double(d[0],d[1]);
+    // label.setBoundBox(new
+    // Rectangle2D.Double(p.getX(),p.getY(),rLabelAnt.getWidth(),rLabelAnt.getHeight()));
+    // Rectangle2D rLabel=(Rectangle2D)label.getBoundBox();
+    // label.setOrig(p);
+    // index.remove(new Envelope(rLabelAnt.getX(), rLabelAnt.getX()
+    // + rLabelAnt.getWidth(), rLabelAnt.getY(), rLabelAnt.getY()
+    // + rLabelAnt.getHeight()), new Integer(calculatedIndex));
+    // index.insert(new Envelope(rLabel.getX(), rLabel.getX() +
+    // rLabel.getWidth(), rLabel
+    // .getY(), rLabel.getY() + rLabel.getHeight()), new Integer(
+    // calculatedIndex));
+    // labelExpansion.addLabel(label);
+    // } else {
+    // FLabel label=(FLabel)labelExpansion.getLabel(((Integer)relations.get(new
+    // Integer(calculatedIndex))).intValue()).clone();
+    // Value value=feat.getAttribute(mapping.getColumnText());
+    // Rectangle2D rLabelAnt=(Rectangle2D)label.getBoundBox().clone();
+    // label.setString(value.toString());
+    //
+    // if (mapping.getColumnRotate()==mapping.getColumnText()){
+    // label.setRotation(((NumericValue)value).doubleValue());
+    // } //Aqu� hay que comprobar, si se quiere, el resto de columnas, si son
+    // iguales a la de Texto.
+    //
+    //
+    // // Obtenemos el �ndice en el fichero de expansi�n
+    // int num = ((Integer) relations.get(integer)).intValue();
+    // posAnteriorInExpansionFile = num;
+    //
+    // /*
+    // * Se modifica la geometr�a y nos guardamos el �ndice dentro del
+    // * fichero de expansi�n en el que se encuentra la geometr�a
+    // * modificada
+    // */
+    // num = expansionFile.modifyRow(num, feat, actualIndexFields);
+    //
+    // /*
+    // * Actualiza la relaci�n del �ndice de la geometr�a al �ndice en el
+    // * fichero de expansi�n.
+    // */
+    // relations.put(integer, new Integer(num));
+    //
+    // Rectangle2D r = ((IFeature) feat).getGeometry().getBounds2D();
+    //
+    // Point2D p=new Point2D.Double(r.getX(),r.getY());
+    //
+    // label.setBoundBox(new
+    // Rectangle2D.Double(p.getX(),p.getY()+rLabelAnt.getHeight(),rLabelAnt.getWidth(),rLabelAnt.getHeight()));
+    // Rectangle2D rLabel=(Rectangle2D)label.getBoundBox();
+    // label.setOrig(p);
+    // index.remove(new Envelope(rLabelAnt.getX(), rLabelAnt.getX()
+    // + rLabelAnt.getWidth(), rLabelAnt.getY(), rLabelAnt.getY()
+    // + rLabelAnt.getHeight()), new Integer(calculatedIndex));
+    // index.insert(new Envelope(rLabel.getX(), rLabel.getX() +
+    // rLabel.getWidth(), rLabel
+    // .getY(), rLabel.getY() + rLabel.getHeight()), new Integer(
+    // calculatedIndex));
+    // labelExpansion.modifyLabel(num,label);
+    // }
+    // fireAfterModifyRow(calculatedIndex,sourceType);
+    // return posAnteriorInExpansionFile;
+    // }
+    // public IRow doRemoveRow(int index,int sourceType) throws
+    // DriverIOException, IOException {
+    // boolean cancel = fireBeforeRemoveRow(index, sourceType);
+    // if (cancel)
+    // return null;
+    // //Llega el calculatedIndex
+    // Integer integer = new Integer(index);
+    //
+    // IFeature feat = null;
+    //
+    // FLabel label=getLabel(index,true);
+    // delRows.set(index, true);
+    // //Si la geometr�a no ha sido modificada
+    // if (!relations.containsKey(integer)) {
+    //
+    // try {
+    // feat = (DefaultFeature) (ova.getFeature(index));
+    // } catch (DriverException e) {
+    // throw new DriverIOException(e);
+    // }
+    // } else {
+    // int num = ((Integer) relations.get(integer)).intValue();
+    // feat = (IFeature) expansionFile.getRow(num).getLinkedRow();
+    // }
+    // System.err.println("Elimina una Row en la posici�n: " + index);
+    // //Se actualiza el �ndice
+    // if (feat != null) {
+    // Rectangle2D r = label.getBoundBox();
+    // this.index.remove(new Envelope(r.getX(), r.getX() + r.getWidth(),
+    // r.getY(), r.getY() + r.getHeight()), new Integer(index));
+    // }
+    // setSelection(new FBitSet());
+    // fireAfterRemoveRow(index, sourceType);
+    // return feat;
+    // }
+    // public void undoAddRow(int calculatedIndex, int sourceType) throws
+    // DriverIOException, IOException {
+    // boolean cancel = fireBeforeRemoveRow(calculatedIndex, sourceType);
+    // if (cancel)
+    // return;
+    // Rectangle2D r = getLabel(calculatedIndex,true).getBoundBox();
+    // this.index.remove(new Envelope(r.getX(), r.getX() + r.getWidth(),
+    // r.getY(), r.getY() + r.getHeight()), new Integer(calculatedIndex));
+    // expansionFile.deleteLastRow();
+    // relations.remove(new Integer(calculatedIndex));
+    // numAdd--;
+    // setSelection(new FBitSet());
+    // labelExpansion.deleteLastLabel();
+    // fireAfterRemoveRow(calculatedIndex, sourceType);
+    // }
+    // public void undoModifyRow(int calculatedIndex, int
+    // previousExpansionFileIndex, int sourceType) throws IOException,
+    // DriverIOException {
+    //
+    // if (previousExpansionFileIndex == -1) {
+    // //Se obtiene la geometr�a para actualizar el �ndice
+    // int inverse = getInversedIndex(calculatedIndex);
+    // DefaultFeature df=(DefaultFeature)getRow(inverse).getLinkedRow();
+    //
+    //
+    // IGeometry g = df.getGeometry();
+    // Rectangle2D r = g.getBounds2D();
+    // //Se elimina de las relaciones y del fichero de expansi�n
+    // relations.remove(new Integer(calculatedIndex));
+    // expansionFile.deleteLastRow();
+    // labelExpansion.deleteLastLabel();
+    // //Se actualizan los �ndices
+    // DefaultFeature dfAnt=(DefaultFeature)getRow(inverse).getLinkedRow();
+    // IGeometry gAnt = dfAnt.getGeometry();
+    // boolean cancel = fireBeforeModifyRow(dfAnt,calculatedIndex, sourceType);
+    // if (cancel)
+    // return;
+    // Rectangle2D rAnt = gAnt.getBounds2D();
+    // this.index.remove(new Envelope(r.getX(), r.getX() + r.getWidth(),
+    // r.getY(), r.getY() + r.getHeight()),
+    // new Integer(calculatedIndex));
+    // this.index.insert(new Envelope(rAnt.getX(),
+    // rAnt.getX() + rAnt.getWidth(), rAnt.getY(),
+    // rAnt.getY() + rAnt.getHeight()), new Integer(calculatedIndex));
+    //
+    //
+    // } else {
+    // //Se obtiene la geometr�a para actualizar el �ndice
+    // IGeometry g = null;
+    // int inverse = getInversedIndex(calculatedIndex);
+    // DefaultFeature df=(DefaultFeature)getRow(inverse).getLinkedRow();
+    // g = df.getGeometry();
+    // Rectangle2D r = g.getBounds2D();
+    // this.index.remove(new Envelope(r.getX(), r.getX() + r.getWidth(),
+    // r.getY(), r.getY() + r.getHeight()),
+    // new Integer(calculatedIndex));
+    //
+    // //Se actualiza la relaci�n de �ndices
+    // relations.put(new Integer(calculatedIndex),
+    // new Integer(previousExpansionFileIndex));
+    //
+    // //Se actualizan los �ndices
+    // df=(DefaultFeature)getRow(inverse).getLinkedRow();
+    // boolean cancel = fireBeforeModifyRow(df,calculatedIndex, sourceType);
+    // if (cancel)
+    // return;
+    // g = df.getGeometry();
+    // r = g.getBounds2D();
+    // this.index.insert(new Envelope(r.getX(), r.getX() + r.getWidth(),
+    // r.getY(), r.getY() + r.getHeight()),
+    // new Integer(calculatedIndex));
+    // Value value=df.getAttribute(mapping.getColumnText());
+    // FLabel label= getLabel(inverse,true);
+    // label.setString(value.toString());
+    // if (mapping.getColumnRotate()==mapping.getColumnText()){
+    // label.setRotation(((NumericValue)value).doubleValue());
+    // }
+    // }
+    // fireAfterModifyRow(calculatedIndex, sourceType);
+    // }
+    // public void undoRemoveRow(int index, int sourceType) throws IOException,
+    // DriverIOException {
+    // boolean cancel = fireBeforeRowAdded(sourceType);
+    // if (cancel)
+    // return;
+    // delRows.set(index, false);
+    // Rectangle2D r = getLabel(index,true).getBoundBox();
+    // this.index.insert(new Envelope(r.getX(), r.getX() + r.getWidth(),
+    // r.getY(), r.getY() + r.getHeight()), new Integer(index));
+    // fireAfterRowAdded(null,index, sourceType);
+    // }
+    public Annotation_EditableAdapter(Annotation_Layer lyrAnnotation) {
+        super();
+
+        // this.labels=lyrAnnotation.getLabels();
+        this.mapping = lyrAnnotation.getAnnotatonMapping();
+        this.legend = lyrAnnotation.getLegend();
+
+        //		this.isInPixels = lyrAnnotation.isInPixels();
+        this.lyrAnnotation = lyrAnnotation;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param row DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public FLabel createLabel(IRow row) {
+        // FSymbol symbol;
+        // // El mapping[0] es el text
+        // int fieldId = mapping.getColumnText();
+        // // El mapping[1] es el �ngulo
+        // int idFieldRotationText = mapping.getColumnRotate();
+        // // El mapping[2] es el color
+        // int idFieldColorText = mapping.getColumnColor();
+        // // El mapping[3] es el alto
+        // int idFieldHeightText = mapping.getColumnHeight();
+        // // El mapping[4] es el tipo de fuente
+        // int idFieldTypeFontText = mapping.getColumnTypeFont();
+        // // El mapping[5] es el estilo de fuente
+        // int idFieldStyleFontText = mapping.getColumnStyleFont();
+        //
+        // IGeometry geom = ((IFeature) row).getGeometry();
+        // String t = new String();
+        // Value val = row.getAttribute(fieldId);
+        // t = val.toString();
+        // if (idFieldColorText != -1) {
+        // Value value=row.getAttribute(idFieldColorText);
+        // if (!(value instanceof NullValue)){
+        // DoubleValue valColor = (DoubleValue) value;
+        // t = t.concat(valColor.toString());
+        // }
+        // }
+        // if (idFieldTypeFontText != -1) {
+        // Value value=row.getAttribute(idFieldTypeFontText);
+        // if (!(value instanceof NullValue)){
+        // StringValue valTypeFont = (StringValue) value;
+        // t = t.concat(valTypeFont.toString());
+        // }
+        // }
+        // if (idFieldStyleFontText != -1) {
+        // Value value=row.getAttribute(idFieldStyleFontText);
+        // if (!(value instanceof NullValue)){
+        // IntValue valStyleFont = (IntValue) value;
+        // t = t.concat(valStyleFont.toString());
+        // }
+        // }
+        //
+        // Value total = ValueFactory.createValue(t);
+        //
+        // FLabel[] lbls = geom.createLabels(0, true);
+        // double rotat = 0;
+        // FSymbol sym = (FSymbol) legend.getDefaultSymbol();
+        // for (int j = 0; j < lbls.length; j++) {
+        // if (lbls[j] != null) {
+        // lbls[j].setString(val.toString());
+        // if (idFieldRotationText != -1) {
+        // Value value=row.getAttribute(idFieldRotationText);
+        // if (value instanceof NullValue){
+        // rotat = sym.getRotation();
+        // }else{
+        // NumericValue rotation = (NumericValue) value;
+        // rotat = rotation.doubleValue();
+        // }
+        // } else {
+        // rotat = sym.getRotation();
+        // }
+        // lbls[j].setRotation(rotat);
+        //
+        // float height;
+        // if (idFieldHeightText != -1) {
+        // Value value=row.getAttribute(idFieldHeightText);
+        // if (value instanceof NullValue){
+        // height = sym.getFontSize();
+        // lbls[j].setHeight(height);
+        // }else{
+        // NumericValue h = (NumericValue) value;
+        // height = h.floatValue();
+        // lbls[j].setHeight(height);
+        // }
+        //
+        // } else {
+        // height = sym.getFontSize();
+        // lbls[j].setHeight(height);
+        // }
+        // Annotation_Legend vuvl = (Annotation_Legend) legend;
+        // if (vuvl.getSymbolByValue(total) == null) {
+        // Color color;
+        // if (idFieldColorText != -1) {
+        // DoubleValue c = (DoubleValue) row
+        // .getAttribute(idFieldColorText);
+        // color = new Color((int) c.getValue());
+        // } else {
+        // color = sym.getFontColor();
+        // }
+        // String typeFont;
+        // if (idFieldTypeFontText != -1) {
+        // StringValue tf = (StringValue) row
+        // .getAttribute(idFieldTypeFontText);
+        // typeFont = tf.getValue();
+        // } else {
+        // typeFont = sym.getFont()
+        // .getFontName();
+        // }
+        // int style;
+        // if (idFieldStyleFontText != -1) {
+        // IntValue sf = (IntValue) row
+        // .getAttribute(idFieldStyleFontText);
+        // style = sf.getValue();
+        // } else {
+        // style = sym.getFont().getStyle();
+        // }
+        // symbol = new FSymbol(FConstant.SYMBOL_TYPE_TEXT);
+        // symbol.setFontSizeInPixels(isInPixels);
+        // symbol.setFont(new Font(typeFont, style, (int) height));
+        // symbol.setDescription(lbls[j].getString());
+        // symbol.setFontColor(color);
+        // vuvl.addSymbol(total, symbol);
+        // }
+        //
+        // }
+        // return lbls[0];
+        // }
+        return null;
+    }
+
+    // public IRowEdited[] getFeatures(Rectangle2D r, String strEPSG) throws
+    // DriverException {
+    // // En esta clase suponemos random access.
+    // // Luego tendremos otra clase que sea VectorialEditableDBAdapter
+    // // que reescribir� este m�todo.
+    // Envelope e = FConverter.convertRectangle2DtoEnvelope(r);
+    // List l = index.query(e);
+    // IRowEdited[] feats = new IRowEdited[l.size()];
+    // try {
+    // for (int index = 0; index < l.size(); index++) {
+    // Integer i = (Integer) l.get(index);
+    // int inverse = getInversedIndex(i.intValue());
+    // feats[index] = (IRowEdited) getRow(inverse);
+    // }
+    // } catch (DriverIOException e1) {
+    // throw new DriverException(e1);
+    // } catch (IOException e1) {
+    // throw new DriverException(e1);
+    // }
+    //
+    // return feats;
+    // }
+    public IRowEdited[] getFeatures(Rectangle2D r, String strEPSG)
+        throws DriverException {
+        // En esta clase suponemos random access.
+        // Luego tendremos otra clase que sea VectorialEditableDBAdapter
+        // que reescribir� este m�todo.
+        Envelope e = FConverter.convertRectangle2DtoEnvelope(r);
+        List l = index.query(e);
+        IRowEdited[] feats = new IRowEdited[l.size()];
+
+        try {
+            for (int index = 0; index < l.size(); index++) {
+                Integer i = (Integer) l.get(index);
+                int inverse = getInversedIndex(i.intValue());
+                feats[index] = (IRowEdited) getRowAnnotation(inverse);
+            }
+        } catch (IOException ex) {
+            DriverIOExceptionType type = new DriverIOExceptionType();
+            type.setDriverName(this.getDriver().getName());
+            throw new DriverException(ex, type);
+        } catch (DriverLoadException ex) {
+            DriverNotLoadedExceptionType type = new DriverNotLoadedExceptionType();
+            type.setDriverName(getDriver().getName());
+            throw new DriverException(ex, type);
+        } catch (DriverIOException ex) {
+            DriverIOExceptionType type = new DriverIOExceptionType();
+            type.setDriverName(this.getDriver().getName());
+            throw new DriverException(ex, type);
+        }
+
+        return feats;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.iver.cit.gvsig.fmap.edition.IEditableSource#getRow(int)
+     */
+    public IRowEdited getRowAnnotation(int index)
+        throws DriverIOException, IOException {
+        int calculatedIndex = getCalculatedIndex(index);
+        Integer integer = new Integer(calculatedIndex);
+
+        // Si no est� en el fichero de expansi�n
+        DefaultRowEdited edRow = null;
+
+        try {
+            if (!relations.containsKey(integer)) {
+                IFeature f = ova.getFeature(calculatedIndex);
+                String s = f.getID();
+
+                // FSymbol
+                // symbol=(FSymbol)((Annotation_Legend)legend).getSymbol(index);
+                Annotation_Mapping mapping = lyrAnnotation.getAnnotatonMapping();
+                NumericValue vRotation = (NumericValue) f.getAttribute(mapping.getColumnRotate());
+                NumericValue vHeight = (NumericValue) f.getAttribute(mapping.getColumnHeight());
+                Value vText = f.getAttribute(mapping.getColumnText());
+                IGeometry geom = lyrAnnotation.getTextWrappingGeometry(vHeight.floatValue(),
+                        vText.toString(), vRotation.doubleValue(), index);
+                f = new DefaultFeature(geom, f.getAttributes(), s);
+                edRow = new DefaultRowEdited(f,
+                        DefaultRowEdited.STATUS_ORIGINAL, index);
+
+                return edRow;
+            } else {
+                int num = ((Integer) relations.get(integer)).intValue();
+                IRowEdited aux = expansionFile.getRow(num);
+                IFeature f = (IFeature) aux.getLinkedRow().cloneRow();
+
+                // FSymbol
+                // symbol=(FSymbol)((Annotation_Legend)legend).getSymbol(index);
+                Annotation_Mapping mapping = lyrAnnotation.getAnnotatonMapping();
+                NumericValue vRotation = (NumericValue) f.getAttribute(mapping.getColumnRotate());
+                NumericValue vHeight = (NumericValue) f.getAttribute(mapping.getColumnHeight());
+                Value vText = f.getAttribute(mapping.getColumnText());
+                IGeometry geom = lyrAnnotation.getTextWrappingGeometry(vHeight.floatValue(),
+                        vText.toString(), vRotation.doubleValue(), index);
+
+                // IGeometry
+                // geom=getGeometry(labelExpansion.getLabel(num).getBoundBox());
+                String s = f.getID();
+                f = new DefaultFeature(geom, f.getAttributes(), s);
+
+                // f.setID(s);
+                edRow = new DefaultRowEdited(f, aux.getStatus(), index);
+
+                return edRow;
+            }
+        } catch (DriverException e) {
+            throw new DriverIOException(e);
+        }
+    }
+
+    // public void saveEdits(IWriter writer, int sourceType)
+    // throws EditionException {
+    // isToSave=true;
+    // super.saveEdits(writer,sourceType);
+    // isToSave=false;
+    //
+    // }
+    private IGeometry getGeometry(Rectangle2D r) {
+        if (isToSave) {
+            return ShapeFactory.createPoint2D(r.getX(), r.getMaxY());
+        }
+
+        GeneralPathX resul = new GeneralPathX();
+        Point2D[] vs = new Point2D[4];
+        vs[0] = new Point2D.Double(r.getX(), r.getY());
+        vs[1] = new Point2D.Double(r.getMaxX(), r.getY());
+        vs[2] = new Point2D.Double(r.getMaxX(), r.getMaxY());
+        vs[3] = new Point2D.Double(r.getX(), r.getMaxY());
+
+        // vs[4]=new Point2D.Double(r.getX(),r.getY());
+        for (int i = 0; i < vs.length; i++) {
+            if (i == 0) {
+                resul.moveTo(vs[i].getX(), vs[i].getY());
+            } else {
+                resul.lineTo(vs[i].getX(), vs[i].getY());
+            }
+        }
+
+        resul.closePath();
+
+        return ShapeFactory.createPolygon2D(resul);
+    }
+
+    // public void startEdition(int sourceType) throws EditionException {
+    // isEditing = true;
+    // try {
+    // expansionFile.open();
+    // index = new Quadtree();
+    // for (int i = 0; i < labels.size(); i++) {
+    // Rectangle2D r=((FLabel)labels.get(i)).getBoundBox();
+    // Envelope e = new Envelope(r.getX(),
+    // r.getX() + r.getWidth(), r.getY(), r.getY()
+    // + r.getHeight());
+    // index.insert(e, new Integer(i));
+    // if (fullExtent == null) {
+    // fullExtent = r;
+    // } else {
+    // fullExtent.add(r);
+    // }
+    // }
+    // } catch (IOException e) {
+    // throw new EditionException(e);
+    // }
+    //
+    // System.err.println("Se han metido en el �ndice "
+    // + index.queryAll().size() + " labels");
+    // }
+    // public Rectangle2D getShapeBounds(int index) throws IOException {
+    // //Solo se utiliza cuando el driver es BoundedShapes
+    // // Si no est� en el fichero de expansi�n
+    // Integer integer = new Integer((int) index);
+    // if (!relations.containsKey(integer)) {
+    // if (ova.getDriver() instanceof BoundedShapes){
+    // BoundedShapes bs = (BoundedShapes) ova.getDriver();
+    // return bs.getShapeBounds(index);
+    // }else{
+    // return ova.getDriver().getShape(index).getBounds2D();
+    // }
+    //
+    // } else {
+    // int num = ((Integer) relations.get(integer)).intValue();
+    // DefaultRowEdited feat;
+    // feat = (DefaultRowEdited) expansionFile.getRow(num);
+    // if (feat.getStatus() == IRowEdited.STATUS_DELETED)
+    // return null;
+    // IGeometry geom = ((IFeature)feat.getLinkedRow()).getGeometry();
+    // return geom.getBounds2D();
+    // }
+    //
+    // }
+    // public FLabel getLabel(int index,boolean calculated) {
+    // FLabel label=null;
+    // int calculatedIndex=index;
+    // Integer integer=new Integer(index);
+    // if (!calculated){
+    // calculatedIndex=getCalculatedIndex(index);
+    // integer = new Integer(calculatedIndex);
+    // }
+    // //Si no est� en el fichero de expansi�n
+    // if (!relations.containsKey(integer)) {
+    // if (calculatedIndex > labels.size()){
+    // return null;
+    // }
+    // label=(FLabel)labels.get(calculatedIndex);
+    // return label;
+    // } else {
+    // int num = ((Integer) relations.get(integer)).intValue();
+    // label=labelExpansion.getLabel(num);
+    // return (FLabel)label;
+    // }
+    // }
+    // public void cancelEdition(int sourceType) throws IOException {
+    // super.cancelEdition(sourceType);
+    // labelExpansion.close();
+    // labelExpansion=null;
+    // labels.clear();
+    // legend=null;
+    // }
+    // public void stopEdition(IWriter writer, int sourceType) throws
+    // EditionException {
+    // super.stopEdition(writer, sourceType);
+    // try {
+    // labelExpansion.close();
+    // } catch (IOException e) {
+    // throw new EditionException(e);
+    // }
+    // labelExpansion=null;
+    // labels.clear();
+    // legend=null;
+    // }
+    // public IGeometry getShape(int rowIndex) throws DriverIOException {
+    // IGeometry geom=null;
+    // // Si no est� en el fichero de expansi�n
+    // int calculatedIndex = getCalculatedIndex(rowIndex);
+    // Integer integer = new Integer(calculatedIndex);
+    // if (!relations.containsKey(integer)) {
+    // geom=ova.getShape(calculatedIndex);
+    // } else {
+    // int num = ((Integer) relations.get(integer)).intValue();
+    // DefaultRowEdited feat;
+    // try {
+    // feat = (DefaultRowEdited) expansionFile.getRow(num);
+    // geom= ((IFeature) feat.getLinkedRow()).getGeometry()
+    // .cloneGeometry();
+    // } catch (IOException e) {
+    // e.printStackTrace();
+    // throw new DriverIOException(e);
+    // }
+    // }
+    // if (geom.getGeometryType()!=FShape.POINT) {
+    // Point2D p=FLabel.createLabelPoint((FShape)geom.getInternalShape());
+    // geom=ShapeFactory.createPoint2D(p.getX(),p.getY());
+    // }
+    // return geom;
+    //
+    // }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/edition/Annotation_EditableAdapter.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_ToolExtension.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_ToolExtension.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_ToolExtension.java	(revision 11783)
@@ -0,0 +1,128 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.IWindow;
+import com.iver.cit.gvsig.fmap.MapContext;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.tools.Behavior.Behavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.MouseMovementBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior;
+import com.iver.cit.gvsig.project.documents.view.gui.View;
+import com.iver.cit.gvsig.project.documents.view.tool.Annotation_ModifyListener;
+import com.iver.cit.gvsig.project.documents.view.toolListeners.StatusBarListener;
+
+
+/**
+ * Class that extends of the tool InfoToolExtension and
+ * override the methods that interests us to change its behavior.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_ToolExtension
+    extends com.iver.cit.gvsig.InfoToolExtension {
+
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+        IWindow window = PluginServices.getMDIManager().getActiveWindow();
+
+        if (window instanceof View) {
+            MapControl mapCtrl = ((View) window).getMapControl();
+
+            if (s.compareTo("MODIFYANNOTATION") == 0) {
+                if (mapCtrl.getMapTool("centerviewtopoint") == null) {
+                    StatusBarListener sbl = new StatusBarListener(mapCtrl);
+                    Annotation_ModifyListener chl = new Annotation_ModifyListener(mapCtrl);
+                    mapCtrl.addMapTool("modifyannotation",
+                        new Behavior[] {
+                            new PointBehavior(chl),
+                            new MouseMovementBehavior(sbl)
+                        });
+                }
+            }
+
+   			if (s.compareTo("MODIFYANNOTATION") == 0) {
+   				mapCtrl.setTool("modifyannotation");
+   			}
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.andami.plugins.IExtension#initialize()
+     */
+    public void initialize() {
+        super.initialize();
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.andami.plugins.IExtension#isEnabled()
+     */
+    public boolean isEnabled() {
+        return super.isEnabled();
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.andami.plugins.IExtension#isVisible()
+     */
+    public boolean isVisible() {
+        IWindow window = PluginServices.getMDIManager().getActiveWindow();
+
+        if (window instanceof View) {
+            MapContext mapContext = ((View) window).getMapControl()
+                                     .getMapContext();
+            FLayer[] layers=mapContext.getLayers().getActives();
+            for (int i=0;i<layers.length;i++){
+            	if (layers[i] instanceof Annotation_Layer){
+            		if (layers[i].isEditing())
+            			return true;
+            	}
+            }
+        }
+
+        return false;
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_ToolExtension.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_Extension.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_Extension.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_Extension.java	(revision 11783)
@@ -0,0 +1,217 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+package com.iver.cit.gvsig;
+
+import javax.swing.ImageIcon;
+
+import com.hardcode.gdbms.engine.data.driver.DriverException;
+import com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.preferences.IPreference;
+import com.iver.andami.preferences.IPreferenceExtension;
+import com.iver.andami.ui.mdiManager.IWindow;
+import com.iver.cit.gvsig.fmap.MapContext;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLyrVect;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.gui.panels.FPanelAbout;
+import com.iver.cit.gvsig.gui.simpleWizard.SimpleWizard;
+import com.iver.cit.gvsig.project.documents.gui.Annotation_ConfigureLabel;
+import com.iver.cit.gvsig.project.documents.gui.Annotation_Create;
+import com.iver.cit.gvsig.project.documents.gui.Annotation_FieldSelect;
+import com.iver.cit.gvsig.project.documents.gui.Annotation_Open;
+import com.iver.cit.gvsig.project.documents.view.IProjectView;
+import com.iver.cit.gvsig.project.documents.view.legend.preferences.Annotation_Preferences;
+import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction;
+import com.iver.cit.gvsig.project.documents.view.toc.gui.FLyrVectEditPropertiesTocMenuEntry2;
+import com.iver.utiles.extensionPoints.ExtensionPoint;
+import com.iver.utiles.extensionPoints.ExtensionPoints;
+import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
+
+/**
+ * Extension to create an annotation layer.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Extension extends Extension implements IPreferenceExtension{
+	private MapContext map = null;
+	private Annotation_Preferences ap=new Annotation_Preferences();
+	/**
+	 * @see com.iver.andami.plugins.IExtension#initialize()
+	 */
+	public void initialize() {
+		ExtensionPoints extensionPoints = ExtensionPointsSingleton
+				.getInstance();
+
+		AbstractTocContextMenuAction ma = (AbstractTocContextMenuAction) ((ExtensionPoint) extensionPoints
+				.get("View_TocActions")).get("FLyrVectEditProperties");
+		((ExtensionPoint) extensionPoints.get("View_TocActions"))
+				.remove("FLyrVectEditProperties");
+		((ExtensionPoint) extensionPoints.get("View_TocActions")).put(
+				"FLyrVectEditProperties",
+				new FLyrVectEditPropertiesTocMenuEntry2(ma));
+		// extensionPoints.add("View_TocActions","FLyrVectEditProperties2",new
+		// FLyrVectEditPropertiesTocMenuEntry2());
+		System.out.println("A�ado WizardAnnotation.");
+		AddLayer.addWizard(Annotation_Open.class);
+	}
+
+	public void postInitialize() {
+		// TODO Auto-generated method stub
+		super.postInitialize();
+		About about = (About) PluginServices.getExtension(About.class);
+		FPanelAbout panelAbout = about.getAboutPanel();
+		java.net.URL aboutURL = this.getClass().getResource("/about.htm");
+		panelAbout.addAboutUrl(PluginServices.getText(this, "annotations"),
+				aboutURL);
+
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		if ("ANNOTATIONLAYER".equals(actionCommand)) {
+			ImageIcon Logo = new javax.swing.ImageIcon(this.getClass()
+					.getClassLoader()
+					.getResource("images/package_graphics.png"));
+
+			SimpleWizard wizard = new SimpleWizard(Logo);
+
+			FLyrVect lv = (FLyrVect) map.getLayers().getActives()[0];
+			Annotation_Layer la = new Annotation_Layer();
+			la.setSource(lv.getSource());
+			la.setProjection(lv.getProjection());
+			la.setName(lv.getName());
+
+			Annotation_FieldSelect panel1 = new Annotation_FieldSelect(wizard
+					.getWizardComponents(), la);
+			Annotation_ConfigureLabel panel2 = new Annotation_ConfigureLabel(
+					wizard.getWizardComponents(), la);
+
+			wizard.getWizardComponents().addWizardPanel(panel1);
+			wizard.getWizardComponents().addWizardPanel(panel2);
+
+			wizard.getWizardComponents()
+					.setFinishAction(
+							new Annotation_Create(wizard.getWizardComponents(),
+									map, la));
+
+			wizard.getWindowInfo().setWidth(540);
+			wizard.getWindowInfo().setHeight(380);
+			wizard.getWindowInfo().setTitle(
+					PluginServices.getText(this, "to_annotation"));
+
+			PluginServices.getMDIManager().addWindow(wizard);
+
+			/*
+			 * FLyrVect lv=(FLyrVect)map.getLayers().getActives()[0];
+			 * FLyrAnnotation la=new FLyrAnnotation();
+			 * la.setSource(lv.getSource());
+			 *
+			 * MappingFieldsToAnotation mfta=new MappingFieldsToAnotation(la);
+			 * PluginServices.getMDIManager().addView(mfta);
+			 *
+			 * if (mfta.isOk()){ map.getLayers().addLayer(la);
+			 * map.getLayers().removeLayer(lv); }
+			 */
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.IExtension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		IWindow v = PluginServices.getMDIManager().getActiveWindow();
+
+		if ((v != null)
+				&& v instanceof com.iver.cit.gvsig.project.documents.view.gui.View) {
+			com.iver.cit.gvsig.project.documents.view.gui.View vista = (com.iver.cit.gvsig.project.documents.view.gui.View) v;
+			IProjectView model = vista.getModel();
+			map = model.getMapContext();
+
+			FLayer[] layers = map.getLayers().getActives();
+
+			if (layers.length == 1) {
+				if (layers[0].isAvailable() && layers[0] instanceof FLyrVect) {
+					FLyrVect lv = (FLyrVect) layers[0];
+
+					// ReadableVectorial src = lv.getSource();
+					try {
+						// if (src == null || src.getShapeType()==FShape.POLYGON
+						// || src.getShapeType()==FShape.LINE)
+						// return false;
+						SelectableDataSource sds = lv.getSource()
+								.getRecordset();
+
+						if (sds.getFieldCount() > 0) {
+							return true;
+						}
+					} catch (DriverException e) {
+						return false;
+					}
+				}
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.IExtension#isVisible()
+	 */
+	public boolean isVisible() {
+		IWindow v = PluginServices.getMDIManager().getActiveWindow();
+
+		if (v == null) {
+			return false;
+		} else if (v instanceof com.iver.cit.gvsig.project.documents.view.gui.View) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	public IPreference getPreferencesPage() {
+		return ap;
+	}
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/Annotation_Extension.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_ConfigureLabel.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_ConfigureLabel.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_ConfigureLabel.java	(revision 11783)
@@ -0,0 +1,517 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.gui;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+
+import jwizardcomponent.JWizardComponents;
+import jwizardcomponent.JWizardPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+
+
+/**
+ * Configure annotation mapping.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_ConfigureLabel extends JWizardPanel {
+    public static final String TEXT_FOR_DEFAULT_VALUE = "- Default -";
+    private static final Rectangle lblDescriptionPosition = new Rectangle(4, 4,
+            355, 60);
+    private static final Rectangle lblStep1Position = new Rectangle(4, 90, 15,
+            15);
+    private static final Rectangle lblAnglePosition = new Rectangle(30, 90,
+            355, 30);
+    private static final Rectangle cmbAnglePosition = new Rectangle(30, 124,
+            170, 18);
+    private static final Rectangle lblStep2Position = new Rectangle(4, 150, 15,
+            15);
+    private static final Rectangle lblColorPosition = new Rectangle(30, 150,
+            355, 30);
+    private static final Rectangle cmbColorPosition = new Rectangle(30, 184,
+            170, 18);
+    private static final Rectangle lblStep3Position = new Rectangle(4, 210, 15,
+            15);
+    private static final Rectangle lblSizePosition = new Rectangle(30, 210,
+            355, 30);
+    private static final Rectangle cmbSizePosition = new Rectangle(30, 244,
+            170, 18);
+    private static final Rectangle lblSizeUnitsPosition = new Rectangle(204,
+            244, 80, 15);
+    private static final Rectangle cmbSizeUnitsPosition = new Rectangle(305,
+            244, 80, 18);
+    private static final Rectangle lblStep4Position = new Rectangle(4, 270, 15,
+            15);
+    private static final Rectangle lblFontPosition = new Rectangle(30, 270,
+            355, 30);
+    private static final Rectangle cmbFontPosition = new Rectangle(30, 304,
+            170, 18);
+    private Annotation_Layer layer;
+    private HashMap fieldsNames = new HashMap();
+    private JLabel lblDescription;
+    private JLabel lblAngle;
+    private JLabel lblColor;
+    private JLabel lblSize;
+    private JLabel lblSizeUnits;
+    private JLabel lblFont;
+    private JLabel lblStep1;
+    private JLabel lblStep2;
+    private JLabel lblStep3;
+    private JLabel lblStep4;
+    private JComboBox cmbAngle = null;
+    private JComboBox cmbColor = null;
+    private JComboBox cmbSize = null;
+    private JComboBox cmbSizeUnits = null;
+    private JComboBox cmbFont = null;
+    private EventsListener eventsListener = new EventsListener();
+    private SelectableDataSource sds;
+
+    public Annotation_ConfigureLabel(JWizardComponents arg0,
+        Annotation_Layer layer) {
+        super(arg0);
+        this.layer = layer;
+
+        try {
+            if (layer.getRecordset() != null) {
+                sds = layer.getRecordset();
+            }
+        } catch (DriverException e) {
+            e.printStackTrace();
+        }
+
+        this.initialize();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void updateButtonsState() {
+        try {
+            if (getWizardComponents().getCurrentIndex() == 1) {
+                setBackButtonEnabled(true);
+                setNextButtonEnabled(false);
+                setFinishButtonEnabled(checkIsOkPanelData());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    protected boolean checkIsOkPanelData() {
+        // if
+        // (!((String)this.getCmbSize().getSelectedItem()).equals(Annotation_ConfigureLabel.TEXT_FOR_DEFAULT_VALUE))
+        // {
+        // return
+        // (((String)this.getCmbSizeUnits().getSelectedItem()).trim().length() >
+        // 0);
+        // }
+        return true;
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    protected void initialize() {
+        this.setLayout(null);
+        this.setSize(new Dimension(358, 263));
+        this.addLabels();
+
+        this.add(getCmbAngle(), null);
+        this.add(getCmbColor(), null);
+        this.add(getCmbSize(), null);
+
+        this.add(getCmbSizeUnits(), null);
+        this.add(getCmbFont(), null);
+
+        checkIsOkPanelData();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    protected void addLabels() {
+        this.lblDescription = new JLabel();
+        this.lblStep1 = new JLabel();
+        this.lblAngle = new JLabel();
+        this.lblStep2 = new JLabel();
+        this.lblColor = new JLabel();
+        this.lblStep3 = new JLabel();
+        this.lblSize = new JLabel();
+
+        this.lblSizeUnits = new JLabel();
+        this.lblStep4 = new JLabel();
+        this.lblFont = new JLabel();
+
+        this.lblDescription.setText(PluginServices.getText(this,
+                "descripcion_de_configuracion_capa_de_anotaciones"));
+        this.lblStep1.setText("1.");
+        this.lblAngle.setText(PluginServices.getText(this,
+                "seleccione_el_campo_angulo_de_la_capa_de_anotaciones"));
+        this.lblStep2.setText("2.");
+        this.lblColor.setText(PluginServices.getText(this,
+                "seleccione_el_campo_color_de_la_capa_de_anotaciones"));
+        this.lblStep3.setText("3.");
+        this.lblSize.setText(PluginServices.getText(this,
+                "seleccione_el_campo_tamano_de_la_capa_de_anotaciones"));
+
+        this.lblSizeUnits.setText(PluginServices.getText(this, "en_unidades"));
+        this.lblStep4.setText("4.");
+        this.lblFont.setText(PluginServices.getText(this,
+                "seleccione_el_campo_fuente_de_la_capa_de_anotaciones"));
+
+        // TODO: Posicionar
+        this.lblDescription.setBounds(lblDescriptionPosition);
+        this.lblStep1.setBounds(lblStep1Position);
+        this.lblAngle.setBounds(lblAnglePosition);
+        this.lblStep2.setBounds(lblStep2Position);
+        this.lblColor.setBounds(lblColorPosition);
+        this.lblStep3.setBounds(lblStep3Position);
+        this.lblSize.setBounds(lblSizePosition);
+
+        this.lblSizeUnits.setBounds(lblSizeUnitsPosition);
+        this.lblStep4.setBounds(lblStep4Position);
+        this.lblFont.setBounds(lblFontPosition);
+
+        this.add(lblDescription, null);
+        this.add(lblStep1, null);
+        this.add(lblAngle, null);
+        this.add(lblStep2, null);
+        this.add(lblColor, null);
+        this.add(lblStep3, null);
+        this.add(lblSize, null);
+
+        this.add(lblSizeUnits, null);
+        this.add(lblStep4, null);
+        this.add(lblFont, null);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param cmb DOCUMENT ME!
+     * @param types DOCUMENT ME!
+     */
+    private void fillFieldsNames(JComboBox cmb, int[] types) {
+        cmb.addItem(Annotation_ConfigureLabel.TEXT_FOR_DEFAULT_VALUE);
+
+        Collection names;
+
+        if (types == null) {
+            String[] allNames = (String[]) this.fieldsNames.get("ALL");
+
+            if (allNames == null) {
+                try {
+                    SelectableDataSource dataSource = this.layer.getRecordset();
+
+                    allNames = dataSource.getFieldNames();
+                    this.fieldsNames.put("ALL", allNames);
+                } catch (DriverException e) {
+                    e.printStackTrace();
+                } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            for (int i = 0; i < allNames.length; i++) {
+                cmb.addItem(allNames[i]);
+            }
+
+            return;
+        }
+
+        Integer typeKey;
+
+        for (int i = 0; i < types.length; i++) {
+            typeKey = new Integer(types[i]);
+
+            if (!this.fieldsNames.containsKey(typeKey)) {
+                names = this.getFieldsFromType(types[i]);
+                this.fieldsNames.put(typeKey, names);
+            } else {
+                names = (Collection) this.fieldsNames.get(typeKey);
+            }
+
+            if (names != null) {
+                Iterator name = names.iterator();
+
+                while (name.hasNext()) {
+                    cmb.addItem(name.next());
+                }
+            }
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param type DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private Collection getFieldsFromType(int type) {
+        ArrayList result = new ArrayList();
+
+        try {
+            SelectableDataSource dataSource = this.layer.getRecordset();
+
+            for (int i = 0; i < dataSource.getFieldCount(); i++) {
+                if (dataSource.getFieldType(i) == type) {
+                    result.add(dataSource.getFieldName(i));
+                }
+            }
+        } catch (DriverException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        if (result.size() == 0) {
+            return null;
+        }
+
+        return result;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JComboBox getCmbAngle() {
+        if (this.cmbAngle == null) {
+            this.cmbAngle = new JComboBox();
+            this.cmbAngle.setEditable(false);
+            this.cmbAngle.setBounds(cmbAnglePosition);
+            this.fillFieldsNames(this.cmbAngle,
+                new int[] { Types.INTEGER, Types.DOUBLE });
+            this.cmbAngle.addItemListener(this.eventsListener);
+
+            if ((sds != null) && (layer.getAnnotatonMapping() != null)) {
+                int index = layer.getAnnotatonMapping().getColumnRotate();
+                setSelectedItem(index, cmbAngle);
+                updateButtonsState();
+            }
+        }
+
+        return this.cmbAngle;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getAngleFieldName() {
+        return (String) this.getCmbAngle().getSelectedItem();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JComboBox getCmbColor() {
+        if (this.cmbColor == null) {
+            this.cmbColor = new JComboBox();
+            this.cmbColor.setEditable(false);
+            this.cmbColor.setBounds(cmbColorPosition);
+            this.fillFieldsNames(this.cmbColor, new int[] { Types.INTEGER });
+            this.cmbColor.addItemListener(this.eventsListener);
+
+            if ((sds != null) && (layer.getAnnotatonMapping() != null)) {
+                int index = layer.getAnnotatonMapping().getColumnColor();
+                setSelectedItem(index, cmbColor);
+            }
+        }
+
+        return this.cmbColor;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param index DOCUMENT ME!
+     * @param cmb DOCUMENT ME!
+     */
+    private void setSelectedItem(int index, JComboBox cmb) {
+        if (sds != null) {
+            String field = null;
+
+            try {
+                field = sds.getFieldName(index);
+            } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+                e.printStackTrace();
+            }
+
+            cmb.setSelectedItem(field);
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getColorFieldName() {
+        return (String) this.getCmbColor().getSelectedItem();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JComboBox getCmbSize() {
+        if (this.cmbSize == null) {
+            this.cmbSize = new JComboBox();
+            this.cmbSize.setEditable(false);
+            this.cmbSize.setBounds(cmbSizePosition);
+            this.fillFieldsNames(this.cmbSize,
+                new int[] { Types.INTEGER, Types.DOUBLE });
+            this.cmbSize.addItemListener(this.eventsListener);
+
+            if ((sds != null) && (layer.getAnnotatonMapping() != null)) {
+                int index = layer.getAnnotatonMapping().getColumnHeight();
+                setSelectedItem(index, cmbSize);
+            }
+        }
+
+        return this.cmbSize;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getSizeFieldName() {
+        return (String) this.getCmbSize().getSelectedItem();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JComboBox getCmbSizeUnits() {
+        if (this.cmbSizeUnits == null) {
+            this.cmbSizeUnits = new JComboBox();
+            this.cmbSizeUnits.setEditable(false);
+            this.cmbSizeUnits.setBounds(cmbSizeUnitsPosition);
+            this.cmbSizeUnits.addItem(PluginServices.getText(this, "pixels"));
+            this.cmbSizeUnits.addItem(PluginServices.getText(this, "metros"));
+            this.cmbSizeUnits.addItemListener(this.eventsListener);
+        }
+
+        return this.cmbSizeUnits;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public boolean sizeUnitsInPixels() {
+        return (this.getCmbSizeUnits().getSelectedIndex() == 0);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JComboBox getCmbFont() {
+        if (this.cmbFont == null) {
+            this.cmbFont = new JComboBox();
+            this.cmbFont.setEditable(false);
+            this.cmbFont.setBounds(cmbFontPosition);
+            this.fillFieldsNames(this.cmbFont,
+                new int[] { Types.VARCHAR, Types.LONGVARCHAR });
+            this.cmbFont.addItemListener(this.eventsListener);
+
+            if ((sds != null) && (layer.getAnnotatonMapping() != null)) {
+                int index = layer.getAnnotatonMapping().getColumnTypeFont();
+                setSelectedItem(index, cmbFont);
+            }
+        }
+
+        return this.cmbFont;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getFontFieldName() {
+        return (String) this.getCmbFont().getSelectedItem();
+    }
+
+    private class EventsListener implements ItemListener {
+        public void itemStateChanged(ItemEvent e) {
+            updateButtonsState();
+        }
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_ConfigureLabel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Open.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Open.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Open.java	(revision 11783)
@@ -0,0 +1,617 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.gui;
+
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.filechooser.FileFilter;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+
+import com.hardcode.driverManager.Driver;
+import com.hardcode.driverManager.DriverLoadException;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.DriverIOExceptionType;
+import com.iver.cit.gvsig.fmap.DriverNotLoadedExceptionType;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.crs.CRSFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.drivers.VectorialDriver;
+import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+import com.iver.cit.gvsig.fmap.layers.FLyrVect;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.layers.LayerListener;
+import com.iver.cit.gvsig.fmap.layers.VectorialFileAdapter;
+import com.iver.cit.gvsig.gui.WizardPanel;
+import com.iver.cit.gvsig.gui.panels.CRSSelectPanel;
+import com.iver.cit.gvsig.project.documents.view.gui.View;
+import com.iver.utiles.swing.JComboBox;
+
+
+/**
+ * Dialog to open an annotation layer.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Open extends WizardPanel {
+    private static String lastPath = null;
+    private JPanel pGeneral = null;
+    private JButton bSelectFile = null;
+    private String fName;
+    private JTextField tFile;
+    private CRSSelectPanel pProyection = null;
+    private JPanel pFileSelection;
+    private JPanel pControls;
+    private JPanel pInPixels;
+    private JComboBox cmbInPixels;
+
+    public Annotation_Open() {
+        super();
+        initialize();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void initialize() {
+        this.setPreferredSize(new java.awt.Dimension(750, 320));
+        this.setSize(new java.awt.Dimension(510, 311));
+        this.setLocation(new java.awt.Point(0, 0));
+        this.add(getPGeneral(), null);
+        this.getBSelectFile().addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent evt) {
+                    acceptButtonActionPerformed(evt);
+                }
+            });
+    }
+
+    /**
+     * Evento de pulsado del bot�n de seleccionar fichero
+     *
+     * @param e
+     */
+    private void acceptButtonActionPerformed(ActionEvent e) {
+        // Selector de Fichero que se quiere georeferenciar
+        if (e.getSource().equals(this.getBSelectFile())) {
+            JFileChooser chooser = new JFileChooser(lastPath);
+            chooser.setDialogTitle(PluginServices.getText(this,
+                    "seleccionar_fichero"));
+
+            // FileFilter f = new DriverFileFilter("Annotation gvSIG Driver");
+            chooser.addChoosableFileFilter(new FileFilter() {
+                    public boolean accept(File f) {
+                        if (f.isDirectory()) {
+                            return true;
+                        }
+
+                        if (isPointShapeType(f)) {
+                            return f.getAbsolutePath().toLowerCase().endsWith(".shp");
+                        }
+
+                        return false;
+                    }
+
+                    public String getDescription() {
+                        return PluginServices.getText(this, "Point Shape Files");
+                    }
+                });
+            chooser.addChoosableFileFilter(new FileFilter() {
+                    public boolean accept(File f) {
+                        if (f.isDirectory()) {
+                            return true;
+                        }
+
+                        String[] files = f.getParentFile().list();
+
+                        for (int i = 0; i < files.length; i++) {
+                            if (!files[i].equals(f.getName()) &&
+                                    files[i].replaceAll("gva", "shp")
+                                                .toLowerCase().equals(f.getName()
+                                                                           .toLowerCase())) {
+                                return (isPointShapeType(f));
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    public String getDescription() {
+                        return PluginServices.getText(this, "Annotations");
+                    }
+                });
+
+            int returnVal = chooser.showOpenDialog(this);
+
+            if (returnVal == JFileChooser.APPROVE_OPTION) {
+                this.fName = chooser.getSelectedFile().toString();
+
+                // FileFilter filter = chooser.getFileFilter();
+                this.getTFile().setText(fName);
+                lastPath = chooser.getCurrentDirectory().getAbsolutePath();
+
+                if (PluginServices.getMainFrame() == null) {
+                    ((JDialog) (getParent().getParent().getParent().getParent())).dispose();
+                } else {
+                    callStateChanged(true);
+
+                    // //Creamos la capa y la cargamos
+                    // try {
+                    // View theView = null;
+                    //
+                    // try {
+                    // theView = (View) PluginServices.getMDIManager()
+                    // .getActiveWindow();
+                    // } catch (ClassCastException exc) {
+                    // return;
+                    // }
+                    //
+                    // File fich = new File(fName);
+                    // boolean ok =
+                    // loadFileAnnotationLayer(theView.getMapControl(),
+                    // fich);
+                    // callStateChanged(ok);
+                    // } catch (DriverLoadException exc) {
+                    // NotificationManager.addError("No se pudo acceder a los
+                    // drivers",
+                    // exc);
+                    // }
+                }
+            }
+        }
+    }
+
+    /**
+     * This method initializes jTextField
+     *
+     * @return javax.swing.JTextField
+     */
+    private JTextField getTFile() {
+        if (tFile == null) {
+            tFile = new JTextField();
+            tFile.setPreferredSize(new java.awt.Dimension(350, 25));
+        }
+
+        return tFile;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getPGeneral() {
+        if (pGeneral == null) {
+            GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+            gridBagConstraints1.insets = new java.awt.Insets(5, 0, 0, 0);
+            gridBagConstraints1.gridy = 3;
+            gridBagConstraints1.gridx = 0;
+
+            GridBagConstraints gridBagConstraints = new GridBagConstraints();
+            gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
+            gridBagConstraints.gridy = 0;
+            gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
+            gridBagConstraints.gridx = 0;
+
+            GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
+            gridBagConstraints2.insets = new java.awt.Insets(0, 0, 2, 0);
+            gridBagConstraints2.gridy = 1;
+            gridBagConstraints2.gridx = 0;
+
+            pGeneral = new JPanel();
+            pGeneral.setLayout(new GridBagLayout());
+            pGeneral.setPreferredSize(new java.awt.Dimension(750, 350));
+            gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTH;
+            gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTH;
+            pGeneral.add(getPFileSelection(), gridBagConstraints);
+            pGeneral.add(getPControls(), gridBagConstraints1);
+            pGeneral.add(getPInPixels(), gridBagConstraints2);
+        }
+
+        return pGeneral;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JPanel getPControls() {
+        if (pControls == null) {
+            GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
+            GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
+            gridBagConstraints2.gridx = 0;
+            gridBagConstraints2.gridy = 1;
+            pControls = new JPanel();
+            pControls.setLayout(new GridBagLayout());
+            pControls.setPreferredSize(new java.awt.Dimension(475, 200));
+            pControls.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, "",
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            gridBagConstraints11.gridx = 0;
+            gridBagConstraints11.gridy = 0;
+
+            // pControls.add(getPCheckUseGeoref(), gridBagConstraints11);
+            pControls.add(getPProyection(), gridBagConstraints2);
+        }
+
+        return pControls;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getPFileSelection() {
+        if (pFileSelection == null) {
+            FlowLayout flowLayout = new FlowLayout();
+            flowLayout.setVgap(10);
+            pFileSelection = new JPanel();
+            pFileSelection.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this, "cargar"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            pFileSelection.setLayout(flowLayout);
+            pFileSelection.setPreferredSize(new java.awt.Dimension(475, 70));
+            pFileSelection.add(getTFile(), null);
+            pFileSelection.add(getBSelectFile(), null);
+        }
+
+        return pFileSelection;
+    }
+
+    /**
+     * This method initializes jButton
+     *
+     * @return javax.swing.JButton
+     */
+    private JButton getBSelectFile() {
+        if (bSelectFile == null) {
+            bSelectFile = new JButton();
+            bSelectFile.setText(PluginServices.getText(this, "cargar"));
+        }
+
+        return bSelectFile;
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void initWizard() {
+        // TODO Auto-generated method stub
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void execute() {
+        // Creamos la capa y la cargamos
+        try {
+            View theView = null;
+
+            try {
+                theView = (View) PluginServices.getMDIManager().getActiveWindow();
+            } catch (ClassCastException exc) {
+                return;
+            }
+
+            File fich = new File(fName);
+            boolean ok = loadFileAnnotationLayer(theView.getMapControl(), fich);
+        } catch (DriverLoadException exc) {
+            NotificationManager.addError("No se pudo acceder a los drivers", exc);
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public FLayer getLayer() {
+        return null;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private CRSSelectPanel getPProyection() {
+        if (pProyection == null) {
+            pProyection = CRSSelectPanel.getPanel(FOpenDialog.getLastProjection());
+            pProyection.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        if (pProyection.isOkPressed()) {
+                            FOpenDialog.setLastProjection(pProyection.getCurProj());
+                        }
+                    }
+                });
+        }
+
+        return pProyection;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getPInPixels() {
+        if (pInPixels == null) {
+            pInPixels = new JPanel(); // CRSSelectPanel.getPanel(FOpenDialog.getLastProjection());
+
+            JLabel lbl = new JLabel(PluginServices.getText(this,
+                        "units_of_annotations"));
+            pInPixels.add(lbl);
+            pInPixels.add(getCmbInPixels());
+        }
+
+        return pInPixels;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JComboBox getCmbInPixels() {
+        if (cmbInPixels == null) {
+            cmbInPixels = new JComboBox();
+            cmbInPixels.addItem(PluginServices.getText(this, "pixels"));
+            cmbInPixels.addItem(PluginServices.getText(this, "meters"));
+
+            // cmbInPixels.addActionListener(new ActionListener(){
+            // public void actionPerformed(ActionEvent e) {
+            // if (e.getSource().equals(PluginServices.getText(this,"pixels"))){
+            //
+            // }
+            //
+            // }
+            //
+            // });
+        }
+
+        return cmbInPixels;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.iver.cit.gvsig.gui.WizardPanel#getTabName()
+     */
+    public String getTabName() {
+        return PluginServices.getText(this, "annotation");
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param file DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private boolean isPointShapeType(File file) {
+        if (!file.getAbsolutePath().toLowerCase().endsWith(".shp")) {
+            return false;
+        }
+
+        VectorialFileAdapter adapter = new VectorialFileAdapter(file);
+        String driverName = "gvSIG shp driver";
+
+        try {
+            Driver driver = LayerFactory.getDM().getDriver(driverName);
+            adapter.setDriver((VectorialDriver) driver);
+        } catch (DriverLoadException e) {
+            return false;
+        }
+
+        FLyrVect capa = new FLyrVect();
+        capa.setSource(adapter);
+
+        int type;
+
+        try {
+            ((VectorialFileDriver) capa.getSource().getDriver()).open(file);
+            ((VectorialFileDriver) capa.getSource().getDriver()).initialize();
+            type = capa.getSource().getShapeType();
+        } catch (DriverIOException e) {
+            return false;
+        } catch (IOException e) {
+            return false;
+        }
+
+        return (type == FShape.POINT);
+    }
+
+    /**
+     * Adds to mapcontrol all the file based layers selected by user in
+     * fileOpenDialog instance.
+     *
+     * @param mapControl MapControl where we want to add the selected layers
+     * @param file FileOpenDialog where user selected file based layers
+     *
+     * @return boolean flag to report sucess of the operation
+     */
+    private boolean loadFileAnnotationLayer(MapControl mapControl, File file) {
+        if (file == null) {
+            return false;
+        }
+
+        FLayer lyr = null;
+        IProjection proj = FOpenDialog.getLastProjection();
+        String driverName = "gvSIG shp driver";
+        Driver driver = null; // Driver[driverNames.length];
+        ArrayList errors = new ArrayList();
+
+        try {
+            driver = LayerFactory.getDM().getDriver(driverName);
+        } catch (DriverLoadException e) {
+            DriverNotLoadedExceptionType type = new DriverNotLoadedExceptionType();
+            type.setDriverName(driverName);
+
+            DriverException exception = new DriverException(e, type);
+            errors.add(exception);
+        }
+
+        // A�adir capas al mapControl se trata como una transaccion
+        mapControl.getMapContext().beginAtomicEvent();
+
+        String layerName = file.getName();
+        lyr = LayerFactory.createLayer(layerName, (VectorialFileDriver) driver,
+                file, proj);
+
+        Annotation_Layer al = new Annotation_Layer();
+        LayerListener[] layerListeners = lyr.getLayerListeners();
+
+        for (int i = 0; i < layerListeners.length; i++) {
+            al.addLayerListener(layerListeners[i]);
+        }
+
+        al.setSource(((FLyrVect) lyr).getSource());
+        al.setProjection(lyr.getProjection());
+        al.setName(layerName);
+
+        try {
+            Annotation_Mapping.addAnnotationMapping(al);
+        } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+            DriverIOExceptionType type = new DriverIOExceptionType();
+            type.setFile(file);
+
+            DriverException newException = new DriverException(e, type);
+            lyr.addError(newException);
+            lyr.setAvailable(false);
+            errors.add(newException);
+        }
+
+        ((FSymbol) al.getLegend().getDefaultSymbol()).setFontSizeInPixels(getCmbInPixels()
+                                                                              .getSelectedItem()
+                                                                              .equals(PluginServices.getText(
+                    this, "pixels")));
+
+        if (lyr != null) {
+            lyr.setVisible(true);
+            checkProjection(lyr, mapControl.getViewPort());
+            mapControl.getMapContext().getLayers().addLayer(al);
+        } // if
+
+        mapControl.getMapContext().endAtomicEvent();
+
+        return true;
+    }
+
+    // TODO Este m�todo est� igual en AddLayer pero es privado y
+    // no est�tico y he tenido que replicar c�digo
+    // Comentar a Joaqu�n para la 1.0.3
+    private static void checkProjection(FLayer lyr, ViewPort viewPort) {
+        if (lyr instanceof FLayers) {
+            FLayers layers = (FLayers) lyr;
+
+            for (int i = 0; i < layers.getLayersCount(); i++) {
+                checkProjection(layers.getLayer(i), viewPort);
+            }
+        }
+
+        if (lyr instanceof FLyrVect) {
+            FLyrVect lyrVect = (FLyrVect) lyr;
+            IProjection proj = lyr.getProjection();
+
+            // Comprobar que la projecci�n es la misma que la vista
+            if (proj == null) {
+                // SUPONEMOS que la capa est� en la proyecci�n que
+                // estamos pidiendo (que ya es mucho suponer, ya).
+                lyrVect.setProjection(viewPort.getProjection());
+
+                return;
+            }
+
+            if (proj != viewPort.getProjection()) {
+                int option = JOptionPane.YES_OPTION;
+
+                if (!CRSFactory.doesRigurousTransformations()) {
+                    option = JOptionPane.showConfirmDialog((Component) PluginServices.getMainFrame(),
+                            PluginServices.getText(Annotation_Layer.class,
+                                "reproyectar_aviso") + "\n" +
+                            PluginServices.getText(Annotation_Layer.class,
+                                "Capa") + ": " + lyrVect.getName(),
+                            PluginServices.getText(Annotation_Layer.class,
+                                "reproyectar_pregunta"),
+                            JOptionPane.YES_NO_OPTION);
+                }
+
+                if (option != JOptionPane.OK_OPTION) {
+                    return;
+                }
+
+                ICoordTrans ct = proj.getCT(viewPort.getProjection());
+                lyrVect.setCoordTrans(ct);
+                System.err.println("coordTrans = " + proj.getAbrev() + " " +
+                    viewPort.getProjection().getAbrev());
+            }
+        }
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Open.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Create.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Create.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Create.java	(revision 11783)
@@ -0,0 +1,276 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.gui;
+
+import java.awt.Component;
+import java.io.File;
+import java.io.IOException;
+
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+
+import jwizardcomponent.FinishAction;
+import jwizardcomponent.JWizardComponents;
+
+import com.hardcode.driverManager.Driver;
+import com.hardcode.gdbms.engine.data.driver.DriverException;
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.MapContext;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.drivers.FieldDescription;
+import com.iver.cit.gvsig.fmap.drivers.SHPLayerDefinition;
+import com.iver.cit.gvsig.fmap.drivers.shp.IndexedShpDriver;
+import com.iver.cit.gvsig.fmap.edition.EditionException;
+import com.iver.cit.gvsig.fmap.edition.IWriter;
+import com.iver.cit.gvsig.fmap.edition.writers.shp.ShpWriter;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.gui.panels.annotation.ConfigureLabel;
+import com.iver.utiles.SimpleFileFilter;
+
+
+/**
+ * Dialog to create a new annotation layer.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Create extends FinishAction {
+    private JWizardComponents myWizardComponents;
+    private MapContext map;
+    private Annotation_Layer layerAnnotation;
+
+    public Annotation_Create(JWizardComponents wizardComponents,
+        MapContext map, Annotation_Layer layerAnnotation) {
+        super(wizardComponents);
+        this.map = map;
+        this.layerAnnotation = layerAnnotation;
+        myWizardComponents = wizardComponents;
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void performAction() {
+        myWizardComponents.getFinishButton().setEnabled(false);
+
+        Annotation_FieldSelect panel1 = (Annotation_FieldSelect) myWizardComponents.getWizardPanel(0);
+        Annotation_ConfigureLabel panel2 = (Annotation_ConfigureLabel) myWizardComponents.getWizardPanel(1);
+
+        SelectableDataSource source;
+        Annotation_Mapping mapping = new Annotation_Mapping();
+
+        try {
+            source = this.layerAnnotation.getRecordset();
+
+            mapping.setColumnText(source.getFieldIndexByName(panel1.getField()));
+
+            if (!panel2.getAngleFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnRotate(source.getFieldIndexByName(
+                        panel2.getAngleFieldName()));
+            }
+
+            if (!panel2.getColorFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnColor(source.getFieldIndexByName(
+                        panel2.getColorFieldName()));
+            }
+
+            if (!panel2.getSizeFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnHeight(source.getFieldIndexByName(
+                        panel2.getSizeFieldName()));
+            }
+
+            if (!panel2.getFontFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnTypeFont(source.getFieldIndexByName(
+                        panel2.getFontFieldName()));
+            }
+        } catch (com.iver.cit.gvsig.fmap.DriverException e) {
+            e.printStackTrace();
+
+            return;
+        } catch (DriverException e) {
+            e.printStackTrace();
+        }
+
+        // this.layerAnnotation.setName(panel1.getNewLayerName());
+        this.layerAnnotation.setMapping(mapping);
+        ((FSymbol) this.layerAnnotation.getLegend().getDefaultSymbol()).setFontSizeInPixels(panel2.sizeUnitsInPixels());
+
+        try {
+            saveToShp(map, this.layerAnnotation, panel1.getDuplicate());
+        } catch (EditionException e) {
+            e.printStackTrace();
+        } catch (DriverIOException e) {
+            e.printStackTrace();
+        }
+
+        this.myWizardComponents.getCancelAction().performAction();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param mapContext DOCUMENT ME!
+     * @param layer DOCUMENT ME!
+     * @param duplicate DOCUMENT ME!
+     *
+     * @throws EditionException DOCUMENT ME!
+     * @throws DriverIOException DOCUMENT ME!
+     */
+    public void saveToShp(MapContext mapContext, Annotation_Layer layer,
+        String duplicate) throws EditionException, DriverIOException {
+        try {
+            JFileChooser jfc = new JFileChooser();
+            SimpleFileFilter filterShp = new SimpleFileFilter("shp",
+                    PluginServices.getText(this, "shp_files"));
+            jfc.setFileFilter(filterShp);
+
+            if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+                File newFile = jfc.getSelectedFile();
+                String path = newFile.getAbsolutePath();
+
+                if (newFile.exists()) {
+                    int resp = JOptionPane.showConfirmDialog((Component) PluginServices.getMainFrame(),
+                            PluginServices.getText(this,
+                                "fichero_ya_existe_seguro_desea_guardarlo"),
+                            PluginServices.getText(this, "guardar"),
+                            JOptionPane.YES_NO_OPTION);
+
+                    if (resp != JOptionPane.YES_OPTION) {
+                        return;
+                    }
+                }
+
+                if (!(path.toLowerCase().endsWith(".shp"))) {
+                    path = path + ".shp";
+                }
+
+                newFile = new File(path);
+
+                SelectableDataSource sds = layer.getRecordset();
+                FieldDescription[] fieldsDescrip = sds.getFieldsDescription();
+
+                ShpWriter writer = (ShpWriter) LayerFactory.getWM().getWriter("Shape Writer");
+                Driver driver = null;
+
+                SHPLayerDefinition lyrDefPoint = new SHPLayerDefinition();
+                lyrDefPoint.setFieldsDesc(fieldsDescrip);
+
+                File filePoints = new File(path);
+                lyrDefPoint.setFile(filePoints);
+                lyrDefPoint.setName(filePoints.getName());
+                lyrDefPoint.setShapeType(FShape.POINT);
+                writer.setFile(filePoints);
+                writer.initialize(lyrDefPoint);
+                driver = getOpenAnnotationDriver(filePoints);
+                writeFeatures(mapContext, layer, writer, driver, duplicate);
+            }
+        } catch (DriverException e) {
+            e.printStackTrace();
+            throw new EditionException(e);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (com.iver.cit.gvsig.fmap.DriverException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param filePoints DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws IOException DOCUMENT ME!
+     */
+    private Driver getOpenAnnotationDriver(File filePoints)
+        throws IOException {
+        IndexedShpDriver drv = new IndexedShpDriver();
+
+        if (!filePoints.exists()) {
+            filePoints.createNewFile();
+
+            File newFileSHX = new File(filePoints.getAbsolutePath().replaceAll("[.]shp",
+                        ".shx"));
+            newFileSHX.createNewFile();
+
+            File newFileDBF = new File(filePoints.getAbsolutePath().replaceAll("[.]shp",
+                        ".dbf"));
+            newFileDBF.createNewFile();
+        }
+
+        File newFileGVA = new File(filePoints.getAbsolutePath().replaceAll("[.]shp",
+                    ".gva"));
+
+        if (!newFileGVA.exists()) {
+            newFileGVA.createNewFile();
+        }
+
+        drv.open(filePoints);
+
+        return drv;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param mapContext DOCUMENT ME!
+     * @param layer DOCUMENT ME!
+     * @param writer DOCUMENT ME!
+     * @param reader DOCUMENT ME!
+     * @param duplicate DOCUMENT ME!
+     *
+     * @throws DriverIOException DOCUMENT ME!
+     * @throws com.iver.cit.gvsig.fmap.DriverException DOCUMENT ME!
+     */
+    private void writeFeatures(MapContext mapContext, Annotation_Layer layer,
+        IWriter writer, Driver reader, String duplicate)
+        throws DriverIOException, com.iver.cit.gvsig.fmap.DriverException {
+        PluginServices.cancelableBackgroundExecution(new Annotation_TaskCreate(
+                mapContext, layer, writer, reader, duplicate));
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Create.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_FieldSelect.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_FieldSelect.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_FieldSelect.java	(revision 11783)
@@ -0,0 +1,295 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.gui;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.event.CaretEvent;
+import javax.swing.event.CaretListener;
+
+import jwizardcomponent.JWizardComponents;
+import jwizardcomponent.JWizardPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+
+
+/**
+ * Panel to select the text field.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_FieldSelect extends JWizardPanel {
+    private static final Rectangle lblDescriptionPosition = new Rectangle(4, 4,
+            355, 75);
+
+    // private static final Rectangle lblStep1Position = new Rectangle(4, 90,
+    // 15,
+    // 15);
+    // private static final Rectangle lblNewLayerNamePosition = new
+    // Rectangle(30,90,355,15);
+    private static final Rectangle lblDuplicatePosition = new Rectangle(30, 80,
+            355, 30);
+    private static final Rectangle cmbDuplicatePosition = new Rectangle(30,
+            110, 170, 18);
+    private static final Rectangle lblStep2Position = new Rectangle(4, 135, 15,
+            12);
+    private static final Rectangle lblFieldPosition = new Rectangle(30, 135,
+            355, 30);
+    private static final Rectangle cmbFieldPosition = new Rectangle(30, 169,
+            170, 18);
+    private Annotation_Layer layer;
+    private JLabel lblDescription = null;
+
+    // private JLabel lblStep1 = null;
+    // private JLabel lblNewLayerName = null;
+    private JLabel lblStep2 = null;
+    private JLabel lblField = null;
+
+    // private JTextField txtNewLayerName = null;
+    private JComboBox cmbField = null;
+    private EventsListener eventsListener = new EventsListener();
+    private JComboBox cmbDuplicate;
+    private JLabel lblDuplicate = null;
+
+    public Annotation_FieldSelect(JWizardComponents arg0, Annotation_Layer layer) {
+        super(arg0);
+        this.layer = layer;
+        this.initialize();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void updateButtonsState() {
+        try {
+            if (getWizardComponents().getCurrentIndex() == 0) {
+                setBackButtonEnabled(false);
+
+                boolean enabled = checkIsOkPanelData();
+                setNextButtonEnabled(enabled);
+                setFinishButtonEnabled(enabled);
+            }
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    protected boolean checkIsOkPanelData() {
+        // if (txtNewLayerName.getText().trim().length() < 1) {
+        // return false;
+        // }
+        if (((String) cmbField.getSelectedItem()).trim().length() < 1) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    protected void initialize() {
+        this.setLayout(null);
+        this.setSize(new Dimension(358, 263));
+        this.addLabels();
+
+        // this.add(getTxtNewLayerName(),null);
+        this.add(getCmbField(), null);
+        this.add(getCmbDuplicate(), null);
+        checkIsOkPanelData();
+    }
+
+    // private JTextField getTxtNewLayerName() {
+    // if (this.txtNewLayerName == null) {
+    // this.txtNewLayerName = new JTextField();
+    // this.txtNewLayerName.setBounds(txtNewLayerNamePosition);
+    // this.txtNewLayerName.setText("NuevaCapa");
+    // this.txtNewLayerName.addCaretListener(eventsListener);
+    // }
+    // return this.txtNewLayerName;
+    // }
+    // public String getNewLayerName() {
+    // return this.getTxtNewLayerName().getText();
+    // }
+    private JComboBox getCmbField() {
+        if (this.cmbField == null) {
+            this.cmbField = new JComboBox();
+            this.cmbField.setEditable(false);
+            this.cmbField.setBounds(cmbFieldPosition);
+            this.cmbField.addItemListener(this.eventsListener);
+            this.cmbField.addItem("");
+
+            try {
+                SelectableDataSource dataSource = this.layer.getRecordset();
+
+                String[] fieldsNames = dataSource.getFieldNames();
+
+                for (int i = 0; i < fieldsNames.length; i++) {
+                    this.cmbField.addItem(fieldsNames[i]);
+                }
+
+                if (layer.getAnnotatonMapping() != null) {
+                    String fieldSelect = dataSource.getFieldName(layer.getAnnotatonMapping()
+                                                                      .getColumnText());
+                    this.cmbField.setSelectedItem(fieldSelect);
+                    setNextButtonEnabled(true);
+                }
+            } catch (DriverException e) {
+                e.printStackTrace();
+            } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return this.cmbField;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private JComboBox getCmbDuplicate() {
+        if (cmbDuplicate == null) {
+            cmbDuplicate = new JComboBox();
+            cmbDuplicate.setBounds(cmbDuplicatePosition);
+            cmbDuplicate.addItem(PluginServices.getText(this, "duplicate.none"));
+            cmbDuplicate.addItem(PluginServices.getText(this, "centered"));
+            cmbDuplicate.setSelectedItem(PluginServices.getText(this, "centered"));
+
+            // cmbInPixels.setBounds(cmbInPixelsPosition);
+            // cmbInPixels.addActionListener(new ActionListener(){
+            // public void actionPerformed(ActionEvent e) {
+            // if (e.getSource().equals(PluginServices.getText(this,"pixels"))){
+            //
+            // }
+            //
+            // }
+            //
+            // });
+        }
+
+        return cmbDuplicate;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getField() {
+        return (String) this.getCmbField().getSelectedItem();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getDuplicate() {
+        return (String) this.getCmbDuplicate().getSelectedItem();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    protected void addLabels() {
+        this.lblDescription = new JLabel();
+
+        // this.lblStep1 = new JLabel();
+        // this.lblNewLayerName = new JLabel();
+        this.lblStep2 = new JLabel();
+        this.lblField = new JLabel();
+        this.lblDuplicate = new JLabel();
+
+        this.lblDuplicate.setText(PluginServices.getText(this, "duplicate"));
+        this.lblDuplicate.setBounds(lblDuplicatePosition);
+        this.lblDescription.setText(PluginServices.getText(this,
+                "descripcion_de_crear_capa_de_anotaciones_nueva"));
+
+        // this.lblStep1.setText("1.");
+        // this.lblNewLayerName.setText(PluginServices.getText(this,"introduzca_el_nombre_de_la_nueva_capa_de_anotaciones"));
+        // this.lblStep2.setText("2.");
+        this.lblField.setText(PluginServices.getText(this,
+                "seleccione_el_campo_de_texto_que_desea_que_se_utilize_para_mostrar_la_nueva_capa"));
+
+        this.lblDescription.setBounds(lblDescriptionPosition);
+
+        // this.lblStep1.setBounds(lblStep1Position);
+        // this.lblNewLayerName.setBounds(lblNewLayerNamePosition);
+        this.lblStep2.setBounds(lblStep2Position);
+        this.lblField.setBounds(lblFieldPosition);
+
+        this.add(lblDescription, null);
+
+        // this.add(lblStep1,null);
+        // this.add(lblNewLayerName,null);
+        this.add(lblStep2, null);
+        this.add(lblField, null);
+        this.add(lblDuplicate, null);
+    }
+
+    private class EventsListener implements CaretListener, ItemListener {
+        public void caretUpdate(CaretEvent arg0) {
+            updateButtonsState();
+        }
+
+        public void itemStateChanged(ItemEvent e) {
+            updateButtonsState();
+        }
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_FieldSelect.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_TaskCreate.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_TaskCreate.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_TaskCreate.java	(revision 11783)
@@ -0,0 +1,637 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.gui;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.sql.Types;
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+
+import org.cresques.cts.ICoordTrans;
+
+import com.hardcode.driverManager.Driver;
+import com.hardcode.gdbms.engine.data.driver.DriverException;
+import com.hardcode.gdbms.engine.values.Value;
+import com.hardcode.gdbms.engine.values.ValueFactory;
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.MapContext;
+import com.iver.cit.gvsig.fmap.core.DefaultFeature;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.IFeature;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.core.v02.FLabel;
+import com.iver.cit.gvsig.fmap.drivers.DriverAttributes;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.drivers.FieldDescription;
+import com.iver.cit.gvsig.fmap.drivers.SHPLayerDefinition;
+import com.iver.cit.gvsig.fmap.drivers.VectorialDriver;
+import com.iver.cit.gvsig.fmap.edition.DefaultRowEdited;
+import com.iver.cit.gvsig.fmap.edition.EditionException;
+import com.iver.cit.gvsig.fmap.edition.IWriter;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLyrVect;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.layers.LayerListener;
+import com.iver.cit.gvsig.fmap.layers.ReadableVectorial;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
+import com.iver.utiles.PostProcessSupport;
+import com.iver.utiles.swing.threads.AbstractMonitorableTask;
+
+
+/**
+ * Task to create the annotation layer.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_TaskCreate extends AbstractMonitorableTask {
+    Annotation_Layer lyrVect;
+    IWriter writer;
+    int rowCount;
+    ReadableVectorial va;
+    SelectableDataSource sds;
+    FBitSet bitSet;
+    MapContext mapContext;
+    VectorialDriver reader;
+    private Annotation_Mapping mapping;
+    private String duplicate;
+    private HashMap mapGeom = new HashMap();
+    private HashMap mapAttri = new HashMap();
+
+    public Annotation_TaskCreate(MapContext mapContext, Annotation_Layer lyr,
+        IWriter writer, Driver reader, String duplicate)
+        throws DriverIOException, com.iver.cit.gvsig.fmap.DriverException {
+        this.duplicate = duplicate;
+        this.mapping = lyr.getAnnotatonMapping();
+        this.mapContext = mapContext;
+        this.lyrVect = lyr;
+        this.writer = writer;
+        this.reader = (VectorialDriver) reader;
+
+        setInitialStep(0);
+        setDeterminatedProcess(true);
+        setStatusMessage(PluginServices.getText(this, "exporting_") + ": " +
+            PluginServices.getText(this, "annotations"));
+
+        va = lyrVect.getSource();
+        sds = lyrVect.getRecordset();
+
+        bitSet = sds.getSelection();
+
+        if (bitSet.cardinality() == 0) {
+            rowCount = va.getShapeCount();
+        } else {
+            rowCount = bitSet.cardinality();
+        }
+
+        setFinalStep(rowCount);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @throws Exception DOCUMENT ME!
+     */
+    public void run() throws Exception {
+        if (duplicate.equals(PluginServices.getText(this, "centered"))) {
+            duplicate();
+        }
+
+        // va.start();
+        ICoordTrans ct = lyrVect.getCoordTrans();
+        DriverAttributes attr = va.getDriverAttributes();
+        boolean bMustClone = false;
+
+        if (attr != null) {
+            if (attr.isLoadedInMemory()) {
+                bMustClone = attr.isLoadedInMemory();
+            }
+        }
+
+        SHPLayerDefinition lyrDef = (SHPLayerDefinition) writer.getTableDefinition();
+        lyrDef.setShapeType(FShape.POINT);
+
+        FieldDescription[] fields = getFieldDescriptions();
+        lyrDef.setFieldsDesc(fields);
+        writer.initialize(lyrDef);
+
+        // Creamos la tabla.
+        writer.preProcess();
+
+        if (duplicate.equals(PluginServices.getText(this, "centered"))) {
+            int pos = 0;
+            Iterator iter = mapGeom.keySet().iterator();
+
+            while (iter.hasNext()) {
+                String textValue = (String) iter.next();
+                Rectangle2D rectangle = (Rectangle2D) mapGeom.get(textValue);
+                IGeometry geom = ShapeFactory.createPoint2D(rectangle.getCenterX(),
+                        rectangle.getCenterY());
+
+                if (ct != null) {
+                    if (bMustClone) {
+                        geom = geom.cloneGeometry();
+                    }
+
+                    geom.reProject(ct);
+                }
+
+                reportStep();
+                setNote(PluginServices.getText(this, "exporting_") + " " + pos +
+                    "    " + mapGeom.size());
+
+                Value[] values = (Value[]) mapAttri.get(textValue);
+                IFeature feat = new DefaultFeature(geom, values, "" + pos);
+                DefaultRowEdited edRow = new DefaultRowEdited(feat,
+                        DefaultRowEdited.STATUS_ADDED, pos);
+                writer.process(edRow);
+                pos++;
+            }
+        } else if (duplicate.equals(PluginServices.getText(this, "none"))) {
+            va.start();
+
+            if (bitSet.cardinality() == 0) {
+                rowCount = va.getShapeCount();
+
+                for (int i = 0; i < rowCount; i++) {
+                    IGeometry geom = va.getShape(i);
+
+                    if (geom.getGeometryType() != FShape.POINT) {
+                        Point2D p = FLabel.createLabelPoint((FShape) geom.getInternalShape());
+                        geom = ShapeFactory.createPoint2D(p.getX(), p.getY());
+                    }
+
+                    if (ct != null) {
+                        if (bMustClone) {
+                            geom = geom.cloneGeometry();
+                        }
+
+                        geom.reProject(ct);
+                    }
+
+                    reportStep();
+                    setNote(PluginServices.getText(this, "exporting_") + " " +
+                        i + "    " + rowCount);
+
+                    if (isCanceled()) {
+                        break;
+                    }
+
+                    if (geom != null) {
+                        Value[] valuesAnnotation = getValuesAnnotation(i);
+
+                        IFeature feat = new DefaultFeature(geom,
+                                valuesAnnotation, "" + i);
+                        DefaultRowEdited edRow = new DefaultRowEdited(feat,
+                                DefaultRowEdited.STATUS_ADDED, i);
+                        writer.process(edRow);
+                    }
+                }
+            } else {
+                int counter = 0;
+
+                for (int i = bitSet.nextSetBit(0); i >= 0;
+                        i = bitSet.nextSetBit(i + 1)) {
+                    IGeometry geom = va.getShape(i);
+
+                    if (geom.getGeometryType() != FShape.POINT) {
+                        Point2D p = FLabel.createLabelPoint((FShape) geom.getInternalShape());
+                        geom = ShapeFactory.createPoint2D(p.getX(), p.getY());
+                    }
+
+                    if (ct != null) {
+                        if (bMustClone) {
+                            geom = geom.cloneGeometry();
+                        }
+
+                        geom.reProject(ct);
+                    }
+
+                    reportStep();
+                    setNote(PluginServices.getText(this, "exporting_") + " " +
+                        counter + "    " + bitSet.cardinality());
+
+                    if (isCanceled()) {
+                        break;
+                    }
+
+                    if (geom != null) {
+                        Value[] valuesAnnotation = getValuesAnnotation(i);
+                        IFeature feat = new DefaultFeature(geom,
+                                valuesAnnotation, "" + i);
+                        DefaultRowEdited edRow = new DefaultRowEdited(feat,
+                                DefaultRowEdited.STATUS_ADDED, i);
+
+                        writer.process(edRow);
+                    }
+
+                    va.stop();
+                }
+            }
+        }
+
+        writer.postProcess();
+
+        //
+        // if (bitSet.cardinality() == 0) {
+        // rowCount = va.getShapeCount();
+        //
+        // for (int i = 0; i < rowCount; i++) {
+        // IGeometry geom = va.getShape(i);
+        //
+        // if (geom.getGeometryType() != FShape.POINT) {
+        // Point2D p = FLabel.createLabelPoint((FShape)
+        // geom.getInternalShape());
+        // geom = ShapeFactory.createPoint2D(p.getX(), p.getY());
+        // }
+        //
+        // if (ct != null) {
+        // if (bMustClone) {
+        // geom = geom.cloneGeometry();
+        // }
+        //
+        // geom.reProject(ct);
+        // }
+        //
+        // reportStep();
+        // setNote(PluginServices.getText(this, "exporting_") +" "+ i+ "
+        // "+rowCount);
+        //
+        // if (isCanceled()) {
+        // break;
+        // }
+        //
+        // if (geom != null) {
+        // Value[] valuesAnnotation = getValuesAnnotation(i);
+        //
+        // IFeature feat = new DefaultFeature(geom, valuesAnnotation,
+        // "" + i);
+        // DefaultRowEdited edRow = new DefaultRowEdited(feat,
+        // DefaultRowEdited.STATUS_ADDED, i);
+        // writer.process(edRow);
+        // }
+        // }
+        // } else {
+        // int counter = 0;
+        //
+        // for (int i = bitSet.nextSetBit(0); i >= 0;
+        // i = bitSet.nextSetBit(i + 1)) {
+        // IGeometry geom = va.getShape(i);
+        //
+        // if (geom.getGeometryType() != FShape.POINT) {
+        // Point2D p = FLabel.createLabelPoint((FShape)
+        // geom.getInternalShape());
+        // geom = ShapeFactory.createPoint2D(p.getX(), p.getY());
+        // }
+        //
+        // if (ct != null) {
+        // if (bMustClone) {
+        // geom = geom.cloneGeometry();
+        // }
+        //
+        // geom.reProject(ct);
+        // }
+        //
+        // reportStep();
+        // setNote(PluginServices.getText(this, "exporting_") +" "+ counter+ "
+        // "+bitSet.cardinality());
+        //
+        // if (isCanceled()) {
+        // break;
+        // }
+        //
+        // if (geom != null) {
+        // Value[] valuesAnnotation = getValuesAnnotation(i);
+        // IFeature feat = new DefaultFeature(geom, valuesAnnotation,
+        // "" + i);
+        // DefaultRowEdited edRow = new DefaultRowEdited(feat,
+        // DefaultRowEdited.STATUS_ADDED, i);
+        //
+        // writer.process(edRow);
+        // }
+        // }
+        // }
+        //
+        // writer.postProcess();
+        // va.stop();
+        mapAttri.clear();
+        mapGeom.clear();
+
+        if (reader != null) {
+            int res = JOptionPane.showConfirmDialog((JComponent) PluginServices.getMDIManager()
+                                                                               .getActiveWindow(),
+                    PluginServices.getText(this,
+                        "insertar_en_la_vista_la_capa_creada"),
+                    PluginServices.getText(this, "insertar_capa"),
+                    JOptionPane.YES_NO_OPTION);
+
+            if (res == JOptionPane.YES_OPTION) {
+                PostProcessSupport.executeCalls();
+                lyrDef = (SHPLayerDefinition) writer.getTableDefinition();
+
+                FLayer newLayer = LayerFactory.createLayer(lyrDef.getName(),
+                        reader, mapContext.getProjection());
+
+                Annotation_Layer la = new Annotation_Layer();
+                LayerListener[] layerListeners = newLayer.getLayerListeners();
+
+                for (int i = 0; i < layerListeners.length; i++) {
+                    la.addLayerListener(layerListeners[i]);
+                }
+
+                la.setSource(((FLyrVect) newLayer).getSource());
+                la.setProjection(newLayer.getProjection());
+                la.setName(newLayer.getName());
+                la.setLegend((VectorialLegend) lyrVect.getLegend());
+                Annotation_Mapping.addAnnotationMapping(la);
+                mapContext.getLayers().addLayer(la);
+            }
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private FieldDescription[] getFieldDescriptions() {
+        SHPLayerDefinition lyrDef = (SHPLayerDefinition) writer.getTableDefinition();
+        FieldDescription[] fields = new FieldDescription[Annotation_Mapping.NUMCOLUMNS]; // lyrDef.getFieldsDesc();
+
+        int posText = mapping.getColumnText();
+        int posTypeFont = mapping.getColumnTypeFont();
+        int posStyleFont = mapping.getColumnStyleFont();
+        int posColor = mapping.getColumnColor();
+        int posHeight = mapping.getColumnHeight();
+        int posRotate = mapping.getColumnRotate();
+
+        FieldDescription[] fieldsDescriptions = lyrDef.getFieldsDesc();
+        setField(Annotation_Mapping.TEXT, fieldsDescriptions, fields, posText, 0);
+        setField(Annotation_Mapping.TYPEFONT, fieldsDescriptions, fields,
+            posTypeFont, 1);
+        setField(Annotation_Mapping.STYLEFONT, fieldsDescriptions, fields,
+            posStyleFont, 2);
+        setField(Annotation_Mapping.COLOR, fieldsDescriptions, fields,
+            posColor, 3);
+        setField(Annotation_Mapping.HEIGHT, fieldsDescriptions, fields,
+            posHeight, 4);
+        setField(Annotation_Mapping.ROTATE, fieldsDescriptions, fields,
+            posRotate, 5);
+
+        return fields;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param name DOCUMENT ME!
+     * @param antFields DOCUMENT ME!
+     * @param fields DOCUMENT ME!
+     * @param pos DOCUMENT ME!
+     * @param i DOCUMENT ME!
+     */
+    private void setField(String name, FieldDescription[] antFields,
+        FieldDescription[] fields, int pos, int i) {
+        int type = Annotation_Mapping.getType(name);
+
+        if (pos != -1) {
+            fields[i] = antFields[pos];
+        } else {
+            fields[i] = new FieldDescription();
+
+            if (type != Types.VARCHAR) {
+                if (name.equals("Color")) {
+                    fields[i].setFieldLength(10);
+                }
+            }
+
+            //			else {
+            //				fields[i].setFieldLength(10);
+            //				fields[i].setFieldDecimalCount(3);
+            //			}
+        }
+
+        fields[i].setFieldType(type);
+        fields[i].setFieldName(name);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param i DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     *
+     * @throws DriverException DOCUMENT ME!
+     * @throws EditionException DOCUMENT ME!
+     */
+    private Value[] getValuesAnnotation(int i)
+        throws DriverException, EditionException {
+        int posText = mapping.getColumnText();
+        int posTypeFont = mapping.getColumnTypeFont();
+        int posStyleFont = mapping.getColumnStyleFont();
+        int posColor = mapping.getColumnColor();
+        int posHeight = mapping.getColumnHeight();
+        int posRotate = mapping.getColumnRotate();
+
+        Value[] values = sds.getRow(i);
+        Value[] valuesAnnotation = new Value[Annotation_Mapping.NUMCOLUMNS];
+
+        setValue(Annotation_Mapping.TEXT, values, valuesAnnotation, posText, 0);
+        setValue(Annotation_Mapping.TYPEFONT, values, valuesAnnotation,
+            posTypeFont, 1);
+        setValue(Annotation_Mapping.STYLEFONT, values, valuesAnnotation,
+            posStyleFont, 2);
+        setValue(Annotation_Mapping.COLOR, values, valuesAnnotation, posColor, 3);
+        setValue(Annotation_Mapping.HEIGHT, values, valuesAnnotation,
+            posHeight, 4);
+        setValue(Annotation_Mapping.ROTATE, values, valuesAnnotation,
+            posRotate, 5);
+
+        return valuesAnnotation;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param name DOCUMENT ME!
+     * @param antValues DOCUMENT ME!
+     * @param values DOCUMENT ME!
+     * @param pos DOCUMENT ME!
+     * @param i DOCUMENT ME!
+     */
+    private void setValue(String name, Value[] antValues, Value[] values,
+        int pos, int i) {
+        int type = Annotation_Mapping.getType(name);
+
+        if (pos != -1) {
+            try {
+                values[i] = ValueFactory.createValueByType(antValues[pos].toString(),
+                        type);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        } else {
+            // if (type == Types.VARCHAR) {
+            // values[i] = ValueFactory.createNullValue();
+            // } else {
+            try {
+                if (name == Annotation_Mapping.TEXT) {
+                    values[i] = ValueFactory.createValueByType(String.valueOf(
+                                Annotation_Mapping.DEFAULTTEXT), type);
+                } else if (name == Annotation_Mapping.COLOR) {
+                    values[i] = ValueFactory.createValueByType(String.valueOf(
+                                Annotation_Mapping.DEFAULTCOLOR), type);
+                } else if (name == Annotation_Mapping.HEIGHT) {
+                    values[i] = ValueFactory.createValueByType(String.valueOf(
+                                Annotation_Mapping.DEFAULTHEIGHT), type);
+                } else if (name == Annotation_Mapping.TYPEFONT) {
+                    values[i] = ValueFactory.createValueByType(String.valueOf(
+                                Annotation_Mapping.DEFAULTTYPEFONT), type);
+                } else if (name == Annotation_Mapping.STYLEFONT) {
+                    values[i] = ValueFactory.createValueByType(String.valueOf(
+                                Annotation_Mapping.DEFAULTSTYLEFONT), type);
+                } else if (name == Annotation_Mapping.ROTATE) {
+                    values[i] = ValueFactory.createValueByType(String.valueOf(
+                                Annotation_Mapping.DEFAULTROTATE), type);
+                }
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            // }
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @throws DriverIOException DOCUMENT ME!
+     * @throws DriverException DOCUMENT ME!
+     * @throws EditionException DOCUMENT ME!
+     */
+    private void duplicate()
+        throws DriverIOException, DriverException, EditionException {
+        va.start();
+
+        if (bitSet.cardinality() == 0) {
+            rowCount = va.getShapeCount();
+
+            for (int i = 0; i < rowCount; i++) {
+                IGeometry geom = va.getShape(i);
+                modifyMap(geom, i);
+
+                // reportStep();
+                // setNote(PluginServices.getText(this, "exporting_") +" "+ i+ "
+                // "+rowCount);
+                if (isCanceled()) {
+                    break;
+                }
+            }
+        } else {
+            for (int i = bitSet.nextSetBit(0); i >= 0;
+                    i = bitSet.nextSetBit(i + 1)) {
+                IGeometry geom = va.getShape(i);
+                modifyMap(geom, i);
+
+                // reportStep();
+                // setNote(PluginServices.getText(this, "exporting_") +" "+
+                // counter+ " "+bitSet.cardinality());
+                if (isCanceled()) {
+                    break;
+                }
+            }
+        }
+
+        va.stop();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param geom DOCUMENT ME!
+     * @param index DOCUMENT ME!
+     *
+     * @throws DriverException DOCUMENT ME!
+     * @throws EditionException DOCUMENT ME!
+     */
+    private void modifyMap(IGeometry geom, int index)
+        throws DriverException, EditionException {
+        if (geom.getGeometryType() != FShape.POINT) {
+            Point2D p = FLabel.createLabelPoint((FShape) geom.getInternalShape());
+            geom = ShapeFactory.createPoint2D(p.getX(), p.getY());
+        }
+
+        if (geom != null) {
+            Value[] valuesAnnotation = getValuesAnnotation(index);
+            String textValue = valuesAnnotation[0].toString();
+
+            if (!mapAttri.containsKey(textValue)) {
+                mapAttri.put(textValue, valuesAnnotation);
+            }
+
+            if (mapGeom.containsKey(textValue)) {
+                IGeometry geometry2 = geom;
+                Rectangle2D rectangle1 = (Rectangle2D) mapGeom.get(textValue);
+
+                // FPoint2D pointNew = new
+                // FPoint2D((point1.getX()+point2.getX())/2,(point1.getY()+point2.getY())/2);
+                mapGeom.put(textValue,
+                    rectangle1.createUnion(geometry2.getBounds2D()));
+                reportStep();
+                setNote(PluginServices.getText(this, "exporting_"));
+            } else {
+                mapGeom.put(textValue, geom.getBounds2D());
+            }
+        }
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_TaskCreate.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Modify.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Modify.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Modify.java	(revision 11783)
@@ -0,0 +1,232 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.gui;
+
+import jwizardcomponent.FinishAction;
+import jwizardcomponent.JWizardComponents;
+
+import com.hardcode.gdbms.engine.data.driver.DriverException;
+import com.iver.cit.gvsig.fmap.MapContext;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.gui.panels.annotation.ConfigureLabel;
+
+
+/**
+ * Dialog to create a new annotation layer.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Modify extends FinishAction {
+    private JWizardComponents myWizardComponents;
+    private MapContext map;
+    private Annotation_Layer layerAnnotation;
+
+    public Annotation_Modify(JWizardComponents wizardComponents,
+        MapContext map, Annotation_Layer layerAnnotation) {
+        super(wizardComponents);
+        this.map = map;
+        this.layerAnnotation = layerAnnotation;
+        myWizardComponents = wizardComponents;
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void performAction() {
+        myWizardComponents.getFinishButton().setEnabled(false);
+
+        Annotation_FieldSelect panel1 = (Annotation_FieldSelect) myWizardComponents.getWizardPanel(0);
+        Annotation_ConfigureLabel panel2 = (Annotation_ConfigureLabel) myWizardComponents.getWizardPanel(1);
+
+        SelectableDataSource source;
+        Annotation_Mapping mapping = new Annotation_Mapping();
+
+        try {
+            source = this.layerAnnotation.getRecordset();
+
+            mapping.setColumnText(source.getFieldIndexByName(panel1.getField()));
+
+            if (!panel2.getAngleFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnRotate(source.getFieldIndexByName(
+                        panel2.getAngleFieldName()));
+            }
+
+            if (!panel2.getColorFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnColor(source.getFieldIndexByName(
+                        panel2.getColorFieldName()));
+            }
+
+            if (!panel2.getSizeFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnHeight(source.getFieldIndexByName(
+                        panel2.getSizeFieldName()));
+            }
+
+            ((FSymbol) this.layerAnnotation.getLegend().getDefaultSymbol()).setFontSizeInPixels(panel2.sizeUnitsInPixels());
+
+            this.layerAnnotation.deleteSpatialIndex();
+
+            if (!panel2.getFontFieldName().equals(ConfigureLabel.TEXT_FOR_DEFAULT_VALUE)) {
+                mapping.setColumnTypeFont(source.getFieldIndexByName(
+                        panel2.getFontFieldName()));
+            }
+        } catch (com.iver.cit.gvsig.fmap.DriverException e) {
+            e.printStackTrace();
+
+            return;
+        } catch (DriverException e) {
+            e.printStackTrace();
+        }
+
+        // this.layerAnnotation.setName(panel1.getNewLayerName());
+        this.layerAnnotation.setMapping(mapping);
+
+        // try {
+        // saveToShp(map, this.layerAnnotation);
+        // } catch (EditionException e) {
+        // e.printStackTrace();
+        // } catch (DriverIOException e) {
+        // e.printStackTrace();
+        // }
+        this.myWizardComponents.getCancelAction().performAction();
+    }
+
+    // public void saveToShp(MapContext mapContext, Annotation_Layer layer)
+    // throws EditionException, DriverIOException {
+    // try {
+    // JFileChooser jfc = new JFileChooser();
+    // SimpleFileFilter filterShp = new SimpleFileFilter("shp",
+    // PluginServices.getText(this, "shp_files"));
+    // jfc.setFileFilter(filterShp);
+    //
+    // if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) ==
+    // JFileChooser.APPROVE_OPTION) {
+    // File newFile = jfc.getSelectedFile();
+    // String path = newFile.getAbsolutePath();
+    //
+    // if (newFile.exists()) {
+    // int resp = JOptionPane.showConfirmDialog((Component)
+    // PluginServices.getMainFrame(),
+    // PluginServices.getText(this,
+    // "fichero_ya_existe_seguro_desea_guardarlo"),
+    // PluginServices.getText(this, "guardar"),
+    // JOptionPane.YES_NO_OPTION);
+    //
+    // if (resp != JOptionPane.YES_OPTION) {
+    // return;
+    // }
+    // }
+    //
+    // if (!(path.toLowerCase().endsWith(".shp"))) {
+    // path = path + ".shp";
+    // }
+    //
+    // newFile = new File(path);
+    //
+    // SelectableDataSource sds = layer.getRecordset();
+    // FieldDescription[] fieldsDescrip = sds.getFieldsDescription();
+    //
+    // ShpWriter writer = (ShpWriter) LayerFactory.getWM().getWriter("Shape
+    // Writer");
+    // Driver driver = null;
+    //
+    // SHPLayerDefinition lyrDefPoint = new SHPLayerDefinition();
+    // lyrDefPoint.setFieldsDesc(fieldsDescrip);
+    //
+    // File filePoints = new File(path);
+    // lyrDefPoint.setFile(filePoints);
+    // lyrDefPoint.setName(filePoints.getName());
+    // lyrDefPoint.setShapeType(FShape.POINT);
+    // writer.setFile(filePoints);
+    // writer.initialize(lyrDefPoint);
+    // driver = getOpenAnnotationDriver(filePoints);
+    // writeFeatures(mapContext, layer, writer, driver);
+    // }
+    // } catch (DriverException e) {
+    // e.printStackTrace();
+    // throw new EditionException(e);
+    // } catch (IOException e) {
+    // e.printStackTrace();
+    // } catch (com.iver.cit.gvsig.fmap.DriverException e) {
+    // e.printStackTrace();
+    // }
+    // }
+    // private Driver getOpenAnnotationDriver(File filePoints)
+    // throws IOException {
+    // IndexedShpDriver drv = new IndexedShpDriver();
+    //
+    // if (!filePoints.exists()) {
+    // filePoints.createNewFile();
+    //
+    // File newFileSHX = new
+    // File(filePoints.getAbsolutePath().replaceAll("[.]shp",
+    // ".shx"));
+    // newFileSHX.createNewFile();
+    //
+    // File newFileDBF = new
+    // File(filePoints.getAbsolutePath().replaceAll("[.]shp",
+    // ".dbf"));
+    // newFileDBF.createNewFile();
+    // }
+    //
+    // File newFileGVA = new
+    // File(filePoints.getAbsolutePath().replaceAll("[.]shp",
+    // ".gva"));
+    //
+    // if (!newFileGVA.exists()) {
+    // newFileGVA.createNewFile();
+    // }
+    //
+    // drv.open(filePoints);
+    //
+    // return drv;
+    // }
+    // private void writeFeatures(MapContext mapContext, Annotation_Layer layer,
+    // IWriter writer, Driver reader)
+    // throws DriverIOException, com.iver.cit.gvsig.fmap.DriverException {
+    // PluginServices.cancelableBackgroundExecution(new Annotation_TaskCreate(
+    // mapContext, layer, writer, reader));
+    // }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/gui/Annotation_Modify.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/Annotation_ModifyWindow.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/Annotation_ModifyWindow.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/Annotation_ModifyWindow.java	(revision 11783)
@@ -0,0 +1,345 @@
+package com.iver.cit.gvsig.project.documents.view.tool.gui;
+
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+
+import com.hardcode.gdbms.engine.values.NumericValue;
+import com.hardcode.gdbms.engine.values.StringValue;
+import com.hardcode.gdbms.engine.values.Value;
+import com.hardcode.gdbms.engine.values.ValueFactory;
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.IWindow;
+import com.iver.andami.ui.mdiManager.WindowInfo;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameText;
+import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
+import com.iver.cit.gvsig.project.documents.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.project.documents.layout.fframes.gui.dialogs.FFrameTextDialog;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.GridBagLayout;
+import javax.swing.JLabel;
+import java.awt.GridBagConstraints;
+import java.awt.event.ActionListener;
+
+import javax.swing.JTextField;
+import javax.swing.text.StyleConstants;
+
+import org.gvsig.gui.beans.AcceptCancelPanel;
+
+public class Annotation_ModifyWindow extends JPanel implements IWindow{
+
+	private JPanel jPanel = null;
+	private JLabel jLabel = null;
+	private JTextField jTextField = null;
+	private JLabel jLabel1 = null;
+	private JComboBox cmbTypeFont = null;
+	private JLabel jLabel2 = null;
+	private JComboBox cmbStyleFont = null;
+	private JLabel jLabel3 = null;
+	private JTextField txtHeight = null;
+	private JLabel jLabel4 = null;
+	private ColorChooserPanel colorPanel = null;
+	private JLabel jLabel5 = null;
+	private JTextField txtRotate = null;
+	private AcceptCancelPanel accept;
+	private boolean isAccepted=false;
+	private JPanel jPanel1 = null;  //  @jve:decl-index=0:visual-constraint="10,10"
+	private JPanel jPanel2 = null;
+	private Annotation_Mapping mapping;
+	/**
+	 * This is the default constructor
+	 */
+	public Annotation_ModifyWindow() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 * @return void
+	 */
+	private void initialize() {
+		this.setLayout(new BorderLayout());
+		this.setSize(292, 197);
+		this.add(getJPanel1(), java.awt.BorderLayout.CENTER);
+	}
+
+	public WindowInfo getWindowInfo() {
+		WindowInfo wi=new WindowInfo(WindowInfo.MODALDIALOG);
+		wi.setTitle(PluginServices.getText(this,"modify_annotation"));
+		return wi;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel() {
+		if (jPanel == null) {
+			GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
+			gridBagConstraints11.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			gridBagConstraints11.gridy = 5;
+			gridBagConstraints11.weightx = 1.0;
+			gridBagConstraints11.gridx = 1;
+			GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
+			gridBagConstraints10.gridx = 0;
+			gridBagConstraints10.gridy = 5;
+			jLabel5 = new JLabel();
+			jLabel5.setText(PluginServices.getText(this,"fontrotate"));
+			jLabel5.setPreferredSize(new java.awt.Dimension(100,16));
+			GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
+			gridBagConstraints9.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			gridBagConstraints9.gridy = 4;
+			gridBagConstraints9.weightx = 1.0;
+			gridBagConstraints9.gridx = 1;
+			GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
+			gridBagConstraints8.gridx = 0;
+			gridBagConstraints8.gridy = 4;
+			jLabel4 = new JLabel();
+			jLabel4.setText(PluginServices.getText(this,"fontcolor"));
+			jLabel4.setPreferredSize(new java.awt.Dimension(100,16));
+			GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
+			gridBagConstraints7.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			gridBagConstraints7.gridy = 3;
+			gridBagConstraints7.weightx = 1.0;
+			gridBagConstraints7.gridx = 1;
+			GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
+			gridBagConstraints6.gridx = 0;
+			gridBagConstraints6.gridy = 3;
+			jLabel3 = new JLabel();
+			jLabel3.setText(PluginServices.getText(this,"fontheight"));
+			jLabel3.setPreferredSize(new java.awt.Dimension(100,16));
+			GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
+			gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			gridBagConstraints5.gridy = 2;
+			gridBagConstraints5.weightx = 1.0;
+			gridBagConstraints5.gridx = 1;
+			GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
+			gridBagConstraints4.gridx = 0;
+			gridBagConstraints4.gridy = 2;
+			jLabel2 = new JLabel();
+			jLabel2.setText(PluginServices.getText(this,"fontstyle"));
+			jLabel2.setPreferredSize(new java.awt.Dimension(100,16));
+			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
+			gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			gridBagConstraints3.gridy = 1;
+			gridBagConstraints3.weightx = 1.0;
+			gridBagConstraints3.gridx = 1;
+			GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
+			gridBagConstraints2.gridx = 0;
+			gridBagConstraints2.gridy = 1;
+			jLabel1 = new JLabel();
+			jLabel1.setText(PluginServices.getText(this,"fonttype"));
+			jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING);
+			jLabel1.setPreferredSize(new java.awt.Dimension(100,16));
+			jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			gridBagConstraints1.gridy = 0;
+			gridBagConstraints1.weightx = 1.0;
+			gridBagConstraints1.gridx = 1;
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 0;
+			jLabel = new JLabel();
+			jLabel.setText(PluginServices.getText(this,"fonttext"));
+			jLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
+			jLabel.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING);
+			jLabel.setPreferredSize(new java.awt.Dimension(100,16));
+			jLabel.setVerticalAlignment(javax.swing.SwingConstants.CENTER);
+			jPanel = new JPanel();
+			jPanel.setLayout(new GridBagLayout());
+			jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"options"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			jPanel.add(jLabel, gridBagConstraints);
+			jPanel.add(getTxtText(), gridBagConstraints1);
+			jPanel.add(jLabel1, gridBagConstraints2);
+			jPanel.add(getCmbTypeFont(), gridBagConstraints3);
+			jPanel.add(jLabel2, gridBagConstraints4);
+			jPanel.add(getCmbStyleFont(), gridBagConstraints5);
+			jPanel.add(jLabel3, gridBagConstraints6);
+			jPanel.add(getTxtHeight(), gridBagConstraints7);
+			jPanel.add(jLabel4, gridBagConstraints8);
+			jPanel.add(getColorChooser(), gridBagConstraints9);
+			jPanel.add(jLabel5, gridBagConstraints10);
+			jPanel.add(getTxtRotate(), gridBagConstraints11);
+		}
+		return jPanel;
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getTxtText() {
+		if (jTextField == null) {
+			jTextField = new JTextField();
+		}
+		return jTextField;
+	}
+
+	/**
+	 * This method initializes txtTypeFont
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JComboBox getCmbTypeFont() {
+		if (cmbTypeFont == null) {
+			cmbTypeFont = new JComboBox();
+			cmbTypeFont.addItem("Arial");
+			cmbTypeFont.addItem("Dialog");
+			cmbTypeFont.addItem("DialogInput");
+			cmbTypeFont.addItem("Serif");
+			cmbTypeFont.addItem("SansSerif");
+			cmbTypeFont.addItem("Monospaced");
+			cmbTypeFont.addItem("Courier");
+			cmbTypeFont.addItem("TimesRoman");
+			cmbTypeFont.addItem("Helvetica");
+			cmbTypeFont.setSelectedItem("Arial");
+
+		}
+		return cmbTypeFont;
+	}
+
+	/**
+	 * This method initializes txtStyleFont
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JComboBox getCmbStyleFont() {
+		if (cmbStyleFont == null) {
+			cmbStyleFont = new JComboBox();
+			cmbStyleFont.addItem("Plain");
+			cmbStyleFont.addItem("Italic");
+			cmbStyleFont.addItem("Bold");
+			cmbStyleFont.setSelectedItem("Plain");
+		}
+		return cmbStyleFont;
+	}
+
+	/**
+	 * This method initializes txtHeight
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getTxtHeight() {
+		if (txtHeight == null) {
+			txtHeight = new JTextField();
+		}
+		return txtHeight;
+	}
+
+	/**
+	 * This method initializes txtColor
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private ColorChooserPanel getColorChooser() {
+		if (colorPanel == null) {
+			colorPanel = new ColorChooserPanel();
+		}
+		return colorPanel;
+	}
+
+	/**
+	 * This method initializes txtRotate
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getTxtRotate() {
+		if (txtRotate == null) {
+			txtRotate = new JTextField();
+		}
+		return txtRotate;
+	}
+	private AcceptCancelPanel getAcceptCancelPanel() {
+		if (accept == null) {
+			ActionListener okAction, cancelAction;
+			okAction = new java.awt.event.ActionListener() {
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+					isAccepted = true;
+					PluginServices.getMDIManager().closeWindow(
+							Annotation_ModifyWindow.this);
+				}
+			};
+			cancelAction = new java.awt.event.ActionListener() {
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+					isAccepted = false;
+					PluginServices.getMDIManager().closeWindow(
+							Annotation_ModifyWindow.this);
+				}
+			};
+			accept = new AcceptCancelPanel(okAction, cancelAction);
+			accept.setPreferredSize(new java.awt.Dimension(200, 30));
+			// accept.setBounds(new java.awt.Rectangle(243,387,160,28));
+			accept.setEnabled(true);
+			accept.setVisible(true);
+		}
+		return accept;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel1() {
+		if (jPanel1 == null) {
+			jPanel1 = new JPanel();
+			jPanel1.setLayout(new BorderLayout());
+			jPanel1.setSize(new java.awt.Dimension(244,142));
+			jPanel1.add(getJPanel(), java.awt.BorderLayout.NORTH);
+			jPanel1.add(getJPanel2(), java.awt.BorderLayout.SOUTH);
+		}
+		return jPanel1;
+	}
+
+	/**
+	 * This method initializes jPanel2
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel2() {
+		if (jPanel2 == null) {
+			jPanel2 = new JPanel();
+			jPanel2.add(getAcceptCancelPanel(), null);
+		}
+		return jPanel2;
+	}
+
+	public void setValues(Value[] values, Annotation_Mapping am) {
+		this.mapping=am;
+		getTxtText().setText(values[am.getColumnText()].toString());
+		getCmbTypeFont().setSelectedItem(values[am.getColumnTypeFont()].toString());
+		int style=((NumericValue)values[am.getColumnStyleFont()]).intValue();
+		getCmbStyleFont().setSelectedIndex(style);
+		getTxtHeight().setText(values[am.getColumnHeight()].toString());
+		int intColor=((NumericValue)values[am.getColumnColor()]).intValue();
+		Color color=new Color(intColor);
+		getColorChooser().setColor(color);
+		getColorChooser().setAlpha(color.getAlpha());
+		getTxtRotate().setText(values[am.getColumnRotate()].toString());
+
+	}
+
+	public boolean isAccepted() {
+		return isAccepted;
+	}
+
+	public Value[] getValues() {
+		Value[] values=new Value[6];
+		values[mapping.getColumnText()]=ValueFactory.createValue(getTxtText().getText());
+		values[mapping.getColumnTypeFont()]=ValueFactory.createValue(getCmbTypeFont().getSelectedItem().toString());
+		values[mapping.getColumnStyleFont()]=ValueFactory.createValue(getCmbStyleFont().getSelectedIndex());
+		values[mapping.getColumnHeight()]=ValueFactory.createValue(Double.parseDouble(getTxtHeight().getText()));
+		values[mapping.getColumnColor()]=ValueFactory.createValue(getColorChooser().getColor().getRGB());
+		values[mapping.getColumnRotate()]=ValueFactory.createValue(Double.parseDouble(getTxtRotate().getText()));
+		return values;
+	}
+
+}  //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/Annotation_ModifyWindow.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/FontChooser.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/FontChooser.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/FontChooser.java	(revision 11783)
@@ -0,0 +1,265 @@
+package com.iver.cit.gvsig.project.documents.view.tool.gui;
+
+/**
+ * Copyright (C) 2005 the Lexi Project.
+ *
+ * This file is part of the Lexi document editor.
+ *
+ * Lexi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * Lexi is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Classpath; see the file COPYING.  If not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ *
+ * Linking this library statically or dynamically with other modules is
+ * making a combined work based on this library.  Thus, the terms and
+ * conditions of the GNU General Public License cover the whole combination.
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.Enumeration;
+import java.util.Vector;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.StyleConstants;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+/**
+ * This class implements a Dialog for selecting a font, consisting of
+ * a font family, a style and a font size.
+ */
+public final class FontChooser extends JPanel
+implements ActionListener,
+    ListSelectionListener, ItemListener {
+//  private Lexi m_app;
+  private JList m_fontList;
+  private JTextArea m_prevArea;
+  private JComboBox m_sizeBox;
+  private JCheckBox m_boldBox, m_italicBox, m_plainBox;
+
+  private boolean m_outcome;
+
+  /**
+   * @param owner this Dialog's parent window.
+   * @param initial the initial font attributes
+   */
+  public FontChooser(JFrame owner, AttributeSet initial) {
+//    super(owner, "Font Chooser");
+    setSize(700, 500);
+    init(owner, initial);
+  }
+
+  /**
+   * Handle the actions associated with the 'ok' and the 'cancel' buttons
+   */
+  public void actionPerformed(ActionEvent e) {
+    String command = e.getActionCommand();
+    if (command.equals("can-button")) {
+      m_outcome = false;
+//      dispose();
+    }
+    else if (command.equals("ok-button")) {
+      m_outcome = true;
+//      dispose();
+    }
+  }
+
+  public boolean getOutcome() {
+    return m_outcome;
+  }
+
+  public int getFontSize() {
+    return Integer.parseInt(m_sizeBox.getSelectedItem().toString());
+  }
+
+  public int getFontStyle() {
+    return m_plainBox.isSelected() ? Font.PLAIN :
+      ((m_boldBox.isSelected() ? Font.BOLD : 0) +
+        (m_italicBox.isSelected() ? Font.ITALIC : 0));
+  }
+
+  public String getFontFamily() {
+    return m_fontList.getSelectedValue().toString();
+  }
+
+  /**
+   * Sets us up with the panels needed to create this font chooser
+   */
+  private void init(Component c, AttributeSet initial) {
+//    m_app = (Lexi) c;
+
+    JPanel main = new JPanel();
+    JPanel buttonPanel = new JPanel();
+    JPanel listPanel = new JPanel();
+    JPanel fontPanel = new JPanel();
+    JPanel optionPanel = new JPanel();
+    JPanel previewPanel = new JPanel();
+    main.setLayout(new BorderLayout());
+    buttonPanel.setLayout(new FlowLayout());
+    fontPanel.setLayout(new BorderLayout());
+    optionPanel.setLayout(new GridLayout(3, 2));
+
+//    Registry reg = Lexi.getRegistry();
+//    Enumeration fontEnum = reg.getKeys("FONTS");
+    Vector fonts = new Vector();
+//    while (fontEnum.hasMoreElements()) {
+//      String fontKey = (String) fontEnum.nextElement();
+//      if (reg.getBoolean("FONTS", fontKey)) {
+//        fonts.add(fontKey);
+//      }
+//    }
+
+    m_fontList = new JList(fonts);
+    m_fontList.addListSelectionListener(this);
+
+    JScrollPane scroller = new JScrollPane(m_fontList);
+    listPanel.add(scroller);
+
+    fontPanel.add(listPanel, BorderLayout.WEST);
+    fontPanel.add(optionPanel, BorderLayout.EAST);
+
+//    int[] sizes = m_app.getFontSizes();
+    m_sizeBox = new JComboBox();
+//    for (int k = 0; k < sizes.length; k++) {
+//      m_sizeBox.addItem(Integer.toString(sizes[k]));
+//    }
+    m_sizeBox.setEditable(false);
+    m_sizeBox.addItemListener(this);
+
+    optionPanel.add(m_sizeBox);
+    optionPanel.add(new JSeparator());
+    m_boldBox = new JCheckBox("Bold", false);
+    m_boldBox.addItemListener(this);
+    m_italicBox = new JCheckBox("Italic", false);
+    m_italicBox.addItemListener(this);
+    m_plainBox = new JCheckBox("Regular", false);
+    m_plainBox.addItemListener(this);
+
+    // Select the initial font style, size and family
+    boolean bold = StyleConstants.isBold(initial);
+    boolean italic = StyleConstants.isItalic(initial);
+    if (!(bold || italic)) {
+      m_plainBox.setSelected(true);
+      m_plainBox.setEnabled(true);
+      m_boldBox.setEnabled(false);
+      m_italicBox.setEnabled(false);
+    }
+    else {
+      if (bold) {
+        m_boldBox.setSelected(true);
+      }
+      if (italic) {
+        m_italicBox.setSelected(true);
+      }
+      m_plainBox.setEnabled(false);
+      m_boldBox.setEnabled(true);
+      m_italicBox.setEnabled(true);
+    }
+    String fontSize = Integer.toString(StyleConstants.getFontSize(initial));
+    m_sizeBox.setSelectedItem(fontSize);
+    String fontFamily = StyleConstants.getFontFamily(initial);
+    m_fontList.setSelectedValue(fontFamily, true);
+
+    optionPanel.add(m_plainBox);
+    optionPanel.add(m_italicBox);
+    optionPanel.add(m_boldBox);
+
+    // Button Pane
+    JButton okButton = new JButton("OK");
+    okButton.setActionCommand("ok-button");
+    okButton.addActionListener(this);
+    JButton cancelButton = new JButton("Cancel");
+    cancelButton.setActionCommand("can-button");
+    cancelButton.addActionListener(this);
+    buttonPanel.add(okButton);
+    buttonPanel.add(cancelButton);
+
+    // Preview Pane
+    m_prevArea = new JTextArea("The Quick Brown Fox...");
+    m_prevArea.setSize(200, 200);
+    m_prevArea.setEditable(false);
+    previewPanel.add(m_prevArea);
+    paintPreviewArea(true);
+
+    // Add Stuff to Main
+    main.add(fontPanel, BorderLayout.NORTH);
+    main.add(previewPanel, BorderLayout.CENTER);
+    main.add(buttonPanel, BorderLayout.SOUTH);
+
+//    getContentPane().add(main);
+//    pack();
+    // set the position of the dialog.
+//    setLocationRelativeTo(c);
+  }
+
+  /**
+   * Handles the list of fonts and the changes
+   */
+  public void itemStateChanged(ItemEvent iEv) {
+    if (iEv.getItem() == m_plainBox && iEv.getStateChange() == ItemEvent.SELECTED) {
+      m_boldBox.setEnabled(false);
+      m_italicBox.setEnabled(false);
+    }
+    if (iEv.getItem() == m_plainBox &&
+        iEv.getStateChange() == ItemEvent.DESELECTED) {
+      m_boldBox.setEnabled(true);
+      m_italicBox.setEnabled(true);
+    }
+    paintPreviewArea(true);
+  }
+
+  /**
+   * Handles the changes in the font size ComboBox
+   */
+  public void valueChanged(ListSelectionEvent listEv) {
+    paintPreviewArea(true);
+  }
+
+  private void paintPreviewArea(boolean repaint) {
+    if (m_prevArea != null) {
+      Object sizeSelection = m_sizeBox.getSelectedItem();
+      Object familySelection = m_fontList.getSelectedValue();
+
+      int size = Integer.parseInt(sizeSelection.toString());
+      String family = familySelection.toString();
+      int style = m_plainBox.isSelected() ? Font.PLAIN :
+        ((m_boldBox.isSelected() ? Font.BOLD : 0) +
+         (m_italicBox.isSelected() ? Font.ITALIC : 0));
+      Font newFont = new Font(family, style, size);
+      m_prevArea.setFont(newFont);
+
+      // Changing the font of the displayed text may cause the
+      // preview area's preferred size to change.
+      if (repaint) {
+//        pack();
+      }
+    }
+  }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/gui/FontChooser.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyListener.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyListener.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyListener.java	(revision 11783)
@@ -0,0 +1,70 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.view.tool;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+
+
+/**
+ * Class that extends of the tool Annotation_ModifyToolListenerImpl and
+ * override the methods that interests us to change its behavior.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_ModifyListener extends Annotation_ModifyToolListenerImpl {
+
+	public Annotation_ModifyListener(MapControl mapCtrl) {
+        super(mapCtrl);
+
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+     */
+    public void point(PointEvent event) {
+    	super.point(event);
+        PluginServices.getMainFrame().enableControls();
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyToolListenerImpl.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyToolListenerImpl.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyToolListenerImpl.java	(revision 11783)
@@ -0,0 +1,156 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.view.tool;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.io.IOException;
+import java.util.BitSet;
+
+import javax.swing.ImageIcon;
+
+import com.hardcode.gdbms.engine.values.Value;
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.Annotation_Extension;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.core.IRow;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.Annotation_EditableAdapter;
+import com.iver.cit.gvsig.fmap.edition.EditionEvent;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.operation.strategies.Annotation_Strategy;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener;
+import com.iver.cit.gvsig.project.documents.view.tool.gui.Annotation_ModifyWindow;
+
+
+/**
+ * Implementation of the interface PointListener as tool
+ * of modify annotation.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_ModifyToolListenerImpl implements PointListener {
+	private static final int tolerance=10;
+	private static final Image imodifytool = new ImageIcon(Annotation_Extension.class.getClassLoader()
+			.getResource("images/ModifyAnnotationCursor.png")).getImage();
+	private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(imodifytool,
+            new Point(16, 16), "");
+    private MapControl mapControl;
+    /**
+     * Create a new Annotation_ModifyToolListenerImpl.
+     *
+     * @param mapControl MapControl.
+     */
+    public Annotation_ModifyToolListenerImpl(MapControl mapControl) {
+        this.mapControl = mapControl;
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+     */
+    public void point(PointEvent event) {
+    	 FLayer[] layers=mapControl.getMapContext().getLayers().getActives();
+         if (layers[0] instanceof Annotation_Layer){
+        	 if (layers[0].isEditing())
+     	    try {
+				Annotation_Mapping am=((Annotation_Layer)layers[0]).getAnnotatonMapping();
+     	    	Annotation_Strategy as=(Annotation_Strategy)((Annotation_Layer)layers[0]).getStrategy();
+     	    	BitSet bs=as.queryByPoint(mapControl.getViewPort().toMapPoint(event.getPoint()),mapControl.getViewPort().toMapDistance(tolerance));
+     	    	Annotation_EditableAdapter aea=(Annotation_EditableAdapter)((Annotation_Layer)layers[0]).getSource();
+				if (bs.cardinality()>0)
+					aea.startComplexRow();
+     	    	for(int i=bs.nextSetBit(0); i>=0; i=bs.nextSetBit(i+1)) {
+     	    		IRow row=aea.getRow(i).getLinkedRow().cloneRow();
+     	    		Value[] values=row.getAttributes();
+					Annotation_ModifyWindow maw=new Annotation_ModifyWindow();
+					maw.setValues(values,am);
+					PluginServices.getMDIManager().addWindow(maw);
+					if (maw.isAccepted()){
+						Value[] newValues=maw.getValues();
+						if (!(values.equals(newValues))){
+							row.setAttributes(newValues);
+							aea.modifyRow(i,row,PluginServices.getText(this,"modify_annotation"),EditionEvent.ALPHANUMERIC);
+						}
+					}
+				}
+     	    	if (bs.cardinality()>0){
+     	    		aea.endComplexRow(PluginServices.getText(this,"modify_annotation"));
+     	    		mapControl.drawMap(false);
+     	    	}
+			} catch (DriverException e) {
+				e.printStackTrace();
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+     	 }
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+     */
+    public Cursor getCursor() {
+        return cur;
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+     */
+    public boolean cancelDrawing() {
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#pointDoubleClick(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+     */
+    public void pointDoubleClick(PointEvent event) {
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/tool/Annotation_ModifyToolListenerImpl.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/preferences/Annotation_Preferences.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/preferences/Annotation_Preferences.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/preferences/Annotation_Preferences.java	(revision 11783)
@@ -0,0 +1,281 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.view.legend.preferences;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.GridBagLayout;
+
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.border.TitledBorder;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.preferences.AbstractPreferencePage;
+import com.iver.andami.preferences.StoreException;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Mapping;
+import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
+import com.iver.utiles.StringUtilities;
+import com.iver.utiles.XMLEntity;
+/**
+ *  Default configuration page.
+ *  <b><b>
+ *  Here the user can establish what settings wants to use by default annotations.
+ *
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Preferences extends AbstractPreferencePage {
+	public static String DEFAULT_ANNOTATION_TEXT = "default_annotation_text";
+
+	public static String DEFAULT_ANNOTATION_TYPEFONT = "default_annotation_typefont";
+
+	public static String DEFAULT_ANNOTATION_ROTATE = "default_annotation_rotate";
+
+	public static String DEFAULT_ANNOTATION_STYLEFONT = "default_annotation_stylefont";
+
+	public static String DEFAULT_ANNOTATION_HEIGHT = "default_annotation_height";
+
+	public static String DEFAULT_ANNOTATION_COLOR = "default_annotation_color";
+
+	protected String id;
+	private ImageIcon icon;
+	private JTextField txtDefaultText;
+	private JTextField txtDefaultTypeFont;
+	private JTextField txtDefaultStyleFont;
+	private JTextField txtDefaultRotate;
+	private JTextField txtDefaultHeight;
+	private ColorChooserPanel jccDefaultColor;
+//	private JSlider jsDefaultColorAlpha;
+	private boolean panelStarted = false;
+
+	/**
+	 * Creates a new panel containing View preferences settings.
+	 *
+	 */
+	public Annotation_Preferences() {
+		super();
+		id = this.getClass().getName();
+		icon = new ImageIcon(this.getClass().getClassLoader().getResource("images/AnnotationProperties.png"));
+	}
+
+	public void initializeValues() {
+		if (!panelStarted) getPanel();
+
+		PluginServices ps = PluginServices.getPluginServices(this);
+		XMLEntity xml = ps.getPersistentXML();
+
+		if (xml.contains(DEFAULT_ANNOTATION_TEXT)) {
+			String text=xml.getStringProperty(DEFAULT_ANNOTATION_TEXT);
+			txtDefaultText.setText(text);
+			Annotation_Mapping.DEFAULTTEXT=text;
+		}else{
+			txtDefaultText.setText("");
+			Annotation_Mapping.DEFAULTTEXT="";
+		}
+		if (xml.contains(DEFAULT_ANNOTATION_TYPEFONT)) {
+			String text=xml.getStringProperty(DEFAULT_ANNOTATION_TYPEFONT);
+			txtDefaultTypeFont.setText(text);
+			Annotation_Mapping.DEFAULTTYPEFONT=text;
+		}else{
+			txtDefaultTypeFont.setText("Arial");
+			Annotation_Mapping.DEFAULTTYPEFONT="Arial";
+		}
+		if (xml.contains(DEFAULT_ANNOTATION_STYLEFONT)) {
+			int styleFont=xml.getIntProperty(DEFAULT_ANNOTATION_STYLEFONT);
+			txtDefaultStyleFont.setText(String.valueOf(styleFont));
+			Annotation_Mapping.DEFAULTSTYLEFONT=styleFont;
+		}else{
+			txtDefaultStyleFont.setText(String.valueOf(Font.PLAIN));
+			Annotation_Mapping.DEFAULTSTYLEFONT=Font.PLAIN;
+		}
+		if (xml.contains(DEFAULT_ANNOTATION_COLOR)) {
+			String stringColor=xml.getStringProperty(DEFAULT_ANNOTATION_COLOR);
+			Color color=StringUtilities.string2Color(stringColor);
+			jccDefaultColor.setColor(color);
+			jccDefaultColor.setAlpha(color.getAlpha());
+//			jsDefaultColorAlpha.setValue(color.getAlpha());
+			Annotation_Mapping.DEFAULTCOLOR=color.getRGB();
+		}else{
+			Color color=Color.black;
+			jccDefaultColor.setColor(color);
+			jccDefaultColor.setAlpha(color.getAlpha());
+//			jsDefaultColorAlpha.setValue(color.getAlpha());
+			Annotation_Mapping.DEFAULTCOLOR=color.getRGB();
+		}
+		if (xml.contains(DEFAULT_ANNOTATION_HEIGHT)) {
+			int height=xml.getIntProperty(DEFAULT_ANNOTATION_HEIGHT);
+			txtDefaultHeight.setText(String.valueOf(height));
+			Annotation_Mapping.DEFAULTHEIGHT=height;
+		}else{
+			txtDefaultHeight.setText("10");
+			Annotation_Mapping.DEFAULTHEIGHT=10;
+		}
+		if (xml.contains(DEFAULT_ANNOTATION_ROTATE)) {
+			int rotate=xml.getIntProperty(DEFAULT_ANNOTATION_ROTATE);
+			txtDefaultRotate.setText(String.valueOf(rotate));
+			Annotation_Mapping.DEFAULTROTATE=rotate;
+		}else{
+			txtDefaultRotate.setText("0");
+			Annotation_Mapping.DEFAULTROTATE=0;
+		}
+	}
+
+	public String getID() {
+		return id;
+	}
+
+	public String getTitle() {
+		return PluginServices.getText(this, "annotation_preferences");
+	}
+
+	public JPanel getPanel() {
+		if (panelStarted) return this;
+		panelStarted = true;
+
+		// just a separator
+		addComponent(new JLabel(" "));
+
+		addComponent(new JLabel(PluginServices.getText(this,"change_options_of_annotations")));
+
+		JPanel optionsPanel = new JPanel();
+		optionsPanel.setBorder(new TitledBorder(PluginServices.getText(this, "options.annotations")));
+		optionsPanel.setLayout(new GridBagLayout());
+
+		addComponent(new JLabel(PluginServices.getText(this,"text")),
+				txtDefaultText = new JTextField());
+
+		addComponent(new JLabel(PluginServices.getText(this,"fonttype")),
+				txtDefaultTypeFont = new JTextField());
+
+		addComponent(new JLabel(PluginServices.getText(this,"fontstyle")),
+				txtDefaultStyleFont = new JTextField());
+
+		addComponent(new JLabel(PluginServices.getText(this,"fontheight")),
+				txtDefaultHeight = new JTextField());
+
+		addComponent(new JLabel(PluginServices.getText(this,"fontrotate")),
+				txtDefaultRotate = new JTextField());
+
+		addComponent(new JLabel(PluginServices.getText(this,"fontcolor")),
+				jccDefaultColor = new ColorChooserPanel());
+//				jsDefaultColorAlpha = new JSlider());
+
+		//addComponent(optionsPanel);
+		addComponent(new JLabel(" "));
+
+		initializeValues();
+		return this;
+	}
+
+	public void storeValues() throws StoreException {
+		Color fontColor=jccDefaultColor.getColor();
+		String text=txtDefaultText.getText();
+		String fontType=txtDefaultTypeFont.getText();
+		int fontStyle=Integer.parseInt(txtDefaultStyleFont.getText());
+		int fontHeight=Integer.parseInt(txtDefaultHeight.getText());
+		int fontRotate=Integer.parseInt(txtDefaultRotate.getText());
+
+		PluginServices ps = PluginServices.getPluginServices(this);
+		XMLEntity xml = ps.getPersistentXML();
+
+		xml.putProperty(DEFAULT_ANNOTATION_COLOR,
+			StringUtilities.color2String(fontColor));
+		xml.putProperty(DEFAULT_ANNOTATION_TEXT,
+			text);
+		xml.putProperty(DEFAULT_ANNOTATION_TYPEFONT,
+			fontType);
+		xml.putProperty(DEFAULT_ANNOTATION_STYLEFONT,
+				fontStyle);
+		xml.putProperty(DEFAULT_ANNOTATION_HEIGHT,
+				fontHeight);
+		xml.putProperty(DEFAULT_ANNOTATION_ROTATE,
+				fontRotate);
+//
+//		Annotation_Mapping.DEFAULTCOLOR=fontColor.getRGB();
+//		Annotation_Mapping.DEFAULTTEXT=text;
+//		Annotation_Mapping.DEFAULTTYPEFONT=fontType;
+//		Annotation_Mapping.DEFAULTSTYLEFONT=fontStyle;
+//		Annotation_Mapping.DEFAULTHEIGHT=fontHeight;
+//		Annotation_Mapping.DEFAULTROTATE=fontRotate;
+	}
+
+
+	public void initializeDefaults() {
+		Color fontColor=Color.black;
+		String text="";
+		String fontType="Arial";
+		int fontStyle=Font.PLAIN;
+		int fontHeight=10;
+		int fontRotate=0;
+
+		jccDefaultColor.setColor(fontColor);
+//		jsDefaultColorAlpha.setValue(fontColor.getAlpha());
+
+		txtDefaultText.setText(text);
+		txtDefaultTypeFont.setText(fontType);
+		txtDefaultStyleFont.setText(String.valueOf(fontStyle));
+		txtDefaultHeight.setText(String.valueOf(fontHeight));
+		txtDefaultRotate.setText(String.valueOf(fontRotate));
+
+		Annotation_Mapping.DEFAULTCOLOR=fontColor.getRGB();
+		Annotation_Mapping.DEFAULTTEXT=text;
+		Annotation_Mapping.DEFAULTTYPEFONT=fontType;
+		Annotation_Mapping.DEFAULTSTYLEFONT=fontStyle;
+		Annotation_Mapping.DEFAULTHEIGHT=fontHeight;
+		Annotation_Mapping.DEFAULTROTATE=fontRotate;
+	}
+
+	public ImageIcon getIcon() {
+		return icon;
+	}
+
+	public boolean isValueChanged() {
+		return super.hasChanged();
+	}
+
+	public void setChangesApplied() {
+		setChanged(false);
+	}
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/preferences/Annotation_Preferences.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/FThemeManagerWindow2.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/FThemeManagerWindow2.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/FThemeManagerWindow2.java	(revision 11783)
@@ -0,0 +1,886 @@
+/*
+ * Created on 24-ene-2005
+ *
+ * gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+package com.iver.cit.gvsig.project.documents.view.legend.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ValidationException;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.instruction.FieldNotFoundException;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.IWindow;
+import com.iver.andami.ui.mdiManager.WindowInfo;
+import com.iver.cit.gvsig.ProjectExtension;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.MapContext;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+import com.iver.cit.gvsig.fmap.layers.FLyrVect;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial;
+import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend;
+import com.iver.cit.gvsig.fmap.rendering.ClassifiedLegend;
+import com.iver.cit.gvsig.fmap.rendering.Legend;
+import com.iver.cit.gvsig.fmap.rendering.LegendFactory;
+import com.iver.cit.gvsig.fmap.rendering.SingleSymbolLegend;
+import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
+import com.iver.cit.gvsig.gui.panels.LinkPanel;
+import com.iver.cit.gvsig.project.documents.view.IProjectView;
+import com.iver.cit.gvsig.project.documents.view.legend.CreateSpatialIndexMonitorableTask;
+import com.iver.cit.gvsig.project.documents.view.legend.scale.gui.FPanelScaleManager;
+import com.iver.utiles.GenericFileFilter;
+import com.iver.utiles.XMLEntity;
+import com.iver.utiles.swing.threads.IMonitorableTask;
+import com.iver.utiles.xml.XMLEncodingUtils;
+import com.iver.utiles.xmlEntity.generate.XmlTag;
+
+/**
+ * @author jmorell (jose.morell@gmail.com)
+ * @version 24-ene-2005
+ */
+public final class FThemeManagerWindow2 extends AbstractPanel implements
+		IWindow {
+	private MapContext mapContext;
+
+	private FLayer layer;
+
+	private Legend renderer; // Le asignaremos la leyenda del primer tema
+								// activo.
+
+	private FPanelScaleManager fPanelScaleManager;
+
+	private FPanelLegendManager fPanelLegendManager;
+
+	private PanelLegendAnnotation panelLegendAnnotation;
+
+	private LinkPanel linkPanel;
+
+	private JTabbedPane organizador = new JTabbedPane(); // @jve:decl-index=0:
+
+	private ComandosListener m_actionListener = new ComandosListener(this);
+
+	// private ProjectView view;
+	private NumberFormat nf = NumberFormat.getInstance();
+
+	/**
+	 * Creates new form JPanel
+	 */
+	public FThemeManagerWindow2() {
+		initialize();
+		this.setSize(650, 420);
+	}
+
+	/**
+	 * Sobrecarga del constructor. Este se utiliza cuando se llama a este
+	 * di�logo desde la barra de comandos.
+	 * 
+	 */
+	public FThemeManagerWindow2(FLayer l, MapContext fMap) {
+		layer = l;
+		mapContext = fMap;
+		initialize();
+		try {
+			ClassifiableVectorial aux = (ClassifiableVectorial) layer;
+			renderer = (Legend) aux.getLegend().cloneLegend();
+			fPanelScaleManager.setMapContext(mapContext);
+			fPanelLegendManager.setMapContext(mapContext);
+		} catch (XMLException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (DriverException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+
+		fPanelScaleManager.setLayer(layer, renderer);
+		if (!(layer instanceof Annotation_Layer)) {
+			fPanelLegendManager.setLayer(layer, renderer);
+		}
+		organizador.setSelectedIndex(0);
+
+		this.setSize(650, 420);
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+
+		fPanelScaleManager = new FPanelScaleManager();
+		fPanelLegendManager = new FPanelLegendManager();
+		panelLegendAnnotation = new PanelLegendAnnotation();
+
+		organizador.addTab(PluginServices.getText(this, "General"),
+				fPanelScaleManager);
+		if (layer instanceof Annotation_Layer) {
+			organizador.addTab(PluginServices.getText(this, "annotations"),
+					panelLegendAnnotation);
+		} else {
+			organizador.addTab(PluginServices.getText(this, "Simbologia"),
+					fPanelLegendManager);
+		}
+		JPanel panelButtons = new JPanel();
+
+		JButton btnAceptar = new JButton(PluginServices
+				.getText(this, "Aceptar"));
+		btnAceptar.setActionCommand("OK");
+		btnAceptar.addActionListener(m_actionListener);
+
+		JButton btnApply = new JButton(PluginServices.getText(this, "Aplicar"));
+		btnApply.setActionCommand("APPLY");
+		btnApply.addActionListener(m_actionListener);
+
+		JButton btnSaveLegend = new JButton(PluginServices.getText(this,
+				"Guardar_leyenda")
+				+ "...");
+		btnSaveLegend.setActionCommand("SAVE_LEGEND");
+		btnSaveLegend.addActionListener(m_actionListener);
+
+		JButton btnLoadLegend = new JButton(PluginServices.getText(this,
+				"Recuperar_leyenda")
+				+ "...");
+		btnLoadLegend.setActionCommand("LOAD_LEGEND");
+		btnLoadLegend.addActionListener(m_actionListener);
+
+		JButton btnCancelar = new JButton(PluginServices
+				.getText(this, "Cerrar"));
+		btnCancelar.setActionCommand("CANCEL");
+		btnCancelar.addActionListener(m_actionListener);
+
+		panelButtons.add(btnApply, null);
+
+		setLayout(new BorderLayout());
+		panelButtons.setLayout(null);
+		organizador.setPreferredSize(new java.awt.Dimension(640, 390));
+		btnAceptar.setBounds(9, 5, 89, 23);
+		btnApply.setBounds(107, 5, 89, 23);
+		btnSaveLegend.setBounds(205, 5, 159, 23);
+		btnLoadLegend.setBounds(373, 5, 159, 23);
+		btnCancelar.setBounds(541, 5, 89, 23);
+		panelButtons.setPreferredSize(new java.awt.Dimension(493, 33));
+		add(organizador, java.awt.BorderLayout.NORTH);
+		panelButtons.add(btnAceptar, null);
+		add(panelButtons, java.awt.BorderLayout.SOUTH);
+		panelButtons.add(btnSaveLegend, null);
+		panelButtons.add(btnLoadLegend, null);
+		panelButtons.add(btnCancelar, null);
+		// if (!(layer instanceof Annotation_Layer)){
+		// btnSaveLegend.setEnabled(false);
+		// btnLoadLegend.setEnabled(false);
+		// }
+	}
+
+	/**
+	 * En esta funci�n se coge el primer tema activo del TOC y se usa su
+	 * renderer para inicializar. Hay que llamarla SIEMPRE que se abra el cuadro
+	 * de di�logo, en el openLegendManager() de la vista.
+	 * 
+	 * @param mapContext
+	 *            TOC que abre este cuadro de di�logo.
+	 * @throws DriverException
+	 */
+	public void setMapContext(MapContext mapContext) throws DriverException {
+		this.mapContext = mapContext;
+		layer = getFirstActiveLayerVect(mapContext.getLayers());
+		try {
+			ClassifiableVectorial aux = (ClassifiableVectorial) layer;
+			renderer = (Legend) aux.getLegend().cloneLegend();
+		} catch (XMLException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		fPanelScaleManager.setMapContext(mapContext);
+		if (!(layer instanceof Annotation_Layer)) {
+			fPanelLegendManager.setMapContext(mapContext);
+		}
+		actualizar();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	private void actualizar() {
+		FLayer lyrSelected = getFirstActiveLayerVect(mapContext.getLayers());
+
+		fPanelScaleManager.setLayer(lyrSelected, renderer);
+		if ((layer instanceof Annotation_Layer)) {
+			panelLegendAnnotation.setLayer(lyrSelected, renderer);
+		} else {
+			fPanelLegendManager.setLayer(lyrSelected, renderer);
+		}
+		organizador.setSelectedIndex(0);
+	}
+
+	private void btnApply_actionPerformed(ActionEvent evt) {
+		// ClassifiableVectorial aux = (ClassifiableVectorial) layer;
+
+		switch (fPanelLegendManager.getVisibleCard()) {
+		case 0: // default symbol
+			renderer = fPanelLegendManager.getM_defaultLegendPanel()
+					.getLegend();
+			fPanelLegendManager.getJComboBox().getModel().setSelectedItem(
+					layer.getName()
+							+ PluginServices.getText(this, "_(Simbolo_unico)"));
+			break;
+		case 1: // Unique Values
+			renderer = fPanelLegendManager.getM_valuesLegendPanel().getLegend();
+			fPanelLegendManager.getJComboBox().getModel().setSelectedItem(
+					layer.getName() + "_(Valores_unicos)");
+			break;
+		case 2:// break values
+			renderer = fPanelLegendManager.getM_breaksLegendPanel().getLegend();
+			fPanelLegendManager.getJComboBox().getModel().setSelectedItem(
+					layer.getName() + "_(Intervalos)");
+			break;
+		case 3:// text
+			fPanelLegendManager.getJComboBox().getModel().setSelectedItem(
+					layer.getName() + "_(Etiquetas_estandar)");
+		}
+		// System.out.println("Color punto 1 " +
+		// renderer.getDefaultSymbol().getColor().toString());
+		// fPanelLegendManager.getM_labelsLegendPanel().setFSymbol(renderer.getDefaultSymbol());
+		// boolean bShapesVisibles =
+		// renderer.getDefaultSymbol().isShapeVisible();
+		fPanelLegendManager.getM_labelsLegendPanel().updateValuesFromControls(
+				(VectorialLegend) renderer);
+		// renderer.getDefaultSymbol().setShapeVisible(bShapesVisibles);
+		// System.out.println("Color punto 2 " +
+		// renderer.getDefaultSymbol().getColor().toString());
+		try {
+			// Intentamos aplicar la leyenda a todas
+			// las capas activas a las que se les pueda aplicar
+			FLayer[] activeLyrs = mapContext.getLayers().getActives();
+			for (int i = 0; i < activeLyrs.length; i++) {
+				FLayer laux = activeLyrs[i];
+				if (activeLyrs[i] instanceof FLayers) {
+					laux = getFirstActiveLayerVect((FLayers) activeLyrs[i]);
+				}
+				if (laux instanceof ClassifiableVectorial) {
+					ClassifiableVectorial aux2 = (ClassifiableVectorial) laux;
+					if (renderer instanceof ClassifiedLegend) {
+						// Es una leyenda que necesita un recordset con un
+						// nombre de campo. Comprobamos que ese recordset
+						// tiene ese nombre de campo y es del tipo esperado
+						ClassifiedLegend cl = (ClassifiedLegend) renderer;
+						if (aux2 instanceof AlphanumericData) {
+							DataSource rs = ((AlphanumericData) aux2)
+									.getRecordset();
+							if (cl.getValues().length == 0) {
+								JOptionPane
+										.showMessageDialog(
+												(Component) PluginServices
+														.getMainFrame(),
+												PluginServices
+														.getText(this,
+																"no_es_posible_aplicar_leyenda_vacia"));
+								return;
+							}
+							int idField = rs.getFieldIndexByName(cl
+									.getFieldName());
+							if (idField != -1) {
+								// TODO: Aqu� deber�amos comprobar si el tipo de
+								// campo
+								// es el tipo de campo esperado.
+								/*
+								 * if (renderer instanceof
+								 * VectorialUniqueValueLegend){
+								 * ((VectorialUniqueValueLegend)renderer).setLabelHeightField(null);
+								 * ((VectorialUniqueValueLegend)renderer).setLabelRotationField(null); }
+								 */
+								aux2.setLegend((VectorialLegend) renderer);
+							}
+
+						}
+					} else if (renderer instanceof SingleSymbolLegend)
+						aux2.setLegend((VectorialLegend) renderer);
+				}
+
+			}
+			// aux.setLegend((VectorialLegend) m_Renderer);
+
+		} catch (FieldNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		if (fPanelScaleManager.getJRadioButton1().isSelected()) {
+			try {
+				layer.setMinScale((nf.parse(fPanelScaleManager.getJTextField1()
+						.getText())).doubleValue());
+			} catch (ParseException ex) {
+				if (fPanelScaleManager.getJTextField1().getText().compareTo("") == 0)
+					layer.setMinScale(-1);
+				else
+					System.err.print(ex.getLocalizedMessage());
+			}
+			try {
+				layer.setMaxScale((nf.parse(fPanelScaleManager.getJTextField2()
+						.getText())).doubleValue());
+			} catch (ParseException ex) {
+				if (fPanelScaleManager.getJTextField2().getText().compareTo("") == 0)
+					layer.setMaxScale(-1);
+				else
+					System.err.print(ex.getLocalizedMessage());
+			}
+
+		} else {
+			layer.setMinScale(-1);
+			layer.setMaxScale(-1);
+		}
+		if (!fPanelScaleManager.getLayerName().equals(layer.getName())) {
+			layer.setName(fPanelScaleManager.getLayerName());
+		}
+		if (layer instanceof FLyrVect) {
+			FLyrVect lyrVect = (FLyrVect) layer;
+			if (fPanelScaleManager.isSpatialIndexSelected()) {
+				// if (lyrVect.getSpatialIndex() == null)
+				if (lyrVect.getISpatialIndex() == null) {
+					// AZABALA
+					try {
+						PluginServices
+								.cancelableBackgroundExecution(getCreateSpatialIndexTask());
+					} catch (DriverIOException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					} catch (DriverException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					// lyrVect.createSpatialIndex();
+				}
+			}
+			// AZABALA
+			/*
+			 * If we unselect the spatial index checkbox...Must we delete
+			 * spatial index file, or we only have to put Spatial Index
+			 * reference to null?. I have followed the second choice
+			 */
+			else {
+				lyrVect.deleteSpatialIndex();
+			}
+
+		}
+		// layer.getFMap().invalidate();
+		layer.getMapContext().callLegendChanged();
+	}
+
+	/**
+	 * Instanciates a ITask (@see com.iver.utiles.swing.threads.ITask) to create
+	 * a spatial index for the selected layer in background. This task also
+	 * allow to monitor process evolution, and to cancel this process.
+	 * 
+	 * @throws DriverException
+	 * @throws DriverIOException
+	 */
+	public IMonitorableTask getCreateSpatialIndexTask()
+			throws DriverIOException, DriverException {
+
+		// FIXME REVISAR ESTO (Quizas lanzar TaskException)
+		return new CreateSpatialIndexMonitorableTask((FLyrVect) layer);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 * 
+	 * @author Fernando Gonz�lez Cort�s
+	 */
+	private class ComandosListener implements ActionListener {
+		private FThemeManagerWindow2 fLayerPropertiesWindow;
+
+		/**
+		 * Creates a new ComandosListener object.
+		 * 
+		 * @param lg
+		 *            DOCUMENT ME!
+		 */
+		public ComandosListener(FThemeManagerWindow2 fLayerPropertiesWindow) {
+			this.fLayerPropertiesWindow = fLayerPropertiesWindow;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+		 */
+		public void actionPerformed(ActionEvent e) {
+			if (e.getActionCommand() == "OK") {
+				// Implementaci�n para hacer funcionar el hyperlink ...
+				// com.iver.cit.gvsig.gui.View theView =
+				// (com.iver.cit.gvsig.gui.View)PluginServices.getMDIManager().getActiveView();
+				// ProjectView view = theView.getModel();
+				if (PluginServices.getMainFrame() != null) {
+					IProjectView view = fPanelScaleManager.getView();
+					view.setTypeLink(fPanelScaleManager.getLinkType());
+					if (fPanelScaleManager.getSelectedLinkField() != null) {
+						view.setSelectedField(fPanelScaleManager
+								.getSelectedLinkField().toString().trim());
+						view.setExtLink(fPanelScaleManager.getExtensionLink());
+					}
+				}
+				//
+				if (layer instanceof Annotation_Layer) {
+					fLayerPropertiesWindow
+							.btnApply_actionPerformedAnnotation(e);
+				} else {
+					fLayerPropertiesWindow.btnApply_actionPerformed(e);
+				}
+				if (PluginServices.getMainFrame() == null)
+					((JDialog) (getParent().getParent().getParent().getParent()))
+							.dispose();
+				else
+					PluginServices.getMDIManager().closeWindow(
+							FThemeManagerWindow2.this);
+				System.out.println("Ok");
+			} else if (e.getActionCommand() == "CANCEL") {
+				if (PluginServices.getMainFrame() == null)
+					((JDialog) (getParent().getParent().getParent().getParent()))
+							.dispose();
+				else
+					PluginServices.getMDIManager().closeWindow(
+							FThemeManagerWindow2.this);
+				System.out.println("CANCEL");
+			} else if (e.getActionCommand() == "APPLY") {
+				if (layer instanceof Annotation_Layer) {
+					fLayerPropertiesWindow
+							.btnApply_actionPerformedAnnotation(e);
+				} else {
+					fLayerPropertiesWindow.btnApply_actionPerformed(e);
+				}
+				System.out.println("APPLY");
+			} else if (e.getActionCommand() == "LOAD_LEGEND") {
+				JFileChooser jfc = new JFileChooser();
+				jfc.addChoosableFileFilter(new GenericFileFilter("gvl",
+						PluginServices.getText(this, "tipo_de_leyenda")));
+				// jfc.addChoosableFileFilter(new
+				// GenericFileFilter("sld","sld"));
+
+				if (jfc.showOpenDialog((Component) PluginServices
+						.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+					File file = jfc.getSelectedFile();
+					if (!(file.getPath().endsWith(".gvl") || file.getPath()
+							.endsWith(".GVL"))) {
+						file = new File(file.getPath() + ".gvl");
+					}
+					readLegend(file);
+					if (layer instanceof Annotation_Layer) {
+						panelLegendAnnotation.setRenderer(renderer);
+						panelLegendAnnotation.actualizar();
+					} else {
+						fPanelLegendManager.setRenderer(renderer);
+						fPanelLegendManager.actualizar();
+					}
+
+				}
+			} else if (e.getActionCommand() == "SAVE_LEGEND") {
+				if (layer instanceof Annotation_Layer) {
+
+				} else {
+					fLayerPropertiesWindow.btnApply_actionPerformed(e);
+				}
+				JFileChooser jfc = new JFileChooser();
+				jfc
+						.addChoosableFileFilter(new GenericFileFilter("sld",
+								"*.sld"));
+				jfc.addChoosableFileFilter(new GenericFileFilter("gvl",
+						PluginServices.getText(this, "tipo_de_leyenda")));
+
+				if (jfc.showSaveDialog((Component) PluginServices
+						.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+					File file = jfc.getSelectedFile();
+					if (jfc.getFileFilter().accept(new File("dummy.sld"))) {
+						if (!(file.getPath().toLowerCase().endsWith(".sld"))) {
+							file = new File(file.getPath() + ".sld");
+						}
+						export2SLD(file);
+					} else {
+						if (!(file.getPath().toLowerCase().endsWith(".gvl"))) {
+							file = new File(file.getPath() + ".gvl");
+						}
+						writeLegend(file);
+					}
+				}
+			} else {
+			}
+		}
+	}
+
+	private void export2SLD(File file) {
+		try {
+			FileWriter writer = new FileWriter(file.getAbsolutePath());
+			writer.write(renderer.getSLDString(layer.getName()));
+			writer.close();
+
+			// Marshaller m = new Marshaller(writer);
+			// m.setEncoding("ISO-8859-1");
+			// m.marshal(renderer.getSLDString());
+		} catch (Exception e) {
+			NotificationManager.addError(PluginServices.getText(this,
+					"Error_exportando_SLD"), e);
+		}
+	}
+
+	public void btnApply_actionPerformedAnnotation(ActionEvent evt) {
+		try {
+			renderer = panelLegendAnnotation.getLegend();
+			panelLegendAnnotation
+					.updateValuesFromControls((VectorialLegend) renderer);
+			// Intentamos aplicar la leyenda a todas
+			// las capas activas a las que se les pueda aplicar
+			FLayer[] activeLyrs = mapContext.getLayers().getActives();
+			for (int i = 0; i < activeLyrs.length; i++) {
+				FLayer laux = activeLyrs[i];
+				if (activeLyrs[i] instanceof FLayers) {
+					laux = getFirstActiveLayerVect((FLayers) activeLyrs[i]);
+				}
+				if (laux instanceof ClassifiableVectorial) {
+					ClassifiableVectorial aux2 = (ClassifiableVectorial) laux;
+					if (renderer instanceof ClassifiedLegend) {
+						// Es una leyenda que necesita un recordset con un
+						// nombre de campo. Comprobamos que ese recordset
+						// tiene ese nombre de campo y es del tipo esperado
+						ClassifiedLegend cl = (ClassifiedLegend) renderer;
+						if (aux2 instanceof AlphanumericData) {
+							DataSource rs = ((AlphanumericData) aux2)
+									.getRecordset();
+							if (cl.getValues().length == 0) {
+								JOptionPane
+										.showMessageDialog(
+												(Component) PluginServices
+														.getMainFrame(),
+												PluginServices
+														.getText(this,
+																"no_es_posible_aplicar_leyenda_vacia"));
+								return;
+							}
+							int idField = rs.getFieldIndexByName(cl
+									.getFieldName());
+							if (idField != -1) {
+								// TODO: Aqu� deber�amos comprobar si el tipo de
+								// campo
+								// es el tipo de campo esperado.
+								/*
+								 * if (renderer instanceof
+								 * VectorialUniqueValueLegend){
+								 * ((VectorialUniqueValueLegend)renderer).setLabelHeightField(null);
+								 * ((VectorialUniqueValueLegend)renderer).setLabelRotationField(null); }
+								 */
+								aux2.setLegend((VectorialLegend) renderer);
+							}
+
+						}
+					} else if (renderer instanceof Annotation_Legend) {
+						aux2.setLegend((VectorialLegend) renderer);
+					} else if (renderer instanceof SingleSymbolLegend)
+						aux2.setLegend((VectorialLegend) renderer);
+				}
+
+			}
+			// aux.setLegend((VectorialLegend) m_Renderer);
+
+		} catch (FieldNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		if (fPanelScaleManager.getJRadioButton1().isSelected()) {
+			try {
+				layer.setMinScale((nf.parse(fPanelScaleManager.getJTextField1()
+						.getText())).doubleValue());
+			} catch (ParseException ex) {
+				if (fPanelScaleManager.getJTextField1().getText().compareTo("") == 0)
+					layer.setMinScale(-1);
+				else
+					System.err.print(ex.getLocalizedMessage());
+			}
+			try {
+				layer.setMaxScale((nf.parse(fPanelScaleManager.getJTextField2()
+						.getText())).doubleValue());
+			} catch (ParseException ex) {
+				if (fPanelScaleManager.getJTextField2().getText().compareTo("") == 0)
+					layer.setMaxScale(-1);
+				else
+					System.err.print(ex.getLocalizedMessage());
+			}
+
+		} else {
+			layer.setMinScale(-1);
+			layer.setMaxScale(-1);
+		}
+		if (!fPanelScaleManager.getLayerName().equals(layer.getName())) {
+			layer.setName(fPanelScaleManager.getLayerName());
+		}
+		if (layer instanceof FLyrVect) {
+			FLyrVect lyrVect = (FLyrVect) layer;
+			if (fPanelScaleManager.isSpatialIndexSelected()) {
+				// if (lyrVect.getSpatialIndex() == null)
+				if (lyrVect.getISpatialIndex() == null) {
+					// AZABALA
+					try {
+						PluginServices
+								.cancelableBackgroundExecution(getCreateSpatialIndexTask());
+					} catch (DriverIOException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					} catch (DriverException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					// lyrVect.createSpatialIndex();
+				}
+			}
+			// AZABALA
+			/*
+			 * If we unselect the spatial index checkbox...Must we delete
+			 * spatial index file, or we only have to put Spatial Index
+			 * reference to null?. I have followed the second choice
+			 */
+			else {
+				lyrVect.deleteSpatialIndex();
+			}
+
+		}
+		// layer.getFMap().invalidate();
+		layer.getMapContext().callLegendChanged();
+
+	}
+
+	private void writeLegend(File file) {
+		try {
+			FileOutputStream fos = new FileOutputStream(file.getAbsolutePath());
+			OutputStreamWriter writer = new OutputStreamWriter(fos,
+					ProjectExtension.PROJECTENCODING);
+			Marshaller m = new Marshaller(writer);
+			m.setEncoding(ProjectExtension.PROJECTENCODING);
+			XMLEntity xml = renderer.getXMLEntity();
+			xml.putProperty("followHeaderEncoding", true);
+			m.marshal(xml.getXmlTag());
+		} catch (Exception e) {
+			NotificationManager.addError(PluginServices.getText(this,
+					"Error_guardando_la_leyenda"), e);
+		}
+	}
+
+	public void readLegend(File file) {
+		File xmlFile = new File(file.getAbsolutePath());
+		try {
+			String encoding = XMLEncodingUtils.getEncoding(new FileInputStream(
+					xmlFile));
+			InputStreamReader reader = null;
+			if (encoding != null) {
+				try {
+					reader = new InputStreamReader(
+							new FileInputStream(xmlFile), encoding);
+					renderer = readLegend(reader, true);
+				} catch (UnsupportedEncodingException e) {
+					reader = new InputStreamReader(
+							new FileInputStream(xmlFile), "ISO-8859-1");
+					try {
+						renderer = readLegend(reader, false);
+					} catch (UnsupportedEncodingException e1) {
+						JOptionPane.showMessageDialog(
+								(Component) PluginServices.getMainFrame(),
+								PluginServices.getText(this, e1
+										.getLocalizedMessage()));
+						return;
+					}
+				}
+			} else {
+				reader = new InputStreamReader(new FileInputStream(xmlFile),
+						"UTF-8");
+				try {
+					renderer = readLegend(reader, false);
+				} catch (UnsupportedEncodingException e1) {
+					JOptionPane.showMessageDialog((Component) PluginServices
+							.getMainFrame(), PluginServices.getText(this, e1
+							.getLocalizedMessage()));
+					return;
+				}
+			}
+		} catch (FileNotFoundException e) {
+			JOptionPane.showMessageDialog((Component) PluginServices
+					.getMainFrame(), PluginServices.getText(this,
+					"fichero_incorrecto"));
+			return;
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public Legend readLegend(Reader reader, boolean encodingFollowed)
+			throws UnsupportedEncodingException {
+		Legend legend = null;
+
+		try {
+			XmlTag tag = (XmlTag) XmlTag.unmarshal(reader);
+			XMLEntity xml = new XMLEntity(tag);
+			if (encodingFollowed) {
+				if (xml.contains("followHeaderEncoding")) {
+					boolean useEncoding = xml
+							.getBooleanProperty("followHeaderEncoding");
+					if (!useEncoding) {
+						throw new UnsupportedEncodingException(
+								"the encoding specified in the xml header is not safe");
+					}
+				} else {
+					// Old projects didn't contain followHeaderEncoding and they
+					// were
+					// not correctly encoded. We throw an exception now, and
+					// we'll try
+					// to reopen the project
+					// using the default system encoding.
+					throw new UnsupportedEncodingException(
+							"the encoding specified in the xml header is not safe");
+				}
+			}
+
+			legend = LegendFactory.createFromXML(xml);
+			return legend;
+		} catch (MarshalException e) {
+			// PluginServices.getLogger().error(PluginServices.getText(this,
+			// "formato_incorrecto"),e);
+			JOptionPane.showMessageDialog((Component) PluginServices
+					.getMainFrame(), PluginServices.getText(this,
+					"formato_incorrecto"));
+			// NotificationManager.addError("Al leer el proyecto", e);
+		} catch (ValidationException e) {
+			// PluginServices.getLogger().error(PluginServices.getText(this,
+			// "formato_incorrecto"),e);
+			JOptionPane.showMessageDialog((Component) PluginServices
+					.getMainFrame(), PluginServices.getText(this,
+					"formato_incorrecto"));
+			// NotificationManager.addError("Al leer el proyecto", e);
+		} catch (XMLException e) {
+			// PluginServices.getLogger().error(PluginServices.getText(this,
+			// "formato_incorrecto"),e);
+			JOptionPane.showMessageDialog((Component) PluginServices
+					.getMainFrame(), PluginServices.getText(this,
+					"formato_incorrecto"));
+			// NotificationManager.addError("Al leer el proyecto", e);
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		// Solo se llama una vez
+		WindowInfo viewInfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
+		viewInfo.setWidth(650);
+		viewInfo.setHeight(420);
+		viewInfo.setTitle(PluginServices
+				.getText(this, "propiedades_de_la_capa"));
+		return viewInfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	/*
+	 * public void viewActivated() { }
+	 * 
+	 * public FMap getMapContext() { return mapContext; } public FLayer
+	 * getLayer() { return layer; } public Legend getRenderer() { return
+	 * renderer; }
+	 */
+
+	/**
+	 * @return Returns the organizador.
+	 */
+	public JTabbedPane getOrganizador() {
+		return organizador;
+	}
+
+	/**
+	 * @param organizador
+	 *            The organizador to set.
+	 */
+	public void setOrganizador(JTabbedPane organizador) {
+		this.organizador = organizador;
+	}
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/FThemeManagerWindow2.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/Annotation_Properties.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/Annotation_Properties.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/Annotation_Properties.java	(revision 11783)
@@ -0,0 +1,141 @@
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+package com.iver.cit.gvsig.project.documents.view.legend.gui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.WindowInfo;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.project.documents.gui.Annotation_ConfigureLabel;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Annotation_Properties extends JPanel {
+    private JPanel pNorth = null;
+    private JPanel pCenter = null;
+    private JPanel pSouth = null;
+    private Annotation_Layer al;
+
+    /**
+     * This is the default constructor
+     *
+     * @param al DOCUMENT ME!
+     */
+    public Annotation_Properties(Annotation_Layer al) {
+        super();
+        this.al = al;
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.setLayout(new BorderLayout());
+        this.setSize(300, 200);
+        this.add(getPNorth(), java.awt.BorderLayout.NORTH);
+        this.add(getPCenter(), java.awt.BorderLayout.CENTER);
+        this.add(getPSouth(), java.awt.BorderLayout.SOUTH);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public WindowInfo getWindowInfo() {
+        WindowInfo viewInfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
+        viewInfo.setWidth(500);
+        viewInfo.setHeight(400);
+        viewInfo.setTitle(PluginServices.getText(this, "propiedades_de_la_capa"));
+
+        return viewInfo;
+    }
+
+    /**
+     * This method initializes pNorth
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getPNorth() {
+        if (pNorth == null) {
+            pNorth = new JPanel();
+        }
+
+        return pNorth;
+    }
+
+    /**
+     * This method initializes pCenter
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getPCenter() {
+        if (pCenter == null) {
+            pCenter = new JPanel();
+            pCenter.add(new Annotation_ConfigureLabel(null, al));
+        }
+
+        return pCenter;
+    }
+
+    /**
+     * This method initializes pSouth
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getPSouth() {
+        if (pSouth == null) {
+            pSouth = new JPanel();
+        }
+
+        return pSouth;
+    }
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/Annotation_Properties.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/PanelLegendAnnotation.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/PanelLegendAnnotation.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/PanelLegendAnnotation.java	(revision 11783)
@@ -0,0 +1,215 @@
+/*
+ * Created on 01-jun-2004
+ *
+ */
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+package com.iver.cit.gvsig.project.documents.view.legend.gui;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBox;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.rendering.Annotation_Legend;
+import com.iver.cit.gvsig.fmap.rendering.Legend;
+import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
+
+/**
+ * @author fjp
+ *
+ */
+public class PanelLegendAnnotation extends AbstractPanel implements
+		ILegendPanel {
+
+	private VectorialLegend m_Renderer;
+
+	private Annotation_Layer m_lyr;
+
+	private FSymbol m_FSymbol;
+
+	private javax.swing.JRadioButton jRadioButton = null;
+
+	private javax.swing.JRadioButton jRadioButton1 = null;
+
+	private JCheckBox jCheckBoxTextOnly = null;
+
+	private JCheckBox chkOverWrite = null;
+
+	/**
+	 * This is the default constructor
+	 */
+	public PanelLegendAnnotation() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 * @return void
+	 */
+	private void initialize() {
+		this.setLayout(null);
+		this.setSize(454, 308);
+		this.add(getJCheckBoxTextOnly(), null);
+		ButtonGroup jButtonGroup = new ButtonGroup();
+		jButtonGroup.add(getJRadioButton1());
+		jButtonGroup.add(getJRadioButton());
+
+		this.add(getJRadioButton1(), null);
+		this.add(getJRadioButton(), null);
+		this.add(getChkOverWrite(), null);
+	}
+
+	public void setLayer(FLayer lyr, Legend r) {
+		m_lyr = (Annotation_Layer) lyr;
+		m_Renderer = (VectorialLegend) r;
+		// getJRadioButton().setSelected(m_lyr.isInPixels());
+		getChkOverWrite().setSelected(((Annotation_Legend)r).isOverWrite());
+		if (r.getDefaultSymbol() instanceof FSymbol)
+			setFSymbol((FSymbol) r.getDefaultSymbol());
+	}
+
+	public void setFSymbol(FSymbol sym) {
+		if (sym == null) {
+			m_FSymbol = new FSymbol(FShape.MULTI);
+		} else
+			m_FSymbol = sym;
+
+		getJRadioButton1().setSelected(!m_FSymbol.isFontSizeInPixels());
+		getJCheckBoxTextOnly().setSelected(!m_FSymbol.isShapeVisible());
+	}
+
+	/**
+	 * This method initializes jRadioButton
+	 *
+	 * @return javax.swing.JRadioButton
+	 */
+	private javax.swing.JRadioButton getJRadioButton() {
+		if (jRadioButton == null) {
+			jRadioButton = new javax.swing.JRadioButton();
+			jRadioButton.setText(PluginServices.getText(this, "En_pixels"));
+			jRadioButton.setBounds(new java.awt.Rectangle(26, 50, 100, 23));
+			jRadioButton.setSelected(true);
+		}
+		return jRadioButton;
+	}
+
+	/**
+	 * This method initializes jRadioButton1
+	 *
+	 * @return javax.swing.JRadioButton
+	 */
+	private javax.swing.JRadioButton getJRadioButton1() {
+		if (jRadioButton1 == null) {
+			jRadioButton1 = new javax.swing.JRadioButton();
+			jRadioButton1.setText(PluginServices.getText(this, "En_metros"));
+			jRadioButton1.setBounds(new java.awt.Rectangle(27, 21, 100, 23));
+		}
+		return jRadioButton1;
+	}
+
+	public Legend getLegend() {
+		return m_Renderer;
+	}
+
+	/**
+	 * @param renderer
+	 *            The renderer to set.
+	 */
+	public void setRenderer(Legend renderer) {
+		this.m_Renderer = (VectorialLegend) renderer;
+		getChkOverWrite().setSelected(((Annotation_Legend)renderer).isOverWrite());
+		if (m_Renderer.getDefaultSymbol() instanceof FSymbol)
+			setFSymbol((FSymbol) m_Renderer.getDefaultSymbol());
+	}
+
+	/**
+	 * This method initializes jCheckBox1
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getJCheckBoxTextOnly() {
+		if (jCheckBoxTextOnly == null) {
+			jCheckBoxTextOnly = new JCheckBox();
+			jCheckBoxTextOnly.setBounds(28, 88, 200, 22);
+			jCheckBoxTextOnly.setText(PluginServices.getText(this,
+					"draw_text_only"));
+		}
+		return jCheckBoxTextOnly;
+	}
+
+	public void updateValuesFromControls(VectorialLegend l) {
+		m_FSymbol.setFontSizeInPixels(jRadioButton.isSelected());
+		m_FSymbol.setShapeVisible(!jCheckBoxTextOnly.isSelected());
+		((Annotation_Legend)l).setIsOverWrite(chkOverWrite.isSelected());
+		// m_Renderer.setDefaultSymbol(m_FSymbol);
+		l.setDefaultSymbol(m_FSymbol);
+	}
+
+	public void repaint() {
+		super.repaint();
+	}
+
+	public void actualizar() {
+		getJRadioButton().setSelected(m_FSymbol.isFontSizeInPixels());
+		getJCheckBoxTextOnly().setSelected(!m_FSymbol.isShapeVisible());
+	}
+
+	/**
+	 * This method initializes chkOverWrite
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getChkOverWrite() {
+		if (chkOverWrite == null) {
+			chkOverWrite = new JCheckBox();
+			chkOverWrite.setBounds(new java.awt.Rectangle(28,121,121,23));
+			chkOverWrite.setText(PluginServices.getText(this,"over_write"));
+			chkOverWrite.setSelected(true);
+		}
+		return chkOverWrite;
+	}
+}
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/legend/gui/PanelLegendAnnotation.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/toc/gui/FLyrVectEditPropertiesTocMenuEntry2.java
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/toc/gui/FLyrVectEditPropertiesTocMenuEntry2.java	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/toc/gui/FLyrVectEditPropertiesTocMenuEntry2.java	(revision 11783)
@@ -0,0 +1,138 @@
+package com.iver.cit.gvsig.project.documents.view.toc.gui;
+
+import javax.swing.JDialog;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.layers.Annotation_Layer;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.project.documents.view.legend.gui.FThemeManagerWindow2;
+import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction;
+import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
+import com.iver.cit.gvsig.project.documents.view.toc.actions.DelegatedTocContextMenuAction;
+
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+/**
+ * Muestra el men� de propiedades del tema.
+ * 
+ * @author jmorell
+ */
+
+public class FLyrVectEditPropertiesTocMenuEntry2 extends
+		DelegatedTocContextMenuAction {
+	public FLyrVectEditPropertiesTocMenuEntry2(
+			AbstractTocContextMenuAction delegated) {
+		super(delegated);
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if (isTocItemBranch(item)) {
+			FLayer lyr = getNodeLayer(item);
+			if (lyr instanceof Annotation_Layer) {
+				return true;
+			}
+		}
+		return super.isVisible(item, selectedItems);
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		FLayer[] actives = selectedItems;
+		if (actives[0] instanceof Annotation_Layer)
+			annotationExecute(item, selectedItems);
+		else
+			super.execute(item, selectedItems);
+	}
+
+	private void annotationExecute(ITocItem item, FLayer[] selectedItems) {
+		FLayer[] actives = selectedItems;
+		FThemeManagerWindow2 fThemeManagerWindow;
+		if (actives.length == 1) {
+			if (!actives[0].isAvailable())
+				return;
+			System.out
+					.println("openPliegoThemeProperties(): Una sola capa. Abrimos el panel para la capa "
+							+ actives[0]);
+			fThemeManagerWindow = new FThemeManagerWindow2(actives[0],
+					actives[0].getMapContext());
+			try {
+				fThemeManagerWindow.setMapContext(getMapContext());
+			} catch (com.iver.cit.gvsig.fmap.DriverException e1) {
+				e1.printStackTrace();
+			}
+			// PluginServices.getMDIManager().addView(fThemeManagerWindow);
+			if (PluginServices.getMainFrame() == null) {
+				JDialog dlg = new JDialog();
+				fThemeManagerWindow.setPreferredSize(fThemeManagerWindow
+						.getSize());
+				dlg.getContentPane().add(fThemeManagerWindow);
+				dlg.setModal(false);
+				dlg.pack();
+				dlg.show();
+			} else {
+				PluginServices.getMDIManager().addWindow(fThemeManagerWindow);
+			}
+		} else {
+			for (int i = 0; i < actives.length; i++) {
+				if (actives[0].isAvailable()) {
+					System.out
+							.println("openPliegoThemeProperties(): Muchas capas. Abrimos el panel para la capa "
+									+ actives[i]);
+					fThemeManagerWindow = new FThemeManagerWindow2(actives[i],
+							getMapContext());
+					// PluginServices.getMDIManager().addView(fThemeManagerWindow);
+					if (PluginServices.getMainFrame() == null) {
+						JDialog dlg = new JDialog();
+						fThemeManagerWindow
+								.setPreferredSize(fThemeManagerWindow.getSize());
+						dlg.getContentPane().add(fThemeManagerWindow);
+						dlg.setModal(false);
+						dlg.pack();
+						dlg.show();
+					} else {
+						PluginServices.getMDIManager().addWindow(
+								fThemeManagerWindow);
+					}
+				}
+			}
+		}
+	}
+
+}

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/src/com/iver/cit/gvsig/project/documents/view/toc/gui/FLyrVectEditPropertiesTocMenuEntry2.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/.cvsignore
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/.cvsignore	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/.cvsignore	(revision 11783)
@@ -0,0 +1,2 @@
+dist
+dist-src
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/.cvsignore
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/build.xml
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/build.xml	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/build.xml	(revision 11783)
@@ -0,0 +1,146 @@
+<project name="Generar extension Anotaciones en Andami" default="generate-without-source" basedir=".">
+    <description>
+        Instala el plugin en Andami
+    </description>
+  <!-- set global properties for this build -->
+  <property name="src" location="src"/>
+  <property name="build" location="bin"/>
+  <property name="dist"  location="dist"/>
+  <property name="mainplugin" value="com.iver.cit.gvsig"/>
+  <property name="plugin" value="com.iver.cit.gvsig.annotation"/>
+  <property name="gvsiglibjar" value="gvsig-annotation"/>
+  <property name="extensionDir" location="../_fwAndami/gvSIG/extensiones"/>
+  <property name="dist-src-name"  value="dist-src"/>
+  <property name="dist-src"  location="${dist-src-name}"/>
+	  <property name="readMe.files" value="Leeme-Annotation.txt, Readme-Annotation.txt"/>
+
+  <target name="init">
+    <!-- Create the time stamp -->
+    <tstamp/>
+    <!-- Create the build directory structure used by compile -->
+    <mkdir dir="${build}"/>
+    <mkdir dir="${dist}"/>
+
+  </target>
+
+	  <target name="generate-source-package">
+	  	<delete dir="${dist-src}" quiet="yes"/>
+	  	<mkdir dir="${dist-src}"/>
+	  	<basename file="${basedir}" property="extensionProjectDir"/>
+	  	<mkdir dir="${dist-src}/${extensionProjectDir}"/>
+	    <copy todir="${dist-src}/${extensionProjectDir}">
+	      <fileset dir="${basedir}"/>
+	    </copy>
+	  	<copy todir="${dist-src}">
+	  		<fileset dir="${basedir}/install/resources" includes="${readMe.files}"/>
+	  	</copy>
+	  	<delete dir="${dist-src}/${extensionProjectDir}/bin"/>
+	  	<mkdir dir="${dist-src}/${extensionProjectDir}/bin"/>
+	  	<delete dir="${dist-src}/${extensionProjectDir}/install"/>
+	  	<delete dir="${dist-src}/${extensionProjectDir}/dist" quiet="yes"/>
+	  	<delete dir="${dist-src}/${extensionProjectDir}/dist-src" quiet="yes"/>
+	  	<loadproperties srcFile="build.number"/>
+	  	<replace casesensitive="true"
+	  	  	token="#build.number#"
+	  		value="${build.number}"
+	  		dir="${dist-src}"
+	  		includes="${readMe.files}"/>
+	  	 <zip destfile="${dist-src}/gvsig_annotation-01_${build.number}-src.zip"
+	  	       basedir="${dist-src-name}"
+	  	       excludes="*.zip"
+	  	  />
+
+	  </target>
+
+
+
+
+	<target name="buildNumber">
+		<propertyfile
+				file="build.number"
+				comment="Build Number for ANT. Do not edit!">
+				<entry  key="build.number" default="0" type="int" operation="+"/>
+		</propertyfile>
+		<property file="build.number"/>
+	</target>
+	<target name="distribution"
+		description="increment build number and generate the distribution without the source file"
+		depends="buildNumber,generate-without-source">
+	</target>
+
+  <target name="generate-without-source" depends="init"
+  		description="generate the distribution without the source file">
+    <!-- Create the distribution directory -->
+    <mkdir dir="${dist}"/>
+    <mkdir dir="${dist}/lib"/>
+  	<mkdir dir="${dist}/images"/>
+
+    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
+    <jar jarfile="${dist}/lib/${plugin}.jar" basedir="${build}" excludes="**/*Driver*,**/*_Legend.*,**/*_Layer.*,**/*_Strategy.*,**/*_Mapping.*,**/*_EditableAdapter.*" includes="com/iver/cit/gvsig/**"/>
+    <!-- <jar jarfile="${drivers-dir}/sde/sde.jar" basedir="${build}" includes="com/iver/cit/gvsig/fmap/drivers/sde/**"/> -->
+  	<copy file="config/config.xml" todir="${dist}"/>
+  	<copy file="build.number" todir="${dist}"/>
+  	<copy file="config/about.htm" todir="${dist}"/>
+  	<loadproperties srcFile="build.number"/>
+  	<replace casesensitive="true"
+  		file="${dist}/about.htm"
+  	  	token="#build.number#"
+  		value="${build.number}"/>
+    <copy todir="${dist}">
+    	<fileset dir="config" includes="text*.properties"/>
+    </copy>
+    <copy todir="${dist}/lib" failonerror="false">
+    	<fileset dir="./lib" includes="*.jar,*.zip"/>
+    	<!-- <fileset dir="." includes=".keystore"/> -->
+    </copy>
+  	<copy todir="${dist}/images">
+  	    	<fileset dir="images" includes="*"/>
+  	</copy>
+  	<move todir="${extensionDir}/${plugin}/images">
+  	  	<fileset dir="${dist}/images" includes="*"/>
+  	</move>
+  	<move todir="${extensionDir}/${plugin}">
+  	  	<fileset dir="${dist}" includes="*"/>
+  	</move>
+  	<move todir="${extensionDir}/${plugin}/lib">
+  	  	<fileset dir="${dist}/lib" includes="**"/>
+  	</move>
+  	<jar jarfile="${extensionDir}/${mainplugin}/lib/gvsig-annotation.jar" basedir="./bin" includes="**/*_Legend.*,**/*_Layer.*,**/*_Strategy.*,**/*_Mapping.*,**/*_EditableAdapter.*"/>
+
+  </target>
+
+
+  <!--target name="generate-with-source" description="generate the distribution with the source file" >
+    <mkdir dir="${dist}"/>
+  	<mkdir dir="${dist}/images"/>
+
+    <jar jarfile="${dist}/${plugin}.jar" basedir="${build}"/>
+    <copy file="config/config.xml" todir="${dist}"/>
+    <copy todir="${dist}">
+    	<fileset dir="." includes="text*.properties"/>
+    </copy>
+    <copy todir="${dist}">
+    	<fileset dir="." includes="${src}"/>
+
+    </copy>
+  	<copy todir="${dist}/images">
+    	<fileset dir="images/" includes="*"/>
+    </copy>
+  	<move todir="${extensionDir}/${plugin}/images">
+  		<fileset dir="images/" includes="*"/>
+  	</move>
+    <move todir="${extensionDir}/${plugin}/">
+    	<fileset dir="${dist}" includes="**/**" excludes="com/iver/cit/gvsig/fmap/drivers/sde/**"/>
+    </move>
+  	<jar jarfile="${drivers-dir}/sde/sde.jar" basedir="./bin" excludes="**/*VectorialSDEDriver*"
+  	includes="com/iver/cit/gvsig/fmap/drivers/sde/*.*"
+  	/>
+  	<jar jarfile="${extensionDir}/${mainplugin}/lib/gvsig-sde.jar" basedir="./bin" includes="com/iver/cit/gvsig/fmap/drivers/sde/VectorialSDEDriver.*"/>
+  </target-->
+
+  <target name="clean"
+        description="clean up" >
+    <delete dir="${dist}"/>
+  </target>
+</project>
+

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/build.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/.classpath
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/.classpath	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/.classpath	(revision 11783)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/libFMap"/>
+	<classpathentry sourcepath="/libGDBMS" kind="lib" path="/libFMap/lib/gdbms-0.8-SNAPSHOT.jar"/>
+	<classpathentry sourcepath="/libDriverManager" kind="lib" path="/libFMap/lib/driver-manager-1.1.jar"/>
+	<classpathentry sourcepath="/libCq CMS for java" kind="lib" path="/libFMap/lib/cms.jar"/>
+	<classpathentry sourcepath="/Utiles/src" kind="lib" path="/_fwAndami/lib/iver-utiles.jar"/>
+	<classpathentry sourcepath="D:/eclipse_3_1/workspace_pruebas/jts/src" kind="lib" path="/libFMap/lib/jts-1.7.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/_fwAndami"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/appgvSIG"/>
+	<classpathentry sourcepath="D:/Download/geotools2/geotools-src-2.1.M4/geotools/module/main/src" kind="lib" path="/libFMap/lib/gt2-main.jar"/>
+	<classpathentry sourcepath="/libUI/src" kind="lib" path="/_fwAndami/lib/beans.jar"/>
+	<classpathentry kind="lib" path="/_fwAndami/lib/castor-0.9.5.3-xml.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/.classpath
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/.project
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/.project	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/.project	(revision 11783)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>extAnnotations</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>de.loskutov.FileSync.FSBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
+	</natures>
+</projectDescription>

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/.project
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/config/text.properties
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/config/text.properties	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/config/text.properties	(revision 11783)
@@ -0,0 +1,24 @@
+#text.properties
+annotations=Anotaciones
+annotation=Anotaci\u00f3n
+annotation_preferences=Preferencias de las anotationes
+annotation_tools=Herramientas de anotaciones
+centered=Centrado
+create_annotation_layer=Crea capa de anotaciones
+change_options_of_annotations=Cambio opciones de las anotaciones
+descripcion_de_crear_capa_de_anotaciones_nueva=<HTML>Con esta herramienta puede crear una capa basada <br>en otra ya existente que le permita realizar un etiquetado avanzado. <br>Cambia la visualizaci\u00f3n de la capa seleccionada mostrando el valor<br> de uno de sus campos.</HTML>
+duplicate=Control de los duplicados
+duplicate.none=Ninguno
+fontcolor=Color del texto
+fontheight=Altura del texto
+fontstyle=Estilo del texto
+fontrotate=Rotaci�n del texto
+fonttext=Texto
+fonttype=Tipo de fuente
+modify_annotation=Modificar anotaci�n
+none=Ninguno
+options=Opciones
+over_write=Sobreescribir
+seleccione_el_campo_de_texto_que_desea_que_se_utilize_para_mostrar_la_nueva_capa=<HTML>Seleccione el campo a etiquetar.</HTML>
+text=Texto
+units_of_annotations=Unidades de las anotationes
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/config/text.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/config/about.htm
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/config/about.htm	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/config/about.htm	(revision 11783)
@@ -0,0 +1,21 @@
+<html>
+  <head>
+    <title>Extesi&oacute;n de la Aplicaci&oacute;n para el manejo de capas de anotaciones.</title>
+    <meta content="">
+    <style></style>
+  </head>
+  <body>
+<table width="60%" border="0">
+  <tr>
+    <td width="64%"><img src="images/logo_horiz_bicolor_gva.png" width="329" height="50"></td>
+    <td width="36%"><div align="right"><img src="images/logoIver.png" width="87" height="50"></div></td>
+  </tr>
+  <tr>
+    <td colspan="2"><font face="Arial, Helvetica, sans-serif">&copy; Copyright
+      Generalitat Valenciana, IVER T.I. 2007.</font></td>
+  </tr>
+</table>
+  <h3>Extensi&oacute;n de la Aplicaci&oacute;n para el para el manejo de capas de anotaciones.</h3>
+  <p><br><br><b> Build Number: #build.number#</b></p>
+  </body>
+</html>
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/config/about.htm
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/config/text_en.properties
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/config/text_en.properties	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/config/text_en.properties	(revision 11783)
@@ -0,0 +1,24 @@
+#text_en.properties
+annotations=Annotations
+annotation=Annotation
+annotation_preferences=Annotation preferences
+annotation_tools=Annotation tools
+centered=Centered
+create_annotation_layer=Create annotation layer
+change_options_of_annotations=Change options of annotations
+descripcion_de_crear_capa_de_anotaciones_nueva=<HTML>A new layer can be created using this tool, <br>based on an already existing layer which allows to perform <br>advanced labeling. It changes the visualization of the<br> selected layer showing the value of one of its fields.</HTML>
+duplicate=Duplicate control.
+duplicate.none=None
+fontcolor=Font color
+fontheight=Font height
+fontstyle=Font style
+fontrotate=Font rotate
+fonttext=Texto
+fonttype=Font type
+modify_annotation=Modify annotation
+none=None
+options=Options
+over_write=Over write
+seleccione_el_campo_de_texto_que_desea_que_se_utilize_para_mostrar_la_nueva_capa=<HTML>Choose the field to label.</HTML>
+text=Text
+units_of_annotations=Units of annotations
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/config/text_en.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/config/config.xml
===================================================================
--- tags/Anotaciones_Build_3/extensions/extAnnotations/config/config.xml	(revision 0)
+++ tags/Anotaciones_Build_3/extensions/extAnnotations/config/config.xml	(revision 11783)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+	<depends plugin-name="com.iver.cit.gvsig" />
+	<libraries library-dir="lib"/>
+    <resourceBundle name="text"/>
+	<extensions>
+		<extension class-name="com.iver.cit.gvsig.Annotation_Extension"
+			description="Annotation extension"
+			active="true"
+			priority="1">
+
+			<menu text="Capa/export_to/annotation" action-command="ANNOTATIONLAYER"
+				tooltip="create_annotation_layer"
+				priority="999"/>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.Annotation_ToolExtension"
+			description="Annotation tool extension"
+			active="true"
+			priority="2">
+
+			<menu text="Capa/modify_annotation" action-command="MODIFYANNOTATION" icon="images/Annotation.png"
+ 				tooltip="modify_annotation"
+				priority="2"/>
+			<tool-bar name="annotation_tools" position="5">
+				<selectable-tool icon="images/Annotation.png" action-command="MODIFYANNOTATION"  tooltip="modify_annotation" position="3"/>
+			</tool-bar>
+		</extension>
+	</extensions>
+</plugin-config>
\ No newline at end of file

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/config/config.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/images/ModifyAnnotationCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/images/ModifyAnnotationCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/images/logo_horiz_bicolor_gva.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/images/logo_horiz_bicolor_gva.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/images/logoIver.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/images/logoIver.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/images/AnnotationProperties.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/images/AnnotationProperties.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Anotaciones_Build_3/extensions/extAnnotations/images/Annotation.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations/images/Annotation.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: tags/Anotaciones_Build_3/extensions/extAnnotations
___________________________________________________________________
Added: svn:ignore
   + dist
dist-src


