Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/config.xml
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/config.xml	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/config.xml	(revision 1648)
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+	<libraries library-dir="lib"/>
+	<resourceBundle name="text"/>
+	<label-set class-name="com.iver.cit.gvsig.gui.View">
+		<label id="1" size="45"/>
+		<label id="2" size="120"/>
+		<label id="3" size="120"/>
+		<label id="4" size="120"/>
+		<label id="5" size="130"/>
+		<label id="6" size="80"/>
+		<label id="7" size="70"/>
+	</label-set>
+	<label-set class-name="com.iver.cit.gvsig.gui.layout.Layout">
+		<label id="1" size="80"/>
+		<label id="2" size="180"/>
+		<label id="3" size="180"/>
+		<label id="4" size="50"/>
+		<label id="5" size="50"/>
+	</label-set>
+	<extensions>
+		<extension class-name="com.iver.cit.gvsig.ProjectExtension" 
+			description="Extensi�n encargada de gestionar los proyectos." 
+			active="true" 
+			priority="1">
+			<menu text="Archivo/nuevo_proyecto" 
+				key="n" mnemonic="n" 
+				tooltip="nuevo_tooltip"
+				action-command="NUEVO" icon="images/new.png"
+				position="-1"/>
+			<menu text="Archivo/abrir_proyecto" 
+				key="a" mnemonic="a" 
+				tooltip="abrir_tooltip"
+				action-command="ABRIR" icon="images/open.png"/>
+			<menu text="Archivo/guardar_proyecto" 
+				key="g" mnemonic="g" 
+				tooltip="guardar_tooltip"
+				action-command="GUARDAR" icon="images/save.png"/>
+			<menu text="Archivo/guardar_como" 
+				key="g" mnemonic="g" 
+				tooltip="guardar_tooltip"
+				action-command="GUARDAR_COMO" icon="images/save.png"/>
+			<tool-bar name="gvSIG">
+				<action-tool icon="images/new.png" tooltip="nuevo_tooltip"
+					action-command="NUEVO"/>
+				<action-tool icon="images/open.png" tooltip="abrir_tooltip"
+					action-command="ABRIR"/>
+				<action-tool icon="images/save.png" tooltip="guardar_tooltip"
+					action-command="GUARDAR"/>
+			</tool-bar>
+			
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.Abrir" 
+			description="Extensi�n encargada de abrir las diferentes capas."
+			active="true" 
+			priority="2">
+			<menu text="Archivo/Anadir_Capa" key="o" icon="images/addlayer.png"/>
+			<tool-bar name="Acciones">
+				<action-tool icon="images/addlayer.png" tooltip="Anadir_Capa"/>
+			</tool-bar>
+		</extension>
+			
+		<extension class-name="com.iver.cit.gvsig.ZoomPrev" 
+			description="Extensi�n encargada de gestionar los zooms previos al actual."
+			active="true">
+			<menu text="Vista/Zoom_Previo" icon="images/ZoomPrevio.png"/>
+			<tool-bar name="Herramientas">
+				<action-tool icon="images/ZoomPrevio.png" action-command="ZOOM_PREV" tooltip="Zoom_Previo"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.StartEditing" 
+			description="Pone en edici�n las capas"
+			active="true">
+			<menu text="Tema/Comenzar edici�n"/>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.StopEditing" 
+			description="Pone en edici�n las capas"
+			active="true">
+			<menu text="Tema/Terminar edici�n" action-command="STOP"/>
+			<menu text="Tema/Cancelar edici�n" action-command="CANCELEDITION"/>
+			<menu text="Tema/Mostrar malla" action-command="SHOWGRID"/>
+			<menu text="Tema/Ocultar malla" action-command="HIDEGRID"/>
+			<menu text="Tema/Ajustar a la malla" action-command="SETADJUSTGRID"/>
+			<menu text="Tema/No ajustar a la malla" action-command="NOTADJUSTGRID"/>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.ViewControls" 
+			description="Extensi�n encargada de gestionar la vista."
+			active="true" 
+			priority="3">
+			<menu text="Vista/Zoom_Completo" action-command="FULL" icon="images/MapContents.png"/>
+			<menu text="Vista/Encuadre" action-command="ENCUADRE" icon="images/encuadre.png"/>
+			<menu text="Vista/Seleccion_por_tema" action-command="SELECTIONBYSHAPE"/>
+			<menu text="Vista/configurar_localizador" action-command="CONFIG_LOCATOR"/>		
+			<menu text="Vista/propiedades" action-command="PROPERTIES"/>
+			<menu text="Vista/poner_temas_a/visibles" action-command="TEMAS_VISIBLES"/>
+			<menu text="Vista/poner_temas_a/no_visibles" action-command="TEMAS_NOVISIBLES"/>
+			<menu text="Vista/poner_temas_a/activos" action-command="TEMAS_ACTIVOS"/>
+			<menu text="Vista/poner_temas_a/no_activos" action-command="TEMAS_NOACTIVOS"/>
+				
+					
+			<tool-bar name="Acciones">
+				<action-tool icon="images/MapContents.png" action-command="FULL" tooltip="Zoom_Completo"/>
+				<action-tool icon="images/encuadre.png" action-command="ENCUADRE" tooltip="gestion_encuadre"/>			
+			</tool-bar>
+			<tool-bar name="Herramientas">
+				<selectable-tool is-default="true" icon="images/ZoomIn.png" action-command="ZOOM_IN" tooltip="Zoom_M�s" group="vista"/>
+				<selectable-tool icon="images/ZoomOut.png" action-command="ZOOM_OUT"  tooltip="Zoom_Menos" group="vista"/>
+				<selectable-tool icon="images/Pan.png" action-command="PAN"  tooltip="Encuadre" group="vista"/>
+				<selectable-tool icon="images/Identify.png" action-command="INFO"  tooltip="informacion" group="vista"/>
+				<selectable-tool icon="images/Distancia.png" action-command="MEDICION"  tooltip="medir_distancias" group="vista"/>
+				<selectable-tool icon="images/Poligono16.png" action-command="AREA"  tooltip="medir_area" group="vista"/>
+				<selectable-tool icon="images/Select.png" action-command="SELPOINT"  tooltip="seleccionar_por_punto" group="vista"/>		
+				<selectable-tool icon="images/SelEspacial2b.png" action-command="SELRECT"  tooltip="seleccionar_por_rectangulo" group="vista"/>
+				
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.ThemeControls" 
+			description="Extensi�n encargada de gestionar los eventos realizados sobre un tema."
+			active="true">
+			<menu text="Tema/propiedades" action-command="PROPERTIES"/>
+			<menu text="Tema/shape_seleccion" action-command="SHAPE_SELECTED" icon="images/shapeseleccion.png"/>
+			<menu text="Tema/Exportar selecci�n a DXF" action-command="DXF_SELECTED"/>
+			<menu text="Tema/borra_seleccion" action-command="DEL_SELECTION" icon="images/delselection.png"/>
+			<menu text="Tema/Zoom_Select" action-command="ZOOM_SELECT" icon="images/ZoomSeleccion.png"/>
+			<tool-bar name="Acciones">
+				<action-tool icon="images/ZoomSeleccion.png" action-command="ZOOM_SELECT"  tooltip="Zoom_Select"/>
+				<action-tool icon="images/delselection.png" action-command="DEL_SELECTION"  tooltip="borra_seleccion"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.LinkControls" 
+			description="Extensi�n encargada de gestionar el hiperlink."
+			active="true">
+			<tool-bar name="Herramientas">
+				<selectable-tool icon="images/Link.png" action-command="LINK"  tooltip="Link" group="vista"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.LayoutControls" 
+			description="Extensi�n encargada de gestionar los eventos realizados sobre el Layout."
+			active="true">
+			
+			<menu text="Mapa/propiedades" action-command="PROPERTIES" tooltip="propiedades_mapa"/>
+			<menu text="Mapa/preparar_pagina" action-command="CONFIG" tooltip="preparar_pagina"/>
+			
+			<menu text="Mapa/Zoom_M�s" action-command="ZOOM_IN" tooltip="Zoom_M�s" icon="images/LayoutZoomIn.png"/>
+			<menu text="Mapa/Zoom_Menos" action-command="ZOOM_OUT" tooltip="Zoom_Menos" icon="images/LayoutZoomOut.png"/>
+			<menu text="Mapa/Desplazamiento" action-command="PAN"  tooltip="Encuadre" icon="images/LayoutPan.png"/>
+			<menu text="Mapa/seleccionar_por_rectangulo" action-command="SELECT"  tooltip="seleccionar_por_rectangulo" icon="images/Select.png"/>
+			<menu text="Mapa/Insertar/Vista" action-command="RECTANGLEVIEW" tooltip="insertar_vista" icon="images/MapaVista.png"/>
+			<menu text="Mapa/Insertar/imagen" action-command="RECTANGLEPICTURE" tooltip="insertar_imagen" icon="images/MapaImagen.png"/>
+			<menu text="Mapa/Insertar/escala" action-command="RECTANGLESCALEBAR"  tooltip="insertar_escala" icon="images/MapaEscala.png"/>
+			<menu text="Mapa/Insertar/leyenda" action-command="RECTANGLELEGEND"  tooltip="insertar_leyenda" icon="images/MapaLeyenda.png"/>
+			<menu text="Mapa/Insertar/texto" action-command="RECTANGLETEXT" tooltip="insertar_texto" icon="images/MapaTexto.png"/>
+			
+			<menu text="Mapa/Insertar/punto" action-command="POINT" tooltip="insertar_punto" icon="images/Point.png"/>
+			<menu text="Mapa/Insertar/rectangulo" action-command="RECTANGLESIMPLE" tooltip="insertar_rectangulo" icon="images/Rectangle.png"/>
+			<menu text="Mapa/Insertar/circulo" action-command="CIRCLE" tooltip="insertar_circulo" icon="images/Circle.png"/>
+			<menu text="mapa/anadir_tag" key="t" action-command="SET_TAG" tooltip="anadir_tag" icon="images/tag.png"/>
+			
+			<tool-bar name="Mapa">
+				<selectable-tool icon="images/tag.png" action-command="SET_TAG" tooltip="anadir_tag"/>
+				<selectable-tool icon="images/LayoutZoomIn.png" action-command="ZOOM_IN" tooltip="Zoom_M�s"/>
+				<selectable-tool icon="images/LayoutZoomOut.png" action-command="ZOOM_OUT" tooltip="Zoom_Menos"/>
+				<selectable-tool icon="images/LayoutPan.png" action-command="PAN"  tooltip="Encuadre"/>
+				<selectable-tool icon="images/Select.png" action-command="SELECT"  tooltip="seleccionar_por_rectangulo"/>
+				<selectable-tool icon="images/MapaVista.png" action-command="RECTANGLEVIEW" tooltip="insertar_vista"/>
+				<selectable-tool icon="images/MapaImagen.png" action-command="RECTANGLEPICTURE" tooltip="insertar_imagen"/>
+				<selectable-tool icon="images/MapaEscala.png" action-command="RECTANGLESCALEBAR"  tooltip="insertar_escala"/>
+				<selectable-tool icon="images/MapaLeyenda.png" action-command="RECTANGLELEGEND"  tooltip="insertar_leyenda"/>
+				<selectable-tool icon="images/MapaTexto.png" action-command="RECTANGLETEXT"  tooltip="insertar_texto"/>
+				<selectable-tool icon="images/MapContents.png" action-command="VIEW_FULL" tooltip="Zoom_Completo_Vista"/>
+				<selectable-tool icon="images/ZoomIn.png" action-command="VIEW_ZOOMIN" tooltip="Zoom_M�s_Vista"/>
+				<selectable-tool icon="images/ZoomOut.png" action-command="VIEW_ZOOMOUT" tooltip="Zoom_Menos_Vista"/>
+				<selectable-tool icon="images/Pan.png" action-command="VIEW_PAN" tooltip="Encuadre_Vista"/>
+			</tool-bar>
+			
+			<tool-bar name="Herramientas">
+				<action-tool icon="images/mundo.gif" action-command="FULL" tooltip="Zoom_Completo"/>
+				<action-tool icon="images/zoomreal.png" action-command="REALZOOM" tooltip="Zoom_Real"/>
+				<action-tool icon="images/zoomselect.png" action-command="ZOOMSELECT" tooltip="Zoom_Select"/>
+				<action-tool icon="images/zoommas.png" action-command="ZOOMIN" tooltip="Zoom_M�s"/>
+				<action-tool icon="images/zoommenos.png" action-command="ZOOMOUT" tooltip="Zoom_Menos"/>
+			</tool-bar>
+			
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.GraphicControls"
+			description="Extensi�n encargada de gestionar los eventos realizados sobre los gr�ficos que contiene el Layout."
+			active="true">
+			
+			<menu text="Gr�ficos/propiedades" action-command="PROPIEDADES" tooltip="propiedades" />
+			<menu text="Gr�ficos/alinear" action-command="ALINEAR" tooltip="alinear_graficos"/>
+			<menu text="Gr�ficos/agrupar" action-command="AGRUPAR" tooltip="agrupar_graficos" icon="images/agrupar.png"/>
+			<menu text="Gr�ficos/desagrupar" action-command="DESAGRUPAR" tooltip="desagrupar_graficos" icon="images/desagrupar.png"/>
+			<menu text="Gr�ficos/simplificar" action-command="SIMPLIFICAR" tooltip="simplificar"/>
+			
+			<menu text="Gr�ficos/colocar_delante" action-command="DELANTE" tooltip="colocar_delante" icon="images/delante.png"/>
+			<menu text="Gr�ficos/colocar_detras" action-command="DETRAS" tooltip="colocar_detras" icon="images/detras.png"/>
+			<menu text="Gr�ficos/tama�o_posicion" action-command="POSICIONAR" tooltip="tama�o_posicion" icon="images/posicionar.png"/>
+			<menu text="Gr�ficos/linea_grafica" action-command="BORDEAR" tooltip="linea_grafica" icon="images/bordear.png"/>
+			<tool-bar name="Herramientas">
+				<action-tool icon="images/delante.png" action-command="DELANTE" tooltip="colocar_delante"/>	
+				<action-tool icon="images/detras.png" action-command="DETRAS" tooltip="colocar_detras"/>
+				<action-tool icon="images/agrupar.png" action-command="AGRUPAR" tooltip="agrupar_graficos"/>
+				<action-tool icon="images/desagrupar.png" action-command="DESAGRUPAR" tooltip="desagrupar_graficos"/>
+				<action-tool icon="images/bordear.png" action-command="BORDEAR" tooltip="linea_grafica"/>
+				<action-tool icon="images/posicionar.png" action-command="POSICIONAR" tooltip="tama�o_posicion"/>		
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.GeometryExtension" 
+			description="Extensi�n encargada de gestionar los eventos realizados sobre una Geometry."
+			active="true">
+			<menu text="geometria/insertar/punto" action-command="POINT" icon="images/Point.png"/>
+			<menu text="geometria/insertar/linea" action-command="LINE" icon="images/Rect.png"/>
+			<menu text="geometria/insertar/polilinea" action-command="POLYLINE" icon="images/Line.png"/>
+			<menu text="geometria/insertar/poligono" action-command="POLYGON" icon="images/Poligon.png"/>
+			<menu text="geometria/insertar/rectangulo" action-command="RECTANGLE" icon="images/Rectangle.png"/>
+			<menu text="geometria/insertar/circulo" action-command="CIRCLE" icon="images/Circle.png"/>
+			<menu text="geometria/insertar/elipse" action-command="ELLIPSE" icon="images/Ellipse.png"/>
+			<menu text="geometria/insertar/arc" action-command="ARC" icon="images/Arc.png"/>
+			<!--menu text="geometria/insertar/curva" action-command="SPLINE" icon="images/Spline.png"/-->
+			<menu text="geometria/insertar/copia" action-command="COPY" icon="images/Copy.png"/>
+			<!--menu text="geometria/insertar/equidistante" action-command="EQUIDISTANCE" icon="images/Equidistance.png"/-->
+			<!--menu text="geometria/insertar/Matriz" action-command="MATRIZ" icon="images/Matriz.png"/-->
+			<menu text="geometria/insertar/simetria" action-command="SYMMETRY" icon="images/Symmetry.png"/>
+			<menu text="geometria/insertar/rotacion" action-command="ROTATION" icon="images/Rotation.png"/>
+			<menu text="geometria/insertar/estirar" action-command="STRETCHING" icon="images/Stretching.png"/>
+			<menu text="geometria/insertar/escalado" action-command="SCALE" icon="images/Scale.png"/>
+			<!--menu text="geometria/insertar/alargar" action-command="EXTEND" icon="images/Extend.png"/-->
+			<!--menu text="geometria/insertar/recortar" action-command="TRIM" icon="images/Trim.png"/-->
+			<!--menu text="geometria/insertar/unir_separar" action-command="UNIT" icon="images/Unit.png"/-->
+			<menu text="geometria/insertar/explotar" action-command="EXPLOIT" icon="images/Exploit.png"/>
+			<!--menu text="geometria/insertar/chaflan" action-command="CHAFLAN" icon="images/Chaflan.png"/-->
+			<!--menu text="geometria/insertar/empalme" action-command="JOIN" icon="images/Join.png"/-->
+			
+			<tool-bar name="insertar">
+				<selectable-tool icon="images/Point.png" action-command="POINT" tooltip="punto" group="vista"/>
+				<selectable-tool icon="images/Rect.png" action-command="LINE" tooltip="linea" group="vista"/>
+				<selectable-tool icon="images/Line.png" action-command="POLYLINE" tooltip="polilinea" group="vista"/>
+				<selectable-tool icon="images/Poligon.png" action-command="POLYGON" tooltip="poligono" group="vista"/>
+				<selectable-tool icon="images/Rectangle.png" action-command="RECTANGLE" tooltip="rectangulo" group="vista"/>
+				<selectable-tool icon="images/Circle.png" action-command="CIRCLE" tooltip="circulo" group="vista"/>
+				<selectable-tool icon="images/Ellipse.png" action-command="ELLIPSE" tooltip="elipse" group="vista"/>
+				<selectable-tool icon="images/Arc.png" action-command="ARC" tooltip="arco" group="vista"/>
+				<!--selectable-tool icon="images/Spline.png" action-command="SPLINE" tooltip="curva" group="vista"/-->
+			</tool-bar>
+			<tool-bar name="modificar">	
+				<selectable-tool name="selection" icon="images/Select.png" action-command="SELECT" tooltip="seleccionar_por_rectangulo" group="vista"/>
+				<selectable-tool icon="images/Copy.png" action-command="COPY" tooltip="copia" group="vista"/>
+				<!--selectable-tool icon="images/Equidistance.png" action-command="EQUIDISTANCE" tooltip="equidistante" group="vista"/-->
+				<!--selectable-tool icon="images/Matriz.png" action-command="MATRIZ" tooltip="matriz" group="vista"/-->
+				<selectable-tool icon="images/Symmetry.png" action-command="SYMMETRY" tooltip="simetria" group="vista"/>
+				<selectable-tool icon="images/Rotation.png" action-command="ROTATION" tooltip="rotacion" group="vista"/>
+				<selectable-tool icon="images/Stretching.png" action-command="STRETCHING" tooltip="estirar" group="vista"/>
+				<selectable-tool icon="images/Scale.png" action-command="SCALE" tooltip="escalado" group="vista"/>
+				<!--selectable-tool icon="images/Extend.png" action-command="EXTEND" tooltip="alargar" group="vista"/-->
+				<!--selectable-tool icon="images/Trim.png" action-command="TRIM" tooltip="recortar" group="vista"/-->
+				<!--selectable-tool icon="images/Unit.png" action-command="UNIT" tooltip="unir_separar" group="vista"/-->
+				<selectable-tool icon="images/Exploit.png" action-command="EXPLOIT" tooltip="explotar" group="vista"/>
+				<!--selectable-tool icon="images/Chaflan.png" action-command="CHAFLAN" tooltip="chaflan" group="vista"/-->
+				<!--selectable-tool icon="images/Join.png" action-command="JOIN" tooltip="empalme" group="vista"/-->
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.RedoCommandExtension" 
+			description="Extensi�n encargada de gestionar los eventos rehacer."
+			active="true">
+			<tool-bar name="modificar">	
+				<action-tool icon="images/Redo.png" action-command="REDO" tooltip="rehacer"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.UndoCommandExtension" 
+			description="Extensi�n encargada de gestionar los eventos deshacer."
+			active="true">
+			<tool-bar name="modificar">	
+				<action-tool icon="images/Undo.png" action-command="UNDO" tooltip="deshacer"/>
+			</tool-bar>
+		</extension>
+		
+		<extension class-name="com.iver.cit.gvsig.TableOperations" 
+			description="Extensi�n encargada de abrir el di�logo para filtrar una tabla."
+			active="true">
+			<menu text="Tabla/filtro" icon="images/Filtro.png"/>
+			<tool-bar name="Herramientas">
+				<action-tool icon="images/Filtro.png" tooltip="filtro"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.ViewProjectWindow" 
+			description="Extensi�n encargada de abrir la ventana de gesti�n del proyecto."
+			active="true">
+			<menu text="Ver/ventana_proyecto" 
+				key="p" mnemonic="p" 
+				tooltip="ver_tooltip"
+				action-command="SHOW"/>
+		</extension>
+		
+		<extension class-name="com.iver.cit.gvsig.Tabla" 
+			description="Extensi�n encargada de abrir la tabla asociada al tema seleccionado."
+			active="true">
+			<menu text="Tema/ver_tabla_atributos" icon="images/ResultConsulta.png"/>
+			<tool-bar name="Acciones">
+				<action-tool icon="images/ResultConsulta.png" 
+					enableText="Un_Layer"
+					tooltip="Muestra_atributos"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.Print" 
+			description="Extensi�n encargada de la impresi�n."
+			active="true">
+			<menu text="Mapa/Imprimir" icon="images/print.png"/>
+			<tool-bar name="Mapa">
+				<action-tool icon="images/print.png"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.PrintProperties" 
+			description="Extensi�n encargada de las propiedades de impresi�n."
+			active="true">
+			<tool-bar name="Mapa">
+				<action-tool icon="images/Frame.gif"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.Export" 
+			description="Extensi�n encargada de exportar una vista al formato de imagen que se seleccione."
+			active="true">
+			<menu text="Vista/exportar_a"/>
+		</extension>
+		<extension class-name="com.iver.cit.gvsig.About" 
+			description="Extensi�n encargada de abrir una ventana con la informaci�n relativa al programa."
+			active="true">
+			<menu text="Ayuda/acerca_de" />
+		</extension>
+		
+	</extensions>
+	<icon src="images/logoGVA.gif" text="Piloto gvSIG-CAD"/>
+</plugin-config>

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/config.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/about.htm
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/about.htm	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/about.htm	(revision 1648)
@@ -0,0 +1,91 @@
+<html>
+
+<body>
+<p>&nbsp;</p>
+<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 and other contributors 2004.</font></td>
+  </tr>
+  <tr> 
+    <td colspan="2">&nbsp;</td>
+  </tr>
+  <tr> 
+    <td colspan="2"><font face="Arial, Helvetica, sans-serif">All rights reserved.</font><font face="Arial, Helvetica, sans-serif"> 
+      (Until true GPL is reached)<br>
+      Visit <a href="http://www.gvsig.gva.es">http://www.gvsig.gva.es</a></font></td>
+  </tr>
+  <tr> 
+    <td colspan="2"><p><font face="Arial, Helvetica, sans-serif"><br>
+        This product includes software developed by the<br>
+        Apache Software Foundation http://www.apache.org/ </font></p>
+      <p><font face="Arial, Helvetica, sans-serif">Other libraries we have used:</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><a href="http://www.geotools.org">Geotools2</a> 
+        =&gt; Magn&iacute;fico proyecto. Hemos aprovechado todo lo relativo a 
+        proyecciones, y es probable que utilicemos m&aacute;s m&oacute;dulos, 
+        por ejemplo el relativo a Styled Layer Descriptor (SLD)..</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><a href="http://www.vividsolutions.com/jts/jtshome.htm">JTS</a> 
+        (Java Topology Suite).=&gt;Sin ella, todo lo referente a an&aacute;lisis 
+        espacial, consultas avanzadas y creaci&oacute;n de topolog&iacute;a, ser&iacute;a 
+        imposible.</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><a href="http://logging.apache.org/">Log4java</a> 
+        =&gt; Para que sepamos en todo momento qu&eacute; est&aacute; haciendo 
+        la aplicaci&oacute;n y se cree un &#8220;log&#8221; o registro de los 
+        posibles fallos. Del proyecto Apache, un verdadero almac&eacute;n de librer&iacute;as 
+        &uacute;tiles.</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><a href="http://xml.apache.org/batik/">Batik</a> 
+        =&gt; Tambi&eacute;n del proyecto Apache. En el futuro, la emplearemos 
+        para trabajar con SVG. Por ahora, la empleamos para etiquetar polil&iacute;neas.</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><a href="http://www.castor.org/">Castor</a>=&gt; 
+        Librer&iacute;a para manejar la persistencia de objetos. Con ella se consigue 
+        guardar y recuperar los objetos del proyecto, y tambi&eacute;n la hemos 
+        empleado para realizar el cliente WMS, bas&aacute;ndonos en los esquemas 
+        que suministra el Opengis Consortium.</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><a href="http://www.ermapper.com/">Ermapper</a>=&gt; 
+        Librer&iacute;a para trabajar con ECW. Solo Windows, pero gratuita. Muy 
+        r&aacute;pida en la visualizaci&oacute;n, y consume poca memoria. Posibilita 
+        trabajar con ficheros raster enormes.</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><br>
+        Tambi&eacute;n hemos reutilizado c&oacute;digo de otros proyectos como 
+        <a href="http://www.vividsolutions.com/jump/main.htm">JUMP</a> (Java Unified 
+        Mapping Platform), <a href="http://mapserver.gis.umn.edu/">MapServer</a>, 
+        etc. Adem&aacute;s, hemos explorado el dise&ntilde;o y el c&oacute;digo 
+        de muchos otros proyectos. Uno de los m&aacute;s prometedores: <a href="http://udig.refractions.net/">UDIG</a> 
+        (User Friendly Desktop Gis), una aplicaci&oacute;n que empez&oacute; un 
+        poco m&aacute;s tarde que nosotros, pero que transmite muy buenas vibraciones.</font></p>
+      <p><font face="Arial, Helvetica, sans-serif">Y hemos portado (de manera 
+        incompleta) la librer&iacute;a <a href="http://dgnlib.maptools.org/">DGNLib</a> 
+        a Java nativo para visualizar ficheros .dgn (versi&oacute;n 7.0, la de 
+        MicroStation 95).</font></p>
+      <p><font face="Arial, Helvetica, sans-serif">En el futuro estamos trabajando 
+        para incorporar otras fuentes de datos, como <a href="http://www.lizardtech.com/">MrSid</a> 
+        o la librer&iacute;a <a href="http://www.gdal.org">GDAL</a>.</font></p>
+      <p><font face="Arial, Helvetica, sans-serif">Y para terminar, menci&oacute;n 
+        aparte al entorno de desarrollo que hemos usado: <a href="http://www.eclipse.org">ECLIPSE</a>, 
+        un entorno de desarrollo incre&iacute;ble.<br>
+        </font> </p>
+      </td>
+  </tr>
+  <tr> 
+    <td colspan="2"><p><font face="Arial, Helvetica, sans-serif"><br>
+        Equipo inicial de desarrollo:</font></p>
+      <p><font face="Arial, Helvetica, sans-serif"><br>
+        Vicente Caballero<br>
+        Fernando Gonz&aacute;lez<br>
+        Jos&eacute; Morell<br>
+        Francisco Jos&eacute; Pe&ntilde;arrubia<br>
+        Luis W. Sevilla</font></p>
+      </td>
+  </tr>
+  
+</table>
+<p>&nbsp;</p>
+<p><font face="Arial, Helvetica, sans-serif"><br>
+  </font></p>
+<p>&nbsp; </p>
+</body>
+</html>

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/config/about.htm
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tablas_sel.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tablas_sel.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/FlowGraph.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/FlowGraph.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/InfoCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/InfoCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Copy.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Copy.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Stretching.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Stretching.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutPan.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutPan.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distLeft.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distLeft.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Pan.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Pan.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logo_horiz_bicolor_gva.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logo_horiz_bicolor_gva.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/nuevoencuadre.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/nuevoencuadre.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/QuitarFiltro.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/QuitarFiltro.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Intervalos.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Intervalos.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Line.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Line.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Scale.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Scale.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Redo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Redo.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Hand.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Hand.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Link.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Link.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Ellipse.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Ellipse.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/delante.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/delante.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/CruxCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/CruxCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Unit.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Unit.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/up.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/up.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaEscala.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaEscala.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomInCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomInCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/RectCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/RectCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distDown.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distDown.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/print.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/print.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Join.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Join.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Circle.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Circle.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/SimboloUnico.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/SimboloUnico.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/PoligonCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/PoligonCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Matriz.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Matriz.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/posicionar.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/posicionar.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomPrevio.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomPrevio.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomSeleccion.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomSeleccion.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomOut.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomOut.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomOut.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomOut.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Find.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Find.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/spaceDown.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/spaceDown.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LimpiaSeleccionCapa.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LimpiaSeleccionCapa.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomOutCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomOutCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/left.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/left.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/save.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/save.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logoGVA.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logoGVA.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/agrupar.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/agrupar.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tablas.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tablas.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/barra1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/barra1.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/SelEspacial2b.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/SelEspacial2b.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/barra3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/barra3.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/delselection.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/delselection.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/bordear.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/bordear.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Select.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Select.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logoGVA.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logoGVA.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/shapeseleccion.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/shapeseleccion.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaVista.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaVista.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoommenos.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoommenos.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ResultConsulta.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ResultConsulta.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Point.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Point.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomInCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomInCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tagCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tagCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Poligono16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Poligono16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Graficos.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Graficos.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/CircleCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/CircleCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LimpiaSeleccion.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LimpiaSeleccion.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/RectangleCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/RectangleCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Undo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Undo.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/down.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/down.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Poligon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Poligon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/sizeWidth.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/sizeWidth.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Equidistance.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Equidistance.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapContents3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapContents3.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/symbolTag.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/symbolTag.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Extend.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Extend.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/centerH.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/centerH.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Vista_sel.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Vista_sel.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Symmetry.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Symmetry.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapContents.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapContents.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Chaflan.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Chaflan.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ValoresUnicos.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ValoresUnicos.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Distancia.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Distancia.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaImagen.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaImagen.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/inLayout.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/inLayout.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/centerV.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/centerV.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/RulerCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/RulerCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tag.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tag.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomIn.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomIn.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/right.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/right.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/fileopen.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/fileopen.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/detras.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/detras.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/encuadre.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/encuadre.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/PointCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/PointCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/new.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/new.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaTexto.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaTexto.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/sizeHeight.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/sizeHeight.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/numero.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/numero.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/icolayer.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/icolayer.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/encuadre.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/encuadre.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/add.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/add.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Trim.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Trim.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Identify.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Identify.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distCenterH.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distCenterH.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/sizeOther.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/sizeOther.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaLeyenda.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/MapaLeyenda.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Exploit.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Exploit.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LineCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LineCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutHand.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutHand.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distCenterV.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distCenterV.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Spline.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Spline.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomOutCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/ZoomOutCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/fullsheet.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/fullsheet.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/SelectedZoom.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/SelectedZoom.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/PromoverSeleccion.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/PromoverSeleccion.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/medir.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/medir.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distRight.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distRight.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/mapas.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/mapas.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/mundo.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/mundo.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Arc.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Arc.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distUp.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/distUp.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomIn.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/LayoutZoomIn.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/barra2.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/barra2.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Frame.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Frame.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tirar.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/tirar.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Select1.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Select1.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoomselect.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoomselect.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoommas.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoommas.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/addlayer.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/addlayer.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Vista.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Vista.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logoIver.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/logoIver.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoomreal.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/zoomreal.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/spaceRight.PNG
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/spaceRight.PNG
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/desagrupar.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/desagrupar.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Rect.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Rect.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/VALENCIA
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/VALENCIA
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Filtro.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Filtro.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Rotation.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Rotation.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/open.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/open.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Rectangle.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/Rectangle.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/mapas_sel.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/images/mapas_sel.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_fr.properties
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_fr.properties	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_fr.properties	(revision 1648)
@@ -0,0 +1,407 @@
+(escala_m�xima)=(�chelle maximum)
+(escala_m�xima)=(�chelle maximum) 
+A0=A0
+A1=A1
+A2=A2
+A3=A3
+A4=A4
+A5=A5
+A6=A6
+_abajo=TRADUCIR
+abrir=Ouvrir
+Abrir_Imagen=Ouvrir une image
+abrir_proyecto=Ouvrir un projet
+abrir_tooltip=Ouvrir un projet existant
+Abrir_una_capa=Ouvrir une couche
+Accion_Predefinida=Action pr�d�finie
+Aceptar=Valider
+acerca_de=A propos de...
+activar_regla=Afficher la r�gle
+adjust_transparency=Ajuster la transparence
+agrupar=Grouper
+agrupar_graficos=Grouper les graphiques
+agrupar_linea=Grouper les lignes graphiques.   
+ajustes_linea_grafica=Ajuster la ligne graphique
+Ajustar_transparencia=Ajuster la transparence
+alias=alias
+alineamiento=Alignement:
+alinear=Aligner
+alinear_graficos=Aligner les graphiques
+alta=Hauteur
+alto=Hauteur
+altura:=Hauteur :
+Altura_fija_de_texto=Fixe la hauteur du texte
+Anadir=Ajouter
+Anadir_al_conjunto=Ajouter � la s�lection
+Anadir_Capa=Ajouter une couche
+Anadir_capa=Ajouter une couche
+Anadir_Todos=Tout ajouter
+ancho=Largeur
+Ancho_Contorno=Epaisseur du contour
+Ancho_de_l�nea=Epaisseur de la ligne
+anchura=Largeur:
+angulo_rotacion=Angle de rotation:
+Anterior=Pr�c�dent
+anterior=Pr�c�dent
+Aplicar=Appliquer
+Archivo=Fichier
+Archivos_de_Disco=Fichiers sur le disque
+_arriba=TRADUCIR
+automatico=Automatique
+Ayuda=Aide
+background_color=Colour d'arri�re plan
+baja=Basse
+Bajar_capa=Descendre la couche
+bmp=Fichiers BMP
+Bold=Gras
+borra_seleccion=Effacer une s�lection
+borrador=Draft
+borrar=Supprimer
+Calcular_intervalos=Calculer les intervalles
+calidad=Qualit�
+Cambio_Color=Changer la couleur
+Cambio_de_estilo=Change le style
+Cambio_Estilo=Changer le style
+Cambios_de_estilo=Changer de style
+Campo=Champ
+campo=Champ
+campo_altura_texto=Taille du champ textuel:
+Campo_clasifica=Champ de classification
+Campo_de_clasificacion=Champ de classification
+Campo_de_etiquetado=Etiqueter � partir d'un champ
+Campos=Champs
+cancel=Annuler
+Cancelar=Annuler
+Capas=Couches
+Capas_del_localizador=Couches de localisation
+capaWMS=Couche WMS
+cargar_leyenda=Charger une l�gende
+Centimetros=Centim�tres
+Cerrar=Fermer
+circulo=Cercle
+Circulo=Cercle
+coincidir_tama�o=Faire co�ncider la taille:
+colocar_a_margenes=Placing with reference to margins.
+colocar_alrededor_seleccionados=To place around the graphics selected.
+colocar_alrededor_todos=Placing around all the graphics.  
+colocar_delante=Apr�s
+colocar_detras=Avant
+color=Couleur :
+Color_Contorno=Couleur du contour
+Color_de_la_L�nea=Couleur de la ligne
+Color_de_Relleno=Couleur de remplissage
+Color_final=Couleur d'arriv�e :
+Color_inicial=Couleur de d�part :
+Color_inicio=Couleur de d�part
+color_texto=Couleur du texte
+comentarios=Commentaires
+configurar=Configurer
+configurar_localizador=Configurer le Beeper...
+Configurar_localizador=Configurer le localisateur
+confirmar_borrar=Confirmer la suppression ?
+conservar_escala_visualizacion=Conserver l'�chelle de la vue
+creation_date=Date de cr�ation
+Cruz=Croix
+Cuadrado=Carr�
+cuando_activo=Quand active
+Derecha=Droite
+Derecho=Droit
+desagrupar=Dissocier
+desagrupar_graficos=Dissocier les graphiques
+Descripcion=Description
+descripcion=Description
+desde_arriba=Depuis le haut:
+desde_izquierda=Depuis la gauche:
+Desplazamiento=D�placer
+Detalles=D�tails
+detalles=D�tails
+DGNFiles=Fichiers DGN
+distance_units=Unit�s de distance
+distribuir=Distribuer :
+divisiones_izquierda=Divisions � partir de la gauche
+documentos_existentes=Documents existants
+Dxffiles=Fichiers DXF
+Editar_leyenda=Editer la l�gende
+editar_propiedades=Editer les propri�t�s
+Elegir_Color=Selectionner la couleur
+Elegir_Fuente=Choisir la fonte
+Eliminar=Supprimer
+eliminar_capa=Supprimer une couche
+en_el_mapa=Dans la carte:
+En_metros=En m�tres
+En_pixels=En pixels
+Encuadre=Zooms
+Encuadre_Vista=D�placer
+enlace_vivo=Alive link
+Enlazar_a_ficheros_de_imagen=Lier � un fichier image
+Enlazar_a_fichero_de_texto=Lier � un fichier texte
+Error_abriendo_el_fichero=Erreur d'ouverture du fichier
+error_escritura=Impossible d'�crire le fichier
+error_lectura=Impossible de lire le fichier
+escala=Echelle
+Escala=Echelle
+Escala_Maxima=Echelle maximum
+Escala_Minima=Echelle minimum
+escala_usuario=Echelle d�finie par l'utilisateur
+espaciado_horizontal=Pas horizontal de la grille
+espaciado_vertical=Pas vertical de la grille
+espacio=Espace:
+Estilo=Style: 
+Etiqueta=Etiquette
+Etiquetado=Etiquetage
+Examinar=Parcourir
+exportar=Exporter
+exportar_a=Exporter vers...
+extension=Extension
+Fichero=Fichier
+filtro=Filtrer
+finalizar=Finaliser
+Font=Fonte
+fuente=Fonte
+Fuente=Fonte
+General=G�n�ral
+Generar_Intervalos=Calculer les Intervalles
+gestion_encuadre=Management of Fit in
+grados=degr�es
+Gr�ficos=Graphiques
+Grosor_de_linea=Largeur de la ligne
+grosor_linea=Largeur de la ligne:
+guardado=Enregister sous
+Guardar=Enregistrer
+guardar_cambios=Enregistrer les changements ?
+guardar_como=Enregistrer comme... 
+Guardar_el_zoom_actual=Enregistrer le zoom actif
+Guardar_leyenda=Enregistrer une l�gende
+guardar_leyenda=Enregistrer une l�gende
+guardar_proyecto=Enregistrer un projet
+guardar_tooltip=Enregistrer le projet
+Habilitar_etiquetado=Etiqueter
+hasta=jusqu'�
+Herramientas=Outils
+Herramientas_vista=Fen�tre des outils
+Hiperenlace=Hyperlien
+horizontal=Horizontal
+Identificar_Resultados=Identifier les r�sultats
+Igual_que_la_impresora=Identique que l'impression
+igual_todos_lados=Equal displacement for all sides.
+Imagen=Image
+imagen=Image
+importar=Importer
+Imprimir=Imprimer
+Inferior=Inf�rieur
+infobreak=It shows the elements of the layer using a range of colors.    
+infodef=It shows all the elements of a layer using the same symbol.  
+informacion=Information
+Informaci�n=Information
+infovalue=Affiche les entit�s d'une couche en utilisant un symbole pour chaque valeur
+Inicializando=Initialisation
+Insertar=Ins�rer
+insertar_circulo=Ins�rer un cercle
+insertar_escala=Ins�rer une �chelle
+insertar_imagen=Ins�rer une image
+insertar_leyenda=Ins�rer une l�gende
+insertar_linea=Ins�rer une ligne
+insertar_poligono=Ins�rer un polygone
+insertar_punto=Ins�rer un point
+insertar_recta=Ins�rer une ligne diagonale
+insertar_rectangulo=Ins�rer un rectangle
+insertar_texto=Ins�rer du texte
+insertar_vista=Ins�rer une vue
+Intervalo=Intervalle
+Intervalos=Intervalles
+Intervalos_equidistantes=Intervalles �gaux
+Intervalos_por_rupturas_naturales=Intervalles par seuils naturels
+introduce_nombre=Nouveau type
+Italic=Italique
+Izquierda=Gauche
+jpg=Fichiers JPEG
+kilometros=Kilom�tres
+Kilometros=Kilom�tres
+leyenda=L�gende
+linea=Ligne
+Linea=Ligne
+linea_grafica=Ligne graphique
+Link=Lien
+malla_activada=Activer la grille
+mantener_intervalo=Maintenir l'intervalle
+map_units=Unit�s de la carte
+Mapa=Carte
+mapas=Cartes
+marco_vista=Espace de travail de la vue
+margenes=Marges:
+M�s_100=L�gende limit�e � 100 enregistrements
+medir_area=Mesurer l'aire
+medir_distancias=Mesurer les distances
+Metros=M�tres
+metros=M�tres
+Milimetros=Millim�tres
+Millas=Miles
+modification_date=Date de modification
+Mostrar_Contorno=Activer le contour
+Mostrar_siempre=Tout afficher
+Muestra_atributos=Afficher les attributs de la couche s�lectionn�e.
+Muestra_los_atributos_de_las_capas_seleccionadas=Afficher les attributs de la couche
+Nivel_de_transparencia=Niveau de transparence
+No_de_intervalos=Nombre d'intervalles
+No_mostrar=Ne pas afficher la couche lorsque l'�chelle est
+No_reconocido=Non reconnu
+No_Shape=Cette couche n'est pas de type shape
+no_visibles=No visibles
+nombre=Nom
+nombre_capa=Nom de la couche
+Nombre_que_se_le_dara_al_zoom=Nom pour le zoom
+nombre_sesion=Nom de la session
+Nombres=Noms
+normal=Normal
+Nueva_tabla=Nouvelle table
+nuevo=Nouveau
+Nuevo_conjunto=Nouvelle s�lection
+nuevo_proyecto=Nouveau projet
+nuevo_tamano_fuente=Nouvelle taille de fonte:
+nuevo_tooltip=Cr�er un nouveau projet
+N�m_intervalos=Nombre d'intervalles
+ok=Ok
+orientacion=Orientation:
+Origen de Datos: =Origine des donn�es: 
+Otros=Autres
+owner=Propri�taire
+path=Chemin
+Perimetro=P�rim�tres
+Personalizado=Personnalisation
+Pies=Pieds
+Plain=Normal
+png=Fichiers PNG
+poligono=Polygone
+por_debajo_de =En dessous de: 
+por_encima_de=Au del� de:
+Por_favor_active_el_tema=Vous devez s�lectionner la couche en premier
+posicion_linea=Position de la ligne
+Preparar_pagina=Pr�parer la page
+preparar_pagina=Pr�parer la page
+presentacion=Pr�sentation
+Previsualizacion=Pr�visualisation
+Previsualizacion_de_simbolo=Pr�visualisation du symbole
+propiedades=Propri�t�s
+Propiedades_de_la_Capa=Propri�t�s de la couche
+Propiedades_del_Tema=Propri�t�s de la couche
+Propiedades_escala_grafica=Propri�t�s de la barre d'�chelle
+propiedades_grafico=Propri�t�s du graphique
+propiedades_mapa=Propri�t�s de la carte
+propiedades_marco_imagenes=Propri�t�s du bloc image
+propiedades_marco_leyenda=Propri�t�s du bloc de l�gende
+propiedades_marco_vista=Propri�t�s du bloc de vue
+propiedades_sesion=Propri�t�s de la session
+propiedades_tabla=Propri�t�s de la table
+propiedades_tema=Propri�t�s de la couche
+Propiedades_texto=Propri�t�s du texte
+propiedades_vista=Propri�t�s de la vue
+Pulgadas=Inches
+punto=Point
+Quitar=Quitter
+Quitar_capa=Supprimer une couche
+Quitar_Todos=Tout supprimer
+Rango_de_escalas=Classes d'�chelles
+Raster files=Fichiers Raster
+recorte_vista=Couper la vue
+recta=Ligne diagonale
+rectangulo=Rectangle
+Recuperar_leyenda=Charger une l�gende
+Recuperar_y_eliminar_otros_zoom=R�cuperer et �liminer les autres zooms
+refrescar=Raffraichir
+registros=registers
+rellenar_marco_vista=Remplir le cadre de la vue
+relleno=Remplir :
+renombrar=Renomer
+resolucion_resultado=R�solution du r�sultat:
+Sample=Exemple
+Se_va_a_tener_en_cuenta_para_borrar_los_registros_desde=... pour supprimer les enregistrements � partir de
+seleccion_fuente=S�lection d'une fonte
+Seleccion_por_tema=S�lection par couche
+Seleccionar=S�lectionner
+seleccionar_capas=S�lectionner des couches
+Seleccionar_del_conjunto=S�lectionner � partir de la s�lection active
+Seleccionar_fichero=S�lectionner un fichier
+seleccionar_formato=S�lectionner un format
+seleccionar_por_punto=S�lectionner � partir d'un point
+seleccionar_por_rectangulo=S�lectionner � partir d'un rectangle
+seleccionar_todos=Tout s�lectionner
+seleccione_fecha=S�lection d'une date...
+selection_color=Couleur de s�lection
+Servidor=Server
+servidor=Server
+shape_seleccion=Exporter une s�lection. 
+Shapefile=Shapefile
+Shapefiles=Shapefiles
+siempre=Toujours
+Siguiente=Suivant
+siguiente=Suivant
+Simbolo=Symbole
+S�mbolo_unico=Symbole unique
+Simbolog�a=Symbologie
+simplificar=Simplifier
+sin_titulo=Sans titre
+sincronizar_color_borde_relleno=Sincronize color of stroke and fill:
+Size=Taille
+Solo_para_capas_vectoriales=Seulement pour les couches vectorielles
+Style=Style
+Subir_capa=Monter une couche
+Superior=Sup�rieure
+Tabla=Table
+Tabla_de_Atributos=Table d'attributs
+Tabla_de_prueba=Table test
+tablas=Tables
+tamano=Taille:
+tamano_metros=Taille en m�tres
+tama�o_pagina=Taille de la page:
+tama�o_posicion=Taille et position
+Tema=Couche
+texto=Texte
+Tipo_de_intervalos=Type d'intervalles
+Tipo_de_leyenda=Type de l�gende
+Tipo_de_linea=Type de ligne
+tipo_fichero_proyecto=Fichier de projet gvSIG (*.GVP)
+tipo_leyenda=Fichier de l�gende (*.GVL)
+tipo_linea=Stroke:
+Tipo_no_reconocido=Type non reconnu
+tipo_relleno=Remplir:
+tipo_simbolo=Type de symbole:
+tipos_de_documentos=Type de documents
+titulo=Gestionnaire de projet
+titulo_confirmar=Confirmer le titre
+Transparencia=Transparence
+transparencia=Transparence
+Triangulo=Triangle
+Un_Layer=S�lectionner une couche
+Un_Layer=Une couche doit-�tre s�lectionn�e
+unidades=Unit�s:
+untitled=sans titre
+utilizar_margenes_impresora=Utiliser les marges de l'imprimante.
+vacia=Vide
+Valor=Valeur
+Valores=Valeurs
+Valores_unicos=Valeurs simples
+Valores_�nicos=Valeurs uniques
+ventana_proyecto=Fen�tre de projet
+Ver=Vue
+ver_tabla_atributos=Voir la table des attributs
+ver_tooltip=Afficher la fen�tre de projet
+vertical=Vertical
+visible=Visible
+visibles=Visibles
+Vista=Vue
+vistas=Vues
+vistas=Vues
+visualizacion= Visualiser
+visualizar_cuadricula=Afficher la grille
+WMS=WMS
+Yardas=Yards
+Zoom_al_Tema=Zoom sur la couche
+Zoom_Completo=Vue g�n�rale
+Zoom_Completo_Vista=Zoom complet dans le cadre
+Zoom_M�s=Zoom avant
+Zoom_M�s_Vista=Zoom avant dans le cadre
+Zoom_Menos=Zoom arri�re
+Zoom_Menos_Vista=Zoom arri�re dans le cadre
+Zoom_Previo=Zoom pr�c�dent
+Zoom_Real=Zoom 1:1
+Zoom_Select=Zoom � la s�lection

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_fr.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-ext.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-ext.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-gvt.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-gvt.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/xml-apis.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/xml-apis.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/xercesImpl.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/xercesImpl.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/fsac.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/fsac.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/JimiProClasses.zip
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/JimiProClasses.zip
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-awt-util.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-awt-util.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/jep-2.24.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/jep-2.24.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-util.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-util.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/wmsclient.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/wmsclient.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-gui-util.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/lib/batik-gui-util.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.cvsignore
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.cvsignore	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.cvsignore	(revision 1648)
@@ -0,0 +1,3 @@
+bin
+dist
+gvSIG*.zip

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.cvsignore
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text.properties
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text.properties	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text.properties	(revision 1648)
@@ -0,0 +1,415 @@
+(escala_m�xima)=(escala m�xima)               
+(escala_m�nima)=(escala m�nima)
+A0=A0
+A1=A1
+A2=A2
+A3=A3
+A4=A4
+A5=A5
+A6=A6
+abajo=Abajo
+abrir=Abrir
+Abrir_Imagen=Abrir Imagen
+abrir_proyecto=Abrir proyecto
+abrir_tooltip=Abre un proyecto existente
+Abrir_una_capa=A�adir capa
+Accion_Predefinida=Acci�n Predefinida
+Aceptar=Aceptar
+acerca_de=Acerca de...
+activar_regla=Activar regla
+activos=Activos
+adjust_transparency=Ajustar Transparencia
+agrupar=Agrupar
+agrupar_graficos=Agrupar gr�ficos
+agrupar_linea=Agrupar l�nea gr�fica con gr�ficos.
+Ajustar_transparencia=Ajustar Transparencia
+ajustes_linea_grafica=Ajustes de l�nea gr�fica
+alias=Alias
+alineamiento=Alineamiento:
+alinear=Alinear
+alinear_graficos=Alinear gr�ficos
+alta=Alta
+alto=Alto
+altura=Altura:
+Altura_fija_de_texto=Altura fija de texto
+Anadir=A�adir
+Anadir_al_conjunto=A�adir al conjunto
+Anadir_Capa=A�adir Capa
+Anadir_Todos=A�adir Todos
+Anadir_todos=A�adir todos
+ancho=Ancho
+Ancho_Contorno=Ancho Contorno
+Ancho_de_l�nea=Ancho de l�nea
+anchura=Anchura:
+angulo_rotacion=�ngulo de rotaci�n:
+anterior=Anterior
+Anterior=Anterior
+Aplicar=Aplicar
+Archivo=Archivo
+Archivos_de_Disco=Ficheros de disco
+arriba=Arriba
+automatico=Autom�tico
+Ayuda=Ayuda
+background_color=Color de fondo
+baja=Baja
+Bajar_capa=Bajar capa
+bmp=Ficheros de tipo bmp
+Bold=Bold
+borrador=Borrador
+borra_seleccion=Borra selecci�n
+borrar=Borrar
+Calcular_intervalos=Calcular intervalos
+calidad=Calidad
+Cambios_de_estilo=Cambios de estilo
+Cambio_Color=Cambio Color
+Cambio_de_estilo=Cambio de estilo
+Cambio_Estilo=Cambio Estilo
+Campo=Campo
+campo=Campo
+Campos=Campos
+campo_altura_texto=Campo de altura de texto:
+Campo_clasifica=Campo de Clasificaci�n
+Campo_de_clasificacion=Campo de clasificaci�n
+Campo_de_etiquetado=Campo de etiquetado
+cancel=Cancelar
+Cancelar=Cancelar
+Capas=Capas
+capaWMS=CapaWMS
+Capas_del_localizador=Capas del localizador
+cargar_leyenda=Cargar leyenda
+Centimetros=Cent�metros
+Cerrar=Cerrar
+Circulo=C�rculo
+circulo=C�rculo
+coincidir_tama�o=Coincidir tama�o:
+colocar_alrededor_seleccionados=Colocar alrededor de los gr�ficos seleccionados.
+colocar_alrededor_todos=Colocar alrededor de todos los gr�ficos.
+colocar_a_margenes=Colocar con referencia a margenes.
+colocar_delante=Colocar delante
+colocar_detras=Colocar detr�s
+color=Color:
+Color_Contorno=Color Contorno
+Color_de_la_L�nea=Color de la L�nea: 
+Color_de_Relleno=Color de Relleno
+Color_final=Color final: 
+Color_inicial=Color inicial: 
+Color_inicio=Color de inicio
+color_texto=Color del texto:
+comentarios=Comentarios
+configurar=Configurar
+Configurar_localizador=Configurar localizador
+configurar_localizador=Configurar Localizador ...
+confirmar_borrar=�Seguro que desea borrar el elemento?
+conservar_escala_visualizacion=Conservar escala de visualizaci�n
+creation_date=Fecha de creaci�n
+Cruz=Cruz
+Cuadrado=Cuadrado
+cuando_activo=Cuando Activo
+Derecha=Derecha
+Derecho=Derecho
+desagrupar=Desagrupar
+desagrupar_graficos=Desagrupar gr�ficos
+descripcion=Descripci�n
+Descripcion=Descripci�n
+desde_arriba=Desde Arriba:
+desde_izquierda=Desde la Izquierda:
+Desplazamiento=Desplazamiento
+detalles=Detalles
+Detalles=Detalles
+DGNFiles=Ficheros .DGN
+distance_units=Unidades de medida
+distribuir=Distribuir:
+divisiones_izquierda=Divisiones a la izquierda
+documentos_existentes=Documentos existentes
+Dxffiles=Ficheros .DXF
+Editar_leyenda=Editar Leyenda
+editar_propiedades=editar propiedades
+Elegir_Color=Elegir Color
+Elegir_Fuente=Elegir Fuente
+Eliminar=Eliminar
+eliminar_capa=Eliminar Capa
+Encuadre=Encuadre
+Encuadre_Vista=Encuadre sobre la Vista
+enlace_vivo=Enlace vivo
+Enlazar_a_ficheros_de_imagen=Enlazar a ficheros de imagen
+Enlazar_a_fichero_de_texto=Enlazar a ficheros de texto
+en_el_mapa= En el mapa:
+En_metros=En metros
+En_pixels=En pixels
+Error_abriendo_el_fichero=Error abriendo el fichero
+error_escritura=No se pudo guardar el proyecto
+error_lectura=No se pudo abrir el proyecto
+Escala=Escala
+escala=Escala
+Escala_Maxima=Escala M�xima
+Escala_Minima=Escala M�nima
+escala_usuario=Escala especificada por el usuario
+espaciado_horizontal=Espaciado horizontal de la malla
+espaciado_vertical=Espaciado vertical de la malla
+espacio=Espacio:
+Estilo=Estilo: 
+Etiqueta=Etiqueta
+Etiquetado=Etiquetado
+Examinar=Examinar    
+exportar=Exportar
+exportar_a=Exportar a...
+extension=Extensi�n
+Fichero=Fichero
+filtro=Filtro
+finalizar=Finalizar
+Font=Font
+Fuente=Fuente
+fuente=Fuente
+General=General
+Generar_Intervalos=Generar Intervalos
+gestion_encuadre=Gesti�n de Encuadres
+grados=grados
+Grosor_de_linea=Grosor de l�nea
+grosor_linea=Grosor de l�nea:
+Gr�ficos=Gr�ficos
+guardado=Guardado en
+Guardar=Guardar
+guardar_cambios=�Quiere guardar los cambios?
+guardar_como=Guardar como...
+Guardar_el_zoom_actual=Guardar el zoom
+Guardar_leyenda=Guardar leyenda
+guardar_leyenda=Guardar leyenda
+guardar_proyecto=Guardar proyecto
+guardar_tooltip=Guarda los cambios del proyecto
+Habilitar_etiquetado=Habilitar etiquetado
+hasta=hasta
+Herramientas=Herramientas
+Herramientas_vista=Herramientas de la Vista
+Hiperenlace=Hiperenlace
+horizontal=Horizontal
+Identificar_Resultados=Identificar Resultados
+Igual_que_la_impresora=Igual que la impresora
+igual_todos_lados=Desplazamiento igual por todos lados.
+Imagen=Image
+imagen=Imagen
+importar=Importar
+Imprimir=Imprimir
+Inferior=Inferior
+infobreak=Muestra los elementos de la capa usando una gama de colores.
+infodef=Muestra todos los elementos de una capa usando el mismo s�mbolo.
+informacion=Informaci�n
+Informaci�n=Informaci�n
+infovalue=Muestra elementos de la capa usando un s�mbolo por cada valor.
+Inicializando=Inicializando
+Insertar=Insertar
+insertar_circulo=Insertar C�rculo
+insertar_escala=Insertar Escala
+insertar_imagen=Insertar Imagen
+insertar_leyenda=Insertar Leyenda
+insertar_linea=Insertar L�nea
+insertar_poligono=Insertar Pol�gono
+insertar_punto=Insertar Punto
+insertar_recta=Insertar Recta
+insertar_rectangulo=Insertar Rect�ngulo
+insertar_texto=Insertar Texto
+insertar_vista=Insertar Vista
+Intervalo=Intervalo
+Intervalos=Intervalos
+Intervalos_equidistantes=Intervalos equidistantes.
+Intervalos_por_rupturas_naturales=Intervalos por rupturas naturales.
+introduce_nombre=Introduce el nuevo nombre
+Italic=Italic
+Izquierda=Izquierda
+Izquierdo=Izquierdo
+jpg=Ficheros JPEG
+Kilometros=Kil�metros
+kilometros=Kil�metros
+leyenda=Leyenda
+Linea=Line
+linea=L�nea
+linea_grafica=L�nea gr�fica
+Link=Enlace
+malla_activada=Malla activada
+mantener_intervalo=Mantener intervalo
+Mapa=Mapa
+mapas=Mapas
+map_units=Unidades de mapa
+marco_vista=Marco de la Vista
+marco_vista=Marco de la vista
+margenes=Margenes:
+medir_area=Medir Area
+medir_distancias=Medir distancias
+Metros=Metros
+metros=Metros
+Milimetros=Mil�metros
+Millas=Millas
+modification_date=�ltima fecha de modificaci�n
+Mostrar_Contorno=Mostrar Contorno
+Mostrar_siempre=Mostrar siempre
+Muestra_atributos=Muestra los atributos de las capas seleccionadas.
+Muestra_los_atributos_de_las_capas_seleccionadas=Muestra los atributos de las capas seleccionadas
+M�s_100=El n�mero de valores es superior a 100, y no aporta informaci�n
+Nivel_de_transparencia=Nivel de transparencia
+nombre=Nombre
+nombre_capa=Nombre de la capa
+Nombres=Nombres
+Nombre_que_se_le_dara_al_zoom=Nombre que se le dar� al zoom
+nombre_sesion=Nombre de la sesi�n
+normal=Normal
+no_activos=No activos
+No_de_intervalos=N� de intervalos
+No_mostrar=No mostrar la capa cuando la escala 
+No_reconocido=No reconocido
+No_Shape=Este Layer no es de tipo Shape
+no_visibles=No visibles
+Nueva_tabla=Nueva Tabla
+nuevo=Nuevo
+Nuevo_conjunto=Nuevo conjunto
+nuevo_proyecto=Nuevo proyecto
+nuevo_tamano_fuente=Nuevo tama�o de fuente: 
+nuevo_tooltip=Crea un nuevo proyecto
+N�m_intervalos=N�m. intervalos  
+ok=Ok
+orientacion=Orientaci�n:
+Origen_de_Datos=Origen de Datos: 
+Otros=Otros
+owner=Propietario
+path=Ruta
+Perimetro=Per�metro
+Personalizado=Personalizado
+Pies=Pies
+Plain=Plain
+png=Ficheros png
+poligono=Pol�gono
+poner_temas_a=Poner temas a ...
+por_debajo_de=por debajo de: 
+por_encima_de=por encima de:
+Por_favor_active_el_tema=Por favor active el tema
+posicion_linea=Posici�n de la l�nea
+Preparar_pagina=Preparar p�gina
+preparar_pagina=Preparar p�gina
+presentacion=Presentaci�n
+Previsualizacion=Previsualizaci�n
+Previsualizacion_de_simbolo=Previsualizaci�n de s�mbolo
+propiedades=Propiedades
+Propiedades_del_Tema=Propiedades del tema
+Propiedades_de_la_Capa=Propiedades de la Capa
+Propiedades_escala_grafica=Propiedades de la escala gr�fica
+propiedades_grafico=Propiedades Gr�fico
+propiedades_mapa=Propiedades del mapa
+propiedades_marco_imagenes=Propiedades del marco de im�genes
+propiedades_marco_leyenda=Propiedades del marco de la leyenda
+propiedades_marco_vista=Propiedades_del_marco_de la vista
+propiedades_sesion=Propiedades de la sesion
+propiedades_tabla=Propiedades de la tabla
+Propiedades_texto=Propiedades del texto
+propiedades_tema=Propiedades del Tema
+propiedades_vista=Propiedades de la vista
+Pulgadas=Pulgadas
+punto=Punto
+Quitar=Quitar
+Quitar_capa=Quitar capa
+Quitar_Todos=Quitar Todos
+Quitar_todos=Quitar todos
+Rango_de_escalas=Rango de escalas
+Rasterfiles=Ficheros raster
+recorte_vista=Recorte a vista
+recta=Recta
+rectangulo=Rect�ngulo
+Recuperar_leyenda=Recuperar leyenda
+Recuperar_y_eliminar_otros_zoom=Recuperar y eliminar otros zooms
+refrescar=Refrescar
+registros=registros
+rellenar_marco_vista=Rellenar marco de la vista
+relleno=Relleno:
+renombrar=Renombrar
+resolucion_resultado=Resoluci�n del resultado:
+seleccionar_capas=Seleccionar Capas
+seleccionar_formato=Seleccionar Formato
+Sample=Sample
+Seleccionar=Seleccionar
+Seleccionar_del_conjunto=Seleccionar del conjunto
+Seleccionar_fichero=Seleccionar fichero
+seleccionar_por_punto=Seleccionar por punto
+seleccionar_por_rectangulo=Seleccionar por rect�ngulo
+seleccionar_todos=Seleccionar todos
+seleccione_fecha=Seleccione una fecha...
+seleccion_fuente=Selecci�n de fuente
+Seleccion_por_tema=Seleccion por tema
+selection_color=Color de la selecci�n
+servidor=Servidor
+Servidor=Servidor
+Se_va_a_tener_en_cuenta_para_borrar_los_registros_desde=Se va a tener en cuenta para borrar los registros desde
+shape_seleccion=Exportar selecci�n.
+Shapefile=Shapefile
+Shapefiles=Ficheros .SHP
+siempre=Siempre
+siguiente=Siguiente
+Siguiente=Siguiente
+Simbolo=Simbolo
+Simbolog�a=Simbolog�a
+Simbolo_unico=Simbolo �nico
+simplificar=Simplificar
+sin_titulo=Sin t�tulo
+sincronizar_color_borde_relleno=Sincronizar el color del borde con el del relleno:
+Size=Size
+Solo_para_capas_vectoriales=Solo para capas vectoriales
+Style=Style
+Subir_capa=Subir capa
+Superior=Superior
+S�mbolo=S�mbolo
+S�mbolo_�nico=S�mbolo �nico
+Tabla=Tabla
+tablas=Tablas
+Tabla_de_Atributos=Tabla de Atributos
+Tabla_de_prueba=Tabla de prueba
+tamano=Tama�o:
+tamano_metros=Tama�o en metros
+tama�o_pagina=Tama�o de p�gina:
+tama�o_posicion=Tama�o y posici�n
+Tema=Capa
+texto=Texto
+tipos_de_documentos=Tipos de documentos
+Tipo_de_intervalos=Tipo de intervalos
+Tipo_de_leyenda=Tipo de leyenda
+Tipo_de_linea=Tipo de linea
+tipo_fichero_proyecto=Fichero de proyecto gvSIG (*.GVP)
+tipo_leyenda=Ficheros de tipo leyenda (*.GVL)
+tipo_linea=Tipo de L�nea:
+Tipo_no_reconocido=Tipo no reconocido
+tipo_relleno=Tipo de Relleno:
+tipo_simbolo=Tipo de s�mbolo:
+titulo=Gestor de proyectos
+titulo_confirmar=Confirmaci�n
+Transparencia=Transparencia
+transparencia=Transparencia
+Triangulo=Triangulo
+unidades=Unidades:
+Unidades=Units
+untitled=sin t�tulo
+Un_Layer=Debe seleccionar al menos una capa.
+utilizar_margenes_impresora=Utilizar m�rgenes de la impresora.
+vacia=vac�a
+Valor=Valor
+Valores=Valores
+Valores_unicos=Valores �nicos
+Valores_�nicos=Valores �nicos
+ventana_proyecto=Ventana de proyecto
+Ver=Ver
+vertical=Vertical
+ver_tabla_atributos=Ver Tabla de atributos
+ver_tooltip=Muestra la ventana de proyecto
+visible=Visible
+visibles=Visibles
+Vista=Vista
+vistas=Vistas
+Visualizacion=Visualizaci�n
+visualizacion=Visualizaci�n
+visualizar_cuadricula=Visualizar Malla
+WMS=WMS
+Yardas=Yardas
+Zoom_al_Tema=Zoom al Tema
+Zoom_Completo=Zoom Completo
+Zoom_Completo_Vista=Zoom Completo sobre la Vista
+Zoom_Menos=Zoom Menos
+Zoom_Menos_Vista=Zoom Menos sobre la Vista
+Zoom_M�s=Zoom M�s
+Zoom_M�s_Vista=Zoom M�s sobre la Vista
+Zoom_Previo=Zoom Previo
+Zoom_Real=Zoom 1:1
+Zoom_Select=Zoom a lo seleccionado

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.project
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.project	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.project	(revision 1648)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>GVSIG</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</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/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.project
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/gvSIG.bat
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/gvSIG.bat
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/LEEME.txt
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/LEEME.txt	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/LEEME.txt	(revision 1648)
@@ -0,0 +1,19 @@
+gvSIG v 0.2.0 beta.
+
+Prerequisitos:
+  - Java instalado (JRE 1.4.2 o superior) (http://java.sun.com)
+  - JAI + JAI image I/O (http://java.sun.com)
+  - librer�as din�micas para los ECW: vienen con cualquier
+    producto de ERMAPPER y son gratuitas (Actualmente solo hay disponibles para
+    MS windows)(http://www.ermapper.com)
+  
+Instalaci�n:
+
+	Descomprimir el archivo zip completo en el directorio deseado
+	
+Ejecuci�n
+	En windows: gvSIG.bat
+	En linux:  gvSIG.sh
+
+M�s informaci�n:
+	gvsig@gva.es
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/LEEME.txt
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/gvSig.sh
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/distFiles/gvSig.sh
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.number
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.number	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.number	(revision 1648)
@@ -0,0 +1,3 @@
+#Build Number for ANT. Do not edit!
+#Wed Dec 15 13:09:14 CET 2004
+build.number=128

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.number
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/VCN
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/VCN	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/VCN	(revision 1648)
@@ -0,0 +1,153 @@
+REALIZADOS:
+
+- Al a�adir un nuevo fframe se debe de quedar ese como seleccionado 
+y todos los dem�s hay que dejarlos como no seleccionados.
+
+- Implementar el FFrameLegend con todos los nombres de capas 
+como textLayout y los s�mbolos.
+
+-Meterle un m�todo que cambie cada uno de los nombres y s�mbolos 
+del fframe en un fframe por separado.
+(Simplificar)A partir de un FFrameLegend crear FFrameText y FFrameSymbol.
+
+-Introducir dentro FGraphicsUtilities la parte del m�todo paintcomponent 
+de FPreviewSymbol que sea com�n dibujar sobre el mapa de forma est�tica.
+Se dibuja por la posici�n del shape y no del rect�ngulo.
+
+-Crear una clase FLayoutUtilities, con los m�todos est�ticos fromSheet y toSheet.
+
+-Crear grupos de fframes unidos, Agrupar y para Desagrupar, 
+de forma que cuando se agrupan se crea un FframeGroup que contenga dentro 
+todos los fframes seleccionados previamente, y cuando se desagrupa 
+se elimina el fframegroup y se vuelve a crear un fframe 
+de cada uno de los fframe que contenia dentro el fframegroup.
+
+-Alinear como lo hace arcView o como lo hace el visual editor en funci�n 
+de los fframes seleccionados o en funci�n del Layout.
+
+-Colocar detr�s y delante fframes seleccionados respecto de los dem�s.
+
+-El FConstanstLayout debe de desaparecer y a�adir las 
+constantes que contiene en las clases que las necesiten.
+
+- Crear las barras de escala y modificar la escala en vez de en metros en cent�metros.
+
+-Cuando se muestra una escala que no es fija, y se modifica la escala de la vista, 
+la escala que lo representa no varia.
+
+- Se pueda abrir el di�logo de propiedades de cada uno de los fframes a�adidos al Layout, 
+con la informaci�n que necesita.
+
+- Cuando se alinea un solo elemento no se hace como deber�a. 
+
+-L�nea gr�fica.
+
+-FullExtent.
+
+- El di�logo de FPanelDefault no tiene la posibilidad p�blica de modificar 
+que no contenga relleno.
+-Los puntos se deben de poder cambiar su tama�o al cambiar su tama�o arrastrando con 
+el rat�n en el Layout y no solo desde el di�logo de propiedades de este.
+
+- El Fshape se crea cada vez que se dibuja y por lo tanto no hay que guardarlo.
+
+- FSymbol tiene que guardarse en XML utilizando la XMLEntity.La forma separar el modelo del Layout.
+
+-Al cambiar de tama�o un fframe por encima de su posicion x e y, se distorsiona.
+
+-Al modificar la escala de una vista en el Layout la escala gr�fica debe de cambiar su tama�o 
+de acuerdo al cambio en la escala de la vista.
+
+-Haciendo un doble click se acceda al dialogo de propiedades de cada uno de los fframes.
+
+-FFrameText: Falta poder posicionar las l�neas a la izquierda, centro o derecha.
+
+-Hacer el entramado que sea transparente totalmente en vez de blanco y que se pueda controlar su transparencia en las l�neas que lo componen.
+
+- La propiedad de poder a�adir una vista, una imagen o una leyenda en forma de borrador o presentaci�n.
+
+- Popupmenu en el Layout que se abre pulsando el bot�n derecho del rat�n.
+
+- En FFrameViewDialog si no se selecciona ninguna vista y se acepta salta una excepci�n.
+
+- Al cambiar el zoom y posicionar alg�n elemento detr�s o delante respecto de los dem�s 
+cambia el zoom y se coloca siempre en mismo lugar.
+
+- Teniendo seleccionada la herramienta de selecci�n y desplazar un fframe cambia su tama�o, ahora lo sigue cambiando pero solo cuando
+ se desplaza de su posici�n, el desplazamiento y cambio de tama�o de un rect�ngulo 
+con el grid seleccionado no funciona del todo bien, cambia 
+el tama�o de forma anormal, pero no siempre.
+
+- Separar el drawLayout para imprimir del drawLayout para visualizar en pantalla.
+
+-En FBorderDialog, falta a�adir propiedades al rect�ngulo que se a�ade, 
+por ejemplo elegir el color, grosor, textura,de momento es un rect�ngulo simple.
+
+
+- FFramePicture se debe cambiar, ya que crea un bufferedimage tan grande como el zoom que se hace y salta la excepci�n de out of memory.
+
+PENDIENTES:
+
+- Rematar el a�adir una vista al Layout, 
+y su actualizaci�n.
+
+- El Di�logo FLegendManagerWindow, 
+para que pueda funcionar igual que en arcView 
+debe ser �nico implementando SingletonView y que se pueda cambiar su modelo 
+por el de otra vista que lo requiera. 
+Ahora mismo lo he dejado como modal y que implementa View.
+
+-Al a�adir una misma vista dos veces al Layout sigue cambiando su extent, cada repaint.
+Tambi�n al tocar la vista y refrescar en el Layout, que debe ser por lo mismo ya que la 
+escala que calcula es diferente cada vez y eso cambia el extent.
+Supongo que es la forma de calcular el extent respecto de la anchura y altura del 
+fframe que lo contiene y al ser dos se reajusta sin parar. Para corregir esto hay que:
+El extent del Fmap debe de quedarse fuera de este, 
+de esta forma no se necesitara clonar fmap cuando el extent 
+de la vista a a�adir al Layout no tiene que ser la misma.
+
+-A�adir el insertar un rect�ngulo a cada uno de los fframes seleccionados
+dentro de fframeGraphics contener FShapes con el rect�ngulo dentro en este caso y 
+pensando en poder a�adir tambi�n de otras formas los rect�ngulos y l�neas que queramos.
+fshape + symbol==graphics.
+
+- No corren prisa: deshacer, escala real, 
+zoom a lo seleccionado.
+
+-Revisar los di�logos de los fframes para ver posibles fallos.
+
+- Hay que tener en cuenta que di�logos abrir cuando hay varios fframes seleccionados 
+cuando se quiere abrir el di�logo de propiedades. En FLayoutGraphics,openFFrameDialog(), 
+hay que abrir el di�logo de propiedades cuando hayan m�s de uno seleccionado, 
+incluido cuando son de tipos diferentes.
+
+- Cuando se deslinka el extent de una vista a�adidar al Layout del extent original, se clona el FMap. 
+
+-FFrameView: Falta recortar a la vista y lo de los eventos de cuando se tiene que actualizar el Layout respecto de los cambios de la vista.
+	Enlace vivo: Se debe guardar el extent actual de la vista y quedarse con ese extent.
+	
+-FFramePicture: Falta lo de los eventos.
+-FFrameScaleBar: Visualizar solo las vistas que esten a�adidas al Layout y no todas.
+-FFrameLegend: Eventos .Y visualizar en la lista de selecci�n, si se quiere, las vistas a�adidas solamente y no todas.
+
+
+-Preparar p�gina: FConfigLayoutDialog muestra una apariencia que no es la del Look and feel elegida. 
+Puede que sea porque es un MODALDIALOG.
+
+- Cuando se posiciona delante o detr�s una barra de escala, se cambia el tipo de fuente. 
+Pero el tama�o es el mismo, el color del graphics tambi�n y el tipo de fuente.
+- El area imprimible hay que conseguir que sea la misma para 
+los attributes, PageFormat y para guardarla en un atributo 
+de la clase Attributes. Imprimir de acuerdo a los m�rgenes establecidos, no funciona bien todav�a. Es un tema delicado.
+
+- m_name de FFrame solo lo utilizan tres fframes de momento.
+
+- Mirar el por que una vista tarda tanto en dibujar un trocillo peque�o en el Layout.
+
+- La leyenda que se introduzca con tama�o adecuado, mirar arcView.
+
+DUDAS:
+
+- El simplificar un fframe, como por ejemplo la leyenda esta ya hecho pero el arcView 
+tambi�n simplifica una vista por cada uno de sus shapes.(Esto no).
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/VCN
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/log4j.properties
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/log4j.properties	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/log4j.properties	(revision 1648)
@@ -0,0 +1,18 @@
+log4j.rootLogger=info, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=application.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/log4j.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/DaySelectionListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/DaySelectionListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/DaySelectionListener.java	(revision 1648)
@@ -0,0 +1,14 @@
+package com.lamatek.swingextras;
+
+/**
+ * Interface used by {@link com.lamatek.swingextras.JDateChooser JDateChooser}
+ * to notify when the user has selected a date.
+ */
+public interface DaySelectionListener {
+	
+	/**
+	 * Called when a user selects a date.
+	 */
+	public void daySelected(int day);
+	
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/DaySelectionListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/JDateChooser.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/JDateChooser.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/JDateChooser.java	(revision 1648)
@@ -0,0 +1,372 @@
+package com.lamatek.swingextras;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Vector;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.EtchedBorder;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+/**
+ * JDateChooser is a simple Date choosing component with similar functionality
+ * to JFileChooser and JColorChooser. It can be used as a component, to 
+ * be inserted into a client layout, or can display it's own Dialog
+ * through use of the {@link #showDialog(Component, String) showDialog} method.
+ * <p>
+ * JDateChooser can be initialized to the current date using the no argument
+ * constructor, or initialized to a predefined date by passing an instance
+ * of Calendar to the constructor.<p>
+ * Using the JDateChooser dialog works in a similar manner to JFileChooser
+ * or JColorChooser. The {@link #showDialog(Component, String) showDialog} method
+ * returns an int that equates to the public variables ACCEPT_OPTION, CANCEL_OPTION
+ * or ERROR_OPTION.<p>
+ * <tt>
+ * JDateChooser chooser = new JDateChooser();<br>
+ * if (chooser.showDialog(this, "Select a date...") == JDateChooser.ACCEPT_OPTION) {<br>
+ * &nbsp;&nbsp;Calendar selectedDate = chooser.getSelectedDate();<br>
+ * &nbsp;&nbsp;// process date here...<br>
+ * }<p>
+ * To use JDateChooser as a component within a GUI, users should subclass
+ * JDateChooser and override the {@link #acceptSelection() acceptSelection} and
+ * {@link #cancelSelection() cancelSelection} methods to process the 
+ * corresponding user selection.<p>
+ * The current date can be retrieved by calling {@link #getSelectedDate() getSelectedDate}
+ * method.
+ */
+
+public class JDateChooser extends JPanel implements ActionListener, DaySelectionListener, View {
+	
+	public static final int CANCEL_OPTION = 4;
+	private int currentDay;
+	private int currentMonth;
+	private int currentYear;
+	private JLabel dateText;
+	private Calendar calendar;
+	private Date date;
+	private JButton previousYear;
+	private JButton previousMonth;
+	private JButton nextMonth;
+	private JButton nextYear;
+	private JButton okay;
+	private JButton cancel;
+	private JPanel days;
+	
+	private DayListener dayListener = new DayListener();
+	/**
+	 * This constructor creates a new instance of JDateChooser initialized to
+	 * the current date.
+	 */
+	public JDateChooser() {
+		this(Calendar.getInstance());
+	}
+	
+	/**
+	 * Creates a new instance of JDateChooser initialized to the given Calendar.
+	 */
+	public JDateChooser(Calendar c) {
+		super();
+		this.calendar = c;
+		this.calendar.setLenient(true);
+		setup();
+	}
+	
+	private void setup() {
+		GridBagLayout g = new GridBagLayout();
+		GridBagConstraints c = new GridBagConstraints();
+		JPanel header = new JPanel(g);
+		c.gridx = 0;
+		c.gridy = 0;
+		c.insets = new Insets(2, 0, 2, 0);
+		previousYear = (JButton) header.add(new JButton("<<"));
+		previousYear.addActionListener(this);
+		previousYear.setToolTipText("A�o anterior");
+		g.setConstraints(previousYear, c);
+		previousMonth = (JButton) header.add(new JButton("<"));
+		previousMonth.addActionListener(this);
+		previousMonth.setToolTipText("Mes anterior");
+		c.gridx++;
+		g.setConstraints(previousMonth, c);
+		dateText = (JLabel) header.add(new JLabel("", JLabel.CENTER));
+		dateText.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
+		c.gridx++;
+		c.weightx = 1.0;
+		c.fill = c.BOTH;
+		g.setConstraints(dateText, c);
+		nextMonth = (JButton) header.add(new JButton(">"));
+		nextMonth.addActionListener(this);
+		nextMonth.setToolTipText("Mes siguiente");
+		c.gridx++;
+		c.weightx = 0.0;
+		c.fill = c.NONE;
+		g.setConstraints(nextMonth, c);
+		nextYear = (JButton) header.add(new JButton(">>"));
+		nextYear.addActionListener(this);
+		nextYear.setToolTipText("A�o siguiente");
+		c.gridx++;
+		g.setConstraints(nextYear, c);
+		
+		updateCalendar(calendar);
+		
+		JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
+		okay = (JButton) buttons.add(new JButton("Ok"));
+		okay.addActionListener(this);
+		cancel = (JButton) buttons.add(new JButton("Cancelar"));
+		cancel.addActionListener(this);
+		
+		setLayout(new BorderLayout());
+		add("North", header);
+		days.setBackground(Color.WHITE);
+		days.setOpaque(true);
+		days.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
+		add("Center", days);
+		add("South", buttons);
+	}
+	
+	private void updateCalendar(Calendar c) {
+		if (days != null)
+			remove(days);
+		currentDay = calendar.get(Calendar.DAY_OF_MONTH);
+		currentMonth = calendar.get(Calendar.MONTH);
+		currentYear = calendar.get(Calendar.YEAR);
+		days = new JPanel(new GridLayout(7, 7));
+		Calendar setup = (Calendar) calendar.clone();
+		setup.set(Calendar.DAY_OF_WEEK, setup.getFirstDayOfWeek());
+		int lastLayoutPosition = 0;
+		for (int i = 0; i < 7; i++) {
+			int dayInt = setup.get(Calendar.DAY_OF_WEEK);
+			if (dayInt == Calendar.MONDAY)
+				days.add(new JLabel("Mon", JLabel.CENTER));
+			if (dayInt == Calendar.TUESDAY)
+				days.add(new JLabel("Tue", JLabel.CENTER));
+			if (dayInt == Calendar.WEDNESDAY)
+				days.add(new JLabel("Wed", JLabel.CENTER));
+			if (dayInt == Calendar.THURSDAY)
+				days.add(new JLabel("Thu", JLabel.CENTER));
+			if (dayInt == Calendar.FRIDAY)
+				days.add(new JLabel("Fri", JLabel.CENTER));
+			if (dayInt == Calendar.SATURDAY)
+				days.add(new JLabel("Sat", JLabel.CENTER));
+			if (dayInt == Calendar.SUNDAY)
+				days.add(new JLabel("Sun", JLabel.CENTER));
+			setup.roll(Calendar.DAY_OF_WEEK, true);
+			lastLayoutPosition++;
+		}
+		setup = (Calendar) calendar.clone();
+		setup.set(Calendar.DAY_OF_MONTH, 1);
+		int first = setup.get(Calendar.DAY_OF_WEEK);
+		for (int i = 0; i < (first - 1); i++) {
+			days.add(new JLabel(""));
+			lastLayoutPosition++;
+		}
+		setup.set(Calendar.DAY_OF_MONTH, 1);
+		for (int i = 0; i < setup.getActualMaximum(setup.DAY_OF_MONTH); i++) {
+			DayButton button = new DayButton(setup.get(setup.DAY_OF_MONTH));
+			if (setup.get(Calendar.DAY_OF_MONTH) == currentDay){
+				button.setBackground(Color.BLUE);
+				button.setForeground(Color.WHITE);
+				dayListener.setDia(button);
+			}
+			button.addDaySelectionListener(this);
+			button.addMouseListener(dayListener);
+			days.add(button);
+			setup.roll(setup.DAY_OF_MONTH, true);
+			lastLayoutPosition++;
+		}
+		for (int i = lastLayoutPosition; i < 49; i++)
+			days.add(new JLabel(""));
+		add("Center", days);
+		validate();
+		setup = null;
+		updateLabel();
+	}
+	
+	private void updateLabel() {
+		Date date = calendar.getTime();
+		dateText.setText(DateFormat.getInstance().format(date));
+	}
+	
+	/**
+	 * Returns the currently selected Date in the form of a java.util.Calendar
+	 * object. Typically called adter receipt of an {@link #ACCEPT_OPTION ACCEPT_OPTION}
+	 * (using the {@link #showDialog(Component, String) showDialog} method) or
+	 * within the {@link #acceptSelection() acceptSelection} method (using the
+	 * JDateChooser as a component.)<p>
+	 * @return java.util.Calendar The selected date in the form of a Calendar object.
+	 */
+	public Calendar getSelectedDate() {
+		return calendar;
+	}
+	
+	/**
+	 * Used to process events from the previous month, previous year, next month, next year,
+	 * okay and cancel buttons. Users should call super.actionPerformed(ActionEvent) if overriding
+	 * this method.
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == okay) {
+			PluginServices.getMDIManager().closeView(this);
+		}
+		if (e.getSource() == cancel) {
+			calendar = null;
+			PluginServices.getMDIManager().closeView(this);
+		}
+		if (e.getSource() == previousYear) {
+			calendar.roll(Calendar.YEAR, -1);
+			updateCalendar(calendar);
+		}
+		if (e.getSource() == previousMonth) {
+			calendar.roll(Calendar.MONTH, -1);
+			updateCalendar(calendar);
+		}
+		if (e.getSource() == nextMonth) {
+			calendar.roll(Calendar.MONTH, 1);
+			updateCalendar(calendar);
+		}
+		if (e.getSource() == nextYear) {
+			calendar.roll(Calendar.YEAR, 1);
+			updateCalendar(calendar);
+		}
+	}
+	
+	/**
+	 * Used to process day selection events from the user. This method resets
+	 * resets the Calendar object to the selected day. Subclasses should make a call
+	 * to super.daySelected() if overriding this method.
+	 */
+	public void daySelected(int d) {
+		calendar.set(Calendar.DAY_OF_MONTH, d);
+		updateLabel();
+		currentDay = d;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+			m_viewinfo.setTitle(PluginServices.getText(this,"seleccione_fecha"));
+			m_viewinfo.setWidth(400);
+			m_viewinfo.setHeight(200);
+		
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}
+
+class DayListener extends MouseAdapter{
+	private DayButton btnDia;
+	
+	public void setDia(DayButton btn){
+		btnDia = btn; 
+	}
+	/**
+	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+	 */
+	public void mouseClicked(MouseEvent e) {
+		if (btnDia != null){
+			btnDia.setBackground(Color.WHITE);
+			btnDia.setForeground(Color.BLACK);
+		}
+
+		btnDia = (DayButton) e.getSource();
+		btnDia.setBackground(Color.BLUE);
+		btnDia.setForeground(Color.WHITE);
+		
+	}
+
+}
+
+class DayButton extends JLabel implements MouseListener {
+	
+	private int day;
+	private Vector listeners;
+	
+	public DayButton(int d) {
+		super((new Integer(d)).toString());
+		this.day = d;
+		addMouseListener(this);
+		this.setBackground(Color.WHITE);
+		this.setOpaque(true);
+		this.setHorizontalAlignment(JLabel.CENTER);
+	}
+	
+	public void addDaySelectionListener(DaySelectionListener l) {
+		if (listeners == null)
+			listeners = new Vector(1, 1);
+		listeners.addElement(l);
+	}
+	
+	public void removeDaySelectionListener(DaySelectionListener l) {
+		if (listeners != null)
+			listeners.removeElement(l);
+	}
+	
+	public void removeAllListeners() {
+		listeners = new Vector(1,1);
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+	 */
+	public void mouseClicked(MouseEvent e) {
+		if (listeners != null) {
+			for (int i = 0; i < listeners.size(); i++) {
+				((DaySelectionListener) listeners.elementAt(i)).daySelected(day);
+			}
+		}
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
+	 */
+	public void mouseEntered(MouseEvent arg0) {
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
+	 */
+	public void mouseExited(MouseEvent arg0) {
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public void mousePressed(MouseEvent arg0) {
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
+	 */
+	public void mouseReleased(MouseEvent arg0) {
+	}
+}
+
+	
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/lamatek/swingextras/JDateChooser.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/UniqueList.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/UniqueList.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/UniqueList.java	(revision 1648)
@@ -0,0 +1,166 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import java.util.*;
+
+
+/**
+ * A List that ignores duplicates. Note: performance is not optimized - a simple linear
+ * search is performed.
+ */
+public class UniqueList implements List {
+    private List list;
+
+    /**
+     * Creates a UniqueList.
+     */
+    public UniqueList() {
+        this(new ArrayList());
+    }
+
+    /**
+     * Creates a UniqueList backed by the given List.
+     * @param list a List that will be this UniqueList's underlying List
+     */
+    public UniqueList(List list) {
+        this.list = list;
+    }
+
+    public int size() {
+        return list.size();
+    }
+
+    public boolean isEmpty() {
+        return list.isEmpty();
+    }
+
+    public boolean contains(Object o) {
+        return list.contains(o);
+    }
+
+    public Iterator iterator() {
+        return list.iterator();
+    }
+
+    public Object[] toArray() {
+        return list.toArray();
+    }
+
+    public Object[] toArray(Object[] a) {
+        return list.toArray(a);
+    }
+
+    public boolean add(Object o) {
+        if (list.contains(o)) {
+            return false;
+        }
+
+        return list.add(o);
+    }
+
+    public boolean remove(Object o) {
+        return list.remove(o);
+    }
+
+    public boolean containsAll(Collection c) {
+        return list.containsAll(c);
+    }
+
+    public boolean addAll(Collection c) {
+    	return addAll(size(), c);
+    }
+
+    public boolean addAll(int index, Collection c) {
+		ArrayList itemsToAdd = new ArrayList(c);
+		itemsToAdd.removeAll(this);
+		return list.addAll(index, itemsToAdd);    	
+    }
+
+    public boolean removeAll(Collection c) {
+        return list.removeAll(c);
+    }
+
+    public boolean retainAll(Collection c) {
+        return list.retainAll(c);
+    }
+
+    public void clear() {
+        list.clear();
+    }
+
+    public boolean equals(Object o) {
+        return list.equals(o);
+    }
+
+    public Object get(int index) {
+        return list.get(index);
+    }
+
+    public Object set(int index, Object element) {
+        return list.set(index, element);
+    }
+
+    public void add(int index, Object element) {
+        if (list.contains(element)) {
+            return;
+        }
+
+        list.add(index, element);
+    }
+
+    public Object remove(int index) {
+        return list.remove(index);
+    }
+
+    public int indexOf(Object o) {
+        return list.indexOf(o);
+    }
+
+    public int lastIndexOf(Object o) {
+        return list.lastIndexOf(o);
+    }
+
+    public ListIterator listIterator() {
+        return list.listIterator();
+    }
+
+    public ListIterator listIterator(int index) {
+        return list.listIterator(index);
+    }
+
+    public List subList(int fromIndex, int toIndex) {
+        return list.subList(fromIndex, toIndex);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/UniqueList.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.txt
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.txt	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.txt	(revision 1648)
@@ -0,0 +1,136 @@
+#Forget 2-digit year specifications ("yyyy"). Otherwise yyMMdd will 
+#consider "20040203" to be invalid (a valid "200402" with a couple of
+#extra characters). (FlexibleDateParser skips patterns that don't
+#parse *all* the characters). Anyway, FlexibleDateParser also tries
+#the (deprecated) Date constructor, and that should parse the most
+#common 2-digit-year formats. [Jon Aquino]
+
+#Lines beginning with "#" and blank lines are ignored. [Jon Aquino]
+
+#Earlier patterns have precedence over later patterns. [Jon Aquino]
+
+#####################################################################
+#Popular SimpleDateFormat strings, culled from the top 1000 hits on 
+#Google and Google Groups on 21 May 2003 [Jon Aquino]
+
+#Multiple Google hits [Jon Aquino]
+
+yyyy-MM-dd
+yyyyMMdd
+dd.MM.yyyy
+
+#Although dd/MM/yyyy had a few more hits in Google, give priority to
+#MM/dd/yyyy because JUMP will be used mainly in North America. 
+#Anyway, yyyy-MM-dd should be preferred to both. [Jon Aquino]
+MM/dd/yyyy
+dd/MM/yyyy
+
+yyyy-MM-dd HH:mm:ss
+yyyyMMddHHmmss
+MMMM d, yyyy
+yyyy.MM.dd hh:mm:ss
+yyyy/MM/dd
+HH:mm
+MMddyyyy
+HH:mm:ss
+ddMMyyyy
+dd-MMM-yyyy
+dd-MM-yyyy
+dd MMM yyyy
+yyyyMMddHHmmssSSS
+yyyyMMddHHmm
+yyyy/MM/dd HH:mm:ss
+yyyy/MM/dd HH:mm
+yyyy.MM.dd
+hh:mm a
+h:mmaa
+MMM d, yyyy
+HHmm
+
+#Single Google hits [Jon Aquino]
+
+yyyyMMddhhmmss
+yyyy_MM_dd.hh_mm_ss_a.zzz
+yyyy_MM_dd
+yyyyMMddhhmmssSSS
+yyyyMMddHHss
+yyyyMMddHHmmsszzzzHHmm
+yyyy/MM/dd/HH/mm/ss/SS
+yyyy.MMM.dd HH:mm:ss.SSS z
+yyyy.MM.dd HH:mm:ss
+yyyy-Md HH:mm:ss
+yyyy-MM-dd-G-hh-mm-ss-z
+yyyy-MM-dd'T'HH:mm:ss
+yyyy-MM-dd hh:mm:ss
+yyyy-MM-dd HH:mm:sszzzzzzzzz
+yyyy-MM-dd HH:mm:sszzz
+yyyy-MM-dd HH:mm:ss.SSSzzzzzzzzz
+yyyy-MM-dd HH:mm:ss.SSSSSS z
+yyyy-MM-dd HH:mm:ss.SSS z
+yyyy-MM-dd HH:mm:ss z
+yyyy-MM-dd HH:mm
+yyyy-MM-d HH:mm:ss
+yyyy-DDD/HH:mm:ss.SSS
+yyyy'-'MM'-'dd
+yyyy DDD:HH:mm:ss
+yyyyMMdd HH:mm
+yyyy/MM/dd hh:mm:ss
+MMM dd, yyyy
+mm:ss:SS
+MM-dd-yyyy
+hh:mm:ss:SSS
+hh:mm:ss dd-MM-yyyy
+hh:mm
+h:mm a, zzzz
+h:mm
+h:m
+ddMMyyyyHHmmssSSS
+ddhhmmz MMM yyyy
+ddMMMyyyy
+dd/MM/yyyy HH:mm:ss zzz
+dd/MMM/yyyy
+dd/MM/yyyy:HHmm
+dd/MM/yyyy -- HH:mm:ss
+dd/MM/yyyy - HH:mm:ss
+dd/MM/yyyy hh:mm
+dd.MMM.yyyy
+dd.MM.yyyy hh:mm:ss a zzz
+dd.MM.yyyy HH:mm:ss
+dd.MM.yyyy '-' HH:mm:ss z
+dd-MMM-yyyy HH:mm
+dd'/'MM'/'yyyy
+dd MMMMM, yyyy
+dd MMMM yyyy
+dd MM yyyy
+d_M_yyyy_hh_mm_ss
+d MMM yyyy
+MMddyyyy.HHmm
+MMddyyyyHHmm
+MMM-dd-yyyy HH:mm:ss.S
+MMM d hh:mm:ss
+MM/dd/yyyy hh:mm:ss z
+MM/dd/yyyy hh:mm:ss.SSS a
+MM/dd/yyyy HH:mm
+MM.dd.yyyy
+MM'/'dd'/'yyyy
+M/dd/yyyy
+M/d/yyyy
+M-dd-yyyy
+HH:mm:ss '-' dd.MM.yyyy
+H:mm
+:mm:ss
+
+#####################################################################
+# Excel patterns [Jon Aquino]
+
+M/dd
+dd-MMM
+MMM-yyyy
+MM/dd/yyyy hh:mm a
+M-yyyy
+hh:mm:ss a
+
+#####################################################################
+# Other patterns [Jon Aquino]
+MMM d
+MMM yyyy

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/StringUtil.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/StringUtil.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/StringUtil.java	(revision 1648)
@@ -0,0 +1,350 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import com.vividsolutions.jts.util.Assert;
+
+/**
+ * Useful String-related utilities.
+ */
+public class StringUtil {
+
+    public static String s(int n) {
+        return (n != 1) ? "s" : "";
+    }
+
+    public static String ies(int n) {
+        return (n != 1) ? "ies" : "y";
+    }
+
+    public static String classNameWithoutQualifiers(String className) {
+        return className.substring(
+            Math.max(className.lastIndexOf("."), className.lastIndexOf("$")) + 1);
+    }
+
+    public static String classNameWithoutPackageQualifiers(String className) {
+        return className.substring(className.lastIndexOf(".") + 1);
+    }
+
+    public static String repeat(char c, int n) {
+        StringBuffer b = new StringBuffer();
+
+        for (int i = 0; i < n; i++) {
+            b.append(c);
+        }
+
+        return b.toString();
+    }
+
+    /**
+     *  Line-wraps s by inserting a newline instead of the first space after the nth
+     *  column. Word-wraps.
+     */
+    public static String split(String s, int n) {
+        StringBuffer b = new StringBuffer();
+        boolean wrapPending = false;
+
+        for (int i = 0; i < s.length(); i++) {
+            if (((i % n) == 0) && (i > 0)) {
+                wrapPending = true;
+            }
+
+            char c = s.charAt(i);
+
+            if (wrapPending && (c == ' ')) {
+                b.append("\n");
+                wrapPending = false;
+            } else {
+                b.append(c);
+            }
+        }
+
+        return b.toString();
+    }
+
+    public static String capitalize(String word) {
+        if (word.length() == 0) {
+            return word;
+        }
+
+        return (word.charAt(0) + "").toUpperCase() + word.substring(1);
+    }
+    
+    public static String uncapitalize(String word) {
+        if (word.length() == 0) {
+            return word;
+        }
+
+        return (word.charAt(0) + "").toLowerCase() + word.substring(1);        
+    }
+
+    /**
+     * Converts the comma-delimited string into a List of trimmed strings.
+     * @param s a String with comma-delimited values
+     * @return a List of the Strings that were delimited by commas
+     */
+    public static List fromCommaDelimitedString(String s) {
+        ArrayList result = new ArrayList();
+        StringTokenizer tokenizer = new StringTokenizer(s, ",");
+
+        while (tokenizer.hasMoreTokens()) {
+            result.add(tokenizer.nextToken().toString().trim());
+        }
+
+        return result;
+    }
+
+    /**
+     * Returns a List of empty Strings.
+     * @param size the size of the List to create
+     * @return a List of blank Strings
+     */
+    public static List blankStringList(int size) {
+        ArrayList list = new ArrayList();
+
+        for (int i = 0; i < size; i++) {
+            list.add("");
+        }
+
+        return list;
+    }
+
+    public static String toFriendlyName(String className) {
+        return toFriendlyName(className, null);
+    }
+    
+    public static String friendlyName(Class c) {
+        return toFriendlyName(c.getName());
+    }
+
+    public static String toFriendlyName(String className, String substringToRemove) {
+        String name = className;
+
+        //Remove substring sooner rather than later because, for example,
+        //?"PlugIn" will become "Plug In". [Jon Aquino]
+        if (substringToRemove != null) {
+            name = StringUtil.replaceAll(name, substringToRemove, "");
+        }
+
+        name = StringUtil.classNameWithoutQualifiers(name);
+        name = insertSpaces(name);
+
+        return name;
+    }
+
+    public static String insertSpaces(String s) {
+        if (s.length() < 2) {
+            return s;
+        }
+
+        String result = "";
+
+        for (int i = 0; i < (s.length() - 2); i++) { //-2
+            result += s.charAt(i);
+
+            if ((Character.isLowerCase(s.charAt(i))
+                && Character.isUpperCase(s.charAt(i + 1)))
+                || (Character.isUpperCase(s.charAt(i + 1))
+                    && Character.isLowerCase(s.charAt(i + 2)))) {
+                result += " ";
+            }
+        }
+
+        result += s.charAt(s.length() - 2);
+        result += s.charAt(s.length() - 1);
+
+        return result.trim();
+    }
+
+    /**
+     * Returns the elements of c separated by commas. If c is empty, an empty
+     * String will be returned.
+     * @param c a Collection of objects to convert to Strings and delimit by commas
+     * @return a String containing c's elements, delimited by commas
+     */
+    public static String toCommaDelimitedString(Collection c) {
+        return toDelimitedString(c, ", ");
+    }
+
+    /**
+     *  Returns original with all occurrences of oldSubstring replaced by
+     *  newSubstring
+     */
+    public static String replaceAll(
+        String original,
+        String oldSubstring,
+        String newSubstring) {
+        return replace(original, oldSubstring, newSubstring, true);
+    }
+
+    /**
+     *  Returns original with occurrences of oldSubstring replaced by
+     *  newSubstring. Set all to true to replace all occurrences, or false to
+     *  replace the first occurrence only.
+     */
+    public static String replace(
+        String original,
+        String oldSubstring,
+        String newSubstring,
+        boolean all) {
+        StringBuffer b = new StringBuffer(original);
+        replace(b, oldSubstring, newSubstring, all);
+
+        return b.toString();
+    }
+
+    /**
+     *  Replaces all instances of the String o with the String n in the
+     *  StringBuffer orig if all is true, or only the first instance if all is
+     *  false. Posted by Steve Chapel <schapel@breakthr.com> on UseNet
+     */
+    public static void replace(StringBuffer orig, String o, String n, boolean all) {
+        if ((orig == null) || (o == null) || (o.length() == 0) || (n == null)) {
+            throw new IllegalArgumentException("Null or zero-length String");
+        }
+
+        int i = 0;
+
+        while ((i + o.length()) <= orig.length()) {
+            if (orig.substring(i, i + o.length()).equals(o)) {
+                orig.replace(i, i + o.length(), n);
+
+                if (!all) {
+                    break;
+                } else {
+                    i += n.length();
+                }
+            } else {
+                i++;
+            }
+        }
+    }
+
+    /**
+     * Returns an throwable's stack trace
+     */
+    public static String stackTrace(Throwable t) {
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        PrintStream ps = new PrintStream(os);
+        t.printStackTrace(ps);
+
+        return os.toString();
+    }
+    
+    public static String head(String s, int lines) {
+        int newlinesEncountered = 0;
+        for (int i = 0; i < s.length(); i++) {
+            if (s.charAt(i) == '\n') {
+                newlinesEncountered++;
+                if (newlinesEncountered == lines) {
+                    return s.substring(0, i);
+                }
+            }
+        }
+        return s;
+    }
+
+    public static String limitLength(String s, int maxLength) {
+        Assert.isTrue(maxLength >= 3);
+
+        if (s == null) {
+            return null;
+        }
+
+        if (s.length() > maxLength) {
+            return s.substring(0, maxLength - 3) + "...";
+        }
+
+        return s;
+    }
+
+    public static boolean isNumber(String token) {
+        try {
+            Double.parseDouble(token);
+
+            return true;
+        } catch (NumberFormatException e) {
+            return false;
+        }
+    }  
+
+    public static String toDelimitedString(Collection c, String delimiter) {
+        if (c.isEmpty()) {
+            return "";
+        }
+
+        StringBuffer result = new StringBuffer();
+
+        for (Iterator i = c.iterator(); i.hasNext();) {
+            Object o = i.next();
+            result.append(delimiter + ((o == null) ? "" : o.toString()));
+        }
+
+        return result.substring(delimiter.length());
+    }
+
+    public static String toTimeString(long milliseconds) {
+        long remainder = milliseconds;
+        long days = remainder / 86400000;
+        remainder = remainder % 86400000;
+
+        long hours = remainder / 3600000;
+        remainder = remainder % 3600000;
+
+        long minutes = remainder / 60000;
+        remainder = remainder % 60000;
+
+        long seconds = remainder / 1000;
+        String s = "";
+
+        if (days > 0) {
+            s += (days + " days ");
+        }
+
+        s
+            += (Fmt.fmt(hours, 2, Fmt.ZF)
+                + ":"
+                + Fmt.fmt(minutes, 2, Fmt.ZF)
+                + ":"
+                + Fmt.fmt(seconds, 2, Fmt.ZF));
+
+        return s;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/StringUtil.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.java	(revision 1648)
@@ -0,0 +1,330 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import com.vividsolutions.jts.util.Assert;
+
+import java.awt.Color;
+import java.awt.Component;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+
+import javax.swing.DefaultCellEditor;
+import javax.swing.JComponent;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.border.LineBorder;
+import javax.swing.table.TableCellEditor;
+
+/**
+ * Warning: This class can parse a wide variety of formats. This flexibility is fine for parsing user
+ * input because the user immediately sees whether the parser is correct and can fix it if
+ * necessary. However, GML files are advised to stick with a safe format like yyyy-MM-dd.
+ * yy/MM/dd is not as safe because while 99/03/04 will be parsed as yyyy/MM/dd, 
+ * 02/03/04 will be parsed as MM/dd/yyyy (because MM/dd/yyyy appears earlier than yyyy/MM/dd
+ * in FlexibleDateParser.txt).
+ */
+public class FlexibleDateParser {
+    private static Collection lenientFormatters = null;
+    private static Collection unlenientFormatters = null;
+    //CellEditor used to be a static field CELL_EDITOR, but I was getting
+    //problems calling it from ESETextField (it simply didn't appear).
+    //The problems vanished when I turned it into a static class. I didn't
+    //investigate further. [Jon Aquino]
+    public static final class CellEditor extends DefaultCellEditor {
+        public CellEditor() {
+            super(new JTextField());
+        }
+        private Object value;
+        private FlexibleDateParser parser = new FlexibleDateParser();
+
+        public boolean stopCellEditing() {
+            try {
+                value = parser.parse((String) super.getCellEditorValue(), true);
+            } catch (Exception e) {
+                ((JComponent) getComponent()).setBorder(new LineBorder(Color.red));
+
+                return false;
+            }
+
+            return super.stopCellEditing();
+        }
+
+        public Component getTableCellEditorComponent(
+            JTable table,
+            Object value,
+            boolean isSelected,
+            int row,
+            int column) {
+            this.value = null;
+            ((JComponent) getComponent()).setBorder(new LineBorder(Color.black));
+
+            return super.getTableCellEditorComponent(
+                table,
+                format((Date) value),
+                isSelected,
+                row,
+                column);
+        }
+
+        private String format(Date date) {
+            return (date == null) ? "" : formatter.format(date);
+        }
+
+        public Object getCellEditorValue() {
+            return value;
+        }
+
+        //Same formatter as used by JTable.DateRenderer. [Jon Aquino]
+        private DateFormat formatter = DateFormat.getDateInstance();
+    };
+
+    private boolean verbose = false;
+
+    private Collection sortByComplexity(Collection patterns) {
+        //Least complex to most complex. [Jon Aquino]
+        TreeSet sortedPatterns = new TreeSet(new Comparator() {
+            public int compare(Object o1, Object o2) {
+                int result = complexity(o1.toString()) - complexity(o2.toString());
+                if (result == 0) {
+                    //The two patterns have the same level of complexity.
+                    //Sort by order of appearance (e.g. to resolve
+                    //MM/dd/yyyy vs dd/MM/yyyy [Jon Aquino]
+                    result = ((Pattern) o1).index - ((Pattern) o2).index;
+                }
+                return result;
+            }
+
+            private TreeSet uniqueCharacters = new TreeSet();
+
+            private int complexity(String pattern) {
+                uniqueCharacters.clear();
+
+                for (int i = 0; i < pattern.length(); i++) {
+                    if (("" + pattern.charAt(i)).trim().length() > 0) {
+                        uniqueCharacters.add("" + pattern.charAt(i));
+                    }
+                }
+
+                return uniqueCharacters.size();
+            }
+        });
+        sortedPatterns.addAll(patterns);
+
+        return sortedPatterns;
+    }
+
+    private Collection lenientFormatters() {
+        if (lenientFormatters == null) {
+            load();
+        }
+
+        return lenientFormatters;
+    }
+
+    private Collection unlenientFormatters() {
+        if (unlenientFormatters == null) {
+            load();
+        }
+
+        return unlenientFormatters;
+    }
+
+    /**
+     * @return null if s is empty
+     */
+    public Date parse(String s, boolean lenient) throws ParseException {
+        if (s.trim().length() == 0) {
+            return null;
+        }
+        //The deprecated Date#parse method is actually pretty flexible. [Jon Aquino]
+        try {
+            if (verbose) {
+                System.out.println(s + " -- Date constructor");
+            }
+            return new Date(s);
+        } catch (Exception e) {
+            //Eat it. [Jon Aquino]
+        }
+
+        try {
+            return parse(s, unlenientFormatters());
+        } catch (ParseException e) {
+            if (lenient) {
+                return parse(s, lenientFormatters());
+            }
+
+            throw e;
+        }
+    }
+
+    private Date parse(String s, Collection formatters) throws ParseException {
+        ParseException firstParseException = null;
+
+        for (Iterator i = formatters.iterator(); i.hasNext();) {
+            SimpleDateFormat formatter = (SimpleDateFormat) i.next();
+
+            if (verbose) {
+                System.out.println(
+                    s
+                        + " -- "
+                        + formatter.toPattern()
+                        + (formatter.isLenient() ? "lenient" : ""));
+            }
+
+            try {
+                return parse(s, formatter);
+            } catch (ParseException e) {
+                if (firstParseException == null) {
+                    firstParseException = e;
+                }
+            }
+        }
+
+        throw firstParseException;
+    }
+
+    private Date parse(String s, SimpleDateFormat formatter) throws ParseException {
+        ParsePosition pos = new ParsePosition(0);
+        Date date = formatter.parse(s, pos);
+
+        if (pos.getIndex() == 0) {
+            throw new ParseException(
+                "Unparseable date: \"" + s + "\"",
+                pos.getErrorIndex());
+        }
+
+        //SimpleDateFormat ignores trailing characters in the pattern string that it
+        //doesn't need. Don't allow it to ignore any characters. [Jon Aquino]
+        if (pos.getIndex() != s.length()) {
+            throw new ParseException(
+                "Unparseable date: \"" + s + "\"",
+                pos.getErrorIndex());
+        }
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+
+        if ((calendar.get(Calendar.YEAR) == 1970) && (s.indexOf("70") == -1)) {
+            calendar.set(Calendar.YEAR, Calendar.getInstance().get(Calendar.YEAR));
+        }
+
+        return calendar.getTime();
+    }
+
+    private static class Pattern {
+        private String pattern;
+        private int index;
+        public Pattern(String pattern, int index) {
+            this.pattern = pattern;
+            this.index = index;
+        }
+        public String toString() {
+            return pattern;
+        }
+    }
+
+    private void load() {
+        if (lenientFormatters == null) {
+            InputStream inputStream =
+                getClass().getResourceAsStream("FlexibleDateParser.txt");
+
+            try {
+                try {
+                    Collection patterns = new ArrayList();
+                    int index = 0;
+                    for (Iterator i = FileUtil.getContents(inputStream).iterator();
+                        i.hasNext();
+                        ) {
+                        String line = ((String) i.next()).trim();
+
+                        if (line.startsWith("#")) {
+                            continue;
+                        }
+
+                        if (line.length() == 0) {
+                            continue;
+                        }
+
+                        patterns.add(new Pattern(line, index));
+                        index++;
+                    }
+
+                    unlenientFormatters = toFormatters(false, patterns);
+                    lenientFormatters = toFormatters(true, patterns);
+                } finally {
+                    inputStream.close();
+                }
+            } catch (IOException e) {
+                Assert.shouldNeverReachHere(e.toString());
+            }
+        }
+    }
+
+    private Collection toFormatters(boolean lenient, Collection patterns) {
+        ArrayList formatters = new ArrayList();
+        //Sort from least complex to most complex; otherwise, ddMMMyyyy 
+        //instead of MMMd will match "May 15". [Jon Aquino]
+        for (Iterator i = sortByComplexity(patterns).iterator(); i.hasNext();) {
+            Pattern pattern = (Pattern) i.next();
+            SimpleDateFormat formatter = new SimpleDateFormat(pattern.pattern);
+            formatter.setLenient(lenient);
+            formatters.add(formatter);
+        }
+
+        return formatters;
+    }
+
+    public static void main(String[] args) throws Exception {
+        System.out.println(DateFormat.getDateInstance().parse("03-Mar-1998"));
+    }
+
+    public void setVerbose(boolean b) {
+        verbose = b;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FlexibleDateParser.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CoordinateArrays.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CoordinateArrays.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CoordinateArrays.java	(revision 1648)
@@ -0,0 +1,221 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import java.util.*;
+
+import com.vividsolutions.jts.algorithm.CGAlgorithms;
+import com.vividsolutions.jts.algorithm.RobustCGAlgorithms;
+import com.vividsolutions.jts.geom.*;
+import com.vividsolutions.jts.util.Assert;
+
+
+/**
+ * Some utility functions for handling Coordinate arrays.
+ */
+public class CoordinateArrays {
+    //<<TODO:REFACTORING>> JTS already has a class named CoordinateArrays.
+    //I wonder if we should collapse this class into that one. [Jon Aquino]
+    // MD - yep, at some point.
+    private static final CGAlgorithms cga = new RobustCGAlgorithms();
+    private final static Coordinate[] coordArrayType = new Coordinate[0];
+
+    public static Coordinate[] toCoordinateArray(List coordList) {
+        return (Coordinate[]) coordList.toArray(coordArrayType);
+    }
+
+    //<<TODO:REFACTORING>> This functionality is duplicated in
+    //the protected method Geometry#reversePointOrder. Perhaps we should
+    //make that method public and deprecate this method, or have this method
+    //delegate to the other. [Jon Aquino]
+    //MD: Geometry#reversePointOrder could delegate to this method.  Can't do it other way around.
+    public static void reverse(Coordinate[] coord) {
+        int last = coord.length - 1;
+        int mid = last / 2;
+
+        for (int i = 0; i <= mid; i++) {
+            Coordinate tmp = coord[i];
+            coord[i] = coord[last - i];
+            coord[last - i] = tmp;
+        }
+    }
+
+    /**
+     * Converts an array of coordinates to a line or point, as appropriate.
+     * @param coords the coordinates of a line or point
+     * @param fact a factory used to create the Geometry
+     * @return a line if there is more than one coordinate; a point if there is
+     * just one coordinate; an empty point otherwise
+     */
+    public static Geometry toLineOrPoint(Coordinate[] coords,
+        GeometryFactory fact) {
+        if (coords.length > 1) {
+            return fact.createLineString(coords);
+        }
+
+        if (coords.length == 1) {
+            return fact.createPoint(coords[0]);
+        }
+
+        return fact.createPoint((Coordinate)null);
+    }
+
+    public static boolean equals(Coordinate[] coord1, Coordinate[] coord2) {
+        if (coord1 == coord2) {
+            return true;
+        }
+
+        if ((coord1 == null) || (coord2 == null)) {
+            return false;
+        }
+
+        if (coord1.length != coord2.length) {
+            return false;
+        }
+
+        for (int i = 0; i < coord1.length; i++) {
+            if (!coord1[i].equals(coord2[i])) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Converts a collection of coordinate arrays to a collection of geometries.
+     * @param coordArrays a collection of Coordinate[]
+     * @param fact a factory used to create the Geometries
+     * @return a collection of LineStrings and Points
+     */
+    public static List fromCoordinateArrays(List coordArrays,
+        GeometryFactory fact) {
+        List geomList = new ArrayList();
+
+        for (Iterator i = coordArrays.iterator(); i.hasNext();) {
+            Coordinate[] coords = (Coordinate[]) i.next();
+            Geometry geom = toLineOrPoint(coords, fact);
+            geomList.add(geom);
+        }
+
+        return geomList;
+    }
+
+    /**
+     * Extract the coordinate arrays for a geometry into a List.
+     * @param g the Geometry to extract from
+     * @param coordArrayList the List to add the coordinate arrays to
+     * @param orientPolygons whether or not the arrays in the List should be
+     * oriented (clockwise for the shell, counterclockwise for the holes)
+     */
+    public static void addCoordinateArrays(Geometry g, boolean orientPolygons,
+        List coordArrayList) {
+        if (g.getDimension() <= 0) {
+            return;
+        } else if (g instanceof LineString) {
+            LineString l = (LineString) g;
+            coordArrayList.add(l.getCoordinates());
+        } else if (g instanceof Polygon) {
+            Polygon poly = (Polygon) g;
+            Coordinate[] shell = poly.getExteriorRing().getCoordinates();
+
+            if (orientPolygons) {
+                shell = ensureOrientation(shell, CGAlgorithms.CLOCKWISE);
+            }
+
+            coordArrayList.add(shell);
+
+            for (int i = 0; i < poly.getNumInteriorRing(); i++) {
+                Coordinate[] hole = poly.getInteriorRingN(i).getCoordinates();
+
+                if (orientPolygons) {
+                    hole = ensureOrientation(hole, CGAlgorithms.COUNTERCLOCKWISE);
+                }
+
+                coordArrayList.add(hole);
+            }
+        } else if (g instanceof GeometryCollection) {
+            GeometryCollection gc = (GeometryCollection) g;
+
+            for (int i = 0; i < gc.getNumGeometries(); i++) {
+                addCoordinateArrays(gc.getGeometryN(i), orientPolygons,
+                    coordArrayList);
+            }
+        } else {
+            Assert.shouldNeverReachHere("Geometry of type " +
+                g.getClass().getName() + " not handled");
+        }
+    }
+
+    /**
+     * Sets the orientation of an array of coordinates.
+     * @param coord the coordinates to inspect
+     * @param desiredOrientation CGAlgorithms.CLOCKWISE or CGAlgorithms.COUNTERCLOCKWISE
+     * @return a new array with entries in reverse order, if the orientation is
+     * incorrect; otherwise, the original array
+     */
+    public static Coordinate[] ensureOrientation(Coordinate[] coord,
+        int desiredOrientation) {
+        if (coord.length == 0) {
+            return coord;
+        }
+
+        int orientation = cga.isCCW(coord) ? CGAlgorithms.COUNTERCLOCKWISE
+                                           : CGAlgorithms.CLOCKWISE;
+
+        if (orientation != desiredOrientation) {
+            Coordinate[] reverse = (Coordinate[]) coord.clone();
+            CoordinateArrays.reverse(reverse);
+
+            return reverse;
+        }
+
+        return coord;
+    }
+
+    /**
+     * Extract the coordinate arrays for a geometry.
+     * Polygons will be checked to ensure their rings are oriented correctly.
+     * Note: coordinates from Points or MultiPoints will not be extracted.
+     * @param g the Geometry to extract from
+     * @param orientPolygons ensure that Polygons are correctly oriented
+     * @return a list of Coordinate[]
+     */
+    public static List toCoordinateArrays(Geometry g, boolean orientPolygons) {
+        List coordArrayList = new ArrayList();
+        addCoordinateArrays(g, orientPolygons, coordArrayList);
+
+        return coordArrayList;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CoordinateArrays.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ColorUtil.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ColorUtil.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ColorUtil.java	(revision 1648)
@@ -0,0 +1,42 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import java.awt.Color;
+
+
+public class ColorUtil {
+  public static final Color GOLD = new Color(255, 192, 0, 150);
+  public static final Color PALE_BLUE = new Color(153, 204, 255, 150);
+  public static final Color PALE_RED = new Color(255, 204, 204, 150);  
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ColorUtil.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FileUtil.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FileUtil.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FileUtil.java	(revision 1648)
@@ -0,0 +1,120 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import java.io.*;
+import java.util.*;
+
+
+/**
+ * File-related utility functions.
+ */
+public class FileUtil {
+    /**
+     * Reads a text file.
+     * @param textFileName the pathname of the file to open
+     * @return the lines of the text file
+     * @throws FileNotFoundException if the text file is not found
+     * @throws IOException if the file is not found or another I/O error occurs
+     */
+    public static List getContents(String textFileName)
+        throws FileNotFoundException, IOException {
+        List contents = new ArrayList();
+        FileReader fileReader = new FileReader(textFileName);
+        BufferedReader bufferedReader = new BufferedReader(fileReader);
+        String line = bufferedReader.readLine();
+
+        while (line != null) {
+            contents.add(line);
+            line = bufferedReader.readLine();
+        }
+
+        return contents;
+    }
+
+    /**
+     * Saves the String to a file with the given filename.
+     * @param textFileName the pathname of the file to create (or overwrite)
+     * @param contents the data to save
+     * @throws IOException if an I/O error occurs.
+     */
+    public static void setContents(String textFileName, String contents)
+        throws IOException {
+        FileWriter fileWriter = new FileWriter(textFileName, false);
+        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
+        bufferedWriter.write(contents);
+        bufferedWriter.flush();
+        bufferedWriter.close();
+        fileWriter.close();
+    }
+
+	public static List getContents(InputStream inputStream) throws IOException {
+		ArrayList contents = new ArrayList();
+		InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
+		try {
+			BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
+			try {
+				String line = bufferedReader.readLine();
+				while (line != null) {
+					contents.add(line);
+					line = bufferedReader.readLine();
+				}
+			} finally {
+				bufferedReader.close();
+			}
+		} finally {
+			inputStreamReader.close();
+		}
+		return contents;
+	}
+
+
+    /**
+     * Saves the List of Strings to a file with the given filename.
+     * @param textFileName the pathname of the file to create (or overwrite)
+     * @param lines the Strings to save as lines in the file
+     * @throws IOException if an I/O error occurs.
+     */
+    public static void setContents(String textFileName, List lines)
+        throws IOException {
+        String contents = "";
+
+        for (Iterator i = lines.iterator(); i.hasNext();) {
+            String line = (String) i.next();
+            contents += (line + System.getProperty("line.separator"));
+        }
+
+        setContents(textFileName, contents);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/FileUtil.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Counter.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Counter.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Counter.java	(revision 1648)
@@ -0,0 +1,58 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+
+/**
+ * A Counter used for example in Maps to count the number of times
+ * an item occurs.
+ */
+public class Counter {
+    private int value = 0;
+
+    public Counter() {
+    }
+
+    public Counter(int value) {
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public void increment() {
+        value++;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Counter.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/LangUtil.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/LangUtil.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/LangUtil.java	(revision 1648)
@@ -0,0 +1,112 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.vividsolutions.jts.util.Assert;
+
+/**
+ * Utilities to support the Java language.
+ */
+public class LangUtil {
+    private static Map primitiveToWrapperMap = new HashMap() {
+
+        {
+            put(byte.class, Byte.class);
+            put(char.class, Character.class);
+            put(short.class, Short.class);
+            put(int.class, Integer.class);
+            put(long.class, Long.class);
+            put(float.class, Float.class);
+            put(double.class, Double.class);
+            put(boolean.class, Boolean.class);
+        }
+    };
+
+    public static String emptyStringIfNull(String s) {
+        return (s == null) ? "" : s;
+    }
+
+    /**
+     * Useful because an expression used to generate o need only be
+     * evaluated once.
+     */
+    public static Object ifNull(Object o, Object alternative) {
+        return (o == null) ? alternative : o;
+    }
+
+    public static Object ifNotNull(Object o, Object alternative) {
+        return (o != null) ? alternative : o;
+    }
+
+    public static Class toPrimitiveWrapperClass(Class primitiveClass) {
+        return (Class) primitiveToWrapperMap.get(primitiveClass);
+    }
+
+    public static boolean isPrimitive(Class c) {
+        return primitiveToWrapperMap.containsKey(c);
+    }
+
+    public static boolean bothNullOrEqual(Object a, Object b) {
+        return (a == null && b == null) || (a != null && b != null && a.equals(b));
+    }
+
+    public static Object newInstance(Class c) {
+        try {
+            return c.newInstance();
+        } catch (Exception e) {
+            Assert.shouldNeverReachHere(e.toString());
+            return null;
+        }
+    }
+
+    public static Collection classesAndInterfaces(Class c) {
+        ArrayList classesAndInterfaces = new ArrayList();
+        classesAndInterfaces.add(c);
+        superclasses(c, classesAndInterfaces);
+        classesAndInterfaces.addAll(Arrays.asList(c.getInterfaces()));
+        return classesAndInterfaces;
+    }
+
+    private static void superclasses(Class c, Collection results) {
+        if (c.getSuperclass() == null) {
+            return;
+        }
+        results.add(c.getSuperclass());
+        superclasses(c.getSuperclass(), results);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/LangUtil.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/OrderedMap.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/OrderedMap.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/OrderedMap.java	(revision 1648)
@@ -0,0 +1,152 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import java.util.*;
+
+
+/**
+ * A Map that preserves the order of its keys.
+ */
+public class OrderedMap implements Map {
+    private Map map;
+    private List keyList;
+
+    /**
+     * Creates an OrderedMap backed by the given map.
+     * @param map a Map that will be this OrderedMap's underlying Map
+     */
+    public OrderedMap(List keyList, Map map) {
+    	this.keyList = keyList;
+        this.map = map;
+    }
+
+    /**
+     * Creates an OrderedMap.
+     */
+    public OrderedMap() {
+        this(new HashMap());
+    }
+    
+    public OrderedMap(Map map) {
+    	this(new UniqueList(), map);
+    }
+
+    public int size() {
+        return map.size();
+    }
+
+    public boolean isEmpty() {
+        return map.isEmpty();
+    }
+
+    public boolean containsKey(Object key) {
+        return map.containsKey(key);
+    }
+
+    public boolean containsValue(Object value) {
+        return map.containsValue(value);
+    }
+
+    public Object get(Object key) {
+        return map.get(key);
+    }
+
+    public Object put(Object key, Object value) {
+        keyList.add(key);
+
+        return map.put(key, value);
+    }
+
+    public Object remove(Object key) {
+        keyList.remove(key);
+
+        return map.remove(key);
+    }
+
+    public void putAll(Map t) {
+        keyList.addAll(t.keySet());
+        map.putAll(t);
+    }
+
+    public void clear() {
+        keyList.clear();
+        map.clear();
+    }
+
+    public Set keySet() {
+        return map.keySet();
+    }
+
+    /**
+     * Returns the keys, in order.
+     * @return the keys in the order they were (first) added
+     */
+    public List keyList() {
+        return keyList;
+    }
+
+    /**
+     * Returns the values.
+     * @return the values in the same order as the keys
+     * @see #keyList()
+     */
+    public List valueList() {
+        return (List) values();
+    }
+
+    /**
+     * Returns the values.
+     * @return the values in the same order as the keys
+     * @see #keyList()
+     */
+    public Collection values() {
+        ArrayList values = new ArrayList();
+
+        for (Iterator i = keyList.iterator(); i.hasNext();) {
+            Object key = i.next();
+            values.add(map.get(key));
+        }
+
+        return values;
+    }
+
+    public Set entrySet() {
+        return map.entrySet();
+    }
+
+    public boolean equals(Object o) {
+        return map.equals(o);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/OrderedMap.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Blackboard.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Blackboard.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Blackboard.java	(revision 1648)
@@ -0,0 +1,134 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import java.util.HashMap;
+import java.util.Map;
+/**
+* String-to-Object map that anyone can use.
+* For example, the Options dialog has a single instance, and
+* it's stored on the Workbench Blackboard.
+*/
+public class Blackboard implements Cloneable {
+    private HashMap properties = new HashMap();
+
+    /**
+     * Used by Java2XML
+     */
+    public HashMap getProperties() {
+        return properties;
+    }
+
+    /**
+     * Used by Java2XML
+     */
+    public void setProperties(HashMap properties) {
+        this.properties = properties;
+    }
+
+    public Blackboard put(String key, Object value) {
+        properties.put(key, value);
+        return this;
+    }
+
+    public Object get(String key) {
+        return properties.get(key);
+    }
+
+    public Blackboard put(String key, boolean value) {
+        put(key, new Boolean(value));
+        return this;
+    }
+    public Blackboard putAll(Map properties) {
+        this.properties.putAll(properties);
+        return this;
+    }
+
+    public boolean get(String key, boolean defaultValue) {
+        if (get(key) == null) {
+            put(key, defaultValue);
+        }
+
+        return getBoolean(key);
+    }
+
+    public boolean getBoolean(String key) {
+        return ((Boolean) get(key)).booleanValue();
+    }
+
+    public Blackboard put(String key, int value) {
+        put(key, new Integer(value));
+        return this;
+    }
+
+    public Blackboard put(String key, double value) {
+        put(key, new Double(value));
+        return this;
+    }
+
+    public double get(String key, double defaultValue) {
+        if (get(key) == null) {
+            put(key, defaultValue);
+        }
+
+        return getDouble(key);
+    }
+
+    public int get(String key, int defaultValue) {
+        if (get(key) == null) {
+            put(key, defaultValue);
+        }
+
+        return getInt(key);
+    }
+
+    public int getInt(String key) {
+        return ((Integer) get(key)).intValue();
+    }
+
+    public double getDouble(String key) {
+        return ((Double) get(key)).doubleValue();
+    }
+
+    public Object get(String key, Object defaultValue) {
+        if (get(key) == null) {
+            put(key, defaultValue);
+        }
+
+        return get(key);
+    }
+    
+    public Object clone() {
+        return new Blackboard().putAll(properties);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Blackboard.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Fmt.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Fmt.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Fmt.java	(revision 1648)
@@ -0,0 +1,677 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+
+// Fmt - some simple single-arg sprintf-like routines
+//
+// Copyright (C) 1996 by Jef Poskanzer <jef@acme.com>.  All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE.
+//
+// Visit the ACME Labs Java page for up-to-date versions of this and other
+// fine Java utilities: http://www.acme.com/java/
+/// Some simple single-arg sprintf-like routines.
+// <P>
+// It is apparently impossible to declare a Java method that accepts
+// variable numbers of any type of argument.  You can declare it to take
+// Objects, but numeric variables and constants are not in fact Objects.
+// <P>
+// However, using the built-in string concatenation, it's almost as
+// convenient to make a series of single-argument formatting routines.
+// <P>
+// Fmt can format the following types:
+// <BLOCKQUOTE><CODE>
+// byte short int long float double char String Object
+// </CODE></BLOCKQUOTE>
+// For each type there is a set of overloaded methods, each returning
+// a formatted String.  There's the plain formatting version:
+// <BLOCKQUOTE><PRE>
+// Fmt.fmt( x )
+// </PRE></BLOCKQUOTE>
+// There's a version specifying a minimum field width:
+// <BLOCKQUOTE><PRE>
+// Fmt.fmt( x, minWidth )
+// </PRE></BLOCKQUOTE>
+// And there's a version that takes flags:
+// <BLOCKQUOTE><PRE>
+// Fmt.fmt( x, minWidth, flags )
+// </PRE></BLOCKQUOTE>
+// Currently available flags are:
+// <BLOCKQUOTE><PRE>
+// Fmt.ZF - zero-fill
+// Fmt.LJ - left justify
+// Fmt.HX - hexadecimal
+// Fmt.OC - octal
+// </PRE></BLOCKQUOTE>
+// The HX and OC flags imply unsigned output.
+// <P>
+// For doubles and floats, there's a significant-figures parameter before
+// the flags:
+// <BLOCKQUOTE><PRE>
+// Fmt.fmt( d )
+// Fmt.fmt( d, minWidth )
+// Fmt.fmt( d, minWidth, sigFigs )
+// Fmt.fmt( d, minWidth, sigFigs, flags )
+// </PRE></BLOCKQUOTE>
+// <P>
+// <A HREF="/resources/classes/Acme/Fmt.java">Fetch the software.</A><BR>
+// <A HREF="/resources/classes/Acme.tar.gz">Fetch the entire Acme package.</A>
+// <HR>
+// Similar classes:
+// <UL>
+// <LI> Andrew Scherpbier's <A HREF="http://www.sdsu.edu/doc/java-SDSU/sdsu.FormatString.html">FormatString</A>
+// Tries to allow variable numbers of arguments by
+// supplying overloaded routines with different combinations of parameters,
+// but doesn't actually supply that many.  The floating point conversion
+// is described as "very incomplete".
+// <LI> Core Java's <A HREF="http://www.apl.jhu.edu/~hall/java/CoreJava-Format.html">Format</A>.
+// The design seems a little weird.  They want you to create an instance,
+// passing the format string to the constructor, and then call an instance
+// method with your data to do the actual formatting.  The extra steps are
+// pointless; better to just use static methods.
+// </UL>
+public class Fmt {
+    // Flags.
+    /// Zero-fill.
+    public static final int ZF = 1;
+
+    /// Left justify.
+    public static final int LJ = 2;
+
+    /// Hexadecimal.
+    public static final int HX = 4;
+
+    /// Octal.
+    public static final int OC = 8;
+
+    // Was a number - internal use.
+    private static final int WN = 16;
+
+    // byte
+    public static String fmt(byte b) {
+        return fmt(b, 0, 0);
+    }
+
+    public static String fmt(byte b, int minWidth) {
+        return fmt(b, minWidth, 0);
+    }
+
+    public static String fmt(byte b, int minWidth, int flags) {
+        boolean hexadecimal = ((flags & HX) != 0);
+        boolean octal = ((flags & OC) != 0);
+
+        if (hexadecimal) {
+            return fmt(Integer.toString(b & 0xff, 16), minWidth, flags | WN);
+        } else if (octal) {
+            return fmt(Integer.toString(b & 0xff, 8), minWidth, flags | WN);
+        } else {
+            return fmt(Integer.toString(b & 0xff), minWidth, flags | WN);
+        }
+    }
+
+    // short
+    public static String fmt(short s) {
+        return fmt(s, 0, 0);
+    }
+
+    public static String fmt(short s, int minWidth) {
+        return fmt(s, minWidth, 0);
+    }
+
+    public static String fmt(short s, int minWidth, int flags) {
+        boolean hexadecimal = ((flags & HX) != 0);
+        boolean octal = ((flags & OC) != 0);
+
+        if (hexadecimal) {
+            return fmt(Integer.toString(s & 0xffff, 16), minWidth, flags | WN);
+        } else if (octal) {
+            return fmt(Integer.toString(s & 0xffff, 8), minWidth, flags | WN);
+        } else {
+            return fmt(Integer.toString(s), minWidth, flags | WN);
+        }
+    }
+
+    // int
+    public static String fmt(int i) {
+        return fmt(i, 0, 0);
+    }
+
+    public static String fmt(int i, int minWidth) {
+        return fmt(i, minWidth, 0);
+    }
+
+    public static String fmt(int i, int minWidth, int flags) {
+        boolean hexadecimal = ((flags & HX) != 0);
+        boolean octal = ((flags & OC) != 0);
+
+        if (hexadecimal) {
+            return fmt(Long.toString(i & 0xffffffffL, 16), minWidth, flags |
+                WN);
+        } else if (octal) {
+            return fmt(Long.toString(i & 0xffffffffL, 8), minWidth, flags | WN);
+        } else {
+            return fmt(Integer.toString(i), minWidth, flags | WN);
+        }
+    }
+
+    // long
+    public static String fmt(long l) {
+        return fmt(l, 0, 0);
+    }
+
+    public static String fmt(long l, int minWidth) {
+        return fmt(l, minWidth, 0);
+    }
+
+    public static String fmt(long l, int minWidth, int flags) {
+        boolean hexadecimal = ((flags & HX) != 0);
+        boolean octal = ((flags & OC) != 0);
+
+        if (hexadecimal) {
+            if ((l & 0xf000000000000000L) != 0) {
+                return fmt(Long.toString(l >>> 60, 16) +
+                    fmt(l & 0x0fffffffffffffffL, 15, HX | ZF), minWidth,
+                    flags | WN);
+            } else {
+                return fmt(Long.toString(l, 16), minWidth, flags | WN);
+            }
+        } else if (octal) {
+            if ((l & 0x8000000000000000L) != 0) {
+                return fmt(Long.toString(l >>> 63, 8) +
+                    fmt(l & 0x7fffffffffffffffL, 21, OC | ZF), minWidth,
+                    flags | WN);
+            } else {
+                return fmt(Long.toString(l, 8), minWidth, flags | WN);
+            }
+        } else {
+            return fmt(Long.toString(l), minWidth, flags | WN);
+        }
+    }
+
+    // float
+    public static String fmt(float f) {
+        return fmt(f, 0, 0, 0);
+    }
+
+    public static String fmt(float f, int minWidth) {
+        return fmt(f, minWidth, 0, 0);
+    }
+
+    public static String fmt(float f, int minWidth, int sigFigs) {
+        return fmt(f, minWidth, sigFigs, 0);
+    }
+
+    public static String fmt(float f, int minWidth, int sigFigs, int flags) {
+        if (sigFigs != 0) {
+            return fmt(sigFigFix(Float.toString(f), sigFigs), minWidth,
+                flags | WN);
+        } else {
+            return fmt(Float.toString(f), minWidth, flags | WN);
+        }
+    }
+
+    // double
+    public static String fmt(double d) {
+        return fmt(d, 0, 0, 0);
+    }
+
+    public static String fmt(double d, int minWidth) {
+        return fmt(d, minWidth, 0, 0);
+    }
+
+    public static String fmt(double d, int minWidth, int sigFigs) {
+        return fmt(d, minWidth, sigFigs, 0);
+    }
+
+    public static String fmt(double d, int minWidth, int sigFigs, int flags) {
+        if (sigFigs != 0) {
+            return fmt(sigFigFix(doubleToString(d), sigFigs), minWidth,
+                flags | WN);
+        } else {
+            return fmt(doubleToString(d), minWidth, flags | WN);
+        }
+    }
+
+    // char
+    public static String fmt(char c) {
+        return fmt(c, 0, 0);
+    }
+
+    public static String fmt(char c, int minWidth) {
+        return fmt(c, minWidth, 0);
+    }
+
+    public static String fmt(char c, int minWidth, int flags) {
+        // return fmt( Character.toString( c ), minWidth, flags );
+        // Character currently lacks a static toString method.  Workaround
+        // is to make a temporary instance and use the instance toString.
+        return fmt(new Character(c).toString(), minWidth, flags);
+    }
+
+    // Object
+    public static String fmt(Object o) {
+        return fmt(o, 0, 0);
+    }
+
+    public static String fmt(Object o, int minWidth) {
+        return fmt(o, minWidth, 0);
+    }
+
+    public static String fmt(Object o, int minWidth, int flags) {
+        return fmt(o.toString(), minWidth, flags);
+    }
+
+    // String
+    public static String fmt(String s) {
+        return fmt(s, 0, 0);
+    }
+
+    public static String fmt(String s, int minWidth) {
+        return fmt(s, minWidth, 0);
+    }
+
+    public static String fmt(String s, int minWidth, int flags) {
+        int len = s.length();
+        boolean zeroFill = ((flags & ZF) != 0);
+        boolean leftJustify = ((flags & LJ) != 0);
+        boolean hexadecimal = ((flags & HX) != 0);
+        boolean octal = ((flags & OC) != 0);
+        boolean wasNumber = ((flags & WN) != 0);
+
+        if ((hexadecimal || octal || zeroFill) && !wasNumber) {
+            throw new InternalError("Acme.Fmt: number flag on a non-number");
+        }
+
+        if (zeroFill && leftJustify) {
+            throw new InternalError("Acme.Fmt: zero-fill left-justify is silly");
+        }
+
+        if (hexadecimal && octal) {
+            throw new InternalError("Acme.Fmt: can't do both hex and octal");
+        }
+
+        if (len >= minWidth) {
+            return s;
+        }
+
+        int fillWidth = minWidth - len;
+        StringBuffer fill = new StringBuffer(fillWidth);
+
+        for (int i = 0; i < fillWidth; ++i)
+            if (zeroFill) {
+                fill.append('0');
+            } else {
+                fill.append(' ');
+            }
+
+        if (leftJustify) {
+            return s + fill;
+        } else if (zeroFill && s.startsWith("-")) {
+            return "-" + fill + s.substring(1);
+        } else {
+            return fill + s;
+        }
+    }
+
+    // Internal routines.
+    private static String sigFigFix(String s, int sigFigs) {
+        // First dissect the floating-point number string into sign,
+        // integer part, fraction part, and exponent.
+        String sign;
+        String unsigned;
+
+        if (s.startsWith("-") || s.startsWith("+")) {
+            sign = s.substring(0, 1);
+            unsigned = s.substring(1);
+        } else {
+            sign = "";
+            unsigned = s;
+        }
+
+        String mantissa;
+        String exponent;
+        int eInd = unsigned.indexOf('e');
+
+        if (eInd == -1) { // it may be 'e' or 'E'
+            eInd = unsigned.indexOf('E');
+        }
+
+        if (eInd == -1) {
+            mantissa = unsigned;
+            exponent = "";
+        } else {
+            mantissa = unsigned.substring(0, eInd);
+            exponent = unsigned.substring(eInd);
+        }
+
+        StringBuffer number;
+        StringBuffer fraction;
+        int dotInd = mantissa.indexOf('.');
+
+        if (dotInd == -1) {
+            number = new StringBuffer(mantissa);
+            fraction = new StringBuffer("");
+        } else {
+            number = new StringBuffer(mantissa.substring(0, dotInd));
+            fraction = new StringBuffer(mantissa.substring(dotInd + 1));
+        }
+
+        int numFigs = number.length();
+        int fracFigs = fraction.length();
+
+        if (((numFigs == 0) || number.equals("0")) && (fracFigs > 0)) {
+            // Don't count leading zeros in the fraction.
+            numFigs = 0;
+
+            for (int i = 0; i < fraction.length(); ++i) {
+                if (fraction.charAt(i) != '0') {
+                    break;
+                }
+
+                --fracFigs;
+            }
+        }
+
+        int mantFigs = numFigs + fracFigs;
+
+        if (sigFigs > mantFigs) {
+            // We want more figures; just append zeros to the fraction.
+            for (int i = mantFigs; i < sigFigs; ++i)
+                fraction.append('0');
+        } else if ((sigFigs < mantFigs) && (sigFigs >= numFigs)) {
+            // Want fewer figures in the fraction; chop.
+            fraction.setLength(fraction.length() -
+                (fracFigs - (sigFigs - numFigs)));
+
+            // Round?
+        } else if (sigFigs < numFigs) {
+            // Want fewer figures in the number; turn them to zeros.
+            fraction.setLength(0); // should already be zero, but make sure
+
+            for (int i = sigFigs; i < numFigs; ++i)
+                number.setCharAt(i, '0');
+
+            // Round?
+        }
+
+        // Else sigFigs == mantFigs, which is fine.
+        if (fraction.length() == 0) {
+            return sign + number + exponent;
+        } else {
+            return sign + number + "." + fraction + exponent;
+        }
+    }
+
+    /// Improved version of Double.toString(), returns more decimal places.
+    // <P>
+    // The JDK 1.0.2 version of Double.toString() returns only six decimal
+    // places on some systems.  In JDK 1.1 full precision is returned on
+    // all platforms.
+    // @deprecated
+    // @see java.lang.Double#toString
+    public static String doubleToString(double d) {
+        // Handle special numbers first, to avoid complications.
+        if (Double.isNaN(d)) {
+            return "NaN";
+        }
+
+        if (d == Double.NEGATIVE_INFINITY) {
+            return "-Inf";
+        }
+
+        if (d == Double.POSITIVE_INFINITY) {
+            return "Inf";
+        }
+
+        // Grab the sign, and then make the number positive for simplicity.
+        boolean negative = false;
+
+        if (d < 0.0D) {
+            negative = true;
+            d = -d;
+        }
+
+        // Get the native version of the unsigned value, as a template.
+        String unsStr = Double.toString(d);
+
+        // Dissect out the exponent.
+        String mantStr;
+
+        // Dissect out the exponent.
+        String expStr;
+        int exp;
+        int eInd = unsStr.indexOf('e');
+
+        if (eInd == -1) { // it may be 'e' or 'E'
+            eInd = unsStr.indexOf('E');
+        }
+
+        if (eInd == -1) {
+            mantStr = unsStr;
+            expStr = "";
+            exp = 0;
+        } else {
+            mantStr = unsStr.substring(0, eInd);
+            expStr = unsStr.substring(eInd + 1);
+
+            if (expStr.startsWith("+")) {
+                exp = Integer.parseInt(expStr.substring(1));
+            } else {
+                exp = Integer.parseInt(expStr);
+            }
+        }
+
+        // Dissect out the number part.
+        String numStr;
+        int dotInd = mantStr.indexOf('.');
+
+        if (dotInd == -1) {
+            numStr = mantStr;
+        } else {
+            numStr = mantStr.substring(0, dotInd);
+        }
+
+        long num;
+
+        if (numStr.length() == 0) {
+            num = 0;
+        } else {
+            num = Integer.parseInt(numStr);
+        }
+
+        // Build the new mantissa.
+        StringBuffer newMantBuf = new StringBuffer(numStr + ".");
+        double p = Math.pow(10, exp);
+        double frac = d - (num * p);
+        String digits = "0123456789";
+        int nDigits = 16 - numStr.length(); // about 16 digits in a double
+
+        for (int i = 0; i < nDigits; ++i) {
+            p /= 10.0D;
+
+            int dig = (int) (frac / p);
+
+            if (dig < 0) {
+                dig = 0;
+            }
+
+            if (dig > 9) {
+                dig = 9;
+            }
+
+            newMantBuf.append(digits.charAt(dig));
+            frac -= (dig * p);
+        }
+
+        if ((int) ((frac / p) + 0.5D) == 1) {
+            // Round up.
+            boolean roundMore = true;
+
+            for (int i = newMantBuf.length() - 1; i >= 0; --i) {
+                int dig = digits.indexOf(newMantBuf.charAt(i));
+
+                if (dig == -1) {
+                    continue;
+                }
+
+                ++dig;
+
+                if (dig == 10) {
+                    newMantBuf.setCharAt(i, '0');
+
+                    continue;
+                }
+
+                newMantBuf.setCharAt(i, digits.charAt(dig));
+                roundMore = false;
+
+                break;
+            }
+
+            if (roundMore) {
+                // If this happens, we need to prepend a 1.  But I haven't
+                // found a test case yet, so I'm leaving it out for now.
+                // But if you get this message, please let me know!
+                newMantBuf.append("ROUNDMORE");
+            }
+        }
+
+        // Chop any trailing zeros.
+        int len = newMantBuf.length();
+
+        while (newMantBuf.charAt(len - 1) == '0')
+            newMantBuf.setLength(--len);
+
+        // And chop a trailing dot, if any.
+        if (newMantBuf.charAt(len - 1) == '.') {
+            newMantBuf.setLength(--len);
+        }
+
+        // Done.
+        return (negative ? "-" : "") + newMantBuf +
+        ((expStr.length() != 0) ? ("e" + expStr) : "");
+    }
+
+    /******************************************************************************
+        /// Test program.
+        public static void main( String[] args )
+            {
+            System.out.println( "Starting tests." );
+            show( Fmt.fmt( "Hello there." ) );
+            show( Fmt.fmt( 123 ) );
+            show( Fmt.fmt( 123, 10 ) );
+            show( Fmt.fmt( 123, 10, Fmt.ZF ) );
+            show( Fmt.fmt( 123, 10, Fmt.LJ ) );
+            show( Fmt.fmt( -123 ) );
+            show( Fmt.fmt( -123, 10 ) );
+            show( Fmt.fmt( -123, 10, Fmt.ZF ) );
+            show( Fmt.fmt( -123, 10, Fmt.LJ ) );
+            show( Fmt.fmt( (byte) 0xbe, 22, Fmt.OC ) );
+            show( Fmt.fmt( (short) 0xbabe, 22, Fmt.OC ) );
+            show( Fmt.fmt( 0xcafebabe, 22, Fmt.OC ) );
+            show( Fmt.fmt( 0xdeadbeefcafebabeL, 22, Fmt.OC ) );
+            show( Fmt.fmt( 0x8000000000000000L, 22, Fmt.OC ) );
+            show( Fmt.fmt( (byte) 0xbe, 16, Fmt.HX ) );
+            show( Fmt.fmt( (short) 0xbabe, 16, Fmt.HX ) );
+            show( Fmt.fmt( 0xcafebabe, 16, Fmt.HX ) );
+            show( Fmt.fmt( 0xdeadbeefcafebabeL, 16, Fmt.HX ) );
+            show( Fmt.fmt( 0x8000000000000000L, 16, Fmt.HX ) );
+            show( Fmt.fmt( 'c' ) );
+            show( Fmt.fmt( new java.util.Date() ) );
+            show( Fmt.fmt( 123.456F ) );
+            show( Fmt.fmt( 123456000000000000.0F ) );
+            show( Fmt.fmt( 123.456F, 0, 8 ) );
+            show( Fmt.fmt( 123.456F, 0, 7 ) );
+            show( Fmt.fmt( 123.456F, 0, 6 ) );
+            show( Fmt.fmt( 123.456F, 0, 5 ) );
+            show( Fmt.fmt( 123.456F, 0, 4 ) );
+            show( Fmt.fmt( 123.456F, 0, 3 ) );
+            show( Fmt.fmt( 123.456F, 0, 2 ) );
+            show( Fmt.fmt( 123.456F, 0, 1 ) );
+            show( Fmt.fmt( 123456000000000000.0F, 0, 4 ) );
+            show( Fmt.fmt( -123.456F, 0, 4 ) );
+            show( Fmt.fmt( -123456000000000000.0F, 0, 4 ) );
+            show( Fmt.fmt( 123.0F ) );
+            show( Fmt.fmt( 123.0D ) );
+            show( Fmt.fmt( 1.234567890123456789F ) );
+            show( Fmt.fmt( 1.234567890123456789D ) );
+            show( Fmt.fmt( 1234567890123456789F ) );
+            show( Fmt.fmt( 1234567890123456789D ) );
+            show( Fmt.fmt( 0.000000000000000000001234567890123456789F ) );
+            show( Fmt.fmt( 0.000000000000000000001234567890123456789D ) );
+            show( Fmt.fmt( 12300.0F ) );
+            show( Fmt.fmt( 12300.0D ) );
+            show( Fmt.fmt( 123000.0F ) );
+            show( Fmt.fmt( 123000.0D ) );
+            show( Fmt.fmt( 1230000.0F ) );
+            show( Fmt.fmt( 1230000.0D ) );
+            show( Fmt.fmt( 12300000.0F ) );
+            show( Fmt.fmt( 12300000.0D ) );
+            show( Fmt.fmt( Float.NaN ) );
+            show( Fmt.fmt( Float.POSITIVE_INFINITY ) );
+            show( Fmt.fmt( Float.NEGATIVE_INFINITY ) );
+            show( Fmt.fmt( Double.NaN ) );
+            show( Fmt.fmt( Double.POSITIVE_INFINITY ) );
+            show( Fmt.fmt( Double.NEGATIVE_INFINITY ) );
+            show( Fmt.fmt( 1.0F / 8.0F ) );
+            show( Fmt.fmt( 1.0D / 8.0D ) );
+            System.out.println( "Done with tests." );
+            }
+
+        private static void show( String str )
+            {
+            System.out.println( "#" + str + "#" );
+            }
+    ******************************************************************************/
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Fmt.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Blackboard.java2xml
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Blackboard.java2xml
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/DebugTimer.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/DebugTimer.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/DebugTimer.java	(revision 1648)
@@ -0,0 +1,91 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import com.vividsolutions.jts.util.Stopwatch;
+
+
+public class DebugTimer {
+    private static final int TIME_LEN = 10;
+    private static DebugTimer timer = new DebugTimer();
+    private Stopwatch sw = null;
+    private String blankStr;
+
+    public DebugTimer() {
+        sw = new Stopwatch();
+        sw.start();
+        blankStr = fillString(TIME_LEN, ' ');
+    }
+
+    public static void startStatic(String msg) {
+        timer.start(msg);
+    }
+
+    public static void logEventStatic(String msg) {
+        timer.logEvent(msg);
+    }
+
+    public void start(String msg) {
+        System.out.println("Started    " + msg);
+        sw.start();
+    }
+
+    public void logEvent(String msg) {
+        String elapsedStr = formatTime(sw.getTimeString());
+        System.out.println("Elapsed: " + elapsedStr + "    " + msg);
+        sw.start();
+    }
+
+    public String formatTime(String timeStr) {
+        if (timeStr.length() < TIME_LEN) {
+            String filled = blankStr + timeStr;
+            int start = filled.length() - TIME_LEN;
+
+            return filled.substring(start);
+        }
+
+        // don't pad if it's already longer
+        return timeStr;
+    }
+
+    public String fillString(int len, char ch) {
+        StringBuffer buf = new StringBuffer(len);
+
+        for (int i = 0; i < len; i++) {
+            buf.append(ch);
+        }
+
+        return buf.toString();
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/DebugTimer.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/MathUtil.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/MathUtil.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/MathUtil.java	(revision 1648)
@@ -0,0 +1,66 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+
+/**
+ * Additional math utilities.
+ * @see Math
+ */
+public class MathUtil {
+    public MathUtil() {
+    }   
+
+    public static double orderOfMagnitude(double x) {
+        return base10Log(x);
+    }
+
+    public static double base10Log(double x) {
+        return Math.log(x) / Math.log(10);
+    }
+
+    public static int mostSignificantDigit(double x) {
+        return (int) (x / Math.pow(10, Math.floor(MathUtil.orderOfMagnitude(x))));
+    }
+
+    /**
+     * Returns the average of two doubles
+     * @param a one of the doubles to average
+     * @param b the other double to average
+     * @return the average of two doubles
+     */
+    public static double avg(double a, double b) {
+        return (a + b) / 2d;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/MathUtil.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionMap.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionMap.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionMap.java	(revision 1648)
@@ -0,0 +1,205 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.util;
+
+import java.util.*;
+
+import com.vividsolutions.jts.util.Assert;
+
+
+/**
+ *  A Map whose values are Collections.
+ */
+public class CollectionMap implements Map {
+    private Map map;
+    private Class collectionClass = ArrayList.class;
+
+    /**
+     * Creates a CollectionMap backed by the given Map class.
+     * @param mapClass a Class that implements Map
+     */
+    public CollectionMap(Class mapClass) {
+        try {
+            map = (Map) mapClass.newInstance();
+        } catch (InstantiationException e) {
+            Assert.shouldNeverReachHere();
+        } catch (IllegalAccessException e) {
+            Assert.shouldNeverReachHere();
+        }
+    }
+    
+    public CollectionMap(Class mapClass, Class collectionClass) {
+        this.collectionClass = collectionClass;
+        try {
+            map = (Map) mapClass.newInstance();
+        } catch (InstantiationException e) {
+            Assert.shouldNeverReachHere();
+        } catch (IllegalAccessException e) {
+            Assert.shouldNeverReachHere();
+        }
+    }    
+
+    /**
+     * Creates a CollectionMap.
+     */
+    public CollectionMap() {
+        this(HashMap.class);
+    }
+    
+    private Collection getItemsInternal(Object key) {
+        Collection collection = (Collection) map.get(key);
+        if (collection == null) {
+            try {
+                collection = (Collection) collectionClass.newInstance();
+            } catch (InstantiationException e) {
+                Assert.shouldNeverReachHere();
+            } catch (IllegalAccessException e) {
+                Assert.shouldNeverReachHere();
+            }
+            map.put(key, collection);
+        }
+        return collection;
+    }
+
+    /**
+     * Adds the item to the Collection at the given key, creating a new Collection if
+     * necessary.
+     * @param key the key to the Collection to which the item should be added
+     * @param item the item to add
+     */
+    public void addItem(Object key, Object item) {
+        getItemsInternal(key).add(item);
+    }
+    
+    public void removeItem(Object key, Object item) {
+        getItemsInternal(key).remove(item);
+    }
+
+    public void clear() {
+        map.clear();
+    }
+
+    /**
+     * Adds the items to the Collection at the given key, creating a new Collection if
+     * necessary.
+     * @param key the key to the Collection to which the items should be added
+     * @param items the items to add
+     */
+    public void addItems(Object key, Collection items) {
+        for (Iterator i = items.iterator(); i.hasNext();) {
+            addItem(key, i.next());
+        }
+    }
+    
+    public void addItems(CollectionMap other) {
+        for (Iterator i = other.keySet().iterator(); i.hasNext(); ) {
+            Object key = i.next();
+            addItems(key, other.getItems(key));
+        }
+    }
+
+    /**
+     * Returns the values.
+     * @return a view of the values, backed by this CollectionMap
+     */
+    public Collection values() {
+        return map.values();
+    }
+
+    /**
+     * Returns the keys.
+     * @return a view of the keys, backed by this CollectionMap
+     */
+    public Set keySet() {
+        return map.keySet();
+    }
+
+    /**
+     * Returns the number of mappings.
+     * @return the number of key-value pairs
+     */
+    public int size() {
+        return map.size();
+    }
+
+    public Object get(Object key) {
+        return getItems(key);
+    }
+
+    public Collection getItems(Object key) {
+        return Collections.unmodifiableCollection(getItemsInternal(key));
+    }
+
+    public Object remove(Object key) {
+        return map.remove(key);
+    }
+
+    public boolean containsKey(Object key) {
+        return map.containsKey(key);
+    }
+
+    public boolean containsValue(Object value) {
+        return map.containsValue(value);
+    }
+
+    public Set entrySet() {
+        return map.entrySet();
+    }
+
+    public boolean isEmpty() {
+        return map.isEmpty();
+    }
+
+    public Object put(Object key, Object value) {
+        Assert.isTrue(value instanceof Collection);
+
+        return map.put(key, value);
+    }
+
+    public void putAll(Map map) {
+        for (Iterator i = map.keySet().iterator(); i.hasNext();) {
+            Object key = i.next();
+            //Delegate to #put so that the assertion is made. [Jon Aquino]
+            put(key, map.get(key));
+        }
+    }
+    public void removeItems(Object key, Collection items) {
+        getItemsInternal(key).removeAll(items);
+    }
+
+	public Map getMap() {
+		return map;
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionMap.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionUtil.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionUtil.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionUtil.java	(revision 1648)
@@ -0,0 +1,321 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import com.vividsolutions.jts.util.Assert;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+
+public class CollectionUtil {
+    public CollectionUtil() {
+    }
+
+    /**
+     * Returns a List of Lists: all combinations of the elements of the given List.
+     * @param maxCombinationSize combinations larger than this value are discarded
+     */
+    public static List combinations(List original, int maxCombinationSize) {
+        return combinations(original, maxCombinationSize, null);
+    }
+
+    public static Map inverse(Map map) {
+        Map inverse;
+        try {
+            inverse = (Map) map.getClass().newInstance();
+        } catch (InstantiationException e) {
+            Assert.shouldNeverReachHere(e.toString());
+
+            return null;
+        } catch (IllegalAccessException e) {
+            Assert.shouldNeverReachHere(e.toString());
+
+            return null;
+        }
+        for (Iterator i = map.keySet().iterator(); i.hasNext();) {
+            Object key = i.next();
+            Object value = map.get(key);
+            inverse.put(value, key);
+        }
+
+        return inverse;
+    }
+
+    /**
+     * Returns a List of Lists: all combinations of the elements of the given List.
+     * @param maxCombinationSize combinations larger than this value are discarded
+     * @param mandatoryItem an item that all returned combinations must contain,
+     * or null to leave unspecified
+     */
+    public static List combinations(List original, int maxCombinationSize,
+        Object mandatoryItem) {
+        ArrayList combinations = new ArrayList();
+
+        //Combinations are given by the bits of each binary number from 1 to 2^N
+        for (int i = 1; i <= ((int) Math.pow(2, original.size()) - 1); i++) {
+            ArrayList combination = new ArrayList();
+            for (int j = 0; j < original.size(); j++) {
+                if ((i & (int) Math.pow(2, j)) > 0) {
+                    combination.add(original.get(j));
+                }
+            }
+            if (combination.size() > maxCombinationSize) {
+                continue;
+            }
+            if ((mandatoryItem != null) &&
+                    !combination.contains(mandatoryItem)) {
+                continue;
+            }
+            combinations.add(combination);
+        }
+
+        return combinations;
+    }
+
+    /**
+     * Returns a List of Lists: all combinations of the elements of the given List.
+     */
+    public static List combinations(List original) {
+        return combinations(original, original.size(), null);
+    }
+
+    public static void removeKeys(Collection keys, Map map) {
+        for (Iterator i = keys.iterator(); i.hasNext();) {
+            Object key = (Object) i.next();
+            map.remove(key);
+        }
+    }
+
+    /**
+     * The nth key corresponds to the nth value
+     */
+    public static List[] keysAndCorrespondingValues(Map map) {
+        ArrayList keys = new ArrayList(map.keySet());
+        ArrayList values = new ArrayList();
+        for (Iterator i = keys.iterator(); i.hasNext();) {
+            Object key = i.next();
+            values.add(map.get(key));
+        }
+
+        return new List[] { keys, values };
+    }
+
+    public static Collection concatenate(Collection collections) {
+        ArrayList concatenation = new ArrayList();
+        for (Iterator i = collections.iterator(); i.hasNext();) {
+            Collection collection = (Collection) i.next();
+            concatenation.addAll(collection);
+        }
+
+        return concatenation;
+    }
+
+    public static Object randomElement(List list) {
+        return list.get((int) Math.floor(Math.random() * list.size()));
+    }
+
+    public static SortedSet reverseSortedSet(int[] ints) {
+        TreeSet sortedSet = new TreeSet(Collections.reverseOrder());
+        for (int i = 0; i < ints.length; i++) {
+            sortedSet.add(new Integer(ints[i]));
+        }
+
+        return sortedSet;
+    }
+
+    public static List reverse(List list) {
+        Collections.reverse(list);
+
+        return list;
+    }
+
+    /**
+     * Data is evenly discarded or duplicated to attain the new size
+     */
+    public static Collection stretch(Collection source, Collection destination,
+        int destinationSize) {
+        Assert.isTrue(destination.isEmpty());
+
+        List originalList = source instanceof List ? (List) source
+                                                   : new ArrayList(source);
+        for (int i = 0; i < destinationSize; i++) {
+            destination.add(originalList.get(
+                    (int) Math.round(
+                        i * originalList.size() / (double) destinationSize)));
+        }
+
+        return destination;
+    }
+
+    public static Object ifNotIn(Object o, Collection c, Object alternative) {
+        return c.contains(o) ? o : alternative;
+    }
+
+    public static void setIfNull(int i, List list, String value) {
+        if (i >= list.size()) {
+            resize(list, i + 1);
+        }
+        if (list.get(i) != null) {
+            return;
+        }
+        list.set(i, value);
+    }
+
+    public static void resize(List list, int newSize) {
+        if (newSize < list.size()) {
+            list.subList(newSize, list.size()).clear();
+        } else {
+            list.addAll(Collections.nCopies(newSize - list.size(), null));
+        }
+    }
+
+    public static boolean containsReference(Object[] objects, Object o) {
+        return indexOf(o, objects) > -1;
+    }
+
+    public static int indexOf(Object o, Object[] objects) {
+        for (int i = 0; i < objects.length; i++) {
+            if (objects[i] == o) {
+                return i;
+            }
+        }
+
+        return -1;
+    }
+
+    /**
+     * Brute force, for when HashSet and TreeSet won't work (e.g. #hashCode
+     * implementation isn't appropriate). The original Collection is not modified.
+     */
+    public static Collection removeDuplicates(Collection original) {
+        ArrayList result = new ArrayList();
+        for (Iterator i = original.iterator(); i.hasNext();) {
+            Object item = i.next();
+            if (!result.contains(item)) {
+                result.add(item);
+            }
+        }
+
+        return result;
+    }
+
+    public static void addIfNotNull(Object item, Collection collection) {
+        if (item != null) {
+            collection.add(item);
+        }
+    }
+
+    /**
+     * Modifies and returns the collection.
+     */
+    public static Collection filterByClass(Collection collection, Class c) {
+        for (Iterator i = collection.iterator(); i.hasNext();) {
+            Object item = i.next();
+            if (!c.isInstance(item)) {
+                i.remove();
+            }
+        }
+
+        return collection;
+    }
+
+    public static Map createMap(Object[] alternatingKeysAndValues) {
+        return createMap(HashMap.class, alternatingKeysAndValues);
+    }
+
+    public static Map createMap(Class mapClass,
+        Object[] alternatingKeysAndValues) {
+        Map map = null;
+        try {
+            map = (Map) mapClass.newInstance();
+        } catch (Exception e) {
+            Assert.shouldNeverReachHere(e.toString());
+        }
+        for (int i = 0; i < alternatingKeysAndValues.length; i += 2) {
+            map.put(alternatingKeysAndValues[i], alternatingKeysAndValues[i +
+                1]);
+        }
+
+        return map;
+    }
+
+    /**
+     * The Smalltalk #collect method.
+     */
+    public static Collection collect(Collection collection, Block block) {
+        ArrayList result = new ArrayList();
+        for (Iterator i = collection.iterator(); i.hasNext();) {
+            Object item = i.next();
+            result.add(block.yield(item));
+        }
+
+        return result;
+    }
+
+    /**
+     * The Smalltalk #select method.
+     */
+    public static Collection select(Collection collection, Block block) {
+        ArrayList result = new ArrayList();
+        for (Iterator i = collection.iterator(); i.hasNext();) {
+            Object item = i.next();
+            if (Boolean.TRUE.equals(block.yield(item))) {
+                result.add(item);
+            }
+            ;
+        }
+
+        return result;
+    }
+
+    public static Object get(Class c, Map map) {
+        if (map.keySet().contains(c)) {
+            return map.get(c);
+        }
+        for (Iterator i = map.keySet().iterator(); i.hasNext();) {
+            Class candidateClass = (Class) i.next();
+            if (candidateClass.isAssignableFrom(c)) {
+                return map.get(candidateClass);
+            }
+        }
+
+        return null;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/CollectionUtil.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Block.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Block.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Block.java	(revision 1648)
@@ -0,0 +1,52 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+/**
+ * Simply a chunk of code that can be passed around. Facilitates 
+ * Smalltalk-like programming. Also useful as a "lexical closure"
+ * i.e. a chunk of code with variables having long lifetimes.
+ * <p>
+ * Typically only one of the #yield methods needs to be implemented.
+ * Which one depends on the context.
+ */
+public abstract class Block {
+    public Object yield(Object arg1, Object arg2) {
+        throw new UnsupportedOperationException();
+    }
+    public Object yield(Object arg) {
+        throw new UnsupportedOperationException();            
+    }
+    public Object yield() {
+        throw new UnsupportedOperationException();            
+    }    
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Block.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SimpleTreeModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SimpleTreeModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SimpleTreeModel.java	(revision 1648)
@@ -0,0 +1,185 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.event.TreeModelEvent;
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import com.vividsolutions.jts.util.Assert;
+
+public abstract class SimpleTreeModel implements TreeModel {
+
+    public static abstract class Folder {
+        private Class childrenClass;
+        private String name;
+        private Object parent;
+        public Folder(String name, Object parent, Class childrenClass) {
+            this.name = name;
+            this.parent = parent;
+            this.childrenClass = childrenClass;
+        }
+        public abstract List getChildren();
+        public String toString() {
+            return name;
+        }
+        public int hashCode() {
+            //JTree puts nodes in a Hashtable. To keep things simple, just return 0,
+            //which will cause linear searches (fine for small trees). [Jon Aquino]
+            return 0;
+        }
+        public boolean equals(Object other) {
+            //Folders are value objects. [Jon Aquino]
+            if (! (other instanceof Folder)) {
+                return false;
+            }
+            Folder otherFolder = (Folder) other;
+            return parent == otherFolder.parent && name.equals(otherFolder.name);
+        }
+
+        public Class getChildrenClass() {
+            return childrenClass;
+        }
+        
+        public Object getParent() {
+            return parent;
+        }
+
+    }
+
+    private Object root;
+
+    public SimpleTreeModel(Object root) {
+        this.root = root;
+    }
+
+    public Object getRoot() {
+        return root;
+    }
+
+    public boolean isLeaf(Object node) {
+        return ! (node instanceof Folder) && getChildCount(node) == 0;
+    }
+
+    public void valueForPathChanged(TreePath path, Object newValue) {
+    }
+
+    public int getIndexOfChild(Object parent, Object child) {
+        for (int i = 0; i < getChildCount(parent); i++) {
+            //Folders are value objects. [Jon Aquino]
+            if (child instanceof Folder
+                && getChild(parent, i) instanceof Folder
+                && getChild(parent, i).toString().equals(child.toString())) {
+                return i;
+            }
+            if (getChild(parent, i) == child) {
+                return i;
+            }
+        }
+        Assert.shouldNeverReachHere(parent + ", " + child);
+        return -1;
+    }
+
+    private ArrayList listeners = new ArrayList();
+    private boolean firingEvents = true;
+
+    public void addTreeModelListener(TreeModelListener listener) {
+        listeners.add(listener);
+    }
+
+    public void removeTreeModelListener(TreeModelListener listener) {
+        listeners.remove(listener);
+    }
+
+    /**
+     * No need to handle Folders
+     * @param parent not a Folder
+     */
+    public abstract List getChildren(Object parent);
+
+    public Object getChild(Object parent, int index) {
+        return children(parent).get(index);
+    }
+
+    private List children(Object parent) {
+        return parent instanceof Folder
+            ? ((Folder) parent).getChildren()
+            : getChildren(parent);
+    }
+
+    public int getChildCount(Object parent) {
+        return children(parent).size();
+    }
+    
+
+    public void fireTreeNodesChanged(TreeModelEvent e) {
+        if (!firingEvents) { return; }
+        for (Iterator i = listeners.iterator(); i.hasNext(); ){
+            TreeModelListener l = (TreeModelListener) i.next();
+            l.treeNodesChanged(e);
+        }
+    }
+    
+    public void fireTreeNodesInserted(TreeModelEvent e) {
+        if (!firingEvents) { return; }
+        for (Iterator i = listeners.iterator(); i.hasNext(); ){
+            TreeModelListener l = (TreeModelListener) i.next();
+            l.treeNodesInserted(e);
+        }
+    }
+    
+    public void fireTreeNodesRemoved(TreeModelEvent e) {
+        if (!firingEvents) { return; }
+        for (Iterator i = listeners.iterator(); i.hasNext(); ){
+            TreeModelListener l = (TreeModelListener) i.next();
+            l.treeNodesRemoved(e);
+        }
+    }
+    
+    public void fireTreeStructureChanged(TreeModelEvent e) {
+        if (!firingEvents) { return; }
+        for (Iterator i = listeners.iterator(); i.hasNext(); ){
+            TreeModelListener l = (TreeModelListener) i.next();
+            l.treeStructureChanged(e);
+        }
+    }    
+
+    public void setFiringEvents(boolean firingEvents) {
+        this.firingEvents = firingEvents;
+    }
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SimpleTreeModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Range.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Range.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Range.java	(revision 1648)
@@ -0,0 +1,151 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import java.util.Comparator;
+import java.util.TreeMap;
+
+import com.vividsolutions.jts.util.Assert;
+
+public class Range {
+    private boolean includingMin;
+    private boolean includingMax;
+    private Object max;
+    private Object min;
+    
+    public Range() {
+        this(new NegativeInfinity(), false, new PositiveInfinity(), false);
+    }
+    
+    //NegativeInfinity and PositiveInfinity are classes so they can be
+    //serialized via Java2XML. [Jon Aquino]
+    public static final class NegativeInfinity {
+    }
+    
+    public static final class PositiveInfinity {
+    }    
+
+    public Range(
+        Object min,
+        boolean includingMin,
+        Object max,
+        boolean includingMax) {
+        Assert.isTrue(!(min.equals(max) && (!includingMin || !includingMax)));            
+        this.min = min;
+        this.max = max;
+        this.includingMin = includingMin;
+        this.includingMax = includingMax;
+    }
+    public boolean equals(Object obj) {
+        return Range.RANGE_COMPARATOR.compare(this, obj) == 0;
+    }
+    public boolean isIncludingMax() {
+        return includingMax;
+    }
+
+    public boolean isIncludingMin() {
+        return includingMin;
+    }
+
+    public Object getMax() {
+        return max;
+    }
+
+    public Object getMin() {
+        return min;
+    }
+
+    public void setIncludingMax(boolean b) {
+        includingMax = b;
+    }
+
+    public void setIncludingMin(boolean b) {
+        includingMin = b;
+    }
+
+    public void setMax(Object object) {
+        max = object;
+    }
+
+    public void setMin(Object object) {
+        min = object;
+    }
+    
+    
+    private static final Comparator INFINITY_COMPARATOR = new Comparator() {
+        public int compare(Object o1, Object o2) {
+            if (o1 instanceof PositiveInfinity || o2 instanceof NegativeInfinity) {
+                return +1;
+            }
+            if (o1 instanceof NegativeInfinity|| o2 instanceof PositiveInfinity) {
+                return -1;
+            }
+            return ((Comparable) o1).compareTo(o2);
+        }
+    };
+
+    public static final Comparator RANGE_COMPARATOR = new Comparator() {
+        public int compare(Object o1, Object o2) {
+            Range range1 =
+                o1 instanceof Range
+                    ? (Range) o1
+                    : new Range(o1, true, o1, true);
+            Range range2 =
+                o2 instanceof Range
+                    ? (Range) o2
+                    : new Range(o2, true, o2, true);
+            int max1ComparedToMin2 =
+                INFINITY_COMPARATOR.compare(range1.getMax(), range2.getMin());
+            if (max1ComparedToMin2 < 0
+                || (max1ComparedToMin2 == 0
+                    && (!range1.isIncludingMax() || !range2.isIncludingMin()))) {
+                return -1;
+            }
+            int min1ComparedToMax2 =
+                INFINITY_COMPARATOR.compare(range1.getMin(), range2.getMax());
+            if (min1ComparedToMax2 > 0
+                || (min1ComparedToMax2 == 0
+                    && (!range1.isIncludingMin() || !range2.isIncludingMax()))) {
+                return +1;
+            }
+            return 0;
+        }
+    };    
+
+    //Trivial, but necessary for Java2XML serialization. [Jon Aquino]
+    public static class RangeTreeMap extends TreeMap {
+        public RangeTreeMap() {
+            super(RANGE_COMPARATOR);
+        }
+    }
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Range.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SortedList.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SortedList.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SortedList.java	(revision 1648)
@@ -0,0 +1,194 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+public class SortedList implements List {
+
+    private List list;
+
+    /**
+     * Creates a UniqueList.
+     */
+    public SortedList() {
+        this(new ArrayList());
+    }
+
+    /**
+     * Creates a SortedList backed by the given List.
+     * @param list a List that will be this SortedList's underlying List
+     */
+    public SortedList(List list) {
+        this.list = list;
+    }
+    
+    private void sort() {
+    	Collections.sort(list);
+    }
+
+    public int size() {
+        return list.size();
+    }
+
+    public boolean isEmpty() {
+        return list.isEmpty();
+    }
+
+    public boolean contains(Object o) {
+        return list.contains(o);
+    }
+
+    public Iterator iterator() {
+        return list.iterator();
+    }
+
+    public Object[] toArray() {
+        return list.toArray();
+    }
+
+    public Object[] toArray(Object[] a) {
+        return list.toArray(a);
+    }
+
+    public boolean add(Object o) {
+        try {
+            return list.add(o);
+        } finally {
+            sort();
+        }
+    }
+
+    public boolean remove(Object o) {
+        try {
+            return list.remove(o);
+        } finally {
+            sort();
+        }
+    }
+
+    public boolean containsAll(Collection c) {
+        return list.containsAll(c);
+    }
+
+    public boolean addAll(Collection c) {
+        try {
+            return list.addAll(c);
+        } finally {
+            sort();
+        }
+    }
+
+    public boolean addAll(int index, Collection c) {
+        try {
+            return list.addAll(index, c);
+        } finally {
+            sort();
+        }
+    }
+
+    public boolean removeAll(Collection c) {
+        try {
+            return list.removeAll(c);
+        } finally {
+            sort();
+        }
+    }
+
+    public boolean retainAll(Collection c) {
+        try {
+            return list.retainAll(c);
+        } finally {
+            sort();
+        }
+    }
+
+    public void clear() {
+        list.clear();
+    }
+
+    public Object get(int index) {
+        return list.get(index);
+    }
+
+    public Object set(int index, Object element) {
+        try {
+            return list.set(index, element);
+        } finally {
+            sort();
+        }
+    }
+
+    public void add(int index, Object element) {
+        try {
+            list.add(index, element);
+        } finally {
+            sort();
+        }
+    }
+
+    public Object remove(int index) {
+        try {
+            return list.remove(index);
+        } finally {
+            sort();
+        }
+    }
+
+    public int indexOf(Object o) {
+        return list.indexOf(o);
+    }
+
+    public int lastIndexOf(Object o) {
+        return list.lastIndexOf(o);
+    }
+
+    public ListIterator listIterator() {
+        return list.listIterator();
+    }
+
+    public ListIterator listIterator(int index) {
+        return list.listIterator(index);
+    }
+
+    public List subList(int fromIndex, int toIndex) {
+        //Not yet supported because we would need to track changes to the
+        //sublist because those changes modify the underlying list. [Jon Aquino]
+        throw new UnsupportedOperationException();
+    }
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/SortedList.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ImmutableFirstElementList.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ImmutableFirstElementList.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ImmutableFirstElementList.java	(revision 1648)
@@ -0,0 +1,159 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+package com.vividsolutions.jump.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+/**
+ * Can't add, replace, or remove the first element in the list.
+ */
+public class ImmutableFirstElementList implements List {
+
+	private List list = new ArrayList();
+	
+	public ImmutableFirstElementList(Object firstElement) {
+		list.add(firstElement);
+	}
+
+    public int size() {
+        return list.size();
+    }
+
+    public boolean isEmpty() {
+        return list.isEmpty();
+    }
+
+    public boolean contains(Object o) {
+        return list.contains(o);
+    }
+
+    public Iterator iterator() {
+    	//Prevent Iterator#remove. [Jon Aquino]
+        return Collections.unmodifiableList(list).iterator();
+    }
+
+    public Object[] toArray() {
+        return list.toArray();
+    }
+
+    public Object[] toArray(Object[] a) {
+        return list.toArray(a);
+    }
+
+    public boolean add(Object o) {
+        return list.add(o);
+    }
+
+    public boolean remove(Object o) {
+    	//An element equal to the first element may exist later in the list. [Jon Aquino] 
+		return list.subList(1, list.size()).remove(o);
+    }
+
+    public boolean containsAll(Collection c) {
+        return list.containsAll(c);
+    }
+
+    public boolean addAll(Collection c) {
+        return list.addAll(c);
+    }
+
+    public boolean addAll(int index, Collection c) {
+		return list.addAll(index == 0 ? 1 : index, c);
+    }
+
+    public boolean removeAll(Collection c) {
+		return list.subList(1, list.size()).remove(c);
+    }
+
+    public boolean retainAll(Collection c) {
+		return list.subList(1, list.size()).retainAll(c);
+    }
+
+    public void clear() {
+		list.subList(1, list.size()).clear();
+    }
+
+    public Object get(int index) {
+        return list.get(index);
+    }
+
+    public Object set(int index, Object element) {
+        if (index == 0) {
+        	return get(0);
+        }
+        return list.set(index, element);
+    }
+
+    public void add(int index, Object element) {
+		list.add(index == 0 ? 1 : index, element);
+    }
+
+    public Object remove(int index) {
+        if (index == 0) { return get(0);
+        }
+        return list.remove(index);
+    }
+
+    public int indexOf(Object o) {
+        return list.indexOf(o);
+    }
+
+    public int lastIndexOf(Object o) {
+        return list.lastIndexOf(o);
+    }
+
+    public ListIterator listIterator() {
+		//Prevent Iterator#remove. [Jon Aquino]
+		return Collections.unmodifiableList(list).listIterator();    	
+    }
+
+    public ListIterator listIterator(int index) {
+		//Prevent Iterator#remove. [Jon Aquino]
+		return Collections.unmodifiableList(list).listIterator(index);    	
+    }
+
+    public List subList(int fromIndex, int toIndex) {
+    	if (fromIndex > 0) {
+    		return list.subList(fromIndex, toIndex);
+    	}
+    	//A bit heavy-handed, but we don't want the first element to be
+    	//modified, moved, or removed. Future: allow the other elements
+    	//to be modified, moved, or removed. [Jon Aquino]
+		return Collections.unmodifiableList(list).subList(fromIndex, toIndex);    	    	
+    }
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/ImmutableFirstElementList.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Range.java2xml
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/vividsolutions/jump/util/Range.java2xml
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LinkControls.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LinkControls.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LinkControls.java	(revision 1648)
@@ -0,0 +1,126 @@
+/*
+ * Created on 01-jun-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.project.ProjectView;
+
+import org.apache.log4j.Logger;
+
+
+/**
+ * Extensi�n para gestionar los hiperlinks.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class LinkControls implements Extension {
+	private static Logger logger = Logger.getLogger(LinkControls.class.getName());
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		ProjectView model = vista.getModel();
+		FMap mapa = model.getMapContext();
+		MapControl mapCtrl = vista.getMapControl().getMapControl();
+		logger.debug("Comand : " + s);
+
+		if (s.compareTo("LINK") == 0) {
+			mapCtrl.setTool("link");
+		}
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			FMap mapa = ((View) f).getModel().getMapContext();
+
+			View v = (View) f;
+
+			return mapa.getLayers().getLayersCount() > 0;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		View f = (View) PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		FLayer[] selected = f.getModel().getMapContext().getLayers().getActives();
+
+		return selected.length > 0;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LinkControls.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Export.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Export.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Export.java	(revision 1648)
@@ -0,0 +1,189 @@
+/*
+ * Created on 17-feb-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.gui.View;
+
+import com.iver.utiles.GenericFileFilter;
+
+import com.sun.jimi.core.Jimi;
+import com.sun.jimi.core.JimiException;
+import com.sun.jimi.core.raster.JimiRasterImage;
+
+import java.awt.Component;
+import java.awt.Image;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+
+/**
+ * Extensi�n para exportar en algunos formatos raster la vista actual.
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class Export implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		View f = (View) PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		return f.getModel().getMapContext().getLayers().getActives().length > 0;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = (com.iver.andami.ui.mdiManager.View) PluginServices.getMDIManager()
+																								  .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		return (f.getClass() == View.class);
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		FileFilter pngFilter = new GenericFileFilter("png",
+				PluginServices.getText(this, "png"));
+		String[] s={"jpg","jpeg"};
+		FileFilter jpgFilter = new GenericFileFilter(s,
+				PluginServices.getText(this, "jpg"));
+		FileFilter bmpFilter = new GenericFileFilter("bmp",
+				PluginServices.getText(this, "bmp"));
+		
+		JFileChooser jfc = new JFileChooser();
+		jfc.addChoosableFileFilter(pngFilter);
+		jfc.addChoosableFileFilter(jpgFilter);
+		jfc.addChoosableFileFilter(bmpFilter);
+		jfc.setFileFilter(pngFilter);
+		if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+			Image tempImage;
+
+			tempImage = ((View) PluginServices.getMDIManager().getActiveView()).getImage();
+
+			File f = jfc.getSelectedFile();
+
+			try {
+				JimiRasterImage jrf = Jimi.createRasterImage(tempImage.getSource());
+				String tempName = f.getName().toUpperCase().trim();
+				if (jfc.getFileFilter().equals(pngFilter)){
+					System.out.println("pngFilter");
+					if (!(tempName.length()>3) || (!(tempName.substring(tempName.length()-4,tempName.length()).equalsIgnoreCase(".png")))){
+						f=new File(f.getPath()+".png");
+					}
+						FileOutputStream fout = new FileOutputStream(f);
+						Jimi.putImage("image/png", jrf, fout);
+						fout.close();
+				} else if (jfc.getFileFilter().equals(bmpFilter)){
+					System.out.println("bmpFilter");
+					if (!(tempName.length()>3) || (!(tempName.substring(tempName.length()-4,tempName.length()).equalsIgnoreCase(".bmp")))){
+						f=new File(f.getPath()+".bmp");
+					}
+						FileOutputStream fout = new FileOutputStream(f);
+						Jimi.putImage("image/bmp", jrf, fout);
+						fout.close();
+				}else if (jfc.getFileFilter().equals(jpgFilter)){
+					System.out.println("jpgFilter");
+					if (!(tempName.length()>3) || ((tempName.length()>3 && !(tempName.substring(tempName.length()-4,tempName.length()).equalsIgnoreCase(".jpg")) || (tempName.length()>4 &&tempName.substring(tempName.length()-5,tempName.length()).equalsIgnoreCase(".jpeg"))))){
+						f=new File(f.getPath()+".jpg");
+					}
+						FileOutputStream fout = new FileOutputStream(f);
+						Jimi.putImage("image/jpg", jrf, fout);
+						fout.close();
+					
+				}
+				/*if (tempName.endsWith(".JPG")) {
+					
+					FileOutputStream fout = new FileOutputStream(f);
+					Jimi.putImage("image/jpg", jrf, fout);
+					fout.close();
+				} else if (tempName.endsWith(".PNG")) {
+					FileOutputStream fout = new FileOutputStream(f);
+					Jimi.putImage("image/png", jrf, fout);
+					fout.close();
+				} else if (tempName.endsWith(".BMP")) {
+					FileOutputStream fout = new FileOutputStream(f);
+					Jimi.putImage("image/bmp", jrf, fout);
+					fout.close();
+				}
+				*/
+			} catch (JimiException e) {
+				NotificationManager.addError("Error exportando la imagen", e);
+			} catch (FileNotFoundException e) {
+				NotificationManager.addError("No se encontr� el fichero", e);
+			} catch (IOException e) {
+				NotificationManager.addError("Error con el fichero", e);
+			}
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Export.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ZoomPrev.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ZoomPrev.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ZoomPrev.java	(revision 1648)
@@ -0,0 +1,103 @@
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.gui.View;
+
+
+/**
+ * Extensi�n que cambia el extent de la vista al extent anterior.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ZoomPrev implements Extension {
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		ViewPort vp = vista.getModel().getMapContext().getViewPort();
+
+		return vp.getExtents().hasPrevious();
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			View v = (View) f;
+
+			FMap mapa = v.getModel().getMapContext();
+
+			return mapa.getLayers().getLayersCount() > 0;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
+	 */
+	public void execute(String arg0) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		ViewPort vp = vista.getModel().getMapContext().getViewPort();
+		vp.setPreviousExtent();
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ZoomPrev.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Tabla.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Tabla.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Tabla.java	(revision 1648)
@@ -0,0 +1,154 @@
+/*
+ * Created on 02-mar-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.gui.Table;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.project.ProjectFactory;
+import com.iver.cit.gvsig.project.ProjectTable;
+
+
+/**
+ * Extensi�n que abre las tablas asociadas a las vistas.
+ *
+ * @author Vicente Caballero Navarro
+ * 
+ */
+public class Tabla implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		View f = (View) PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		FLayer[] selected = f.getModel().getMapContext().getLayers().getActives();
+        
+        boolean algunaTabla = false;
+        for (int i = 0; i < selected.length; i++) {
+			if (selected[i] instanceof AlphanumericData){
+				AlphanumericData co = (AlphanumericData) selected[i];
+				try {
+					if (co.getRecordset() != null) {
+						algunaTabla = true;
+					}
+				} catch (DriverException e) {
+				}
+			}
+		}
+
+		return algunaTabla;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+														   .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		return (f.getClass() == View.class);
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
+	 */
+	public void execute(String s) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		FLayer[] actives = ((View) vista).getModel().getMapContext().getLayers()
+							.getActives();
+
+		 for (int i = 0; i < actives.length; i++) {
+        	if (actives[i] instanceof AlphanumericData){
+        		AlphanumericData co = (AlphanumericData)actives[i];
+			
+				try {
+					SelectableDataSource dataSource = co.getRecordset();
+					ProjectExtension ext = (ProjectExtension) PluginServices
+																		  .getExtension(ProjectExtension.class);
+
+					ProjectTable projectTable = ext.getProject().getTable(co);
+
+					if (projectTable == null) {
+						String strAux = PluginServices.getText(this, "Tabla de atributos de ");
+						projectTable = ProjectFactory.createTable(strAux + actives[i].getName(), dataSource);
+						projectTable.setAssociatedTable(co);
+						ext.getProject().addTable(projectTable);
+					}
+					
+					Table t = new Table();
+					t.setModel(projectTable);
+					PluginServices.getMDIManager().addView(t);
+				} catch (DriverException e) {
+					NotificationManager.addError("Error al cargar los drivers",
+						e);
+				}
+			}
+			
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Tabla.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/RedoCommandExtension.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/RedoCommandExtension.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/RedoCommandExtension.java	(revision 1648)
@@ -0,0 +1,117 @@
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.gui.cad.CadMapControl;
+
+import java.io.IOException;
+
+
+/**
+ * Extensi�n encargada de gestionar el rehacer un comando anteriormente
+ * deshecho.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class RedoCommandExtension implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		CadMapControl cadmap = (CadMapControl) vista.getMapControl();
+
+		if (s.compareTo("REDO") == 0) {
+			try {
+				cadmap.getCadToolAdapter().getEditableFeatureSource().redo();
+			} catch (DriverIOException e) {
+				NotificationManager.addError("Error accediendo a los Drivers para rehacer un comando",
+					e);
+			} catch (IOException e) {
+				NotificationManager.addError("Error accediendo al fichero para rehacer un comando",
+					e);
+			}
+
+			vista.getMapControl().getMapControl().drawMap(false);
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		CadMapControl cadmap = (CadMapControl) vista.getMapControl();
+		if (cadmap.getCadToolAdapter().getEditableFeatureSource()==null)return false;
+		return cadmap.getCadToolAdapter().getEditableFeatureSource()
+					 .moreRedoCommands();
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/RedoCommandExtension.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java	(revision 1648)
@@ -0,0 +1,640 @@
+/* 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;
+
+import java.awt.Color;
+import java.awt.geom.Rectangle2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+import org.cresques.cts.IProjection;
+import org.cresques.cts.ProjectionPool;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.utiles.StringUtilities;
+import com.iver.utiles.XMLEntity;
+
+
+/**
+ * Clase que representa un proyecto de openSIG
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class Project implements Serializable, PropertyChangeListener {
+	public static String VERSION="0.3";
+	private PropertyChangeSupport change;
+	boolean modified = false;
+	private String name;
+	private String path;
+	private String creationDate;
+	private String modificationDate;
+	private String owner;
+	private String comments;
+	private Color selectionColor = new Color(255, 255, 0);
+	private ArrayList views = new ArrayList();
+	private ArrayList tables = new ArrayList();
+	private ArrayList maps = new ArrayList();
+	private ArrayList extents = new ArrayList();
+	static private IProjection defaultProjection = ProjectionPool.get("EPSG:23030"); 
+
+	/**
+	 * Creates a new Project object.
+	 */
+	public Project() {
+		change = new PropertyChangeSupport(this);
+
+		//        change.addPropertyChangeListener(this);
+		creationDate = DateFormat.getDateInstance().format(new Date());
+		modificationDate = creationDate;
+		LayerFactory.setDriversPath(PluginServices.getPluginServices(this)
+												  .getPluginDirectory()
+												  .getAbsolutePath() +
+			File.separator + "drivers");
+	}
+
+	/**
+	 * Obtiene la fecha de creaci�n del proyecto
+	 *
+	 * @return
+	 */
+	public String getCreationDate() {
+		return creationDate;
+	}
+
+	/**
+	 * Obtiene el nombre del proyecto
+	 *
+	 * @return
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Obtiene la ruta completa del fichero donde se guardo por �ltima vez el
+	 * proyecto
+	 *
+	 * @return
+	 */
+	public String getPath() {
+		return path;
+	}
+
+	/**
+	 * Asigna la fecha de creaci�n del proyecto. Este m�todo tiene sentido s�lo
+	 * por que al recuperar la fecha del XML hay que asignarla al objeto
+	 * proyecto de alguna manera. La fecha se asigna en el constructor y no se
+	 * deber�a de modificar nunca
+	 *
+	 * @param string
+	 */
+	public void setCreationDate(String string) {
+		creationDate = string;
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * A�ade un mapa al proyecto
+	 *
+	 * @param m
+	 */
+	public void addMap(ProjectMap m) {
+		maps.add(m);
+		m.addPropertyChangeListener(this);
+		modified = true;
+		change.firePropertyChange("", null, null);
+		m.setProject(this);
+	}
+
+	/**
+	 * Elimina un mapa del proyecto
+	 *
+	 * @param i indice del mapa
+	 */
+	public void delMap(int i) {
+		maps.remove(i);
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * Establece el nombre del proyecto
+	 *
+	 * @param string
+	 */
+	public void setName(String string) {
+		name = string;
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * establece la ruta completa de donde se encuentra guardado el proyecto
+	 *
+	 * @param string
+	 */
+	public void setPath(String string) {
+		path = string;
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param co DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public ProjectTable getTable(AlphanumericData co) {
+		/**
+		 * Como las tablas se pueden a�adir cuando se pincha en "ver tabla" de
+		 * una capa, se puede intentar a�adir dos veces la misma tabla
+		 */
+		for (int i = 0; i < tables.size(); i++) {
+			if (((ProjectTable) tables.get(i)).getAssociatedTable() == co) {
+				return (ProjectTable) tables.get(i);
+			}
+		}
+
+		return null;
+	}
+
+	/**
+	 * A�ade una tabla al proyecto
+	 *
+	 * @param t
+	 */
+	public void addTable(ProjectTable t) {
+		tables.add(t);
+		t.addPropertyChangeListener(this);
+		modified = true;
+		change.firePropertyChange("", null, null);
+		t.setProject(this);
+	}
+
+	/**
+	 * Elimina una tabla del proyecto
+	 *
+	 * @param i indice de la tabla
+	 */
+	public void delTable(int i) {
+		tables.remove(i);
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * A�ade una vista al proyecto
+	 *
+	 * @param v
+	 */
+	public void addView(ProjectView v) {
+		views.add(v);
+		v.addPropertyChangeListener(this);
+		modified = true;
+		change.firePropertyChange("", null, null);
+		v.setProject(this);
+	}
+
+	/**
+	 * Elimina una tabla del proyecto
+	 *
+	 * @param i indice del proyecto
+	 */
+	public void delView(int i) {
+		views.remove(i);
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * Devuelve true si el proyecto (o alguna tabla, vista o mapa que contiene)
+	 * fue modificado
+	 *
+	 * @return
+	 */
+	public boolean isModified() {
+		return modified;
+	}
+
+	/**
+	 * Obtiene los comentarios
+	 *
+	 * @return
+	 */
+	public String getComments() {
+		return comments;
+	}
+
+	/**
+	 * Obtiene la fecha de la �ltima modificaci�n
+	 *
+	 * @return
+	 */
+	public String getModificationDate() {
+		return modificationDate;
+	}
+
+	/**
+	 * Obtiene el propietario del proyecto
+	 *
+	 * @return
+	 */
+	public String getOwner() {
+		return owner;
+	}
+
+	/**
+	 * Establece una cadena como comentarios al proyecto
+	 *
+	 * @param string
+	 */
+	public void setComments(String string) {
+		comments = string;
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * Establece la fecha de la �ltima modificaci�n
+	 *
+	 * @param string
+	 */
+	public void setModificationDate(String string) {
+		modificationDate = string;
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * Establece el propietario del proyecto
+	 *
+	 * @param string
+	 */
+	public void setOwner(String string) {
+		owner = string;
+		modified = true;
+		change.firePropertyChange("", null, null);
+	}
+
+	/**
+	 * Establece el flag de modificado del proyecto
+	 *
+	 * @param b
+	 */
+	public void setModified(boolean b) {
+		modified = b;
+	}
+
+	/**
+	 * Obtiene el color de selecci�n que se usar� en el proyecto
+	 *
+	 * @return
+	 */
+	public Color getSelectionColor() {
+		return selectionColor;
+	}
+
+	/**
+	 * Establece el color de selecci�n
+	 *
+	 * @param color
+	 */
+	public void setSelectionColor(Color color) {
+		selectionColor = color;
+		FSymbol.setSelectionColor(color);
+		modified = true;
+		change.firePropertyChange("selectionColor", null, color);
+	}
+
+	/**
+	 * Obtiene el color como un entero para su serializaci�n a XML
+	 *
+	 * @return
+	 */
+	public String getColor() {
+		return StringUtilities.color2String(selectionColor);
+	}
+
+	/**
+	 * M�todo invocado al recuperar de XML para establecer el color de
+	 * seleccion del proyecto
+	 *
+	 * @param color Entero que representa un color
+	 */
+	public void setColor(String color) {
+		modified = true;
+		selectionColor = StringUtilities.string2Color(color);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent evt) {
+		this.modified = true;
+		change.firePropertyChange(evt);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param arg1
+	 */
+	public void addExtent(ProjectExtent arg1) {
+		extents.add(arg1);
+		modified = true;
+		change.firePropertyChange("addExtent", null, null);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param arg0
+	 *
+	 * @return
+	 */
+	public Object removeExtent(int arg0) {
+		modified = true;
+		change.firePropertyChange("delExtent", null, null);
+
+		return extents.remove(arg0);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public ProjectExtent[] getExtents() {
+		return (ProjectExtent[]) extents.toArray(new ProjectExtent[0]);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param arg0
+	 */
+	public synchronized void addPropertyChangeListener(
+		PropertyChangeListener arg0) {
+		change.addPropertyChangeListener(arg0);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return
+	 */
+	public ArrayList getMaps() {
+		return maps;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return
+	 */
+	public ArrayList getTables() {
+		return tables;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return
+	 */
+	public ArrayList getViews() {
+		return views;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws DriverException
+	 */
+	public XMLEntity getXMLEntity() throws DriverException {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("VERSION",VERSION);
+		xml.putProperty("comments", comments);
+		xml.putProperty("creationDate", creationDate);
+
+		int numExtents = extents.size();
+		/*double[] xs = new double[size];
+		double[] ys = new double[size];
+		double[] ws = new double[size];
+		double[] hs = new double[size];
+		*/
+		xml.putProperty("numExtents",numExtents);
+		for (int i = 0; i < numExtents; i++) {
+		/*	Rectangle2D rect = (Rectangle2D) extents.get(i);
+			xs[i] = rect.getX();
+			ys[i] = rect.getY();
+			ws[i] = rect.getWidth();
+			hs[i] = rect.getHeight();
+		*/
+			xml.addChild(((ProjectExtent)extents.get(i)).getXMLEntity());
+		}
+/*
+		xml.putProperty("extentsX", xs);
+		xml.putProperty("extentsY", ys);
+		xml.putProperty("extentsW", ws);
+		xml.putProperty("extentsH", hs);
+*/
+		xml.putProperty("numViews", views.size());
+
+		for (int i = 0; i < views.size(); i++) {
+			xml.addChild(((ProjectView) views.get(i)).getXMLEntity());
+		}
+
+		xml.putProperty("numMaps", maps.size());
+
+		for (int i = 0; i < maps.size(); i++) {
+			xml.addChild(((ProjectMap) maps.get(i)).getXMLEntity());
+		}
+
+		xml.putProperty("modificationDate", modificationDate);
+		xml.putProperty("modified", modified);
+		xml.putProperty("name", name);
+		xml.putProperty("owner", owner);
+		xml.putProperty("path", path);
+		xml.putProperty("selectionColor",
+			StringUtilities.color2String(selectionColor));
+		xml.putProperty("numTables", tables.size());
+
+		for (int i = 0; i < tables.size(); i++) {
+			xml.addChild(((ProjectTable) tables.get(i)).getXMLEntity());
+		}
+		xml.putProperty("projection", defaultProjection.getAbrev());
+
+		return xml;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param xml DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 * @throws XMLException
+	 * @throws DriverException
+	 * @throws DriverIOException
+	 */
+	public static Project createFromXML(XMLEntity xml)
+		throws XMLException, DriverException, DriverIOException {
+		Project p = new Project();
+		p.comments = xml.getStringProperty("comments");
+		p.creationDate = xml.getStringProperty("creationDate");
+/*
+		double[] xs = xml.getDoubleArrayProperty("extentsX");
+		double[] ys = xml.getDoubleArrayProperty("extentsY");
+		double[] ws = xml.getDoubleArrayProperty("extentsW");
+		double[] hs = xml.getDoubleArrayProperty("extentsH");
+*/
+		int numExtents=xml.getIntProperty("numExtents");
+		for (int i = 0; i < numExtents; i++) {
+			ProjectExtent pe=ProjectExtent.createFromXML(xml.getChild(i));
+			p.extents.add(pe);
+		}
+
+		int numViews = xml.getIntProperty("numViews");
+
+		for (int i = numExtents; i < numViews+numExtents; i++) {
+			p.views.add(ProjectView.createFromXML(xml.getChild(i), p));
+		}
+
+		int numMaps = xml.getIntProperty("numMaps");
+
+		for (int i = numViews+numExtents; i < (numMaps + numViews+numExtents); i++) {
+			p.maps.add(ProjectMap.createFromXML(xml.getChild(i), p));
+		}
+
+		p.modificationDate = xml.getStringProperty("modificationDate");
+		p.modified = xml.getBooleanProperty("modified");
+		p.name = xml.getStringProperty("name");
+		p.owner = xml.getStringProperty("owner");
+		p.path = xml.getStringProperty("path");
+		p.selectionColor = StringUtilities.string2Color(xml.getStringProperty(
+					"selectionColor"));
+
+		int numTables = xml.getIntProperty("numTables");
+
+		for (int i = numExtents+numMaps + numViews; i < (numExtents+numTables + numMaps + numViews);
+				i++) {
+			p.tables.add(ProjectTable.createFromXML(xml.getChild(i), p));
+		}
+		String strProj = xml.getStringProperty("projection");
+		if (strProj != null)
+			Project.setProjection(ProjectionPool.get(strProj));
+
+		return p;
+	}
+
+	/**
+	 * Obtiene la vista que contiene a la capa que se pasa como
+	 * par�metro
+	 *
+	 * @param layer Capa cuya vista se quiere obtener
+	 *
+	 * @return
+	 *
+	 * @throws RuntimeException Si la capa que se pasa como par�metro no se
+	 * encuentra en ninguna vista
+	 */
+	public String getView(FLayer layer) {
+		for (int v = 0; v < views.size(); v++) {
+			ProjectView pView = (ProjectView) views.get(v);
+			FLayers layers = pView.getMapContext().getLayers();
+
+			for (int i = 0; i < layers.getLayersCount(); i++) {
+				if (layers.getLayer(i) == layer) {
+					return pView.getName();
+				}
+			}
+		}
+
+		throw new RuntimeException("The layer is not in a view");
+	}
+
+	/**
+	 * Devuelve la vista cuyo nombre coincide (sensible a mayusculas)
+	 * con el que se pasa como par�metro. Devuelve null si no hay ninguna
+	 * vista con ese nombre
+	 *
+	 * @param viewName Nombre de la vista que se quiere obtener
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public ProjectView getViewByName(String viewName) {
+		for (int v = 0; v < views.size(); v++) {
+			ProjectView pView = (ProjectView) views.get(v);
+
+			if (pView.getName().equals(viewName)) {
+				return pView;
+			}
+		}
+
+		return null;
+	}
+	public static IProjection getProjection() {
+		return defaultProjection;
+	}
+	public static void setProjection(IProjection defaultProjection) {
+		Project.defaultProjection = defaultProjection;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/XMLEntityXMLHandler.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/XMLEntityXMLHandler.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/XMLEntityXMLHandler.java	(revision 1648)
@@ -0,0 +1,168 @@
+/* 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;
+
+import java.util.EmptyStackException;
+import java.util.Stack;
+
+import org.apache.log4j.Logger;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+import com.iver.utiles.XMLEntity;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class XMLEntityXMLHandler implements ContentHandler {
+    private static Logger logger = Logger.getLogger(XMLEntityXMLHandler.class.getName());
+	private XMLEntity lastEntity;
+    private Stack entities = new Stack();
+
+    /**
+     * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
+     */
+    public void setDocumentLocator(Locator arg0) {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#startDocument()
+     */
+    public void startDocument() throws SAXException {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#endDocument()
+     */
+    public void endDocument() throws SAXException {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String,
+     *      java.lang.String)
+     */
+    public void startPrefixMapping(String arg0, String arg1)
+        throws SAXException {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
+     */
+    public void endPrefixMapping(String arg0) throws SAXException {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#startElement(java.lang.String,
+     *      java.lang.String, java.lang.String, org.xml.sax.Attributes)
+     */
+    public void startElement(String namespaceURI, String localName,
+        String qName, Attributes atts) throws SAXException {
+        
+        XMLEntity aux = new XMLEntity();
+        entities.push(aux);
+
+        for (int i = 0; i < atts.getLength(); i++) {
+            String name = atts.getLocalName(i);
+            String value = atts.getValue(i);
+
+			aux.putProperty(name, value);
+        }
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#endElement(java.lang.String,
+     *      java.lang.String, java.lang.String)
+     */
+    public void endElement(String namespaceURI, String localName, String qName)
+        throws SAXException {
+        if (localName.equals("entity")){
+			XMLEntity aux = (XMLEntity) entities.pop();
+			try{
+				XMLEntity last = (XMLEntity) entities.peek();
+				last.addChild(aux);
+			}catch (EmptyStackException e) {
+			}
+			lastEntity = aux;
+        }
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#characters(char[], int, int)
+     */
+    public void characters(char[] arg0, int arg1, int arg2)
+        throws SAXException {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
+     */
+    public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
+        throws SAXException {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String,
+     *      java.lang.String)
+     */
+    public void processingInstruction(String arg0, String arg1)
+        throws SAXException {
+    }
+
+    /**
+     * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
+     */
+    public void skippedEntity(String arg0) throws SAXException {
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public XMLEntity getXMLEntity() {
+        return lastEntity;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/XMLEntityXMLHandler.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectExtent.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectExtent.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectExtent.java	(revision 1648)
@@ -0,0 +1,155 @@
+/* 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;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectExtent {
+    private Rectangle2D extent = new Rectangle2D.Double();
+    private String description;
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public Rectangle2D getExtent() {
+        return extent;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param string
+     */
+    public void setDescription(String string) {
+        description = string;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param rectangle2D
+     */
+    public void setExtent(Rectangle2D rectangle2D) {
+        extent = rectangle2D;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getEncuadre() {
+        return extent.getMinX() + "," + extent.getMinY() + "," +
+        extent.getWidth() + "," + extent.getHeight();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param encuadre DOCUMENT ME!
+     */
+    public void setEncuadre(String encuadre) {
+        String[] coords = encuadre.split(",");
+        extent = new Rectangle2D.Double(new Double(coords[0]).doubleValue(),
+                new Double(coords[1]).doubleValue(),
+                new Double(coords[2]).doubleValue(),
+                new Double(coords[3]).doubleValue());
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return description;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public XMLEntity getXMLEntity() {
+        XMLEntity xml = new XMLEntity();
+        xml.putProperty("description", description);
+        xml.putProperty("extentX", extent.getX());
+        xml.putProperty("extentY", extent.getY());
+        xml.putProperty("extentW", extent.getWidth());
+        xml.putProperty("extentH", extent.getHeight());
+
+        return xml;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param xml DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public static ProjectExtent createFromXML(XMLEntity xml) {
+        ProjectExtent pe = new ProjectExtent();
+        pe.description = xml.getStringProperty("description");
+        pe.extent.setRect(xml.getDoubleProperty("extentX"),
+            xml.getDoubleProperty("extentY"), xml.getDoubleProperty("extentW"),
+            xml.getDoubleProperty("extentH"));
+
+        return pe;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectExtent.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectFactory.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectFactory.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectFactory.java	(revision 1648)
@@ -0,0 +1,74 @@
+/* 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;
+
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+
+
+
+public class ProjectFactory {
+	public static ProjectMap createMap(String baseName){
+		return ProjectMap.createMap(baseName);
+	}
+	
+	public static ProjectTable createTable(String name, SelectableDataSource sds){
+		return ProjectTable.createTable(name, sds);
+	}
+	
+	//TODO implementar bien
+/*	public static ProjectTable createTable(String viewName, FTable ftable){
+		return Table.createTable(viewName, ftable);
+	}
+*/	
+	public static ProjectView createView(String baseName){
+		return ProjectView.createView(baseName);
+	}
+	
+	public static Project createProject(){
+		return new Project();
+	}
+	
+	public static ProjectExtent createExtent(){
+		return new ProjectExtent();
+	}
+	
+	
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectFactory.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectTable.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectTable.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectTable.java	(revision 1648)
@@ -0,0 +1,309 @@
+/* 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;
+
+import com.hardcode.driverManager.DriverLoadException;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.data.DataSourceFactory;
+import com.hardcode.gdbms.engine.data.DataSourceFactory.DBDriverInfo;
+import com.hardcode.gdbms.engine.data.DataSourceFactory.DriverInfo;
+import com.hardcode.gdbms.engine.data.DataSourceFactory.FileDriverInfo;
+import com.hardcode.gdbms.engine.data.FileDriver;
+import com.hardcode.gdbms.engine.data.NoSuchTableException;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+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.SingleLayer;
+
+import com.iver.utiles.XMLEntity;
+
+import java.text.DateFormat;
+
+import java.util.Date;
+
+
+/**
+ * Tabla del proyecto
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectTable extends ProjectElement {
+	private static int numTables = 0;
+	private SelectableDataSource modelo;
+
+	/* No es necesaria para operar, s�lo para guardar el proyecto */
+	private AlphanumericData associatedTable;
+
+	/**
+	 * Establece a true el bit index-�simo del bitmap de campos visibles. Los
+	 * campos cuyos bits est�n a true se considerar�n visibles y viceversa
+	 *
+	 * @param index indice del bit que se quiere establecer a true
+	 */
+	public void set(int index) {
+		//TODO implementar bien
+		//        modelo.set(index);
+		change.firePropertyChange("visibles", true, true);
+	}
+
+	/**
+	 * Obtiene el valor del bit index-�simo del bitmap de campos visibles
+	 *
+	 * @param index indice del bit que se quiere obtener
+	 *
+	 * @return devuelve true si el campo index-�simo es visible y false en caso
+	 * 		   contrario
+	 */
+	public boolean get(int index) {
+		//TODO implementar bien
+		//        return modelo.get(index);
+		return false;
+	}
+
+	/**
+	 * Obtiene el modelo de la Tabla. Es decir, una clase con capacidad para
+	 * leer la informaci�n de la tabla
+	 *
+	 * @return
+	 */
+	public SelectableDataSource getModelo() {
+		return modelo;
+	}
+
+	/**
+	 * Establece el valor del bit index-�simo al valor  'value'
+	 *
+	 * @param bitIndex indice del bit que se quiere tocar
+	 * @param value valor que se quiere establecer en el bit indicado
+	 */
+	public void set(int bitIndex, boolean value) {
+		//TODO implementar bien
+		//        modelo.set(bitIndex, value);
+		change.firePropertyChange("visibles", value, value);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param sds DOCUMENT ME!
+	 *
+	 * @return
+	 */
+	public static ProjectTable createTable(String name, SelectableDataSource sds) {
+		ProjectTable t = new ProjectTable();
+		t.modelo = sds;
+
+		if (name == null){
+			t.setName(PluginServices.getText(t, "Tabla") + numTables);
+		}else{
+			t.setName(name);
+		}
+		t.setCreationDate(DateFormat.getInstance().format(new Date()));
+		numTables++;
+
+		return t;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param sds DOCUMENT ME!
+	 */
+	public void setDataSource(SelectableDataSource sds) {
+		modelo = sds;
+
+		setName(sds.getName());
+		setCreationDate(DateFormat.getInstance().format(new Date()));
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = super.getXMLEntity();
+		//xml.putProperty("nameClass", this.getClass().getName());
+		xml.putProperty("numTables", numTables);
+		xml.addChild(modelo.getXMLEntity());
+
+		DriverInfo di = DataSourceFactory.getDriverInfo(modelo.getName());
+		xml.putProperty("gdbmsname", di.name);
+		xml.putProperty("dbms", di.dbms);
+
+		if (associatedTable != null) {
+			xml.putProperty("layerName", ((FLayer) associatedTable).getName());
+			xml.putProperty("viewName",
+				project.getView((FLayer) associatedTable));
+		}
+
+		if (di instanceof DataSourceFactory.PersistentFileDriverInfo) {
+			DataSourceFactory.PersistentFileDriverInfo pfdi = (DataSourceFactory.PersistentFileDriverInfo) di;
+			xml.putProperty("type", "sameDriverFile");
+			xml.putProperty("file", pfdi.file);
+		} else if (di instanceof DataSourceFactory.VolatileFileDriverInfo) {
+			DataSourceFactory.VolatileFileDriverInfo vfdi = (DataSourceFactory.VolatileFileDriverInfo) di;
+			xml.putProperty("type", "otherDriverFile");
+			xml.putProperty("file", vfdi.file);
+			xml.putProperty("driverName", vfdi.driverName);
+		} else if (di instanceof DataSourceFactory.DBDriverInfo) {
+			xml.putProperty("type", "db");
+
+			DBDriverInfo dbdi = (DBDriverInfo) di;
+
+			xml.putProperty("host", dbdi.host);
+			xml.putProperty("port", dbdi.port);
+			xml.putProperty("user", dbdi.user);
+			xml.putProperty("password", dbdi.password);
+			xml.putProperty("dbName", dbdi.dbName);
+			xml.putProperty("tableName", dbdi.sqlQuery);
+			xml.putProperty("driverInfo", dbdi.driverInfo);
+		}
+
+		return xml;
+	}
+
+	private void setSelectableDataSource(XMLEntity xml) throws XMLException, DriverException{
+		String layerName = null;
+		
+		if (xml.contains("layerName"))
+			layerName = xml.getStringProperty("layerName");
+
+		if (layerName == null) {
+			DataSource dataSource;
+
+			try {
+				dataSource = DataSourceFactory.createRandomDataSource(xml.getStringProperty(
+							"gdbmsname"));
+			} catch (NoSuchTableException e) {
+				throw new XMLException(e);
+			} catch (DriverLoadException e) {
+				throw new XMLException(e);
+			}
+
+			SelectableDataSource sds = new SelectableDataSource(dataSource);
+
+			sds.setXMLEntity(xml.getChild(0));
+
+			setDataSource(sds);
+		} else {
+			ProjectView vista = project.getViewByName(xml.getStringProperty(
+						"viewName"));
+			FLayer layer = vista.getMapContext().getLayers().getLayer(layerName);
+
+			modelo = ((AlphanumericData) layer).getRecordset();
+			associatedTable = (AlphanumericData) layer;
+		}
+	}
+	
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param xml DOCUMENT ME!
+	 * @param p DOCUMENT ME!
+	 *
+	 * @throws XMLException
+	 * @throws DriverException
+	 *
+	 * @see com.iver.cit.gvsig.project.ProjectElement#setXMLEntity(com.iver.utiles.XMLEntity)
+	 */
+	public void setXMLEntity(XMLEntity xml, Project p)
+		throws XMLException, DriverException {
+		numTables = xml.getIntProperty("numTables");
+
+		
+		
+		if (xml.getStringProperty("type").equals("otherDriverFile")) {
+			DataSourceFactory.addFileDataSource(xml.getStringProperty(
+					"driverName"), xml.getStringProperty("gdbmsname"),
+				xml.getStringProperty("file"), xml.getStringProperty("dbms"));
+
+			setSelectableDataSource(xml);
+		} else if (xml.getStringProperty("type").equals("sameDriverFile")) {
+			String layerName = xml.getStringProperty("layerName");
+
+			ProjectView vista = project.getViewByName(xml.getStringProperty(
+			"viewName"));
+			FLayer layer = vista.getMapContext().getLayers().getLayer(layerName);
+			
+			modelo = ((AlphanumericData) layer).getRecordset();
+			associatedTable = (AlphanumericData) layer;
+
+			DataSourceFactory.addFileDataSource(xml.getStringProperty("gdbmsname"),
+			xml.getStringProperty("file"), xml.getStringProperty("dbms"), (FileDriver) ((SingleLayer)layer).getSource().getDriver());
+		} else if (xml.getStringProperty("type").equals("db")) {
+			DataSourceFactory.addDBDataSource(xml.getStringProperty("gdbmsname"),
+				xml.getStringProperty("host"), xml.getIntProperty("port"),
+				xml.getStringProperty("user"),
+				xml.getStringProperty("password"),
+				xml.getStringProperty("dbName"),
+				xml.getStringProperty("tableName"),
+				xml.getStringProperty("driverInfo"));
+			
+			setSelectableDataSource(xml);
+		}
+
+		setName(xml.getStringProperty("name"));
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public AlphanumericData getAssociatedTable() {
+		return associatedTable;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param associatedTable DOCUMENT ME!
+	 */
+	public void setAssociatedTable(AlphanumericData associatedTable) {
+		this.associatedTable = associatedTable;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectTable.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectElement.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectElement.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectElement.java	(revision 1648)
@@ -0,0 +1,259 @@
+/* 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;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.util.Date;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.CancelationException;
+import com.iver.cit.gvsig.fmap.layers.DifferentVersionException;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.utiles.XMLEntity;
+
+
+/**
+ * Clase base de los elementos del proyecto (mapas, tablas y vistas)
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public abstract class ProjectElement implements Serializable {
+    protected PropertyChangeSupport change;
+    protected Project project;
+    protected String name;
+    protected String creationDate;
+    protected String owner;
+    protected String comment;
+
+    /**
+     * Creates a new ProjectElement object.
+     */
+    public ProjectElement() {
+        creationDate = DateFormat.getDateInstance().format(new Date());
+        change = new PropertyChangeSupport(this);
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return name;
+    }
+
+    /**
+     * Obtiene el nombre del elemento
+     *
+     * @return
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Establece el nombre del elemento
+     *
+     * @param string
+     */
+    public void setName(String string) {
+    	String oldValue = name;
+        name = string;
+        change.firePropertyChange("name", oldValue, name);
+    }
+
+    /**
+     * Obtiene la fecha de creaci�n del elemento
+     *
+     * @return
+     */
+    public String getCreationDate() {
+        return creationDate;
+    }
+
+    /**
+     * Obtiene el propietario del elemento
+     *
+     * @return
+     */
+    public String getOwner() {
+        return owner;
+    }
+
+    /**
+     * Establece la fecha de creaci�n del elemento.
+     *
+     * @param string
+     */
+    public void setCreationDate(String string) {
+        creationDate = string;
+        change.firePropertyChange("creationDate", creationDate, creationDate);
+    }
+
+    /**
+     * Establece el propietario del elemento
+     *
+     * @param string
+     */
+    public void setOwner(String string) {
+        owner = string;
+        change.firePropertyChange("owner", owner, owner);
+    }
+
+    /**
+     * Obtiene los comentarios del proyecto
+     *
+     * @return
+     */
+    public String getComment() {
+        return comment;
+    }
+
+    /**
+     * Establece los comentarios del proyecto
+     *
+     * @param string
+     */
+    public void setComment(String string) {
+        comment = string;
+        change.firePropertyChange("comment", comment, comment);
+    }
+
+    /**
+     * A�ade un listener para los cambios en las bounded properties
+     *
+     * @param listener
+     */
+    public synchronized void addPropertyChangeListener(
+        PropertyChangeListener listener) {
+        change.addPropertyChangeListener(listener);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     * @throws DriverException
+     */
+    public XMLEntity getXMLEntity() {
+        XMLEntity xml = new XMLEntity();
+        xml.putProperty("className",this.getClass().getName());
+        xml.putProperty("comment", comment);
+        xml.putProperty("creationDate", creationDate);
+        xml.putProperty("name", name);
+        xml.putProperty("owner", owner);
+
+        //xml.addChild(mapContext.getXMLEntity);
+        return xml;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param xml DOCUMENT ME!
+     * @param p DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     * @throws XMLException
+     * @throws DriverException
+     * @throws DriverIOException
+     * @throws DifferentVersionException
+     * @throws CancelationException
+     * @throws DifferentVersionException
+     * @throws ClassNotFoundException
+     * @throws InstantiationException
+     * @throws IllegalAccessException
+     * @throws DriverIOException
+     * @throws DriverLoadException
+     */
+    public static ProjectElement createFromXML(XMLEntity xml, Project p) throws XMLException, DriverException, DriverIOException{
+        ProjectElement pe = null;
+
+            Class clase;
+			try {
+				clase = Class.forName(xml.getStringProperty("className"));
+			pe = (ProjectElement) clase.newInstance();
+			} catch (ClassNotFoundException e) {
+	            NotificationManager.addError("Clase de ProjectElement no reconocida",
+	                    e);
+			} catch (InstantiationException e) {
+	            NotificationManager.addError("Clase de ProjectElement no reconocida",
+	                    e);
+			} catch (IllegalAccessException e) {
+	            NotificationManager.addError("Clase de ProjectElement no reconocida",
+	                    e);
+			}
+
+        pe.setComment(xml.getStringProperty("comment"));
+        pe.setCreationDate(xml.getStringProperty("creationDate"));
+        pe.setName(xml.getStringProperty("name"));
+        pe.setOwner(xml.getStringProperty("owner"));
+        pe.project = p;
+
+		pe.setXMLEntity(xml,p);
+
+        return pe;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param xml DOCUMENT ME!
+     * @throws IllegalAccessException
+     * @throws InstantiationException
+     * @throws ClassNotFoundException
+     * @throws DriverIOException
+     * @throws DriverLoadException
+     * @throws XMLException
+     * @throws DriverIOException
+     */
+    public abstract void setXMLEntity(XMLEntity xml,Project p)throws XMLException, DriverException, DriverIOException;
+	public Project getProject() {
+		return project;
+	}
+	public void setProject(Project project) {
+		this.project = project;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectElement.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectView.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectView.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectView.java	(revision 1648)
@@ -0,0 +1,278 @@
+/* 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;
+
+import java.awt.Color;
+import java.text.DateFormat;
+import java.util.Date;
+
+import org.cresques.cts.IProjection;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.utiles.XMLEntity;
+
+
+/**
+ * Clase que representa una vista del proyecto
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectView extends ProjectElement {
+	private static int numViews = 0;
+
+	//public static int METROS = 0;
+	//public static int KILOMETROS = 1;
+	//public static int[] unidades = new int[] { METROS, KILOMETROS };
+	///private Color backgroundColor = new Color(255, 255, 255);
+	private FMap mapOverViewContext;
+	private FMap mapContext;
+	private int m_typeLink = 0;
+	private String m_extLink;
+	private String m_selectedField = null;
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return
+	 */
+	public FMap getMapContext() {
+		return mapContext;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return
+	 */
+	public FMap getMapOverViewContext() {
+		return mapOverViewContext;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param baseName
+	 *
+	 * @return
+	 */
+	public static ProjectView createView(String baseName) {
+		ProjectView v = new ProjectView();
+		v.mapContext = new FMap(new ViewPort(Project.getProjection()));
+		v.mapOverViewContext = new FMap(null);
+
+		//v.mapOverViewContext = null;
+		v.setName(baseName + " - " + numViews);
+		v.setCreationDate(DateFormat.getInstance().format(new Date()));
+		numViews++;
+
+		return v;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.project.ProjectView#setMapContext(com.iver.cit.gvsig.fmap.FMap)
+	 */
+	public void setMapContext(FMap fmap) {
+		mapContext = fmap;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param fmap DOCUMENT ME!
+	 */
+	public void setMapOverViewContext(FMap fmap) {
+		mapOverViewContext = fmap;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = super.getXMLEntity();
+		//xml.putProperty("nameClass", this.getClass().getName());
+		xml.putProperty("numViews", numViews);
+		xml.putProperty("m_selectedField", m_selectedField);
+		xml.putProperty("m_typeLink", m_typeLink);
+		xml.putProperty("m_extLink", m_extLink);
+		xml.addChild(mapContext.getXMLEntity());
+
+		if ((mapOverViewContext != null) &&
+				(mapOverViewContext.getViewPort().getExtent() != null)) {
+			xml.putProperty("mapOverView", true);
+			xml.addChild(mapOverViewContext.getXMLEntity());
+		} else {
+			xml.putProperty("mapOverView", false);
+		}
+
+		return xml;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param xml DOCUMENT ME!
+	 * @param p DOCUMENT ME!
+	 * @throws XMLException
+	 * @throws DriverException
+	 * @throws DriverIOException
+	 *
+	 * @see com.iver.cit.gvsig.project.ProjectElement#setXMLEntity(com.iver.utiles.XMLEntity)
+	 */
+	public void setXMLEntity(XMLEntity xml, Project p)
+		throws XMLException, DriverException, DriverIOException {
+		numViews = xml.getIntProperty("numViews");
+		m_selectedField = xml.getStringProperty("m_selectedField");
+		m_typeLink = xml.getIntProperty("m_typeLink");
+		m_extLink = xml.getStringProperty("m_extLink");
+		setMapContext(FMap.createFromXML(xml.getChild(0)));
+
+		if (xml.getBooleanProperty("mapOverView")) {
+			setMapOverViewContext(FMap.createFromXML(xml.getChild(1)));
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param p DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 * @throws XMLException
+	 * @throws DriverException
+	 * @throws DriverIOException
+	 */
+	public ProjectView cloneProjectView(Project p)
+		throws XMLException, DriverException, DriverIOException {
+		return (ProjectView) createFromXML(getXMLEntity(), p);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public IProjection getProjection() {
+		return mapContext.getProjection();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public IProjection getOverViewProjection() {
+		return mapOverViewContext.getProjection();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public String getExtLink() {
+		return m_extLink;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public int getTypeLink() {
+		return m_typeLink;
+	}
+
+	/**
+     * Se selecciona la extensi�n para realizar cuando se quiera el link.
+     *
+     * @param s nombre del campo.
+     */
+	public void setExtLink(String s) {
+		m_extLink = s;
+	}
+
+	/**
+     * Se selecciona el tipo de fichero para realizar cuando se quiera el link.
+     *
+     * @param i tipo de fichero.
+     */
+	public void setTypeLink(int i) {
+		m_typeLink = i;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param c DOCUMENT ME!
+	 */
+	public void setBackColor(Color c) {
+//		getMapContext().getViewPort().addViewPortListener(getMapContext()
+	//													   .getEventBuffer());
+		getMapContext().getViewPort().setBackColor(c);
+		//getMapContext().getViewPort().removeViewPortListener(getMapContext()
+			//												  .getEventBuffer());
+	}
+
+	/**
+	 * Se selecciona el nombre del campo para realizar cuando se quiera el
+	 * link.
+	 *
+	 * @param s nombre del campo.
+	 */
+	public void setSelectedField(String s) {
+		m_selectedField = s;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public String getSelectedField() {
+		return m_selectedField;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectView.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectMap.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectMap.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectMap.java	(revision 1648)
@@ -0,0 +1,130 @@
+/* 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;
+
+import com.hardcode.gdbms.engine.data.DriverException;
+
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import com.iver.utiles.XMLEntity;
+
+import java.text.DateFormat;
+
+import java.util.Date;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectMap extends ProjectElement {
+	private static int numMaps = 0;
+	private Layout model;
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param baseName DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public static ProjectMap createMap(String baseName) {
+		ProjectMap m = new ProjectMap();
+		m.setName(baseName + " - " + numMaps);
+		m.setCreationDate(DateFormat.getInstance().format(new Date()));
+		numMaps++;
+
+		return m;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.project.ProjectMap#getModel()
+	 */
+	public Layout getModel() {
+		return model;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.project.ProjectMap#setMapContext(com.iver.cit.gvsig.project.castor.XMLEntity)
+	 */
+	public void setModel(Layout f) {
+		model = f;
+		f.setName(getName());
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.project.ProjectElement#setName(java.lang.String)
+	 */
+	public void setName(String string) {
+		super.setName(string);
+
+		Layout m = getModel();
+
+		if (m != null) {
+			m.setName(string);
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws DriverException
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = super.getXMLEntity();
+		//xml.putProperty("nameClass", this.getClass().getName());
+		xml.putProperty("numMaps", numMaps);
+		xml.addChild(model.getXMLEntity());
+
+		return xml;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.project.ProjectElement#setXMLEntity(com.iver.utiles.XMLEntity)
+	 */
+	public void setXMLEntity(XMLEntity xml, Project p) {
+		numMaps = xml.getIntProperty("numMaps");
+		model = Layout.createLayout(xml.getChild(0), p);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectMap.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ThemeControls.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ThemeControls.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ThemeControls.java	(revision 1648)
@@ -0,0 +1,265 @@
+/*
+ * Created on 31-may-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 java.awt.Component;
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.util.BitSet;
+
+import javax.swing.JFileChooser;
+
+import org.apache.log4j.Logger;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.drivers.dxf.write.DxfWriter;
+import com.iver.cit.gvsig.fmap.drivers.shp.SHP;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.EditionException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.EditableVectorialLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.Selectable;
+import com.iver.cit.gvsig.fmap.operations.strategies.SelectedShapeVisitor;
+import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.project.ProjectView;
+import com.iver.utiles.GenericFileFilter;
+
+
+/**
+ * Extensi�n de operaciones sobre el tema.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ThemeControls implements Extension {
+	private static Logger logger = Logger.getLogger(ThemeControls.class.getName());
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
+	 */
+	public void execute(String s) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		ProjectView model = vista.getModel();
+		FMap mapa = model.getMapContext();
+		MapControl mapCtrl = vista.getMapControl().getMapControl();
+		logger.debug("Comand : " + s);
+
+		if (s.compareTo("PROPERTIES") == 0) {
+			vista.openThemeProperties();
+		} else if (s.compareTo("SHAPE_SELECTED") == 0) {
+			createShape(mapa);
+		} else if (s.compareTo("DXF_SELECTED") == 0) {
+			createDxf(mapa);
+		} else if (s.compareTo("DEL_SELECTION") == 0) {
+			boolean refresh = false;
+
+			for (int i = 0; i < mapa.getLayers().getLayersCount(); i++) {
+				if (mapa.getLayers().getLayer(i) instanceof Selectable) {
+					if (mapa.getLayers().getLayer(i).isActive()) {
+						BitSet bitset = ((Selectable) mapa.getLayers().getLayer(i)).getSelection();
+
+						if (bitset.cardinality() != 0) {
+							refresh = true;
+						}
+
+						bitset.clear();
+					}
+				}
+			}
+
+			if (refresh) {
+				mapCtrl.drawMap(false);
+			}
+		} else if (s.compareTo("ZOOM_SELECT") == 0) {
+			Rectangle2D selectedExtent = mapa.getSelectionBounds();
+
+			if (selectedExtent != null) {
+				mapa.getViewPort().setExtent(selectedExtent);
+			}
+		}
+	}
+
+	/**
+	 * Crea un nuevo shape.
+	 *
+	 * @param map FMap de donde coger las capas a copiar.
+	 */
+	private void createShape(FMap map) {
+		if (map.getSelectionBounds() != null) {
+			JFileChooser jfc = new JFileChooser();
+			jfc.addChoosableFileFilter(new GenericFileFilter("shp",
+					PluginServices.getText(this, "ShapeFile")));
+
+			if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+				File file=jfc.getSelectedFile();
+				if (!(file.getPath().endsWith(".shp") || file.getPath().endsWith(".SHP"))){
+					file=new File(file.getPath()+".shp");
+				}
+				//SHP.SHPFileFromSelected(map, file);
+				SelectedShapeVisitor ssv=new SelectedShapeVisitor();
+				try {
+					map.getLayers().process(ssv);
+					} catch (DriverException e1) {
+						throw new RuntimeException("No se espera que SelectByPointVisitor lance esta excepci�n",
+								e1);
+					} catch (VisitException e) {
+						throw new RuntimeException("No se espera que SelectByPointVisitor lance esta excepci�n",
+								e);
+					}
+				IGeometry[] fgs=ssv.getSelectedGeometries();
+				SelectableDataSource sds=ssv.getSelectableDataSource();
+				BitSet bitset=ssv.getBitSet();
+				try {
+					sds.start();
+					SHP.SHPFileFromGeometries(fgs,bitset,sds,file);
+					sds.stop();
+				} catch (com.hardcode.gdbms.engine.data.DriverException e2) {
+					NotificationManager.addError("No se pudo escribir la capa", e2);
+				}
+			}
+		} // else {
+
+		//}
+	}
+	
+	/**
+	 * Crea un DXF2000 partiendo de los objetos seleccionados.
+	 * @param map
+	 */
+	private void createDxf(FMap map) {
+		if (map.getSelectionBounds() != null) {
+			JFileChooser jfc = new JFileChooser();
+			jfc.addChoosableFileFilter(new GenericFileFilter("dxf",
+					PluginServices.getText(this, "DxfFile")));
+
+			if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+				File file=jfc.getSelectedFile();
+				if (!(file.getPath().endsWith(".dxf") || file.getPath().endsWith(".DXF"))){
+					file=new File(file.getPath()+".dxf");
+				}
+				//SHP.SHPFileFromSelected(map, file);
+				SelectedShapeVisitor ssv=new SelectedShapeVisitor();
+				try {
+					map.getLayers().process(ssv);
+					} catch (DriverException e1) {
+						throw new RuntimeException("No se espera que SelectByPointVisitor lance esta excepci�n",
+								e1);
+					} catch (VisitException e) {
+						throw new RuntimeException("No se espera que SelectByPointVisitor lance esta excepci�n",
+								e);
+					}
+				IGeometry[] fgs=ssv.getSelectedGeometries();
+				DxfWriter dxfWriter = new DxfWriter();
+				try {
+					dxfWriter.write(fgs, file);
+				} catch (Exception e2) {
+					// TODO Auto-generated catch block
+					e2.printStackTrace();
+				}
+				/*SelectableDataSource sds=ssv.getSelectableDataSource();
+				BitSet bitset=ssv.getBitSet();
+				try {
+					sds.start();
+					SHP.SHPFileFromGeometries(fgs,bitset,sds,file);
+					sds.stop();
+				} catch (com.hardcode.gdbms.engine.data.DriverException e2) {
+					NotificationManager.addError("No se pudo escribir la capa", e2);
+				}*/
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			FMap mapa = ((View) f).getModel().getMapContext();
+
+			View v = (View) f;
+
+			return mapa.getLayers().getLayersCount() > 0;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		View f = (View) PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		FLayer[] selected = f.getModel().getMapContext().getLayers().getActives();
+
+		return selected.length > 0;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ThemeControls.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GeometryExtension.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GeometryExtension.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GeometryExtension.java	(revision 1648)
@@ -0,0 +1,176 @@
+/* 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 java.io.IOException;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLyrVect;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.EditableVectorialLayer;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.gui.cad.CadMapControl;
+
+
+/**
+ * Extensi�n dedicada a controlar las diferentes operaciones sobre el editado
+ * de una capa.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class GeometryExtension implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		CadMapControl cadmap=(CadMapControl)vista.getMapControl();
+		if (s.compareTo("SPLINE") == 0) {
+			//Spline.png
+			vista.getMapControl().setCadTool("spline");
+		} else if (s.compareTo("COPY") == 0) {
+			//Copy.png
+			vista.getMapControl().setCadTool("copy");
+		} else if (s.compareTo("EQUIDISTANCE") == 0) {
+			//Equidistance.png
+		} else if (s.compareTo("MATRIZ") == 0) {
+			//Matriz.png
+		} else if (s.compareTo("SYMMETRY") == 0) {
+			//Symmetry.png
+			vista.getMapControl().setCadTool("symmetry");
+		} else if (s.compareTo("ROTATION") == 0) {
+			//Rotation.png
+			vista.getMapControl().setCadTool("rotate");
+		} else if (s.compareTo("STRETCHING") == 0) {
+			//Stretching.png
+			vista.getMapControl().setCadTool("stretching");
+		} else if (s.compareTo("SCALE") == 0) {
+			//Scale.png
+			vista.getMapControl().setCadTool("scale");
+		} else if (s.compareTo("EXTEND") == 0) {
+			//Extend.png
+		} else if (s.compareTo("TRIM") == 0) {
+			//Trim.png
+		} else if (s.compareTo("UNIT") == 0) {
+			//Unit.png
+		} else if (s.compareTo("EXPLOIT") == 0) {
+			//Exploit.png
+			vista.getMapControl().setCadTool("exploit");
+		} else if (s.compareTo("CHAFLAN") == 0) {
+			//Chaflan.png
+		} else if (s.compareTo("JOIN") == 0) {
+			//Join.png
+		} else if (s.compareTo("SELECT") == 0) {
+			vista.getMapControl().setCadTool("selection");
+		} else if (s.compareTo("POINT") == 0) {
+			vista.getMapControl().setCadTool("point");
+		} else if (s.compareTo("LINE") == 0) {
+			vista.getMapControl().setCadTool("line");
+		} else if (s.compareTo("POLYLINE") == 0) {
+			vista.getMapControl().setCadTool("polyline");
+		} else if (s.compareTo("CIRCLE") == 0) {
+			vista.getMapControl().setCadTool("circle");
+		} else if (s.compareTo("ARC") == 0) {
+			vista.getMapControl().setCadTool("arc");
+		} else if (s.compareTo("ELLIPSE") == 0) {
+			vista.getMapControl().setCadTool("ellipse");
+		} else if (s.compareTo("RECTANGLE") == 0) {
+			vista.getMapControl().setCadTool("rectangle");
+		} else if (s.compareTo("POLYGON") == 0) {
+			vista.getMapControl().setCadTool("polygon");
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			FLayer[] l = ((View) f).getModel().getMapContext().getLayers()
+						  .getActives();
+
+			for (int i = 0; i < l.length; i++) {
+				if (l[i] instanceof EditableVectorialLayer) {
+					if (((EditableVectorialLayer) l[i]).isEditing())
+						return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GeometryExtension.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewProjectWindow.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewProjectWindow.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewProjectWindow.java	(revision 1648)
@@ -0,0 +1,80 @@
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+
+
+/**
+ * Extensi�n que abre la ventana de gestor de proyecto.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ViewProjectWindow implements Extension {
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
+	 */
+	public void execute(String arg0) {
+		ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(com.iver.cit.gvsig.ProjectExtension.class);
+		pe.showProjectWindow();
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		return true;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewProjectWindow.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StopEditing.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StopEditing.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StopEditing.java	(revision 1648)
@@ -0,0 +1,138 @@
+/*
+ * Created on 21-feb-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;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.edition.EditionException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.EditableVectorialLayer;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.project.ProjectView;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class StopEditing implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f.getClass() == View.class) {
+			View vista = (View) f;
+			ProjectView model = vista.getModel();
+			FMap mapa = model.getMapContext();
+			EditableVectorialLayer capa = (EditableVectorialLayer) mapa.getLayers()
+																	   .getActives()[0];
+
+			try {
+				if (actionCommand.equals("STOP")){
+					capa.stopEdition();
+				}else if (actionCommand.equals("CANCELEDITION")){
+					capa.cancelEdition();
+				}else if (actionCommand.equals("SHOWGRID")){
+					vista.getMapControl().getCadToolAdapter().setGrid(true);
+				}else if (actionCommand.equals("HIDEGRID")){
+					vista.getMapControl().getCadToolAdapter().setGrid(false);
+				}else if (actionCommand.equals("SETADJUSTGRID")){
+					vista.getMapControl().getCadToolAdapter().setAdjustGrid(true);
+				}else if (actionCommand.equals("NOTADJUSTGRID")){
+					vista.getMapControl().getCadToolAdapter().setAdjustGrid(false);
+				}
+			} catch (EditionException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			View vista = (View) f;
+			ProjectView model = vista.getModel();
+			FMap mapa = model.getMapContext();
+
+			FLayer[] capas = mapa.getLayers().getActives();
+
+			for (int i = 0; i < capas.length; i++) {
+				if (capas[i] instanceof EditableVectorialLayer) {
+					return ((EditableVectorialLayer) capas[i]).isEditing();
+				}
+			}
+		}
+
+		return false;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StopEditing.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java	(revision 1648)
@@ -0,0 +1,241 @@
+/* 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 com.hardcode.driverManager.DriverLoadException;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.data.DataSourceFactory;
+import com.hardcode.gdbms.engine.instruction.SemanticException;
+import com.hardcode.gdbms.parser.ParseException;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.ui.mdiManager.View;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.gui.Table;
+import com.iver.cit.gvsig.gui.filter.DefaultExpressionDataSource;
+import com.iver.cit.gvsig.gui.filter.ExpressionListener;
+import com.iver.cit.gvsig.gui.filter.FilterDialog;
+import com.iver.cit.gvsig.project.ProjectView;
+import com.iver.utiles.exceptionHandling.ExceptionListener;
+
+import java.io.IOException;
+
+
+/**
+ * Extensi�n que controla las operaciones realizadas sobre las tablas.
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class TableOperations implements Extension, ExpressionListener {
+	private SelectableDataSource dataSource = null;
+	private Table vista;
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		View v = PluginServices.getMDIManager().getActiveView();
+
+		if (v instanceof Table) {
+			vista = (Table) v;
+			dataSource = vista.getModel().getModelo();
+		} else if (v instanceof com.iver.cit.gvsig.gui.View) {
+			ProjectView pv = ((com.iver.cit.gvsig.gui.View) v).getModel();
+
+			try {
+				dataSource = ((AlphanumericData) pv.getMapContext().getLayers()
+												   .getActives()[0]).getRecordset();
+			} catch (DriverException e) {
+				NotificationManager.addError(e.getMessage(), e);
+			}
+		}
+
+		DefaultExpressionDataSource ds = new DefaultExpressionDataSource();
+		ds.setTable(dataSource);
+
+		FilterDialog dlg = new FilterDialog();
+		dlg.addExpressionListener(this);
+		dlg.addExceptionListener(new ExceptionListener() {
+				public void exceptionThrown(Throwable t) {
+					NotificationManager.addError(t.getMessage(), t);
+				}
+			});
+
+		dlg.setModel(ds);
+		PluginServices.getMDIManager().addView(dlg);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.filter.ExpressionListener#newSet(java.lang.String)
+	 */
+	public void newSet(String expression) {
+		long[] sel = doSet(expression);
+
+		if (sel == null) {
+			throw new RuntimeException("Not a 'where' clause?");
+		}
+
+		FBitSet selection = new FBitSet();
+
+		for (int i = 0; i < sel.length; i++) {
+			selection.set((int) sel[i]);
+		}
+
+		dataSource.clearSelection();
+		dataSource.setSelection(selection);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.filter.ExpressionListener#newSet(java.lang.String)
+	 */
+	private long[] doSet(String expression) {
+		try {
+			DataSource ds = DataSourceFactory.executeSQL(expression);
+
+			return ds.getWhereFilter();
+		} catch (DriverLoadException e) {
+			NotificationManager.addError("Error cargando el driver", e);
+		} catch (com.hardcode.gdbms.engine.data.DriverException e) {
+			NotificationManager.addError("Error accediendo al driver", e);
+		} catch (ParseException e) {
+			NotificationManager.addError("Parse error", e);
+		} catch (SemanticException e) {
+			NotificationManager.addError(e.getMessage(), e);
+		} catch (IOException e) {
+			NotificationManager.addError("GDBMS internal error", e);
+		}
+
+		return null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.filter.ExpressionListener#addToSet(java.lang.String)
+	 */
+	public void addToSet(String expression) {
+		long[] sel = doSet(expression);
+
+		if (sel == null) {
+			throw new RuntimeException("Not a 'where' clause?");
+		}
+
+		FBitSet selection = new FBitSet();
+
+		for (int i = 0; i < sel.length; i++) {
+			selection.set((int) sel[i]);
+		}
+
+		FBitSet fbs = dataSource.getSelection();
+		fbs.or(selection);
+		dataSource.setSelection(fbs);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.filter.ExpressionListener#fromSet(java.lang.String)
+	 */
+	public void fromSet(String expression) {
+		long[] sel = doSet(expression);
+
+		if (sel == null) {
+			throw new RuntimeException("Not a 'where' clause?");
+		}
+
+		FBitSet selection = new FBitSet();
+
+		for (int i = 0; i < sel.length; i++) {
+			selection.set((int) sel[i]);
+		}
+
+		FBitSet fbs = dataSource.getSelection();
+		fbs.and(selection);
+		dataSource.setSelection(fbs);
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		View v = PluginServices.getMDIManager().getActiveView();
+
+		if (v == null) {
+			return false;
+		}
+
+		if (v.getClass() == Table.class) {
+			return true;
+		} else {
+			if (v instanceof com.iver.cit.gvsig.gui.View) {
+				com.iver.cit.gvsig.gui.View view = (com.iver.cit.gvsig.gui.View) v;
+				ProjectView pv = view.getModel();
+				FLayer[] seleccionadas = pv.getMapContext().getLayers()
+										   .getActives();
+
+				if (seleccionadas.length == 1) {
+					if (seleccionadas[0] instanceof AlphanumericData) {
+						return true;
+					}
+				}
+			}
+
+			return false;
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Print.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Print.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Print.java	(revision 1648)
@@ -0,0 +1,312 @@
+/*
+ * Created on 17-feb-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.ui.mdiManager.View;
+
+import com.iver.cit.gvsig.gui.layout.Attributes;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.print.PageFormat;
+import java.awt.print.Paper;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+
+import javax.print.Doc;
+import javax.print.DocFlavor;
+import javax.print.DocPrintJob;
+import javax.print.PrintException;
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.ServiceUI;
+import javax.print.SimpleDoc;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.event.PrintJobAdapter;
+import javax.print.event.PrintJobEvent;
+import javax.print.event.PrintJobListener;
+
+
+/**
+ * Extensi�n desde la que se imprime.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Print implements Extension, Printable {
+	public static PrinterJob printerJob = PrinterJob.getPrinterJob();
+	private static Layout l = null;
+	private Paper paper;
+	Rectangle2D.Double aux = null;
+	private int veces = 0;
+	private PrintService[] m_cachePrintServices = null;
+	private PrintService m_cachePrintService = null;
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+		l = (Layout) PluginServices.getMDIManager().getActiveView();
+
+		PageFormat format = printerJob.defaultPage(); //new PageFormat();
+		paper = format.getPaper();
+
+		//double margin = 72.0 / 25.4 * 5.0;
+		try {
+			PluginServices.backgroundExecution(new Runnable() {
+					public void run() {
+						if (l.getAtributes().getType() == Attributes.CUSTOM) {
+							l.showPrintDialog(printerJob);
+						} else {
+							l.showPrintDialog(null);
+						}
+					}
+				});
+
+			//Thread.sleep(10000);
+		} catch (Exception e) {
+			System.out.println("Excepci�n al abrir el di�logo de impresi�n: " +
+				e);
+		}
+	}
+
+	/**
+	 * Se dibuja sobre el graphics el Layout.
+	 *
+	 * @param g2 graphics sobre el que se dibuja.
+	 */
+	public void drawShapes(Graphics2D g2) {
+		///double w = paper.getWidth();
+		//System.out.println("w " + w);
+		///double h = paper.getHeight();
+		//System.out.println("h " + h);
+		//g2.translate(-l.getRect().x, -l.getRect().y);
+		l.drawLayoutPrint(g2);
+
+		// System.out.println("drawShapes = "+g2.getTransform().getScaleX());
+		//g2.translate(l.getRect().x, l.getRect().y);
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		View f = PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		return (f.getClass() == Layout.class);
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		Layout f = (Layout) PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.awt.print.Printable#print(java.awt.Graphics, java.awt.print.PageFormat, int)
+	 */
+	public int print(Graphics g, PageFormat format, int pi)
+		throws PrinterException {
+		if (pi >= 1) {
+			return Printable.NO_SUCH_PAGE;
+		}
+
+		System.err.println("Clip 0 = " + g.getClip());
+
+		Graphics2D g2d = (Graphics2D) g;
+
+		double x = format.getImageableX();
+		double y = format.getImageableY();
+		double w = format.getImageableWidth();
+		double h = format.getImageableHeight();
+
+		//System.err.println("Orientaci�n en Print: " + format.getOrientation());
+		System.out.println("print:(" + x + "," + y + "," + w + "," + h + ")");
+		System.err.println("Clip 1 = " + g2d.getClip());
+
+		AffineTransform at = g2d.getTransform();
+		g2d.translate(0, 0);
+		l.obtainRect(true);
+
+		//LWSAffineTransform at = g2d.getTransform();
+		g2d.scale((double) 72 / (double) (Attributes.DPI),
+			(double) 72 / (double) (Attributes.DPI));
+		System.err.println("Clip 2 =" + g2d.getClip());
+
+		if (l.getAtributes().isMargin()) {
+			g2d.setClip((int) (l.getRect().getMinX() +
+				FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[2],
+					l.getAT())),
+				(int) (l.getRect().getMinY() +
+				FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[0],
+					l.getAT())),
+				(int) (l.getRect().getWidth() -
+				FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[2] +
+					l.getAtributes().m_area[3], l.getAT())),
+				(int) (l.getRect().getHeight() -
+				FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[0] +
+					l.getAtributes().m_area[1], l.getAT())));
+		} else {
+			/*
+			   Rectangle rec=(Rectangle)g2d.getClipBounds();
+			   Rectangle2D.Double rec2d=new Rectangle2D.Double();
+			   rec2d.setRect(rec.x,rec.y,l.getRect().width,rec.getHeight());
+			   g2d.setClip((int)rec2d.x,(int)rec2d.y,(int)rec2d.width,(int)rec2d.height);
+			 */
+			/* g2d.setClip((int) l.getRect().getMinX(),
+			   (int) l.getRect().getMinY(), (int) l.getRect().getWidth(),
+			   (int) l.getRect().getHeight()); */
+		}
+
+		veces++;
+		System.out.println("veces = " + veces);
+
+		drawShapes(g2d);
+		g2d.setTransform(at);
+
+		return Printable.PAGE_EXISTS;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * Abre un di�logo para imprimir.
+	 *
+	 * @param layout Layout a imprimir.
+	 */
+	public void OpenDialogToPrint(Layout layout) {
+		l = layout;
+
+		PageFormat format = printerJob.defaultPage(); //new PageFormat();
+		paper = format.getPaper();
+
+		try {
+			if (layout.getAtributes().getType() == Attributes.CUSTOM) {
+				layout.showPrintDialog(printerJob);
+			} else {
+				layout.showPrintDialog(null);
+			}
+		} catch (Exception e) {
+			System.out.println("Excepci�n al abrir el di�logo de impresi�n: " +
+				e);
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Imprime el Layout que se pasa como par�metro.
+	 *
+	 * @param layout Layout a imprimir.
+	 */
+	public void printLayout(Layout layout) {
+		l = layout;
+
+		try {
+			printerJob.setPrintable((Printable) PluginServices.getExtension(
+					com.iver.cit.gvsig.Print.class));
+
+			//Actualizar attributes
+			PrintRequestAttributeSet att = layout.getAtributes()
+												 .toPrintAttributes();
+			DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
+
+			if (m_cachePrintServices == null) {
+				m_cachePrintServices = PrintServiceLookup.lookupPrintServices(flavor,
+						null);
+			}
+
+			PrintService defaultService = null;
+
+			if (m_cachePrintService == null) {
+				defaultService = PrintServiceLookup.lookupDefaultPrintService();
+			}
+
+			if (m_cachePrintService == null) {
+				m_cachePrintService = ServiceUI.printDialog(null, 200, 200,
+						m_cachePrintServices, defaultService, flavor, att);
+			}
+
+			if (m_cachePrintService != null) {
+				DocPrintJob jobNuevo = m_cachePrintService.createPrintJob();
+				PrintJobListener pjlistener = new PrintJobAdapter() {
+						public void printDataTransferCompleted(PrintJobEvent e) {
+							System.out.println("Fin de impresi�n");
+						}
+					};
+
+				jobNuevo.addPrintJobListener(pjlistener);
+
+				Doc doc = new SimpleDoc((Printable) PluginServices.getExtension(
+							com.iver.cit.gvsig.Print.class), flavor, null);
+				jobNuevo.print(doc, att);
+			}
+		} catch (PrintException pe) {
+			pe.printStackTrace();
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Print.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewControls.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewControls.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewControls.java	(revision 1648)
@@ -0,0 +1,216 @@
+/*
+ * Created on 20-feb-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.gui.Encuadrator;
+import com.iver.cit.gvsig.gui.ExtentListSelectorModel;
+import com.iver.cit.gvsig.gui.FPanelExtentSelector;
+import com.iver.cit.gvsig.gui.FPanelLocConfig;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.gui.project.ViewProperties;
+import com.iver.cit.gvsig.gui.selectionByTheme.DefaultSelectionByThemeModel;
+import com.iver.cit.gvsig.gui.selectionByTheme.MySelectionByThemeListener;
+import com.iver.cit.gvsig.gui.selectionByTheme.SelectionByTheme;
+import com.iver.cit.gvsig.project.Project;
+import com.iver.cit.gvsig.project.ProjectExtent;
+import com.iver.cit.gvsig.project.ProjectView;
+
+import org.apache.log4j.Logger;
+
+
+//import com.iver.utiles.FPanelExtentSelector;
+
+/**
+ * Extensi�n que controla las operaciones basicas realizadas sobre la vista.
+ *
+ * @author vcn
+ */
+public class ViewControls implements Extension {
+	private static Logger logger = Logger.getLogger(ViewControls.class.getName());
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
+	 */
+	public void execute(String s) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		ProjectView model = vista.getModel();
+		FMap mapa = model.getMapContext();
+		MapControl mapCtrl = vista.getMapControl().getMapControl();
+		logger.debug("Comand : " + s);
+
+		if (s.compareTo("FULL") == 0) {
+			try {
+			    // mapa.beginAtomicEvent();
+				mapa.getViewPort().setExtent(mapa.getLayers().getFullExtent());
+				vista.repaintMap();
+				// mapa.endAtomicEvent();
+			} catch (DriverException e) {
+				NotificationManager.addError("Error obteniendo el full extent",
+					e);
+			}
+		} else if (s.compareTo("SELECTIONBYSHAPE") == 0) {
+			SelectionByTheme dlg = new SelectionByTheme();
+			FLayer[] layers = mapa.getLayers().getActives();
+			int count = 0;
+			dlg.setModel(new DefaultSelectionByThemeModel());
+			dlg.addSelectionListener(new MySelectionByThemeListener());
+			PluginServices.getMDIManager().addView(dlg);
+		} else if (s.compareTo("ENCUADRE") == 0) {
+			FPanelExtentSelector l = new FPanelExtentSelector();
+
+			ProjectExtension p = (ProjectExtension) PluginServices.getExtension(com.iver.cit.gvsig.ProjectExtension.class);
+			Project project = p.getProject();
+			ExtentListSelectorModel modelo = new ExtentListSelectorModel(project);
+			ProjectExtent[] extents = project.getExtents();
+			project.addPropertyChangeListener(modelo);
+			l.setModel(modelo);
+			l.addSelectionListener(new Encuadrator(project, mapa, vista));
+			PluginServices.getMDIManager().addView(l);
+		} else if (s.compareTo("INFO") == 0) {
+			mapCtrl.setTool("info");
+		} else if (s.compareTo("CONFIG_LOCATOR") == 0) {
+			//Set up the map overview
+			FPanelLocConfig m_panelLoc = new FPanelLocConfig(vista.getMapOverview());
+			PluginServices.getMDIManager().addView(m_panelLoc);
+			m_panelLoc.setPreferredSize(m_panelLoc.getSize());
+		} else if (s.compareTo("PAN") == 0) {
+			mapCtrl.setTool("pan");
+		} else if (s.compareTo("ZOOM_IN") == 0) {
+			mapCtrl.setTool("zoomIn");
+		} else if (s.compareTo("ZOOM_OUT") == 0) {
+			mapCtrl.setTool("zoomOut");
+		} else if (s.compareTo("MEDICION") == 0) {
+			mapCtrl.setTool("medicion");
+		} else if (s.compareTo("AREA") == 0) {
+			mapCtrl.setTool("area");
+		} else if (s.compareTo("SELRECT") == 0) {
+			mapCtrl.setTool("rectSelection");
+		} else if (s.compareTo("SELPOINT") == 0) {
+			mapCtrl.setTool("pointSelection");
+		} else if (s.compareTo("PROPERTIES") == 0) {
+			ViewProperties viewProperties = new ViewProperties(model);
+			PluginServices.getMDIManager().addView(viewProperties);
+		} else if (s.compareTo("TEMAS_VISIBLES") == 0) {
+			setVisibles(true, mapa);
+		} else if (s.compareTo("TEMAS_NOVISIBLES") == 0) {
+			setVisibles(false, mapa);
+		} else if (s.compareTo("TEMAS_ACTIVOS") == 0) {
+			setActives(true, mapa);
+		} else if (s.compareTo("TEMAS_NOACTIVOS") == 0) {
+			setActives(false, mapa);
+		}
+	}
+
+	/**
+	 * Pone todas las capas visibles o no visibles.
+	 *
+	 * @param visible true si que quieren poner a visibles.
+	 * @param mapa FMap sobre el que actuar.
+	 */
+	private void setVisibles(boolean visible, FMap mapa) {
+		for (int i = 0; i < mapa.getLayers().getLayersCount(); i++) {
+			FLayer layer = mapa.getLayers().getLayer(i);
+			layer.setVisible(visible);
+		}
+	}
+
+	/**
+	 * Pone todas las capas activas o no activas.
+	 *
+	 * @param active true si que quieren poner a activas.
+	 * @param mapa FMap sobre el que actuar.
+	 */
+	private void setActives(boolean active, FMap mapa) {
+		for (int i = 0; i < mapa.getLayers().getLayersCount(); i++) {
+			FLayer layer = mapa.getLayers().getLayer(i);
+			layer.setActive(active);
+		}
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			View vista = (View) f;
+			ProjectView model = vista.getModel();
+			FMap mapa = model.getMapContext();
+
+			return mapa.getLayers().getLayersCount() > 0;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ViewControls.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Abrir.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Abrir.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Abrir.java	(revision 1648)
@@ -0,0 +1,229 @@
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.drivers.RasterDriver;
+import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.gui.FOpenDialog;
+import com.iver.cit.gvsig.gui.FileOpenDialog;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.gui.WMSDataSourceAdapter;
+import com.iver.cit.gvsig.gui.wms.WMSWizard;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+import org.cresques.cts.gt2.CoordSys;
+import org.cresques.cts.gt2.CoordTrans;
+
+import java.awt.geom.Rectangle2D;
+
+import java.io.File;
+
+import javax.swing.JOptionPane;
+
+
+/**
+ * Extensi�n que abre un di�logo para seleccionar la capa o capas que se
+ * quieren a�adir a la vista.
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class Abrir implements Extension {
+	public FOpenDialog fopen = null;
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		return (f.getClass() == View.class);
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		View theView = (View) PluginServices.getMDIManager().getActiveView();
+		fopen = new FOpenDialog();
+
+		FileOpenDialog fileDlg = new FileOpenDialog(new Class[] {
+					VectorialFileDriver.class, RasterDriver.class
+				});
+		WMSWizard wms = new WMSWizard();
+		wms.setDataSource(new WMSDataSourceAdapter());
+
+		//        DataBaseOpenDialog dbop = new DataBaseOpenDialog();
+		//        dbop.setClasses(new Class[] { DBDriver.class });
+		fopen.addTab("Fichero", fileDlg);
+		fopen.addWizardTab("WMS", wms);
+
+		//        fopen.addTab("Base de datos", dbop);
+		PluginServices.getMDIManager().addView(fopen);
+
+		if (fopen.isAccepted()) {
+			FLayer lyr = null;
+
+			if (fopen.getSelectedTab() == fileDlg) {
+				if (fileDlg.getFiles() == null) {
+					return;
+				}
+
+				IProjection proj = FOpenDialog.getLastProjection();
+				File[] files = fileDlg.getFiles();
+				String[] driverNames = fileDlg.getDriverNames();
+				Rectangle2D[] rects=new Rectangle2D[files.length];
+				boolean first=false;
+				theView.getMapControl().getMapContext()
+				   .beginAtomicEvent();
+
+				for (int iFile = 0; iFile < files.length; iFile++) {
+					File fich = files[iFile];
+					String layerName = fich.getName();
+					String layerPath = fich.getAbsolutePath();
+
+					try {
+						lyr = LayerFactory.createLayer(layerName,
+								driverNames[iFile], fich, proj);
+
+						if (lyr != null) {
+							lyr.setVisible(true);
+							if (theView.getMapControl().getMapContext().getViewPort().getExtent()==null){
+								first=true;
+							}
+
+							// Comprobar que la projecci�n es la misma que la vista
+							if (proj != theView.getProjection()) {
+								int option = JOptionPane.showConfirmDialog(null,
+										"La proyecci�n de la capa no es igual que la de la vista",
+										"�Desea reproyectar?",
+										JOptionPane.YES_NO_OPTION);
+
+								if (option == JOptionPane.NO_OPTION) {
+									continue;
+								} else {
+									ICoordTrans ct = new CoordTrans((CoordSys) proj,
+											(CoordSys) theView.getProjection());
+									lyr.setCoordTrans(ct);
+									System.err.println("coordTrans = " +
+										proj.getAbrev() + " " +
+										theView.getProjection().getAbrev());
+								}
+							}
+
+							theView.getMapControl().getMapContext().getLayers()
+								   .addLayer(lyr);
+							rects[iFile]=lyr.getFullExtent();
+							
+							// TODO: Poner una variable y dibujar solo cuando
+							// todas las capas hayan sido cargadas.
+							// TODO Se deber� de redibujar mediante la captura de los eventos, por
+							//eso se comenta la parte anterior
+							//							theView.getMapControl().drawMap();
+							//							theView.getTOC().refresh();
+						}
+
+					} catch (DriverException e) {
+						NotificationManager.addError("Error al crear la capa", e);
+					}
+				}
+
+				//Esto permite que cuando se cargan varias capas de golpe y la vista est� vacia,se ponga como extent la suma de todos sus extents.
+				if (rects.length > 1) {
+					Rectangle2D rect = new Rectangle2D.Double();
+					rect.setRect(rects[0]);
+
+					if (first) {
+						for (int i = 0; i < rects.length; i++) {
+							rect.add(rects[i]);
+						}
+
+						theView.getMapControl().getMapContext().getViewPort()
+							   .setExtent(rect);
+					}
+				}
+				theView.getMapControl().getMapContext()
+				   .endAtomicEvent();
+
+			} else if (fopen.getSelectedTab() == wms) {
+				String layerName = wms.getLayerName();
+
+				lyr = LayerFactory.createLayer(layerName,
+						wms.getLayersRectangle(), wms.getHost(),
+						wms.getFormat(), wms.getLayersQuery(),
+						wms.getQueryableLayerQuery(), wms.getSRS());
+
+				if (lyr != null) {
+					lyr.setVisible(true);
+					theView.getMapControl().getMapContext().beginAtomicEvent();
+					theView.getMapControl().getMapContext().getLayers()
+						   .addLayer(lyr);
+					theView.getMapControl().getMapContext().endAtomicEvent();
+				}
+			} // for
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/Abrir.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/UndoCommandExtension.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/UndoCommandExtension.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/UndoCommandExtension.java	(revision 1648)
@@ -0,0 +1,136 @@
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.EditableVectorialLayer;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.gui.cad.CadMapControl;
+import com.iver.cit.gvsig.project.ProjectView;
+
+import java.io.IOException;
+
+
+/**
+ * Extensi�n encargada de gestionar el deshacer los comandos anteriormente
+ * aplicados.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class UndoCommandExtension implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		CadMapControl cadmap = (CadMapControl) vista.getMapControl();
+
+		if (s.compareTo("UNDO") == 0) {
+			try {
+				cadmap.getCadToolAdapter().getEditableFeatureSource().undo();
+			} catch (DriverIOException e) {
+				NotificationManager.addError("Error accediendo a los Drivers para deshacer un comando",
+					e);
+			} catch (IOException e) {
+				NotificationManager.addError("Error accediendo al fichero para deshacer un comando",
+					e);
+			}
+
+			vista.getMapControl().getMapControl().drawMap(false);
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		View vista = (View) PluginServices.getMDIManager().getActiveView();
+		ProjectView model = vista.getModel();
+		FMap mapa = model.getMapContext();
+
+		FLayer[] capas = mapa.getLayers().getActives();
+		if (capas.length != 1) return false;
+		if (capas[0] instanceof EditableVectorialLayer){
+			EditableVectorialLayer lyr = (EditableVectorialLayer) capas[0];
+			if (lyr.isEditing()) {
+				CadMapControl cadmap = (CadMapControl) vista.getMapControl();
+				if (cadmap.getCadToolAdapter().getEditableFeatureSource()==null)return false;
+				return cadmap.getCadToolAdapter().getEditableFeatureSource()
+							 .moreUndoCommands();
+			}else{
+				return false;
+			}
+		}else{
+			return false;
+		}
+
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/UndoCommandExtension.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GraphicControls.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GraphicControls.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GraphicControls.java	(revision 1648)
@@ -0,0 +1,128 @@
+/*
+ * Created on 15-jul-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.ui.mdiManager.View;
+
+import com.iver.cit.gvsig.gui.layout.FLayoutGraphics;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import org.apache.log4j.Logger;
+
+
+/**
+ * Extensi�n que actua sobre el Layout para controlas las diferentes
+ * operaciones sobre los gr�ficos.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class GraphicControls implements Extension {
+	private static Logger logger = Logger.getLogger(GraphicControls.class.getName());
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+		Layout layout = (Layout) PluginServices.getMDIManager().getActiveView();
+		FLayoutGraphics lg = new FLayoutGraphics(layout);
+		logger.debug("Comand : " + s);
+
+		if (s.compareTo("SIMPLIFICAR") == 0) {
+			lg.simplify();
+		} else if (s.compareTo("AGRUPAR") == 0) {
+			lg.grouping();
+		} else if (s.compareTo("DESAGRUPAR") == 0) {
+			lg.ungrouping();
+		} else if (s.compareTo("PROPIEDADES") == 0) {
+			lg.openFFrameDialog();
+		} else if (s.compareTo("ALINEAR") == 0) {
+			lg.aligning();
+		} else if (s.compareTo("DETRAS") == 0) {
+			lg.behind();
+		} else if (s.compareTo("DELANTE") == 0) {
+			lg.before();
+		} else if (s.compareTo("BORDEAR") == 0) {
+			lg.border();
+		} else if (s.compareTo("POSICIONAR") == 0) {
+			lg.position();
+		}
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		View f = PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == Layout.class) {
+			Layout layout = (Layout) f;
+
+			return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/GraphicControls.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutControls.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutControls.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutControls.java	(revision 1648)
@@ -0,0 +1,180 @@
+/*
+ * Created on 05-may-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.ui.mdiManager.View;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.gui.layout.FLayoutZooms;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import org.apache.log4j.Logger;
+
+
+/**
+ * Extensi�n para controlar las operaciones basicas sobre el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class LayoutControls implements Extension {
+	private static Logger logger = Logger.getLogger(LayoutControls.class.getName());
+	private Layout layout = null;
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String s) {
+		layout = (Layout) PluginServices.getMDIManager().getActiveView();
+
+		FLayoutZooms zooms = new FLayoutZooms(layout);
+		logger.debug("Comand : " + s);
+
+		if (s.compareTo("PAN") == 0) {
+			layout.setTool(Layout.PAN);
+		} else if (s.compareTo("ZOOM_IN") == 0) {
+			layout.setTool(Layout.ZOOM_MAS);
+		} else if (s.compareTo("ZOOM_OUT") == 0) {
+			layout.setTool(Layout.ZOOM_MENOS);
+		} else if (s.compareTo("RECTANGLEVIEW") == 0) {
+			layout.setTool(Layout.RECTANGLEVIEW);
+		} else if (s.compareTo("RECTANGLEPICTURE") == 0) {
+			layout.setTool(Layout.RECTANGLEPICTURE);
+		} else if (s.compareTo("RECTANGLESCALEBAR") == 0) {
+			layout.setTool(Layout.RECTANGLESCALEBAR);
+		} else if (s.compareTo("RECTANGLELEGEND") == 0) {
+			layout.setTool(Layout.RECTANGLELEGEND);
+		} else if (s.compareTo("RECTANGLETEXT") == 0) {
+			layout.setTool(Layout.RECTANGLETEXT);
+		} else if (s.compareTo("SELECT") == 0) {
+			layout.setTool(Layout.SELECT);
+		} else if (s.compareTo("POINT") == 0) {
+			layout.setTool(Layout.POINT);
+		} else if (s.compareTo("LINE") == 0) {
+			layout.setTool(Layout.LINE);
+		} else if (s.compareTo("POLYLINE") == 0) {
+			layout.setTool(Layout.POLYLINE);
+		} else if (s.compareTo("CIRCLE") == 0) {
+			layout.setTool(Layout.CIRCLE);
+		} else if (s.compareTo("RECTANGLESIMPLE") == 0) {
+			layout.setTool(Layout.RECTANGLESIMPLE);
+		} else if (s.compareTo("POLYGON") == 0) {
+			layout.setTool(Layout.POLYGON);
+		} else if (s.compareTo("CONFIG") == 0) {
+			layout.showFConfig();
+		} else if (s.compareTo("PROPERTIES") == 0) {
+			layout.showFProperties();
+		} else if (s.compareTo("FULL") == 0) {
+			layout.fullRect();
+		} else if (s.compareTo("REALZOOM") == 0) {
+			zooms.realZoom();
+		} else if (s.compareTo("ZOOMOUT") == 0) {
+			zooms.zoomOut();
+		} else if (s.compareTo("ZOOMIN") == 0) {
+			zooms.zoomIn();
+		} else if (s.compareTo("ZOOMSELECT") == 0) {
+			zooms.zoomSelect();
+		} else if (s.compareTo("VIEW_ZOOMIN") == 0) {
+			layout.setTool(Layout.VIEW_ZOOMIN);
+		} else if (s.compareTo("VIEW_ZOOMOUT") == 0) {
+			layout.setTool(Layout.VIEW_ZOOMOUT);
+		} else if (s.compareTo("VIEW_FULL") == 0) {
+			try {
+				layout.viewFull();
+			} catch (DriverException e) {
+				//TODO Enviar a Andami
+				e.printStackTrace();
+			}
+		} else if (s.compareTo("VIEW_PAN") == 0) {
+			layout.setTool(Layout.VIEW_PAN);
+		} else if (s.compareTo("SET_TAG") == 0) {
+			layout.setTool(Layout.SET_TAG);
+		}
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		View f = PluginServices.getMDIManager().getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == Layout.class) {
+			Layout layout = (Layout) f;
+
+			return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+
+	/**
+	 * Devuelve el Layout sobre el que se opera.
+	 *
+	 * @return Layout.
+	 */
+	public Layout getLayout() {
+		return layout;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutControls.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StartEditing.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StartEditing.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StartEditing.java	(revision 1648)
@@ -0,0 +1,149 @@
+/*
+ * Created on 21-feb-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;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.edition.EditionException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.EditableVectorialLayer;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.project.ProjectView;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class StartEditing implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f.getClass() == View.class) {
+			View vista = (View) f;
+			ProjectView model = vista.getModel();
+			FMap mapa = model.getMapContext();
+			final EditableVectorialLayer capa = (EditableVectorialLayer) mapa.getLayers().getActives()[0];
+				PluginServices.backgroundExecution(new Runnable() {
+					public void run() {
+						try {
+							capa.startEdition();
+						} catch (EditionException e) {
+							e.printStackTrace();
+						}
+					}
+				});
+		}
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			View vista = (View) f;
+			ProjectView model = vista.getModel();
+			FMap mapa = model.getMapContext();
+
+			FLayer[] capas = mapa.getLayers().getActives();
+
+			for (int i = 0; i < capas.length; i++) {
+				if (!(capas[i] instanceof EditableVectorialLayer)) {
+					return false;
+				}
+			}
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		com.iver.andami.ui.mdiManager.View f = PluginServices.getMDIManager()
+															 .getActiveView();
+
+		if (f == null) {
+			return false;
+		}
+
+		if (f.getClass() == View.class) {
+			View vista = (View) f;
+			ProjectView model = vista.getModel();
+			FMap mapa = model.getMapContext();
+
+			if (mapa.getLayers().getActives().length == 1){
+				if (mapa.getLayers().getActives()[0] instanceof EditableVectorialLayer){
+					if (!((EditableVectorialLayer) mapa.getLayers().getActives()[0]).isEditing()){
+						return true;
+					}
+				}
+			}
+		} 
+		return false;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/StartEditing.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java	(revision 1648)
@@ -0,0 +1,292 @@
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.drivers.shp.SHP;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.cit.gvsig.gui.project.ProjectWindow;
+import com.iver.cit.gvsig.project.Project;
+import com.iver.cit.gvsig.project.ProjectFactory;
+import com.iver.utiles.GenericFileFilter;
+import com.iver.utiles.XMLEntity;
+import com.iver.utiles.xmlEntity.generate.XmlTag;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ValidationException;
+
+import java.awt.Component;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+
+import java.text.DateFormat;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+
+
+/**
+ * Extension que proporciona controles para crear proyectos nuevos, abrirlos y
+ * guardarlos. Adem�s los tipos de tabla que soporta el proyecto son a�adidos
+ * en esta clase.
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectExtension implements Extension {
+	private ArrayList tableExtensions = new ArrayList();
+	private ProjectWindow projectFrame;
+	private Project p;
+	private boolean modified = false;
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+		p = ProjectFactory.createProject();
+		p.setName(PluginServices.getText(this, "untitled"));
+		p.setModified(false);
+		projectFrame = new ProjectWindow(this);
+		projectFrame.setProject(p);
+		showProjectWindow();
+		PluginServices.getMainFrame().setTitle(PluginServices.getText(this, "sin_titulo"));
+
+		LayerFactory.setDriversPath(PluginServices.getPluginServices(this)
+												  .getPluginDirectory()
+												  .getAbsolutePath() +
+			File.separator + "drivers");
+	}
+
+	/**
+	 * Muestra la ventana con el gestor de proyectos.
+	 */
+	public void showProjectWindow() {
+		PluginServices.getMDIManager().addView(projectFrame);
+	}
+
+	/**
+	 * Guarda el proyecto actual en disco.
+	 */
+	private void guardar() {
+		if (p.getPath() == null) {
+			guardarDialogo();
+		} else {
+			escribirProyecto(new File(p.getPath()), p);
+		}
+	}
+	private void guardarDialogo(){
+		JFileChooser jfc = new JFileChooser();
+		jfc.addChoosableFileFilter(new GenericFileFilter("gvp",
+				PluginServices.getText(this, "tipo_fichero_proyecto")));
+
+		if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+			File file=jfc.getSelectedFile();
+			if (!(file.getPath().endsWith(".gvp") || file.getPath().endsWith(".GVP"))){
+				file=new File(file.getPath()+".gvp");
+			}
+			escribirProyecto(file, p);
+		}
+	}
+	/**
+	 * Guarda si el proyecto ha sido modificado.
+	 *
+	 * @return True si se ha guardado correctamente.
+	 */
+	private boolean modificado() {
+		if (p.isModified()) {
+			int res = JOptionPane.showConfirmDialog((Component) PluginServices.getMainFrame(),
+					PluginServices.getText(this, "guardar_cambios"),
+					PluginServices.getText(this, "nuevo_proyecto"),
+					JOptionPane.YES_NO_CANCEL_OPTION,
+					JOptionPane.INFORMATION_MESSAGE);
+
+			if (res == JOptionPane.YES_OPTION) {
+				guardar();
+			} else if (res == JOptionPane.CANCEL_OPTION) {
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#updateUI(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		if (actionCommand.equals("NUEVO")) {
+			//Si est� modificado se pregunta si se quiere guardar el anterior
+			if (!modificado()) {
+				return;
+			}
+
+			PluginServices.getMDIManager().closeAllViews();
+			p = ProjectFactory.createProject();
+			p.setName(PluginServices.getText(this, "untitled"));
+			p.setModified(false);
+			projectFrame.setProject(p);
+			showProjectWindow();
+			PluginServices.getMainFrame().setTitle(PluginServices.getText(this, "sin_titulo"));
+		} else if (actionCommand.equals("ABRIR")) {
+			//Si est� modificado se pregunta si se quiere guardar el anterior
+			if (!modificado()) {
+				return;
+			}
+
+			JFileChooser jfc = new JFileChooser();
+			jfc.addChoosableFileFilter(new GenericFileFilter("gvp",
+					PluginServices.getText(this, "tipo_fichero_proyecto")));
+
+			if (jfc.showOpenDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+				PluginServices.getMDIManager().closeAllViews();
+
+				Project o = leerProyecto(jfc.getSelectedFile());
+
+				if (o != null) {
+					p = o;
+				}
+
+				projectFrame.setProject(p);
+				PluginServices.getMainFrame().setTitle(p.getName());
+				projectFrame.refreshControls();
+				showProjectWindow();
+			}
+		} else if (actionCommand.equals("GUARDAR")) {
+			guardar();
+		} else if (actionCommand.equals("GUARDAR_COMO")) {
+			guardarDialogo();
+		}
+	}
+
+	/**
+	 * Escribe el proyecto en XML.
+	 *
+	 * @param file Fichero.
+	 * @param p Proyecto.
+	 */
+	private void escribirProyecto(File file, Project p) {
+		// write it out as XML
+		try {
+			FileWriter writer = new FileWriter(file.getAbsolutePath());
+			Marshaller m = new Marshaller(writer);
+			m.setEncoding("ISO-8859-1");
+			p.setName(file.getName());
+			p.setPath(file.toString());
+			p.setModificationDate(DateFormat.getDateInstance().format(new Date()));
+			p.setModified(false);
+			m.marshal(p.getXMLEntity().getXmlTag());
+			PluginServices.getMainFrame().setTitle(file.getName());
+		} catch (Exception e) {
+			NotificationManager.addError("Error guardando el proyecto", e);
+		}
+
+		projectFrame.refreshControls();
+	}
+
+	/**
+	 * Lee del XML el proyecto.
+	 *
+	 * @param file Fichero.
+	 *
+	 * @return Proyecto.
+	 */
+	public Project leerProyecto(File file) {
+		Project proj = null;
+
+		try {
+			File xmlFile = new File(file.getAbsolutePath());
+			FileReader reader;
+			reader = new FileReader(xmlFile);
+
+			XmlTag tag = (XmlTag) XmlTag.unmarshal(reader);
+			p = Project.createFromXML(new XMLEntity(tag));
+		} catch (FileNotFoundException e) {
+			NotificationManager.addError("Al leer el proyecto", e);
+		} catch (MarshalException e) {
+			NotificationManager.addError("Al leer el proyecto", e);
+		} catch (ValidationException e) {
+			NotificationManager.addError("Al leer el proyecto", e);
+		} catch (XMLException e) {
+			NotificationManager.addError("Al leer el proyecto", e);
+		} catch (DriverException e) {
+			NotificationManager.addError("Al leer el proyecto", e);
+		} catch (DriverIOException e2) {
+			NotificationManager.addError("Al leer el proyecto", e2);
+		}
+
+		return proj;
+	}
+
+	/**
+	 * Devuelve el proyecto.
+	 *
+	 * @return Proyecto.
+	 */
+	public Project getProject() {
+		return p;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		return true;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/ComandosListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/ComandosListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/ComandosListener.java	(revision 1648)
@@ -0,0 +1,363 @@
+/*
+ * Created on 17-jun-2003
+ *
+ * Copyright (c) 2003
+ * Francisco Jos�Pearrubia Mart�ez
+ * IVER Tecnolog�s de la Informacin S.A.
+ * Salamanca 50
+ * 46005 Valencia (        SPAIN )
+ * +34 963163400
+ * mailto:fran@iver.es
+ * http://www.iver.es
+ */
+/* 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.DEMO;
+
+import java.awt.Color;
+import java.awt.HeadlessException;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import javax.swing.JDialog;
+
+import org.cresques.cts.IProjection;
+import org.cresques.cts.ProjectionPool;
+import org.geotools.data.DataSourceException;
+import org.geotools.data.DataStore;
+import org.geotools.data.FeatureSource;
+import org.geotools.map.DefaultMapLayer;
+import org.geotools.map.MapLayer;
+import org.geotools.styling.Style;
+import org.geotools.styling.StyleBuilder;
+
+import com.hardcode.gdbms.engine.data.DBDriver;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.drivers.RasterDriver;
+import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
+import com.iver.cit.gvsig.fmap.layers.CancelationException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLyrGT2;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.gui.DataBaseOpenDialog;
+import com.iver.cit.gvsig.gui.FOpenDialog;
+import com.iver.cit.gvsig.gui.FPanelLocConfig;
+import com.iver.cit.gvsig.gui.FileOpenDialog;
+import com.iver.cit.gvsig.gui.Table;
+import com.iver.cit.gvsig.gui.legendmanager.FLegendManagerWindow;
+import com.iver.cit.gvsig.project.ProjectTable;
+import com.vividsolutions.jts.geom.LineString;
+import com.vividsolutions.jts.geom.MultiLineString;
+import com.vividsolutions.jts.geom.MultiPoint;
+import com.vividsolutions.jts.geom.Point;
+
+
+
+//import java.awt.Frame;
+
+/**
+ * @author Administrador
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class ComandosListener implements ActionListener {
+	private MapControl m_MapControl;
+    private FMap m_Mapa;
+    private SingleView theView;
+    
+    private static final boolean WKB_ENABLED = true;
+    
+    PruebasGT2 pruebasGT2 = null; //new PruebasGT2();
+
+    public ComandosListener(MapControl mapa, SingleView Owner) {
+        m_Mapa = mapa.getMapContext();
+        theView = Owner;
+        m_MapControl = mapa;
+    }
+    
+    /**
+     * Load the data from the specified dataStore and construct a {@linkPlain Context context} with
+     * a default style.
+     *
+     * @param url The url of the shapefile to load.
+     * @param name DOCUMENT ME!
+     *
+     * @throws IOException is a I/O error occured.
+     * @throws DataSourceException if an error occured while reading the data source.
+     * @throws FileNotFoundException DOCUMENT ME!
+     */
+    protected void loadLayer(DataStore store, String layerName)
+        throws IOException, DataSourceException {
+        final FeatureSource features = store.getFeatureSource(layerName);
+
+        // Create the style
+        final StyleBuilder builder = new StyleBuilder();
+        final Style style;
+        Class geometryClass = features.getSchema().getDefaultGeometry().getType();
+
+        if (LineString.class.isAssignableFrom(geometryClass)
+                || MultiLineString.class.isAssignableFrom(geometryClass)) {
+            style = builder.createStyle(builder.createLineSymbolizer());
+        } else if (Point.class.isAssignableFrom(geometryClass)
+                || MultiPoint.class.isAssignableFrom(geometryClass)) {
+            style = builder.createStyle(builder.createPointSymbolizer());
+        } else {
+            style = builder.createStyle(builder.createPolygonSymbolizer(Color.ORANGE, Color.BLACK, 1));
+        }
+
+        final MapLayer layer = new DefaultMapLayer(features, style);
+        layer.setTitle(layerName);
+        
+        FLyrGT2 lyrGT2 = new FLyrGT2(layer);
+        try {
+			m_Mapa.getLayers().addLayer(lyrGT2);
+		} catch (CancelationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        
+    }
+    
+    
+    /* (non-Javadoc)
+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+     */
+    public void actionPerformed(ActionEvent e) {
+		// TODO LWS Esto debe venir de fuera (proyeccion del fichero, o de la vista)
+		IProjection proj = ProjectionPool.get("EPSG:23030");
+		ViewPort vp = m_Mapa.getViewPort();
+
+        if (e.getActionCommand() == "ZOOM_TODO") {
+            try {
+				vp.setExtent(m_Mapa.getFullExtent());
+				m_MapControl.drawMap(false);
+			} catch (DriverException e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+            m_MapControl.drawMap(false);
+        }
+        if (e.getActionCommand() == "ZOOM_PREVIO") {            
+            vp.setPreviousExtent();
+        }
+        if (e.getActionCommand().indexOf("GT2") != -1 && pruebasGT2 != null) {
+        	pruebasGT2.setMapContext(m_Mapa);
+        	pruebasGT2.actionPerformed(e);
+        }
+        
+		if (e.getActionCommand() == "OPEN_LOCATOR") {
+			//Set up the dialog that the button brings up.
+			JDialog dialog = new JDialog();
+			FPanelLocConfig m_panelLoc = new FPanelLocConfig(theView.getMapOverview());
+			m_panelLoc.setPreferredSize(m_panelLoc.getSize());
+			dialog.getContentPane().add(m_panelLoc);
+			dialog.setModal(true);			
+			dialog.pack();
+			dialog.show();
+		} 
+        
+		if (e.getActionCommand() == "PRUEBA") {
+			int i;
+			double valor;
+			FLegendManagerWindow dlg = new FLegendManagerWindow();
+			
+			dlg.show(); 
+		}
+
+        if (e.getActionCommand() == "ZOOM_MAS") {
+            m_MapControl.setTool("zoomIn"); // Por defecto
+        }
+
+        if (e.getActionCommand() == "ZOOM_MENOS") {
+			m_MapControl.setTool("zoomout");
+        }
+
+        if (e.getActionCommand() == "PAN") {
+			m_MapControl.setTool("pan");
+        }
+
+        if (e.getActionCommand() == "INFO") {
+			m_MapControl.setTool("info");
+        }
+        if (e.getActionCommand() == "SELRECT") {
+			m_MapControl.setTool("rectSelection");
+        }
+        
+        if (e.getActionCommand() == "MEDICION") {
+			m_MapControl.setTool("medicion");
+        }
+        if (e.getActionCommand() == "MEDIRAREA") {
+			m_MapControl.setTool("area");
+        }
+        
+        if ((e.getActionCommand() == "ADD_LAYER") || (e.getActionCommand() == "ADD_MEMORY_LAYER")) {
+        	JDialog dlg = new JDialog();
+            dlg.setModal(true);
+            FileOpenDialog fileDlg = new FileOpenDialog(new Class[]{VectorialFileDriver.class, RasterDriver.class});
+            DataBaseOpenDialog dbop = new DataBaseOpenDialog();
+            dbop.setClasses(new Class[]{DBDriver.class});
+            
+            FOpenDialog fopen = new FOpenDialog();
+            fopen.addTab("Fichero", fileDlg);
+            fopen.addTab("Base de datos", dbop);
+            // fileDlg.setPreferredSize(fopen.getSize());
+            dlg.setSize(fopen.getSize());
+            dlg.getContentPane().add(fopen);
+            dlg.pack();
+            dlg.show();
+            
+  
+            // TODO: Hacer lo de la capa WMS tambi�n.
+    		if (fileDlg.getFiles() == null) return;
+    		FLayer lyr = null;
+    		File[] files = fileDlg.getFiles();
+    		String[] driverNames = fileDlg.getDriverNames();
+			m_MapControl.getMapContext()
+			   .beginAtomicEvent();
+
+    		for  (int iFile=0; iFile < files.length; iFile++)
+    		{
+    			File fich = files[iFile];
+    			String layerName = fich.getName();
+    			String layerPath = fich.getAbsolutePath();
+    			
+    			try {
+    				lyr = LayerFactory.createLayer(layerName, driverNames[iFile], fich, proj);
+
+    				lyr.setVisible(true);
+    				lyr.setName(layerName);
+    				if (lyr != null )
+    				{
+    					try {
+    						theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
+    					} catch (CancelationException ex) {
+    						// TODO Auto-generated catch block
+    						ex.printStackTrace();
+    					}
+    					// TODO: Poner una variable y dibujar solo cuando
+    					// todas las capas hayan sido cargadas.
+    					// theView.getMapControl().drawMap();	   				
+    					// theView.getTOC().refresh();
+    				}    		
+    				
+    			} catch (DriverException ex) {
+    				ex.printStackTrace();
+				}
+    			
+    		} // for
+			m_MapControl.getMapContext()
+			   .endAtomicEvent();
+			theView.getTOC().refresh();
+
+            return;
+
+        }
+
+        /**
+
+        String pathFich = fc.getDirectory() + fc.getFile();
+
+
+        System.out.println(pathFich);
+        FLyrVect lyr = new FLyrVect(fc.getFile(),pathFich);
+
+        m_Mapa.AddLayer(lyr);
+        m_Owner.jLeyenda.Refresh();
+
+        }
+
+        **/
+        if (e.getActionCommand() == "EXPORT") {
+            // Export jExport = new Export(m_MapControl);
+        }
+
+        if (e.getActionCommand() == "VIEW_TABLE") {
+    		FLayer[] actives = m_Mapa.getLayers().getActives();
+
+    		 for (int i = 0; i < actives.length; i++) {
+            	if (actives[i] instanceof AlphanumericData){
+            		AlphanumericData co = (AlphanumericData)actives[i];
+    			
+					SelectableDataSource dataSource;
+					try {
+						dataSource = co.getRecordset();
+						ProjectTable projectTable =  ProjectTable.createTable(actives[i].getName(),
+									dataSource);
+							projectTable.setAssociatedTable(co);
+						
+						Table t = new Table();
+						t.setModel(projectTable);
+			            JDialog myDialog = new JDialog(theView, "Tabla de Atributos (" 
+			            		  + t.getModel().getAssociatedTable().getRecordset().getRowCount() + " registros)" );
+			            myDialog.setContentPane(t);
+	
+			            // myViewer.addAttributeTableViewerListener(m_Owner);
+			            myDialog.pack();
+			            myDialog.show(); 
+					} catch (DriverException e1) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					} catch (HeadlessException ex) {
+						// TODO Auto-generated catch block
+						ex.printStackTrace();
+					} catch (com.hardcode.gdbms.engine.data.DriverException ex) {
+						// TODO Auto-generated catch block
+						ex.printStackTrace();
+					}
+
+    			}
+    			
+    		}
+        	
+        }
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/ComandosListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SingleView.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SingleView.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SingleView.java	(revision 1648)
@@ -0,0 +1,826 @@
+/*
+ * Created on 19-may-2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+/* 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.DEMO;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.awt.geom.Point2D;
+import java.awt.image.ImageObserver;
+import java.util.Locale;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+import javax.swing.JToolBar;
+import javax.swing.UIManager;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+
+import com.iver.andami.messages.Messages;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.tools.PanListenerImpl;
+import com.iver.cit.gvsig.fmap.tools.RectangleSelectionListener;
+import com.iver.cit.gvsig.fmap.tools.ZoomInListenerImpl;
+import com.iver.cit.gvsig.fmap.tools.ZoomOutListenerImpl;
+import com.iver.cit.gvsig.fmap.tools.ZoomOutRightButtonListener;
+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.MoveBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.RectangleBehavior;
+import com.iver.cit.gvsig.gui.IView;
+import com.iver.cit.gvsig.gui.MapOverview;
+import com.iver.cit.gvsig.gui.Dialogs.FInfoDialog;
+import com.iver.cit.gvsig.gui.Panels.FPanelAbout;
+import com.iver.cit.gvsig.gui.toc.TOC;
+import com.iver.cit.gvsig.gui.toolListeners.InfoListener;
+import com.iver.cit.gvsig.gui.toolListeners.StatusBarListener;
+import com.iver.cit.gvsig.gui.toolListeners.ZoomInListener;
+
+
+/* import java.awt.GridBagLayout;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.awt.Dimension; */
+
+/**
+ * @author Administrador
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class SingleView extends JFrame implements IView, WindowListener {
+	public static ImageObserver m_ImageObserver = null;
+	private static Logger logger = Logger.getLogger(SingleView.class.getName());
+	
+	public JPanel panelvista = null;
+
+	//public FLegend jLeyenda;
+	//private TOC vTOC;
+	public MapControl m_MapControl;
+	public FInfoDialog m_dlgInfo;
+// 	public FProjection m_Projection;
+	private JScrollPane jscrollTOC;
+	private TOC m_TOC;
+	private MapOverview m_MapLoc;
+	private String m_Name = null;
+	// private com.iver.cit.opensig.project.View modelo;
+	
+    private javax.swing.JMenuItem aboutMenuItem;
+    private javax.swing.JButton btn_FullExtent;
+    private javax.swing.JMenuItem contentsMenuItem;
+    private javax.swing.JMenuItem copyMenuItem;
+    private javax.swing.JMenuItem cutMenuItem;
+    private javax.swing.JMenuItem deleteMenuItem;
+    private javax.swing.JMenu editMenu;
+    private javax.swing.JMenuItem exitMenuItem;
+    private javax.swing.JMenu fileMenu;
+    private javax.swing.JMenu helpMenu;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JTextField jTextField1;
+    private javax.swing.JToolBar jToolBar1;
+    public Export jExport;
+    private ComandosListener m_acL;
+    
+    private javax.swing.JMenuBar menuBar;
+    
+    private class myKeyAdapter extends KeyAdapter {
+    		/* (non-Javadoc)
+		 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+		 */
+		public void keyReleased(KeyEvent arg0) {
+			System.out.println("Hola colega");
+			super.keyReleased(arg0);
+		}
+
+	}
+	private myKeyAdapter m_OrejaTeclado = new myKeyAdapter();
+    /** Button group for pan, zoom, and all exclusive tools */
+    private ButtonGroup myButtonGroup = new ButtonGroup();
+    private javax.swing.JMenuItem openMenuItem;
+    private javax.swing.JMenuItem exportMenuItem;
+    private javax.swing.JMenuItem pasteMenuItem;
+    private javax.swing.JMenuItem saveAsMenuItem;
+    private javax.swing.JMenuItem saveMenuItem;
+    private javax.swing.JMenu TemaMenu;
+    private javax.swing.JMenuItem verTabla;
+    private javax.swing.JMenu VistaMenu;
+    private JTextArea m_txt;
+    private JTextField m_txtCoords;
+    
+
+    SingleView() {
+    	m_ImageObserver = this;
+        setSize(640, 480);
+        initComponents();
+
+        // setExtendedState(MAXIMIZED_BOTH);
+        addWindowListener((WindowListener) this);
+        // m_Map.addMouseListener(this);
+        m_dlgInfo = new FInfoDialog();
+        // addMouseListener(this);
+        // addKeyListener((KeyListener) this);
+        addKeyListener(m_OrejaTeclado);
+        
+		LayerFactory.setDriversPath("D:/java/eclipse30/eclipse/workspace/Andami/gvSIG/extensiones/com.iver.cit.gvsig/drivers");        
+        // m_MapControl.addTool(MapControl.ZOOM_MAS);
+        // m_MapControl.addCoordsListener(this);
+        
+    }
+
+
+	public MapControl getMapControl()
+	{
+		return m_MapControl;
+	}
+	public MapControl getMapOverview()
+	{
+		return m_MapLoc;
+	} 
+	
+    public static void main(String[] args) {
+		try {
+			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());			
+		} catch (Exception e) {
+			System.out.println(UIManager.getCrossPlatformLookAndFeelClassName()); 
+		} 
+		PropertyConfigurator.configure(SingleView.class.getClassLoader()
+														 .getResource("log4j.properties"));
+
+		Locale loc = null;
+
+		if (args.length == 0) {
+			loc = Locale.getDefault();
+		} else {
+			loc = new Locale(args[0]);
+		}
+
+		Messages.init(loc);
+
+
+        SingleView testApp = new SingleView();
+
+        // testApp.getContentPane().add(elMapa);
+        testApp.show();
+        
+    }
+
+    /**
+     * Add the tools to the tools panel.
+     */
+    private void addTools(JToolBar inPanel, MapControl inDisplay) {
+        /* inPanel.setLayout(new GridBagLayout());
+        GridBagConstraints c = new GridBagConstraints();
+        c.fill = c.HORIZONTAL;
+        c.insets = new Insets(1,1,1,1);
+        c.weightx = 1;
+
+        // set the width of the panel.
+        inPanel.setPreferredSize(new Dimension(40,40));
+        inPanel.setMinimumSize(new Dimension(40,10));
+
+
+
+        c.gridy = 0;
+        c.gridx = 0; */
+    	
+    	inPanel.setLayout(new BorderLayout());
+    	
+    	JToolBar tempPanel = new JToolBar();
+    	
+        btn_FullExtent.setIcon(new javax.swing.ImageIcon(
+                "images/MapContents.png"));
+        btn_FullExtent.setActionCommand("ZOOM_TODO");
+        btn_FullExtent.addActionListener(m_acL);
+        tempPanel.add(btn_FullExtent);
+        
+        JButton  btnZoomPrevio = new JButton();
+        btnZoomPrevio.setIcon(new javax.swing.ImageIcon(
+		        "images/ZoomPrevio.png"));
+        btnZoomPrevio.setActionCommand("ZOOM_PREVIO");
+        btnZoomPrevio.addActionListener(m_acL);
+        tempPanel.add(btnZoomPrevio);
+        
+        tempPanel.add(new JToolBar.Separator(new java.awt.Dimension(16,16)));
+		// inPanel.add(new JToolBar.Separator());
+
+        // the select tool not that it does anything
+        // the zoom in tool
+        // c.gridy++;
+        // JRadioButton tempGISButton = new JRadioButton("Zoom In", � new ZoomInCommand(this));
+        // JRadioButton tempGISButton = new JRadioButton("Zoom In");
+        JToggleButton tempGISButton = new JToggleButton("Zoom por rect�ngulo");
+        tempGISButton.setBorder(null);
+        tempGISButton.setIcon(new javax.swing.ImageIcon("images/zoomIn.png"));
+
+        // tempGISButton.setSelectedIcon(new javax.swing.ImageIcon("images/zoomPrev.gif"));
+        // tempGISButton.setRolloverIcon(tempGISButton.getSelectedIcon());
+        tempGISButton.setRolloverEnabled(true);
+        tempGISButton.setToolTipText(tempGISButton.getText());
+        tempGISButton.setText("");
+        tempGISButton.setSelected(true);
+        tempGISButton.setActionCommand("ZOOM_MAS");
+        tempGISButton.addActionListener(m_acL);
+
+        //Listener de eventos de movimiento que pone las coordenadas del rat�n en la barra de estado
+        StatusBarListener sbl = new StatusBarListener(m_MapControl);
+
+        // Zoom por rect�ngulo
+        ZoomOutRightButtonListener zoil = new ZoomOutRightButtonListener(m_MapControl);
+        ZoomInListener zil = new ZoomInListener(m_MapControl);
+        m_MapControl.addMapTool("zoomIn", new Behavior[]{new RectangleBehavior(zil),
+        				new PointBehavior(zoil), new MouseMovementBehavior(sbl)});
+        
+        m_MapControl.pushTool("zoomIn"); // Por defecto
+        
+        //TODO: Antes funcionaba con esto
+       /*      ZoomInListenerImpl zili = new ZoomInListenerImpl(m_MapControl);
+            m_MapControl.setCursor(zili.getCursor());
+            m_MapControl.addMapTool("zoomrect",
+                    new RectangleBehavior(zili));
+            m_MapControl.setTool("zoomrect");
+            */ 
+        myButtonGroup.add(tempGISButton);
+
+        // inPanel.add(tempGISButton, c);
+        tempPanel.add(tempGISButton);
+
+        // the zoom out tool
+        // c.gridy++;
+        tempGISButton = new JToggleButton("Alejar"); //, new ZoomOutCommand(this));
+        tempGISButton.setBorder(null);
+        tempGISButton.setIcon(new javax.swing.ImageIcon("images/zoomOut.png"));
+        // Zoom out (pinchas y el mapa se centra y te muestra m�s).
+        // No es dibujando un rect�ngulo, es solo pinchando.
+
+        ZoomOutListenerImpl zoli = new ZoomOutListenerImpl(m_MapControl);
+        m_MapControl.addMapTool("zoomout", new PointBehavior(zoli));
+        m_MapControl.setCursor(zoli.getCursor());
+        
+        // pan
+
+        PanListenerImpl pli = new PanListenerImpl(m_MapControl);
+        m_MapControl.setCursor(pli.getCursor());
+        m_MapControl.addMapTool("pan", new MoveBehavior(pli));
+        
+        // info
+        //Info por punto
+        InfoListener il = new InfoListener(m_MapControl);
+        //il.setModel(modelo);
+        m_MapControl.addMapTool("info", new PointBehavior(il));
+        
+        //Selecci�n por rect�ngulo
+        RectangleSelectionListener rsl = new RectangleSelectionListener(m_MapControl);
+        m_MapControl.addMapTool("rectSelection",
+                new RectangleBehavior(rsl));        
+        
+        // tempGISButton.setSelectedIcon(getIcon("ZoomOutActive.png"));
+        // tempGISButton.setRolloverIcon(tempGISButton.getSelectedIcon());
+        // tempGISButton.setRolloverEnabled(true);
+        tempGISButton.setToolTipText(tempGISButton.getText());
+        tempGISButton.setText("");
+        tempGISButton.setActionCommand("ZOOM_MENOS");
+        tempGISButton.addActionListener(m_acL);
+
+        myButtonGroup.add(tempGISButton);
+
+        // inPanel.add(tempGISButton, c);
+        tempPanel.add(tempGISButton);
+
+        // The Pan Tool
+        // c.gridy++;
+        tempGISButton = new JToggleButton("Pan Around"); // , new PanCommand(this));
+        tempGISButton.setBorder(null);
+        tempGISButton.setIcon(new javax.swing.ImageIcon("images/pan.png")); // getIcon("PanInactive.png"));
+
+        tempGISButton.setToolTipText(tempGISButton.getText());
+        tempGISButton.setText("");
+        tempGISButton.setActionCommand("PAN");
+        tempGISButton.addActionListener(m_acL);
+
+        myButtonGroup.add(tempGISButton);
+        tempPanel.add(tempGISButton);
+
+        tempGISButton = new JToggleButton("Info"); // , new PanCommand(this));
+        tempGISButton.setBorder(null);
+        tempGISButton.setIcon(new javax.swing.ImageIcon("images/identify.png")); // getIcon("PanInactive.png"));
+        tempGISButton.setToolTipText(tempGISButton.getText());
+        tempGISButton.setText("");
+        tempGISButton.setActionCommand("INFO");
+        tempGISButton.addActionListener(m_acL);
+
+        myButtonGroup.add(tempGISButton);
+        tempPanel.add(tempGISButton);
+
+        tempGISButton = new JToggleButton("Selecci�n por rect�ngulo"); 
+        tempGISButton.setBorder(null);
+        tempGISButton.setIcon(new javax.swing.ImageIcon("images/Select.png")); 
+        tempGISButton.setToolTipText(tempGISButton.getText());
+        tempGISButton.setText("");
+        tempGISButton.setActionCommand("SELRECT");
+        tempGISButton.addActionListener(m_acL);
+
+        myButtonGroup.add(tempGISButton);
+        tempPanel.add(tempGISButton);
+        
+        
+        tempGISButton = new JToggleButton("Medir distancia"); // , new PanCommand(this));
+        tempGISButton.setBorder(null);
+        tempGISButton.setIcon(new javax.swing.ImageIcon("images/medir.png")); // getIcon("PanInactive.png"));
+        tempGISButton.setToolTipText(tempGISButton.getText());
+        tempGISButton.setText("");
+        tempGISButton.setActionCommand("MEDICION");
+        tempGISButton.addActionListener(m_acL);
+
+        myButtonGroup.add(tempGISButton);
+        tempPanel.add(tempGISButton);
+        
+        tempGISButton = new JToggleButton("Medir area"); // , new PanCommand(this));
+        tempGISButton.setBorder(null);
+        tempGISButton.setIcon(new javax.swing.ImageIcon("images/poligono16.png")); // getIcon("PanInactive.png"));
+        tempGISButton.setToolTipText(tempGISButton.getText());
+        tempGISButton.setText("");
+        tempGISButton.setActionCommand("MEDIRAREA");
+        tempGISButton.addActionListener(m_acL);
+
+        myButtonGroup.add(tempGISButton);
+        tempPanel.add(tempGISButton);
+        
+        
+
+        
+        inPanel.setRollover(true);
+
+        /* tempMenuButton = new GISMenuButton(tempEditNodesCommand, tempRadioButton);
+        tempEditNodesCommand.setButton(tempMenuButton);
+        tempMenuButton.initPanel();
+        inPanel.add(tempMenuButton, c); */
+
+        // Add a panel for the additional buttons.
+        m_txtCoords = new JTextField();
+        m_txtCoords.setPreferredSize(new Dimension(300,20));
+        
+        inPanel.add(tempPanel,BorderLayout.WEST);
+        inPanel.add(m_txtCoords, BorderLayout.EAST);
+
+        /* c.gridy++;
+        c.anchor = c.NORTH;
+        c.weighty = 1;
+        c.fill = c.HORIZONTAL;
+        inPanel.add(new JPanel(), c); */
+
+        //        inPanel.add(myAuxillaryButtonPanel, c);
+
+    }
+
+    /** Exit the Application */
+    private void exitForm(java.awt.event.WindowEvent evt) { //GEN-FIRST:event_exitForm
+        System.exit(0);
+    }
+
+    //GEN-LAST:event_exitForm
+    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) { //GEN-FIRST:event_exitMenuItemActionPerformed
+        System.exit(0);
+    }
+    
+	private void info(Point pScreen){
+		ViewPort vp = m_MapControl.getMapContext().getViewPort();
+		Point2D pReal = vp.toMapPoint(pScreen);
+
+		FLayer[] sel = m_MapControl.getMapContext().getLayers().getActives();
+
+		// Denro de queryByPoint tenemos que separar los registros que vienen asociados a una 
+		// capa o a otra. Supongo que lo correcto ser�a que montaramos un XML y usar el visor
+		// de XML que ha empezado Fernando.
+		// String strResul = m_MapControl.queryByPoint(pScreen,m_MapControl.toMapDistance(3),"");
+
+		JDialog dlg = new JDialog();
+		m_dlgInfo.setPreferredSize(m_dlgInfo.getSize());
+		m_dlgInfo.clearAll();
+				
+		// if (strResul == "" ) return;
+		String strResul;
+
+		for (int i=0; i< sel.length; i++)
+		{
+			FLayer laCapa = sel[i];
+
+			/* if (laCapa instanceof FLyrWMS)
+			{
+				strResul = laCapa.QueryByPoint(pScreen,m_MapControl.toMapDistance(3),"" );
+				// System.out.println("LWS: strResul="+strResul);
+				m_dlgInfo.addLayerInfo(laCapa.getName(), strResul);
+			}
+			else
+			{
+				strResul = laCapa.QueryByPoint(pReal,m_MapControl.toMapDistance(3),"" );
+				
+		        String[] arraySplit = null;
+		        arraySplit = strResul.split("\n");
+
+				if (arraySplit.length > 1)
+				{
+					// System.out.println("LWS: strResul="+strResul);
+					String descrip = "";
+					if (laCapa.getParentLayer() != null)
+						descrip = laCapa.getParentLayer().getName() + "_";
+					m_dlgInfo.addLayerInfo(descrip + laCapa.getName(), strResul);
+				}
+				
+			} */			
+		}
+		m_dlgInfo.refresh();
+		dlg.getContentPane().add(m_dlgInfo);
+		dlg.setModal(true);			
+		dlg.pack();
+		dlg.show();
+
+	}
+ 
+    //GEN-LAST:event_exitMenuItemActionPerformed
+    private void initComponents() { //GEN-BEGIN:initComponents
+        jToolBar1 = new javax.swing.JToolBar();
+        btn_FullExtent = new javax.swing.JButton();
+        jLabel1 = new javax.swing.JLabel();
+        jTextField1 = new javax.swing.JTextField();
+        
+        jPanel1 = new javax.swing.JPanel();
+        menuBar = new javax.swing.JMenuBar();
+        fileMenu = new javax.swing.JMenu();
+        openMenuItem = new javax.swing.JMenuItem();
+        saveMenuItem = new javax.swing.JMenuItem();
+        saveAsMenuItem = new javax.swing.JMenuItem();
+        exportMenuItem = new javax.swing.JMenuItem();
+        exitMenuItem = new javax.swing.JMenuItem();
+        editMenu = new javax.swing.JMenu();
+        cutMenuItem = new javax.swing.JMenuItem();
+        copyMenuItem = new javax.swing.JMenuItem();
+        pasteMenuItem = new javax.swing.JMenuItem();
+        deleteMenuItem = new javax.swing.JMenuItem();
+        helpMenu = new javax.swing.JMenu();
+        contentsMenuItem = new javax.swing.JMenuItem();
+        aboutMenuItem = new javax.swing.JMenuItem();
+
+        VistaMenu = new JMenu();
+        TemaMenu = new JMenu();
+        verTabla = new JMenuItem();
+        
+        m_txt = new JTextArea(0,0);
+		// jToolBar1.add(m_txt);
+		// m_txt.addKeyListener(m_OrejaTeclado);        
+
+        addWindowListener(new java.awt.event.WindowAdapter() {
+                public void windowClosing(java.awt.event.WindowEvent evt) {
+                    exitForm(evt);
+                }
+            });
+
+        jLabel1.setText("Escala:");
+
+        // jToolBar1.add(jLabel1);
+        jTextField1.setText("jTextField1");
+
+        // jToolBar1.add(jTextField1);
+
+		m_MapControl = new MapControl();
+
+		m_MapControl.getMapContext().getViewPort()
+				.setBackColor(new Color(220,220,255));
+		
+		m_TOC = new TOC();
+		m_TOC.setMapContext(m_MapControl.getMapContext());
+		m_MapLoc = new MapOverview(m_MapControl);
+		m_MapLoc.setPreferredSize(new Dimension(150,200));
+		JSplitPane tempMainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+		tempMainSplit.setPreferredSize(new Dimension(500, 300));
+		// jscrollTOC = new JScrollPane(m_TOC);
+
+		//jscrollTOC.setPreferredSize(new Dimension(200, 1000));
+		// jscrollTOC.setSize(300, 600);
+
+		//jscrollTOC.setAutoscrolls(true);
+		//jscrollTOC.setVisible(true);
+		// tempMainSplit.setLeftComponent(jscrollTOC);
+		
+		// Ponemos el localizador
+		JSplitPane tempSplitToc = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+		
+		tempSplitToc.setTopComponent(m_TOC);
+		tempSplitToc.setBottomComponent(m_MapLoc);
+		tempSplitToc.setResizeWeight(0.7);
+		tempMainSplit.setLeftComponent(tempSplitToc);
+
+		m_TOC.setVisible(true);
+		
+		tempMainSplit.setRightComponent(m_MapControl);
+
+		this.getContentPane().setLayout(new BorderLayout());
+
+		getContentPane().add(jToolBar1, java.awt.BorderLayout.NORTH);
+
+		// getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
+
+
+		this.getContentPane().add(tempMainSplit, BorderLayout.CENTER);
+
+
+        m_acL = new ComandosListener(m_MapControl, this);
+
+        fileMenu.setText("Fichero");
+        openMenuItem.setText("A�adir capa...");
+        openMenuItem.setActionCommand("ADD_LAYER");
+        openMenuItem.addActionListener(m_acL);
+        fileMenu.add(openMenuItem);
+
+		JMenuItem abrirEnMemoria = new JMenuItem(); 
+		abrirEnMemoria.setText("A�adir capa en memoria...");
+		abrirEnMemoria.setActionCommand("ADD_MEMORY_LAYER");
+		abrirEnMemoria.addActionListener(m_acL);
+		fileMenu.add(abrirEnMemoria);
+
+//		a submenu
+		JMenu abrirGT2 = new JMenu();
+		abrirGT2.setText("Abrir capa GT2");
+		
+		JMenuItem abrirGT2_Shp = new JMenuItem(); 
+		abrirGT2_Shp.setText("Shp");
+		abrirGT2_Shp.setActionCommand("ADD_GT2_SHP");
+		abrirGT2_Shp.addActionListener(m_acL);		
+		abrirGT2.add(abrirGT2_Shp);
+		
+		JMenuItem abrirGT2_PostGIS = new JMenuItem(); 
+		abrirGT2_PostGIS.setText("PostGIS");
+		abrirGT2_PostGIS.setActionCommand("ADD_GT2_POSTGIS");
+		abrirGT2_PostGIS.addActionListener(m_acL);		
+		abrirGT2.add(abrirGT2_PostGIS);
+
+		JMenuItem abrirGT2_ArcSDE = new JMenuItem(); 
+		abrirGT2_ArcSDE.setText("ArcSDE");
+		abrirGT2_ArcSDE.setActionCommand("ADD_GT2_ARCSDE");
+		abrirGT2_ArcSDE.addActionListener(m_acL);		
+		abrirGT2.add(abrirGT2_ArcSDE);
+		
+		fileMenu.add(abrirGT2);
+
+		fileMenu.addSeparator();
+	
+		JMenuItem prueba = new JMenuItem(); 
+		prueba.setText("Probar breaks");
+		prueba.setActionCommand("PRUEBA");
+		prueba.addActionListener(m_acL);
+		fileMenu.add(prueba);
+
+        /* saveMenuItem.setText("Guardar");
+         fileMenu.add(saveMenuItem);
+         saveAsMenuItem.setText("Guardar como ...");
+         fileMenu.add(saveAsMenuItem);
+         */
+        exportMenuItem.setText("Exportar vista a...");
+        exportMenuItem.setActionCommand("EXPORT");
+        exportMenuItem.addActionListener(m_acL);
+        fileMenu.add(exportMenuItem);
+
+        exitMenuItem.setText("Salir");
+        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent evt) {
+                    exitMenuItemActionPerformed(evt);
+                }
+            });
+
+        fileMenu.add(exitMenuItem);
+
+        menuBar.add(fileMenu);
+
+        /*editMenu.setText("Editar");
+         cutMenuItem.setText("Cortar");
+         editMenu.add(cutMenuItem);
+         copyMenuItem.setText("Copiar");
+         editMenu.add(copyMenuItem);
+         pasteMenuItem.setText("Pegar");
+         editMenu.add(pasteMenuItem);
+         deleteMenuItem.setText("Borrar");
+         editMenu.add(deleteMenuItem);
+         menuBar.add(editMenu);
+        */
+        VistaMenu.setText("Vista");
+        
+		JMenuItem mnuOpenLocator = new JMenuItem(); 
+		mnuOpenLocator.setText("Abrir localizador");
+		mnuOpenLocator.setActionCommand("OPEN_LOCATOR");
+		mnuOpenLocator.addActionListener(m_acL);
+		VistaMenu.add(mnuOpenLocator);
+        
+        menuBar.add(VistaMenu);
+
+        TemaMenu.setText("Tema");
+        verTabla.setText("Ver tabla del tema activo...");
+        verTabla.setActionCommand("VIEW_TABLE");
+        verTabla.addActionListener(m_acL);
+
+        TemaMenu.add(verTabla);
+        menuBar.add(TemaMenu);
+
+        helpMenu.setText("Ayuda");
+              contentsMenuItem.setText("Temas de Ayuda");
+        helpMenu.add(contentsMenuItem);
+
+        aboutMenuItem.setText("Acerca de...");
+        aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                JDialog dlg = new JDialog();
+                FPanelAbout panelAbout = new FPanelAbout();
+                panelAbout.setPreferredSize(panelAbout.getSize());                
+                dlg.getContentPane().add(panelAbout);
+                dlg.pack();
+                dlg.setResizable(false);
+                dlg.setModal(true);
+                dlg.show();
+            }
+        });
+        
+        helpMenu.add(aboutMenuItem);
+        menuBar.add(helpMenu);
+        
+        setJMenuBar(menuBar);
+
+
+		// m_TOC.refresh();
+
+
+        addTools(jToolBar1, m_MapControl);
+    }
+
+    //GEN-END:initComponents
+
+    /* (non-Javadoc)
+     * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+     */
+    /* public void mouseClicked(MouseEvent E) {
+        if (m_Map.m_Estado == FMap.INFO) {
+            if (m_Map.m_Layers.size() == 0) {
+                return;
+            }
+
+            Point pScreen = E.getPoint();
+            Point2D.Double pReal = m_Map.ToMapPoint(pScreen);
+            FLyrVect laCapa = m_TOC.getFirstLayerSelected(); // m_Mapa.GetLayer(0);
+            String strResul = laCapa.QueryByPoint(pReal, 10);
+
+            // System.out.println(pScreen);
+            // System.out.println(pReal);
+            System.out.println("strResul = " + strResul);
+
+            // DlgInfo dlgInfo = new DlgInfo(this, true);
+            m_dlgInfo.clearAll();
+            m_dlgInfo.addLayerInfo(laCapa.m_LayerName, strResul);
+            m_dlgInfo.refresh();
+            m_dlgInfo.show();
+        }
+    } */
+    
+	public void repaintMap() {
+		m_MapControl.drawMap(false);
+		repaint();
+		// m_Map.refresh();
+	}
+
+
+
+    public void windowActivated(WindowEvent e) {
+    }
+
+    public void windowClosed(WindowEvent e) {
+        System.out.println("Salgo");
+    }
+
+    /**
+     * class for handling messages from the window expecially the window closing event to end
+     * the process when the window closes.
+     */
+    public void windowClosing(WindowEvent e) {
+        System.out.println("Salgo");
+        System.exit(0);
+    }
+
+    public void windowDeactivated(WindowEvent e) {
+    }
+
+    public void windowDeiconified(WindowEvent e) {
+    }
+
+    public void windowIconified(WindowEvent e) {
+    }
+
+    public void windowOpened(WindowEvent e) {
+    }
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.opensig.gui.IView#getTOC()
+	 */
+	/*public IToc getTOC() {
+		return m_TOC;
+	} */
+
+	public void showCoords(double x, double y)
+	{
+		m_txtCoords.setText("x= " + x + " y= " + y);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.opensig.gui.IView#getViewName()
+	 */
+	public String getViewName() {		
+		return "Ejemplo de Visor sencillo";
+	}
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.opensig.gui.IView#setViewName(java.lang.String)
+	 */
+	public void setViewName(String viewName) {
+		m_Name = viewName;
+		
+	}
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.ICoordsListener#coordsChanged(double, double)
+	 */
+	public void coordsChanged(double x, double y) {
+		showCoords(x, y);
+		
+	}
+
+
+
+	public TOC getTOC() {
+		return m_TOC;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SingleView.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/PruebasGT2.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/PruebasGT2.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/PruebasGT2.java	(revision 1648)
@@ -0,0 +1,225 @@
+/*
+ * Created on 22-dic-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.DEMO;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import java.net.URL;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+
+import org.geotools.data.DataSourceException;
+import org.geotools.data.DataStore;
+import org.geotools.data.FeatureSource;
+// import org.geotools.data.arcsde.ArcSDEDataStoreFactory;
+import org.geotools.map.DefaultMapLayer;
+import org.geotools.map.MapLayer;
+import org.geotools.styling.Style;
+import org.geotools.styling.StyleBuilder;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.layers.CancelationException;
+import com.iver.cit.gvsig.fmap.layers.FLyrGT2;
+import com.vividsolutions.jts.geom.LineString;
+import com.vividsolutions.jts.geom.MultiLineString;
+import com.vividsolutions.jts.geom.MultiPoint;
+import com.vividsolutions.jts.geom.Point;
+/* import org.geotools.data.postgis.PostgisDataStoreFactory;
+import org.geotools.data.shapefile.ShapefileDataStore; */
+
+/**
+ * Pruebas de capas GT2 (ArcSDE, etc), hechas por Fran, sacadas del
+ * CommandListener
+ * @author Luis W. Sevilla (sevilla_lui@gva.es)
+ */
+public class PruebasGT2 implements ActionListener {
+    // static PostgisDataStoreFactory postGisFactory = new PostgisDataStoreFactory();
+    // static ArcSDEDataStoreFactory arcSdeFactory = new ArcSDEDataStoreFactory();
+
+    Map remote;
+    private FMap m_Mapa;
+    
+    /**
+    *
+    */
+   protected void addLayerGT2_Shp() {
+       /* JFileChooser fileChooser = new JFileChooser(); // lastFolder);
+       fileChooser.addChoosableFileFilter(new SimpleFileFilter("shp", "Shapefile (*.shp)"));
+
+       int result = fileChooser.showOpenDialog(theView);
+
+       if (result == JFileChooser.APPROVE_OPTION) {
+           File file = fileChooser.getSelectedFile();
+           // lastFolder = file.getParentFile();
+
+           try {
+            // Load the file
+           	URL url = file.toURL();
+
+            DataStore store;
+            
+            // Para shapes
+            store = new ShapefileDataStore(url);
+            
+            loadLayer(store, store.getTypeNames()[0]);
+           } catch (Throwable t) {
+               JOptionPane.showMessageDialog(null, "An error occurred while loading the file",
+                   "Demo GT2", JOptionPane.ERROR_MESSAGE);
+               t.printStackTrace();
+           }
+       } */
+   }
+   protected void addLayerGT2_PostGIS()
+   {
+	    /* remote = new HashMap();
+	    remote.put("dbtype","postgis");        
+	    remote.put("host","213.172.37.189"); //Jos� Miguel
+	    remote.put("port", new Integer(5432));
+	    remote.put("database", "geomarketing");
+	    remote.put("user", "Geomarketing");
+	    remote.put("passwd", "geomarketing");
+	    remote.put("charset", "");
+	    remote.put("namespace", "");
+	    
+	    DataStore store;
+		try {
+			store = postGisFactory.createDataStore(remote);
+			loadLayer(store, "ferrocarril");
+			
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} */
+		
+   	
+   }
+   /**
+    * Load the data from the specified dataStore and construct a {@linkPlain Context context} with
+    * a default style.
+    *
+    * @param url The url of the shapefile to load.
+    * @param name DOCUMENT ME!
+    *
+    * @throws IOException is a I/O error occured.
+    * @throws DataSourceException if an error occured while reading the data source.
+    * @throws FileNotFoundException DOCUMENT ME!
+    */
+   protected void loadLayer(DataStore store, String layerName)
+       throws IOException, DataSourceException {
+       final FeatureSource features = store.getFeatureSource(layerName);
+
+       // Create the style
+       final StyleBuilder builder = new StyleBuilder();
+       final Style style;
+       Class geometryClass = features.getSchema().getDefaultGeometry().getType();
+
+       if (LineString.class.isAssignableFrom(geometryClass)
+               || MultiLineString.class.isAssignableFrom(geometryClass)) {
+           style = builder.createStyle(builder.createLineSymbolizer());
+       } else if (Point.class.isAssignableFrom(geometryClass)
+               || MultiPoint.class.isAssignableFrom(geometryClass)) {
+           style = builder.createStyle(builder.createPointSymbolizer());
+       } else {
+           style = builder.createStyle(builder.createPolygonSymbolizer(Color.ORANGE, Color.BLACK, 1));
+       }
+
+       final MapLayer layer = new DefaultMapLayer(features, style);
+       layer.setTitle(layerName);
+       
+       FLyrGT2 lyrGT2 = new FLyrGT2(layer);
+       try {
+			m_Mapa.getLayers().addLayer(lyrGT2);
+		} catch (CancelationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+       
+   }
+   
+   protected void addLayerGT2_ArcSDE()
+   {
+	    remote = new HashMap();
+	    remote.put("dbtype","arcsde");        
+	    remote.put("server","192.168.0.165"); //Jos� Miguel
+	    remote.put("port", new Integer(5151));
+	    remote.put("instance", "sde");
+	    remote.put("user", "sde");
+	    remote.put("password", "aquilina");
+	    
+	    
+	    DataStore store;
+		/* try {
+			store = arcSdeFactory.createDataStore(remote);
+			loadLayer(store, "SDE.VIAS");
+			
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} */
+		
+   	
+   }
+
+   public void setMapContext(FMap map)
+   {
+   		m_Mapa = map;
+   }
+	public void actionPerformed(ActionEvent e) {
+		if (e.getActionCommand() == "ADD_GT2_POSTGIS") {            
+			addLayerGT2_PostGIS();
+		}
+		if (e.getActionCommand() == "ADD_GT2_SHP") {            
+		    addLayerGT2_Shp();
+		}
+		if (e.getActionCommand() == "ADD_GT2_ARCSDE") {            
+		    addLayerGT2_ArcSDE();
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/PruebasGT2.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SimpleFileFilter.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SimpleFileFilter.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SimpleFileFilter.java	(revision 1648)
@@ -0,0 +1,92 @@
+/* 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.DEMO;
+
+import java.io.File;
+import javax.swing.filechooser.FileFilter;
+
+
+/**
+ * A simple file filter implementation that allow to specify one or more file
+ * extensions
+ *
+ * @author wolf
+ */
+public class SimpleFileFilter extends FileFilter implements java.io.FileFilter {
+    String[] extensions;
+    String description;
+
+    public SimpleFileFilter(String extension, String description) {
+        this.extensions = new String[] { extension };
+        this.description = description;
+    }
+
+    public SimpleFileFilter(String[] extensions, String description) {
+        this.extensions = extensions;
+        this.description = description;
+    }
+
+    /**
+     * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
+     */
+    public boolean accept(File f) {
+        if (f.isDirectory()) {
+            return true;
+        }
+
+        String extension = FileUtils.getFileExtension(f);
+
+        for (int i = 0; i < extensions.length; i++) {
+            if (extension.equals(extensions[i])) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * @see javax.swing.filechooser.FileFilter#getDescription()
+     */
+    public String getDescription() {
+        return description;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/SimpleFileFilter.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/FileUtils.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/FileUtils.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/FileUtils.java	(revision 1648)
@@ -0,0 +1,67 @@
+/* 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.DEMO;
+
+import java.io.File;
+
+
+/**
+ * Utility class that contains some useful function related
+ * to file management
+ *
+ * @author wolf
+ */
+public class FileUtils {
+    private FileUtils() {
+    }
+
+    public static String getFileExtension(File f) {
+        String fileName = f.getName();
+        int extensionStart = fileName.lastIndexOf('.');
+        String extension = "";
+
+        if (extensionStart >= 0) {
+            extension = fileName.substring(extensionStart + 1);
+        }
+
+        return extension;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/FileUtils.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/Export.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/Export.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/Export.java	(revision 1648)
@@ -0,0 +1,159 @@
+
+/* 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.DEMO;
+
+import java.awt.FileDialog;
+import java.awt.Image;
+import java.io.File;
+import java.io.FileOutputStream;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.sun.jimi.core.Jimi;
+import com.sun.jimi.core.raster.JimiRasterImage;
+
+/**
+ * @author VCN
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+
+public class Export
+{
+	private MapControl m_MapControl;
+	private FileDialog fd;
+	private Image tempImage;
+	Export(MapControl fm)
+	{
+		m_MapControl=fm;
+		JFileChooser tempChooser = new JFileChooser();
+
+		tempChooser.addChoosableFileFilter(new FileFilter() {
+				public boolean accept(File f) {
+					String extension = "";
+					if (f.isDirectory()) return true;
+					int i = f.getName().lastIndexOf('.');
+					if (i > 0) extension = f.getName().substring(i + 1).toLowerCase();
+					if (extension.equals("bmp")) return true;
+					else return false;
+				}
+				public String getDescription() {
+					return "Achivos BMP (*.bmp)";
+				}
+			});
+			
+	tempChooser.addChoosableFileFilter(new FileFilter() {
+			   public boolean accept(File f) {
+				   String extension = "";
+				   if (f.isDirectory()) return true;
+				   int i = f.getName().lastIndexOf('.');
+				   if (i > 0) extension = f.getName().substring(i + 1).toLowerCase();
+				   if (extension.equals("jpg") || extension.equals("jpeg")) return true;
+				   else return false;
+			   }
+			   public String getDescription() {
+				   return "Archivos JPEG (*.jpg; *.jpeg)";
+			   }
+		   });
+		   
+	tempChooser.addChoosableFileFilter(new FileFilter() {
+				public boolean accept(File f) {
+					String extension = "";
+					if (f.isDirectory()) return true;
+					int i = f.getName().lastIndexOf('.');
+					if (i > 0) extension = f.getName().substring(i + 1).toLowerCase();
+					if (extension.equals("png")) return true;
+					else return false;
+				}
+				public String getDescription() {
+					return "Archivos PNG (*.png)";
+				}
+			});
+
+	tempChooser.showSaveDialog(m_MapControl);
+	
+	File	tempFile = tempChooser.getSelectedFile();
+	if (tempFile != null){
+		try{
+		
+				tempImage = null;
+ 				tempImage = m_MapControl.getImage();
+				JimiRasterImage jrf = Jimi.createRasterImage(tempImage.getSource());
+				String tempName = tempFile.getName().toUpperCase().trim();
+				String extension="";
+		
+				if ((tempName.endsWith(".JPG")) || (tempName.endsWith(".JPEG")) || (tempChooser.getFileFilter().getDescription().toString()=="Archivos JPEG (*.jpg; *.jpeg)")){
+					if (!(tempName.endsWith(".JPG")) || (tempName.endsWith(".JPEG"))) extension=".jpg";	
+					
+					File f1=new File(tempFile.getParent(), tempFile.getName() + extension);
+					tempFile.renameTo(f1);
+					System.out.println(tempFile.getName() + ".jpg");
+					FileOutputStream fout = new FileOutputStream(f1);
+					Jimi.putImage("image/jpg",jrf,fout);
+					fout.close();
+				}
+				else if ((tempName.endsWith(".PNG")) || (tempChooser.getFileFilter().getDescription().toString()=="Archivos PNG (*.png)")){
+					if (!(tempName.endsWith(".PNG"))) extension=".png";
+					File f2=new File(tempFile.getParent(), tempFile.getName() + extension);
+					tempFile.renameTo(f2);
+					System.out.println(tempFile.getName() + ".png");
+					FileOutputStream fout = new FileOutputStream(f2);
+					Jimi.putImage("image/png",jrf,fout);
+					fout.close();
+				}
+				else if ((tempName.endsWith(".BMP")) || (tempChooser.getFileFilter().getDescription().toString()=="Achivos BMP (*.bmp)")){
+					if (!(tempName.endsWith(".BMP"))) extension=".bmp";
+					File f3=new File(tempFile.getParent(), tempFile.getName() + extension);
+					tempFile.renameTo(f3);
+					System.out.println(tempFile.getName() + ".bmp");
+					FileOutputStream fout = new FileOutputStream(f3);
+					Jimi.putImage("image/bmp",jrf,fout);
+					fout.close();
+				}
+		}catch (Exception e){System.out.println("Exception   "+e);}
+	}
+  }
+//>>>>>>> 1.2
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/DEMO/Export.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FontChooser.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FontChooser.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FontChooser.java	(revision 1648)
@@ -0,0 +1,646 @@
+/*
+ * Created on 02-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.gui.Dialogs;
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+
+import java.awt.Font;
+import java.awt.GraphicsEnvironment;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.awt.event.KeyEvent;
+import java.util.StringTokenizer;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+
+/**
+ * Based on FontChooser by Janos Szatmary. Posted on the Sun Java forums.
+ *
+ * Szatmary, Janos. "A FontChooser Class (source included)." April 2001.
+ * Available from http://forum.java.sun.com/thread.jsp?forum=57&thread=124810.
+ * Internet; accessed 6 November 2002.
+ *
+*/
+public class FontChooser extends JPanel implements View{
+    private String sampleText = "The quick brown fox jumped over the lazy dog.";
+    String[] styleList = new String[] { PluginServices.getText(this,"Plain"),
+    		PluginServices.getText(this,"Bold"), PluginServices.getText(this,"Italic") };
+    String[] sizeList = new String[] {
+            "2", "4", "6", "8", "10", "12", "14", "16", "18", "20", "22", "24",
+            "30", "36", "48", "72"
+        };
+    String currentFont = null;
+    int currentStyle = -1;
+    int currentSize = -1;
+    public boolean ok = false;
+
+    // Variables declaration - do not modify
+    private javax.swing.JPanel jPanel3;
+    private javax.swing.JTextField jFont;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JList jFontList;
+    private javax.swing.JPanel jPanel4;
+    private javax.swing.JTextField jStyle;
+    private javax.swing.JScrollPane jScrollPane2;
+    private javax.swing.JList jStyleList;
+    private javax.swing.JPanel jPanel5;
+    private javax.swing.JTextField jSize;
+    private javax.swing.JScrollPane jScrollPane3;
+    private javax.swing.JList jSizeList;
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JScrollPane jScrollPane4;
+    private javax.swing.JTextArea jSample;
+    private javax.swing.JPanel jButtons;
+    private javax.swing.JButton jOk;
+    private javax.swing.JButton jCancel;
+    private javax.swing.JLabel jLabel6;
+	private String m_title;
+	/* ------------------------------------------------------------- */
+    private FontChooser() {
+        //super(parent, modal);
+        jbInit();
+        setListValues(jFontList,
+            GraphicsEnvironment.getLocalGraphicsEnvironment()
+                               .getAvailableFontFamilyNames());
+        setListValues(jStyleList, styleList);
+        setListValues(jSizeList, sizeList);
+        setCurrentFont(jSample.getFont());
+       // pack();
+    }
+
+    private FontChooser(Font font) {
+        this();
+        setCurrentFont(font);
+    }
+
+    /* ------------------------------------------------------------- */
+    private void setListValues(JList list, String[] values) {
+        if (list.getModel() instanceof DefaultListModel) {
+            DefaultListModel model = (DefaultListModel) list.getModel();
+            model.removeAllElements();
+
+            for (int j = 0; j < values.length; j++) {
+                model.addElement(values[j]);
+            }
+        }
+    }
+
+    /* ------------------------------------------------------------- */
+    private void setSampleFont() {
+        if ((currentFont != null) && (currentStyle >= 0) && (currentSize > 0)) {
+            jSample.setFont(new Font(currentFont, currentStyle, currentSize));
+        }
+    }
+
+    private String styleToString(int style) {
+        String str = "";
+
+        if ((style & Font.BOLD) == Font.BOLD) {
+            if (str.length() > 0) {
+                str += ",";
+            }
+
+            str += PluginServices.getText(this,"Bold");
+        }
+
+        if ((style & Font.ITALIC) == Font.ITALIC) {
+            if (str.length() > 0) {
+                str += ",";
+            }
+
+            str += PluginServices.getText(this,"Italic");
+        }
+
+        if ((str.length() <= 0) && ((style & Font.PLAIN) == Font.PLAIN)) {
+            str = PluginServices.getText(this,"Plain");
+        }
+
+        return str;
+    }
+
+    /* ------------------------------------------------------------- */
+    public Font getCurrentFont() {
+        return jSample.getFont();
+    }
+
+    /* ------------------------------------------------------------- */
+    public void setCurrentFont(Font font) {
+        if (font == null) {
+            font = jSample.getFont();
+        }
+		
+        jFont.setText(font.getName());
+        jFontActionPerformed(null);
+
+        jStyle.setText(styleToString(font.getStyle()));
+        jStyleActionPerformed(null);
+
+        jSize.setText(Integer.toString(font.getSize()));
+        jSizeActionPerformed(null);
+    }
+
+    /* ------------------------------------------------------------- */
+    public static Font showDialog(String title, Font font) {
+        FontChooser dialog = new FontChooser(font);
+        PluginServices.getMDIManager().addView(dialog);
+        /*Point p1 = parent.getLocation();
+        Dimension d1 = parent.getSize();
+        Dimension d2 = dialog.getSize();
+
+        int x = p1.x + ((d1.width - d2.width) / 2);
+        int y = p1.y + ((d1.height - d2.height) / 2);
+
+        if (x < 0) {
+            x = 0;
+        }
+
+        if (y < 0) {
+            y = 0;
+        }
+*/
+        if (title != null) {
+            dialog.m_title=title;
+        }
+
+      //  dialog.setLocation(x, y);
+      //  dialog.setVisible(true);
+		
+        Font newfont = null;
+
+        if (dialog.ok) {
+            newfont = dialog.getCurrentFont();
+        }
+
+        //dialog.dispose();
+
+        return newfont;
+    }
+
+    /** This method is called from within the constructor to
+    * initialize the form.
+    * WARNING: Do NOT modify this code. The content of this
+    method is
+    * always regenerated by the FormEditor.
+    */
+    private void jbInit() {
+        jPanel3 = new javax.swing.JPanel();
+        jFont = new javax.swing.JTextField();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        jFontList = new javax.swing.JList();
+        jPanel4 = new javax.swing.JPanel();
+        jStyle = new javax.swing.JTextField();
+        jScrollPane2 = new javax.swing.JScrollPane();
+        jStyleList = new javax.swing.JList();
+        jPanel5 = new javax.swing.JPanel();
+        jSize = new javax.swing.JTextField();
+        jScrollPane3 = new javax.swing.JScrollPane();
+        jSizeList = new javax.swing.JList();
+        jPanel1 = new javax.swing.JPanel();
+        jScrollPane4 = new javax.swing.JScrollPane();
+        jScrollPane4.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        jScrollPane4.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
+        jSample = new javax.swing.JTextArea();
+        jSample.setEditable(false);
+        jButtons = new javax.swing.JPanel();
+        jOk = new javax.swing.JButton();
+        jCancel = new javax.swing.JButton();
+        jLabel6 = new javax.swing.JLabel();
+        setLayout(new java.awt.GridBagLayout());
+
+        java.awt.GridBagConstraints gridBagConstraints1;
+        //setTitle("Font Chooser");
+        /*addWindowListener(new java.awt.event.WindowAdapter() {
+                public void windowClosing(java.awt.event.WindowEvent evt) {
+                    closeDialog(evt);
+                }
+            });
+*/
+        jPanel3.setLayout(new java.awt.GridBagLayout());
+
+        java.awt.GridBagConstraints gridBagConstraints2;
+        jPanel3.setBorder(new javax.swing.border.TitledBorder(
+                new javax.swing.border.EtchedBorder(), " "+PluginServices.getText(this,"Font")+" "));
+
+        jFont.setEditable(false);
+        jFont.setColumns(24);
+        jFont.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent evt) {
+                    jFontActionPerformed(evt);
+                }
+            });
+        gridBagConstraints2 = new java.awt.GridBagConstraints();
+        gridBagConstraints2.gridwidth = 0;
+        gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        gridBagConstraints2.insets = new java.awt.Insets(0, 3, 0, 3);
+        gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;
+        gridBagConstraints2.weightx = 1.0;
+        jStyle.setEditable(false);
+        jPanel3.add(jFont, gridBagConstraints2);
+
+        jFontList.setModel(new DefaultListModel());
+        jFontList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+        jFontList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+                public void valueChanged(
+                    javax.swing.event.ListSelectionEvent evt) {
+                    jFontListValueChanged(evt);
+                }
+            });
+        jScrollPane1.setViewportView(jFontList);
+
+        gridBagConstraints2 = new java.awt.GridBagConstraints();
+        gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints2.insets = new java.awt.Insets(3, 3, 3, 3);
+        gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;
+        gridBagConstraints2.weightx = 1.0;
+        gridBagConstraints2.weighty = 1.0;
+        jPanel3.add(jScrollPane1, gridBagConstraints2);
+
+        gridBagConstraints1 = new java.awt.GridBagConstraints();
+        gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints1.insets = new java.awt.Insets(5, 5, 0, 0);
+        gridBagConstraints1.weightx = 0.5;
+        gridBagConstraints1.weighty = 1.0;
+        add(jPanel3, gridBagConstraints1);
+
+        jPanel4.setLayout(new java.awt.GridBagLayout());
+
+        java.awt.GridBagConstraints gridBagConstraints3;
+        jPanel4.setBorder(new javax.swing.border.TitledBorder(
+                new javax.swing.border.EtchedBorder(), " "+PluginServices.getText(this,"Style")+" "));
+
+        jStyle.setColumns(18);
+        jStyle.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent evt) {
+                    jStyleActionPerformed(evt);
+                }
+            });
+        gridBagConstraints3 = new java.awt.GridBagConstraints();
+        gridBagConstraints3.gridwidth = 0;
+        gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        gridBagConstraints3.insets = new java.awt.Insets(0, 3, 0, 3);
+        gridBagConstraints3.anchor = java.awt.GridBagConstraints.NORTHWEST;
+        gridBagConstraints3.weightx = 1.0;
+        jPanel4.add(jStyle, gridBagConstraints3);
+
+        jStyleList.setModel(new DefaultListModel());
+        jStyleList.setVisibleRowCount(4);
+        jStyleList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+                public void valueChanged(
+                    javax.swing.event.ListSelectionEvent evt) {
+                    jStyleListValueChanged(evt);
+                }
+            });
+        jScrollPane2.setViewportView(jStyleList);
+
+        gridBagConstraints3 = new java.awt.GridBagConstraints();
+        gridBagConstraints3.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints3.insets = new java.awt.Insets(3, 3, 3, 3);
+        gridBagConstraints3.anchor = java.awt.GridBagConstraints.NORTHWEST;
+        gridBagConstraints3.weightx = 0.5;
+        gridBagConstraints3.weighty = 1.0;
+        jPanel4.add(jScrollPane2, gridBagConstraints3);
+
+        gridBagConstraints1 = new java.awt.GridBagConstraints();
+        gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints1.insets = new java.awt.Insets(5, 5, 0, 0);
+        gridBagConstraints1.weightx = 0.375;
+        gridBagConstraints1.weighty = 1.0;
+        add(jPanel4, gridBagConstraints1);
+
+        jPanel5.setLayout(new java.awt.GridBagLayout());
+
+        java.awt.GridBagConstraints gridBagConstraints4;
+        jPanel5.setBorder(new javax.swing.border.TitledBorder(
+                new javax.swing.border.EtchedBorder(), " "+PluginServices.getText(this,"Size")+" "));
+
+        jSize.setColumns(6);
+        jSize.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent evt) {
+                    jSizeActionPerformed(evt);
+                }
+            });
+        gridBagConstraints4 = new java.awt.GridBagConstraints();
+        gridBagConstraints4.gridwidth = 0;
+        gridBagConstraints4.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        gridBagConstraints4.insets = new java.awt.Insets(0, 3, 0, 3);
+        gridBagConstraints4.anchor = java.awt.GridBagConstraints.NORTHWEST;
+        gridBagConstraints4.weightx = 1.0;
+        jPanel5.add(jSize, gridBagConstraints4);
+
+        jSizeList.setModel(new DefaultListModel());
+        jSizeList.setVisibleRowCount(4);
+        jSizeList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+        jSizeList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+                public void valueChanged(
+                    javax.swing.event.ListSelectionEvent evt) {
+                    jSizeListValueChanged(evt);
+                }
+            });
+        jScrollPane3.setViewportView(jSizeList);
+
+        gridBagConstraints4 = new java.awt.GridBagConstraints();
+        gridBagConstraints4.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints4.insets = new java.awt.Insets(3, 3, 3, 3);
+        gridBagConstraints4.anchor = java.awt.GridBagConstraints.NORTHWEST;
+        gridBagConstraints4.weightx = 0.25;
+        gridBagConstraints4.weighty = 1.0;
+        jPanel5.add(jScrollPane3, gridBagConstraints4);
+
+        gridBagConstraints1 = new java.awt.GridBagConstraints();
+        gridBagConstraints1.gridwidth = 0;
+        gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints1.insets = new java.awt.Insets(5, 5, 0, 5);
+        gridBagConstraints1.weightx = 0.125;
+        gridBagConstraints1.weighty = 1.0;
+
+        //    getContentPane().add(jPanel5, gridBagConstraints1);
+        jPanel1.setLayout(new java.awt.GridBagLayout());
+
+        java.awt.GridBagConstraints gridBagConstraints5;
+        jPanel1.setBorder(new javax.swing.border.TitledBorder(
+                new javax.swing.border.EtchedBorder(), " "+PluginServices.getText(this,"Sample")+" "));
+
+        jSample.setWrapStyleWord(true);
+        jSample.setLineWrap(true);
+        jSample.setColumns(20);
+        jSample.setRows(3);
+        jSample.setText(sampleText);
+        jScrollPane4.setViewportView(jSample);
+
+        gridBagConstraints5 = new java.awt.GridBagConstraints();
+        gridBagConstraints5.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints5.insets = new java.awt.Insets(0, 3, 3, 3);
+        gridBagConstraints5.weightx = 1.0;
+        gridBagConstraints5.weighty = 1.0;
+        jPanel1.add(jScrollPane4, gridBagConstraints5);
+
+        gridBagConstraints1 = new java.awt.GridBagConstraints();
+        gridBagConstraints1.gridwidth = 0;
+        gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints1.insets = new java.awt.Insets(0, 5, 0, 5);
+        gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
+        gridBagConstraints1.weightx = 1.0;
+        add(jPanel1,
+            new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0,
+                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+                new Insets(0, 3, 3, 3), 0, 0));
+
+        jButtons.setLayout(new java.awt.GridBagLayout());
+
+        jOk.setMnemonic(KeyEvent.VK_O);
+        jOk.setText(PluginServices.getText(this,"Aceptar"));
+        jOk.setRequestFocusEnabled(false);
+        jOk.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent evt) {
+                    jOkActionPerformed(evt);
+                }
+            });
+        jButtons.add(jOk,
+            new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.WEST, GridBagConstraints.NONE,
+                new Insets(5, 5, 5, 0), 0, 0));
+
+        jCancel.setMnemonic(KeyEvent.VK_C);
+        jCancel.setText(PluginServices.getText(this,"Cancelar"));
+        jCancel.setRequestFocusEnabled(false);
+        jCancel.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent evt) {
+                    jCancelActionPerformed(evt);
+                }
+            });
+
+        jButtons.add(jCancel,
+            new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.WEST, GridBagConstraints.NONE,
+                new Insets(5, 5, 5, 5), 0, 0));
+
+        gridBagConstraints1 = new java.awt.GridBagConstraints();
+        gridBagConstraints1.gridwidth = 0;
+        gridBagConstraints1.anchor = java.awt.GridBagConstraints.SOUTHWEST;
+        gridBagConstraints1.weightx = 1.0;
+        add(jButtons,
+            new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
+                GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE,
+                new Insets(0, 0, 0, 0), 0, 0));
+    }
+
+    private void jCancelActionPerformed(java.awt.event.ActionEvent evt) {
+        // Add your handling code here:
+    	PluginServices.getMDIManager().closeView(FontChooser.this);
+    }
+
+    private void jOkActionPerformed(java.awt.event.ActionEvent evt) {
+        // Add your handling code here:
+        ok = true;
+        PluginServices.getMDIManager().closeView(FontChooser.this);
+    }
+
+    private void jSizeActionPerformed(java.awt.event.ActionEvent evt) {
+        // Add your handling code here:
+        int size = 0;
+
+        try {
+            size = Integer.parseInt(jSize.getText());
+        } catch (Exception e) {
+        }
+
+        if (size > 0) {
+            currentSize = size;
+            setSampleFont();
+        }
+    }
+
+    private void jStyleActionPerformed(java.awt.event.ActionEvent evt) {
+        // Add your handling code here:
+        StringTokenizer st = new StringTokenizer(jStyle.getText(), ",");
+        int style = 0;
+
+        while (st.hasMoreTokens()) {
+            String str = st.nextToken().trim();
+
+            if (str.equalsIgnoreCase(PluginServices.getText(this,"Plain"))) {
+                style |= Font.PLAIN;
+            } else if (str.equalsIgnoreCase(PluginServices.getText(this,"Bold"))) {
+                style |= Font.BOLD;
+            } else if (str.equalsIgnoreCase(PluginServices.getText(this,"Italic"))) {
+                style |= Font.ITALIC;
+            }
+        }
+
+        if (style >= 0) {
+            currentStyle = style;
+            setSampleFont();
+        }
+    }
+
+    private void jFontActionPerformed(java.awt.event.ActionEvent evt) {
+        // Add your handling code here:
+        DefaultListModel model = (DefaultListModel) jFontList.getModel();
+
+        if (model.indexOf(jFont.getText()) >= 0) {
+            currentFont = jFont.getText();
+            setSampleFont();
+        }
+    }
+
+    private void jStyleListValueChanged(
+        javax.swing.event.ListSelectionEvent evt) {
+        // Add your handling code here:
+        String str = new String();
+        Object[] values = jStyleList.getSelectedValues();
+
+        if (values.length > 0) {
+            int j;
+
+            for (j = 0; j < values.length; j++) {
+                String s = (String) values[j];
+
+                if (s.equalsIgnoreCase(PluginServices.getText(this,"Plain"))) {
+                    str = PluginServices.getText(this,"Plain");
+
+                    break;
+                }
+
+                if (str.length() > 0) {
+                    str += ",";
+                }
+
+                str += (String) values[j];
+            }
+        } else {
+            str = styleToString(currentStyle);
+        }
+
+        jStyle.setText(str);
+        jStyleActionPerformed(null);
+    }
+
+    private void jSizeListValueChanged(javax.swing.event.ListSelectionEvent evt) {
+        // Add your handling code here:
+        String str = (String) jSizeList.getSelectedValue();
+
+        if ((str == null) || (str.length() <= 0)) {
+            str = Integer.toString(currentSize);
+        }
+
+        jSize.setText(str);
+        jSizeActionPerformed(null);
+    }
+
+    private void jFontListValueChanged(javax.swing.event.ListSelectionEvent evt) {
+        // Add your handling code here:
+        String str = (String) jFontList.getSelectedValue();
+
+        if ((str == null) || (str.length() <= 0)) {
+            str = currentFont;
+        }
+
+        jFont.setText(str);
+        jFontActionPerformed(null);
+    }
+
+   
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+public ViewInfo getViewInfo() {
+	ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setWidth(350);
+		m_viewinfo.setHeight(250);
+		//vi.setResizable(false);
+		m_viewinfo.setTitle(PluginServices.getText(this,"Elegir_Fuente"));
+	
+		return m_viewinfo;
+	}
+
+/**
+ * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+ */
+public void viewActivated() {
+}
+
+    // End of variables declaration
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FontChooser.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/CSSelectionDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/CSSelectionDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/CSSelectionDialog.java	(revision 1648)
@@ -0,0 +1,73 @@
+/*
+ * Created on 26-ene-2005
+ */
+package com.iver.cit.gvsig.gui.Dialogs;
+
+import org.cresques.cts.IProjection;
+import org.cresques.ui.cts.CSSelectionDialogPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+/**
+ * @author Luis W. Sevilla (sevilla_lui@gva.es)
+ */
+public class CSSelectionDialog
+	extends CSSelectionDialogPanel implements View {
+	private boolean okPressed = false;
+	private IProjection lastProj = null;
+
+	/**
+	 * 
+	 */
+	public CSSelectionDialog() {
+		super();
+		this.initialize();
+	}
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+        this.setBounds(0, 0, 323, 233);
+        getAcceptButton().addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent e) {
+                PluginServices.getMDIManager().closeView(CSSelectionDialog.this);
+                okPressed = true;
+            }
+        });
+        getCancelButton().addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent e) {
+                PluginServices.getMDIManager().closeView(CSSelectionDialog.this);
+                okPressed = false;
+                setProjection(lastProj);
+            }
+        });
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+   		m_viewinfo.setTitle(PluginServices.getText(this, "selecciona_sistema_de_referencia"));
+		return m_viewinfo;
+	}
+
+	public boolean isOkPressed() { return okPressed; }
+	
+	/**
+	 * @return
+	 */
+	public IProjection getProjection() {
+		return getProjPanel().getProjection();
+	}
+	/**
+	 * @param proj
+	 */
+	public void setProjection(IProjection proj) {
+		lastProj = proj;
+		getProjPanel().setProjection(proj);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/CSSelectionDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/General.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/General.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/General.java	(revision 1648)
@@ -0,0 +1,820 @@
+/*
+ * Created on 30-mar-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.Dialogs;
+
+import java.awt.Color;
+import java.awt.Dimension;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.SingleLayer;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author vcn To change the template for this generated type comment go to
+ *         Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
+ *         Comments
+ */
+public class General extends JPanel {
+    private javax.swing.JPanel general = null;
+    private javax.swing.JLabel jLabel = null;
+    private javax.swing.JTextField jTextField = null;
+    private javax.swing.JPanel nombre = null;
+    private javax.swing.JPanel jPanel2 = null;
+    private javax.swing.JLabel jLabel1 = null;
+    private javax.swing.JRadioButton jRadioButton = null;
+    private javax.swing.JRadioButton jRadioButton1 = null;
+    private javax.swing.JPanel jPanel3 = null;
+    private javax.swing.JLabel jLabel2 = null;
+    private javax.swing.JTextField jTextField1 = null;
+    private javax.swing.JLabel jLabel3 = null;
+    private javax.swing.JPanel jPanel4 = null;
+    private javax.swing.JPanel jPanel5 = null;
+    private javax.swing.JLabel jLabel4 = null;
+    private javax.swing.JTextField jTextField2 = null;
+    private javax.swing.JLabel jLabel5 = null;
+    private javax.swing.JPanel central = null;
+    private javax.swing.JPanel srango = null;
+    private javax.swing.JPanel crango = null;
+    private javax.swing.JPanel propiedades = null;
+    private javax.swing.JPanel rango = null;
+    private javax.swing.JPanel jPanel11 = null;
+    private javax.swing.JLabel jLabel6 = null;
+    private javax.swing.JLabel jLabel7 = null;
+    private javax.swing.JPanel npropiedades = null;
+    private javax.swing.JPanel cpropiedades = null;
+    private javax.swing.JLabel jLabel8 = null;
+    private javax.swing.JLabel jLabel9 = null;
+    private javax.swing.JLabel jLabel10 = null;
+    private javax.swing.JLabel jLabel11 = null;
+    private javax.swing.JLabel jLabel12 = null;
+    private javax.swing.JLabel jLabel13 = null;
+    private javax.swing.JLabel jLabel14 = null;
+    private javax.swing.JLabel jLabel15 = null;
+    private javax.swing.JPanel spropiedades = null;
+    private javax.swing.JLabel jLabel16 = null;
+    private javax.swing.JLabel jLabel17 = null;
+
+    //private FRenderer m_render;
+    private ClassifiableVectorial m_layer = null;
+    private java.awt.Label label = null;
+
+    /**
+     * This is the default constructor
+     *
+     * @param lyr DOCUMENT ME!
+     */
+    public General(FLayer lyr) {
+        super();
+
+        //m_render=render;
+        m_layer = (ClassifiableVectorial) lyr;
+        initialize();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void rellenar() {
+        try {
+			jLabel9.setText(String.valueOf(((FLayer)m_layer).getFullExtent().getMaxY()));
+	        jLabel11.setText(String.valueOf(((FLayer)m_layer).getFullExtent().getMinY()));
+	        jLabel13.setText(String.valueOf(((FLayer)m_layer).getFullExtent().getMinX()));
+	        jLabel15.setText(String.valueOf(((FLayer)m_layer).getFullExtent().getMaxX()));
+		} catch (DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.add(getpgeneral());
+
+        //jTextField.setText("");
+        this.setEnable(false);
+        this.setSize(566, 449);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param b DOCUMENT ME!
+     */
+    private void setEnable(boolean b) {
+        jLabel2.setEnabled(b);
+        jTextField1.setEditable(b);
+        jLabel3.setEnabled(b);
+        jLabel4.setEnabled(b);
+        jTextField2.setEditable(b);
+        jLabel5.setEnabled(b);
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpgeneral() {
+        if (general == null) {
+            general = new javax.swing.JPanel();
+            general.setLayout(new java.awt.BorderLayout());
+            general.add(getpnombre(), java.awt.BorderLayout.NORTH);
+            general.add(getpcentral(), java.awt.BorderLayout.CENTER);
+
+            //general.add(getJPanel2(), java.awt.BorderLayout.WEST);
+        }
+
+        return general;
+    }
+
+    /**
+     * This method initializes jLabel
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel() {
+        if (jLabel == null) {
+            jLabel = new javax.swing.JLabel();
+            jLabel.setText(PluginServices.getText(this,"nombre"));
+        }
+
+        return jLabel;
+    }
+
+    /**
+     * This method initializes jTextField
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getJTextField() {
+        if (jTextField == null) {
+            jTextField = new javax.swing.JTextField();
+            jTextField.setText(((FLayer)m_layer).getName());
+            jTextField.setPreferredSize(new Dimension(140, 22));
+        }
+
+        return jTextField;
+    }
+
+    /**
+     * This method initializes jPanel1
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpnombre() {
+        if (nombre == null) {
+            nombre = new javax.swing.JPanel();
+            nombre.add(getJLabel(), null);
+            nombre.add(getJTextField(), null);
+        }
+
+        return nombre;
+    }
+
+    /**
+     * This method initializes jPanel2
+     *
+     * @return javax.swing.JPanel
+     */
+
+    /*        private javax.swing.JPanel getJPanel2() {
+                    if(jPanel2 == null) {
+                            jPanel2 = new javax.swing.JPanel();
+                            jPanel2.setLayout(new java.awt.BorderLayout());
+                            jPanel2.add(getJPanel3(), java.awt.BorderLayout.NORTH);
+                    }
+                    return jPanel2;
+            }
+    */
+
+    /**
+     * This method initializes jLabel1
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel1() {
+        if (jLabel1 == null) {
+            jLabel1 = new javax.swing.JLabel();
+            jLabel1.setText(PluginServices.getText(this,"Rango_de_escalas"));
+            jLabel1.setForeground(Color.blue);
+            jLabel1.setName("jLabel1");
+        }
+
+        return jLabel1;
+    }
+
+    /**
+     * 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,"Mostrar_siempre"));
+            jRadioButton.setName("jRadioButton");
+            jRadioButton.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        System.out.println("mostrar"); // TODO Auto-generated Event stub actionPerformed()
+                        setEnable(false);
+                    }
+                });
+        }
+
+        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,"No_mostrar"));
+            jRadioButton1.setName("jRadioButton1");
+            jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        System.out.println("no mostrar"); // TODO Auto-generated Event stub actionPerformed()
+                        setEnable(true);
+                    }
+                });
+        }
+
+        return jRadioButton1;
+    }
+
+    /**
+     * This method initializes jPanel3
+     *
+     * @return javax.swing.JPanel
+     */
+
+    /*        private javax.swing.JPanel getJPanel3() {
+                    if(jPanel3 == null) {
+                            jPanel3 = new javax.swing.JPanel();
+                            jPanel3.setLayout(new java.awt.BorderLayout());
+                            jPanel3.add(getJPanel4(), java.awt.BorderLayout.EAST);
+                    }
+                    return jPanel3;
+            }
+    */
+
+    /**
+     * This method initializes jLabel2
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel2() {
+        if (jLabel2 == null) {
+            jLabel2 = new javax.swing.JLabel();
+            jLabel2.setText(PluginServices.getText(this,"por_debajo_de"));
+        }
+
+        return jLabel2;
+    }
+
+    /**
+     * This method initializes jTextField1
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getJTextField1() {
+        if (jTextField1 == null) {
+            jTextField1 = new javax.swing.JTextField();
+            jTextField1.setSize(100, 30);
+            jTextField1.setText("100,30");
+        }
+
+        return jTextField1;
+    }
+
+    /**
+     * This method initializes jLabel3
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel3() {
+        if (jLabel3 == null) {
+            jLabel3 = new javax.swing.JLabel();
+            jLabel3.setText(PluginServices.getText(this,"(escala_m�xima) "));
+        }
+
+        return jLabel3;
+    }
+
+    /**
+     * This method initializes jPanel4
+     *
+     * @return javax.swing.JPanel
+     */
+
+    /*        private javax.swing.JPanel getJPanel4() {
+                    if(jPanel4 == null) {
+                            jPanel4 = new javax.swing.JPanel();
+                            java.awt.GridLayout layGridLayout6 = new java.awt.GridLayout();
+                            layGridLayout6.setRows(1);
+                            layGridLayout6.setColumns(3);
+                            jPanel4.setLayout(layGridLayout6);
+                            jPanel4.add(getJPanel5(), null);
+                    }
+                    return jPanel4;
+            }
+    */
+
+    /**
+     * This method initializes jPanel5
+     *
+     * @return javax.swing.JPanel
+     */
+
+    /*private javax.swing.JPanel getJPanel5() {
+            if(jPanel5 == null) {
+                    jPanel5 = new javax.swing.JPanel();
+                    java.awt.GridLayout layGridLayout7 = new java.awt.GridLayout();
+                    layGridLayout7.setRows(2);
+                    jPanel5.setLayout(layGridLayout7);
+            }
+            return jPanel5;
+    }*/
+
+    /**
+     * This method initializes jLabel4
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel4() {
+        if (jLabel4 == null) {
+            jLabel4 = new javax.swing.JLabel();
+            jLabel4.setText(PluginServices.getText(this,"por_encima_de"));
+        }
+
+        return jLabel4;
+    }
+
+    /**
+     * This method initializes jTextField2
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getJTextField2() {
+        if (jTextField2 == null) {
+            jTextField2 = new javax.swing.JTextField();
+            jTextField2.setSize(100, 30);
+            jTextField2.setText("100,30");
+        }
+
+        return jTextField2;
+    }
+
+    /**
+     * This method initializes jLabel5
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel5() {
+        if (jLabel5 == null) {
+            jLabel5 = new javax.swing.JLabel();
+            jLabel5.setText(PluginServices.getText(this,"(escala_m�nima)"));
+        }
+
+        return jLabel5;
+    }
+
+    /**
+     * This method initializes jPanel6
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpcentral() {
+        if (central == null) {
+            central = new javax.swing.JPanel();
+            central.setLayout(new java.awt.BorderLayout());
+            central.add(getppropiedades(), java.awt.BorderLayout.SOUTH);
+            central.add(getprango(), java.awt.BorderLayout.WEST);
+            central.setBorder(BorderFactory.createLoweredBevelBorder()); //setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
+        }
+
+        return central;
+    }
+
+    /**
+     * This method initializes jPanel7
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpsrango() {
+        if (srango == null) {
+            srango = new javax.swing.JPanel();
+
+            java.awt.GridLayout layGridLayout10 = new java.awt.GridLayout();
+            layGridLayout10.setRows(2);
+            layGridLayout10.setColumns(3);
+            srango.setLayout(layGridLayout10);
+            srango.add(getJLabel2(), null);
+            srango.add(getJTextField1(), null);
+            srango.add(getJLabel3(), null);
+            srango.add(getJLabel4(), null);
+            srango.add(getJTextField2(), null);
+            srango.add(getJLabel5(), null);
+            srango.setName("jPanel7");
+        }
+
+        return srango;
+    }
+
+    /**
+     * This method initializes jPanel8
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpcrango() {
+        if (crango == null) {
+            crango = new javax.swing.JPanel();
+            crango.setLayout(new java.awt.BorderLayout());
+            crango.add(getJRadioButton(), java.awt.BorderLayout.NORTH);
+            crango.add(getJRadioButton1(),
+                java.awt.BorderLayout.BEFORE_LINE_BEGINS);
+            crango.add(getpsrango(), java.awt.BorderLayout.SOUTH);
+
+            ButtonGroup group = new ButtonGroup();
+            group.add(getJRadioButton());
+            group.add(getJRadioButton1());
+            getJRadioButton().setSelected(true);
+        }
+
+        return crango;
+    }
+
+    /**
+     * This method initializes jPanel9
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getppropiedades() {
+        if (propiedades == null) {
+            propiedades = new javax.swing.JPanel();
+            propiedades.setLayout(new java.awt.BorderLayout());
+            propiedades.add(getpnpropiedades(), java.awt.BorderLayout.NORTH);
+            propiedades.add(getpcpropiedades(), java.awt.BorderLayout.CENTER);
+            propiedades.add(getpspropiedades(), java.awt.BorderLayout.SOUTH);
+            propiedades.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this,"propiedades"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+
+            /*jPanel9.setLayout(new java.awt.BorderLayout());
+            jPanel9.add(getJPanel11(), java.awt.BorderLayout.NORTH);
+            jPanel9.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
+
+            */
+        }
+
+        return propiedades;
+    }
+
+    /**
+     * This method initializes jPanel10
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getprango() {
+        if (rango == null) {
+            rango = new javax.swing.JPanel();
+            rango.setLayout(new java.awt.BorderLayout());
+
+            //rango.add(getJLabel1(), java.awt.BorderLayout.NORTH);
+            rango.add(getpcrango(), java.awt.BorderLayout.EAST);
+            rango.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
+                    PluginServices.getText(this,"Rango_de_escalas"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+        }
+
+        return rango;
+    }
+
+    /**
+     * This method initializes jPanel11
+     *
+     * @return javax.swing.JPanel
+     */
+
+    /*        private javax.swing.JPanel getJPanel11() {
+                    if(jPanel11 == null) {
+                            jPanel11 = new javax.swing.JPanel();
+                            jPanel11.setLayout(new java.awt.BorderLayout());
+                            jPanel11.add(getJPanel12(), java.awt.BorderLayout.NORTH);
+                            jPanel11.add(getJPanel13(), java.awt.BorderLayout.CENTER);
+                            jPanel11.add(getJPanel14(), java.awt.BorderLayout.SOUTH);
+                    }
+                    return jPanel11;
+            }
+    */
+
+    /**
+     * This method initializes jLabel6
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel6() {
+        if (jLabel6 == null) {
+            jLabel6 = new javax.swing.JLabel();
+            jLabel6.setForeground(Color.blue);
+            jLabel6.setText(PluginServices.getText(this,"propiedades"));
+        }
+
+        return jLabel6;
+    }
+
+    /**
+     * This method initializes jLabel7
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel7() {
+        if (jLabel7 == null) {
+            jLabel7 = new javax.swing.JLabel();
+            jLabel7.setText("Extent");
+        }
+
+        return jLabel7;
+    }
+
+    /**
+     * This method initializes jPanel12
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpnpropiedades() {
+        if (npropiedades == null) {
+            npropiedades = new javax.swing.JPanel();
+            npropiedades.setLayout(new java.awt.BorderLayout());
+
+            //npropiedades.add(getJLabel6(), java.awt.BorderLayout.CENTER);
+            npropiedades.add(getJLabel7(), java.awt.BorderLayout.SOUTH);
+            npropiedades.add(getLabel(), java.awt.BorderLayout.NORTH);
+        }
+
+        return npropiedades;
+    }
+
+    /**
+     * This method initializes jPanel13
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpcpropiedades() {
+        if (cpropiedades == null) {
+            cpropiedades = new javax.swing.JPanel();
+
+            java.awt.GridLayout layGridLayout19 = new java.awt.GridLayout();
+            layGridLayout19.setRows(4);
+            layGridLayout19.setColumns(2);
+            cpropiedades.setLayout(layGridLayout19);
+            cpropiedades.add(getJLabel8(), null);
+            cpropiedades.add(getJLabel9(), null);
+            cpropiedades.add(getJLabel10(), null);
+            cpropiedades.add(getJLabel11(), null);
+            cpropiedades.add(getJLabel12(), null);
+            cpropiedades.add(getJLabel13(), null);
+            cpropiedades.add(getJLabel14(), null);
+            cpropiedades.add(getJLabel15(), null);
+        }
+
+        return cpropiedades;
+    }
+
+    /**
+     * This method initializes jLabel8
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel8() {
+        if (jLabel8 == null) {
+            jLabel8 = new javax.swing.JLabel();
+            jLabel8.setText(PluginServices.getText(this,"Superior"));
+        }
+
+        return jLabel8;
+    }
+
+    /**
+     * This method initializes jLabel9
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel9() {
+        if (jLabel9 == null) {
+            jLabel9 = new javax.swing.JLabel();
+
+            //jLabel9.setText(String.valueOf(m_render.m_layer.getLayerExtent().getMaxY()));
+        }
+
+        return jLabel9;
+    }
+
+    /**
+     * This method initializes jLabel10
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel10() {
+        if (jLabel10 == null) {
+            jLabel10 = new javax.swing.JLabel();
+            jLabel10.setText(PluginServices.getText(this,"Inferior"));
+        }
+
+        return jLabel10;
+    }
+
+    /**
+     * This method initializes jLabel11
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel11() {
+        if (jLabel11 == null) {
+            jLabel11 = new javax.swing.JLabel();
+
+            //jLabel11.setText(String.valueOf(m_render.m_layer.getLayerExtent().getMinY()));
+        }
+
+        return jLabel11;
+    }
+
+    /**
+     * This method initializes jLabel12
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel12() {
+        if (jLabel12 == null) {
+            jLabel12 = new javax.swing.JLabel();
+            jLabel12.setText(PluginServices.getText(this,"Izquierda"));
+        }
+
+        return jLabel12;
+    }
+
+    /**
+     * This method initializes jLabel13
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel13() {
+        if (jLabel13 == null) {
+            jLabel13 = new javax.swing.JLabel();
+
+            //jLabel13.setText(String.valueOf(m_render.m_layer.getLayerExtent().getMinX()));
+        }
+
+        return jLabel13;
+    }
+
+    /**
+     * This method initializes jLabel14
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel14() {
+        if (jLabel14 == null) {
+            jLabel14 = new javax.swing.JLabel();
+            jLabel14.setText(PluginServices.getText(this,"Derecha"));
+        }
+
+        return jLabel14;
+    }
+
+    /**
+     * This method initializes jLabel15
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel15() {
+        if (jLabel15 == null) {
+            jLabel15 = new javax.swing.JLabel();
+
+            //jLabel15.setText(String.valueOf(m_render.m_layer.getLayerExtent().getMaxX()));
+        }
+
+        return jLabel15;
+    }
+
+    /**
+     * This method initializes jPanel14
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getpspropiedades() {
+        if (spropiedades == null) {
+            spropiedades = new javax.swing.JPanel();
+            spropiedades.add(getJLabel16(), null);
+            spropiedades.add(getJLabel17(), null);
+        }
+
+        return spropiedades;
+    }
+
+    /**
+     * This method initializes jLabel16
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel16() {
+        if (jLabel16 == null) {
+            jLabel16 = new javax.swing.JLabel();
+            jLabel16.setText(PluginServices.getText(this,"Origen_de_Datos"));
+        }
+
+        return jLabel16;
+    }
+
+    /**
+     * This method initializes jLabel17
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel17() {
+        if (jLabel17 == null) {
+            jLabel17 = new javax.swing.JLabel();
+            // TODO: REVISAR. AQU� DEBER�A PONER EL ORIGEN DE DATOS DE ESTA CAPA
+            jLabel17.setText(((SingleLayer)m_layer).getSource().getDriver().toString());
+        }
+
+        return jLabel17;
+    }
+
+    /**
+     * This method initializes label
+     *
+     * @return java.awt.Label
+     */
+    private java.awt.Label getLabel() {
+        if (label == null) {
+            label = new java.awt.Label();
+            label.setText("Label");
+        }
+
+        return label;
+    }
+}
+ //  @jve:visual-info  decl-index=0 visual-constraint="247,3"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/General.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialog.java	(revision 1648)
@@ -0,0 +1,456 @@
+/*
+ * Created on 24-jun-2003
+ *
+ * Copyright (c) 2003
+ * Francisco Jos� Pe�arrubia Mart�nez
+ * IVER Tecnolog�as de la Informaci�n S.A.
+ * Salamanca 50
+ * 46005 Valencia (        SPAIN )
+ * +34 963163400
+ * mailto:fran@iver.es
+ * http://www.iver.es
+ */
+/* 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.gui.Dialogs;
+
+import java.awt.BorderLayout;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.project.ProjectView;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Administrador To change the template for this generated type comment
+ *         go to Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public final class FInfoDialog extends JPanel implements SingletonView {
+   	boolean DEBUG=true;
+    private ArrayList m_arrayNomTemas;
+    private String m_strInfo;
+    private ArrayList m_arrayStrings;
+    private MyTableModel m_gridModel;
+    private int m_itemSelected;
+    private int m_subItemSelected;
+    private DefaultTreeModel m_treeModel;
+
+    // Variables declaration - do not modify
+    private javax.swing.JSplitPane jSplitPane1;
+    private javax.swing.JTable m_grid;
+    private javax.swing.JTree jTree1;
+    
+	private ProjectView viewModel = null; 
+	
+	/**
+     * Creates new form FInfoDialog
+     *
+     * @param parent DOCUMENT ME!
+     * @param modal DOCUMENT ME!
+     */
+    public FInfoDialog() {
+        //super(parent, modal);
+        m_arrayNomTemas = new ArrayList();
+        m_arrayStrings = new ArrayList();
+
+        initComponents();
+        
+        this.setSize(300, 235);
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void refresh() {
+        setSelected(0, 0);
+        refreshLeft();
+        refreshRight();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void clearAll() {
+        m_arrayStrings.clear();
+        m_arrayNomTemas.clear();
+        m_strInfo = "";
+        jTree1.removeAll();
+        
+
+        DefaultMutableTreeNode top = new DefaultMutableTreeNode("root");
+
+        // m_treeModel.setRoot(top);
+        m_treeModel = new DefaultTreeModel(top);
+        m_gridModel.setData("","",0);
+        jTree1.setModel(m_treeModel);
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void refreshLeft() {
+        int i;
+        int j;
+
+        DefaultMutableTreeNode idRoot = (DefaultMutableTreeNode) m_treeModel.getRoot();
+        
+        
+
+        for (i = 0; i < m_arrayStrings.size(); i++) {
+            String strInfo = (String) m_arrayStrings.get(i);
+            String nomTema = (String) m_arrayNomTemas.get(i);
+            StringTokenizer tkz = new StringTokenizer(strInfo, "\n");
+            String strCampos = tkz.nextToken();
+
+            DefaultMutableTreeNode idTema = new DefaultMutableTreeNode(nomTema);
+            m_treeModel.insertNodeInto(idTema, idRoot, i);
+            
+            
+
+            j = 0;
+
+            while (tkz.hasMoreTokens()) {
+                String token = tkz.nextToken();
+                StringTokenizer tkzValores = new StringTokenizer(token, "|");
+                String strID = tkzValores.nextToken();
+                MyTreeItem aux = new MyTreeItem(strID, i, j);
+
+                DefaultMutableTreeNode idChild = new DefaultMutableTreeNode(aux);
+                m_treeModel.insertNodeInto(idChild, idTema, j);
+
+                // jTree1.expandRow(j);
+                if ((i == m_itemSelected) && (j == m_subItemSelected)) {
+                    // TreePath elPath = jTree1.getPathForRow(j);
+                    TreePath elPath = new TreePath(idChild.getPath());
+                    jTree1.expandPath(elPath);
+                   if (DEBUG) System.out.println("El path = " + elPath);
+                    jTree1.setSelectionPath(elPath);
+                }
+
+                // m_tree->Expand(idChild);
+                // m_tree->EnsureVisible(idChild);
+                j++;
+            }
+        }
+         // for tema
+
+        jTree1.stopEditing();
+        jTree1.setRootVisible(false);
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void refreshRight() {
+        m_grid.invalidate();
+        m_grid.repaint();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param idItem DOCUMENT ME!
+     * @param idSubItem DOCUMENT ME!
+     */
+    private void setSelected(int idItem, int idSubItem) {
+        m_itemSelected = idItem;
+        m_subItemSelected = idSubItem;
+
+        int i;
+        int numCols;
+        int numRows = 0;
+
+        for (i = 0; i < m_arrayStrings.size(); i++) {
+            if (i == m_itemSelected) {
+                m_strInfo = (String) m_arrayStrings.get(i);
+            }
+        }
+
+        StringTokenizer tkz = new StringTokenizer(m_strInfo, "\n");
+        if (! tkz.hasMoreTokens()) return;
+        
+        String strCampos = tkz.nextToken();
+
+        StringTokenizer tkzCampos = new StringTokenizer(strCampos, "|");
+        i = 0;
+
+        while (tkzCampos.hasMoreTokens()) {
+            tkzCampos.nextToken();
+            i++;
+        }
+
+        numCols = i;
+
+        int regSelec = 0;
+        String strValores = "";
+
+        while (tkz.hasMoreTokens()) {
+            String token = tkz.nextToken();
+
+            if (regSelec == m_subItemSelected) {
+                strValores = token;
+            }
+
+            regSelec++;
+        }
+
+        if (strValores != "") {
+            m_gridModel.setData(strCampos, strValores, numCols);
+        }
+
+        refreshRight();
+    }
+
+    /**
+     * This method is called from within the constructor to initialize the
+     * form. WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    private void initComponents() {
+        jSplitPane1 = new javax.swing.JSplitPane();
+
+        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("root");
+        m_treeModel = new DefaultTreeModel(rootNode);
+
+        jTree1 = new javax.swing.JTree(m_treeModel);
+        jTree1.setEditable(true);
+        jTree1.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+        jTree1.setShowsRootHandles(true);
+
+        m_grid = new javax.swing.JTable();
+
+      /*  addWindowListener(new java.awt.event.WindowAdapter() {
+                public void windowClosing(java.awt.event.WindowEvent evt) {
+                    closeDialog(evt);
+                }
+            });
+*/
+        jTree1.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
+                public void valueChanged(
+                    javax.swing.event.TreeSelectionEvent evt) {
+                    jTree1ValueChanged(evt);
+                }
+            });
+
+        //Create the scroll pane and add the tree to it. 
+        JScrollPane treeView = new JScrollPane(jTree1);
+
+        //Add the scroll panes to a split pane.
+        jSplitPane1.setLeftComponent(treeView);
+
+        m_gridModel = new MyTableModel();
+        m_grid.setModel(m_gridModel);
+
+        JScrollPane tableView = new JScrollPane(m_grid);
+
+        // tableView.setBackground(java.awt.Color.WHITE);
+        jSplitPane1.setRightComponent(tableView);
+
+        java.awt.Dimension minimumSize = new java.awt.Dimension(100, 50);
+        m_grid.setMinimumSize(minimumSize);
+        treeView.setMinimumSize(minimumSize);
+
+        // splitPane.setDividerLocation(100); //XXX: ignored in some releases
+        //of Swing. bug 4101306
+        //workaround for bug 4101306:
+        //treeView.setPreferredSize(new Dimension(100, 100)); 
+        jSplitPane1.setPreferredSize(new java.awt.Dimension(300, 200));
+
+        setLayout(new BorderLayout());
+        add(jSplitPane1, java.awt.BorderLayout.CENTER);
+
+        //pack();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param evt DOCUMENT ME!
+     */
+    private void jTree1ValueChanged(javax.swing.event.TreeSelectionEvent evt) {
+        // Add your handling code here:
+        DefaultMutableTreeNode node = (DefaultMutableTreeNode) jTree1.getLastSelectedPathComponent();
+
+        if (node == null) {
+            return;
+        }
+
+        Object nodeInfo = node.getUserObject();
+
+        if (node.isLeaf()) {
+            MyTreeItem dato = (MyTreeItem) nodeInfo;
+            setSelected(dato.m_idNodo, dato.m_idSubNodo);
+        }
+
+        // System.out.println("El path seleccionado= " + jTree1.getRowForPath(evt.getPath()));
+    }
+
+   
+    /**
+     * DOCUMENT ME!
+     *
+     * @param nomTema DOCUMENT ME!
+     * @param strInfo DOCUMENT ME!
+     */
+    public void addLayerInfo(String nomTema, String strInfo) {
+        m_arrayNomTemas.add(nomTema);
+        m_arrayStrings.add(strInfo);
+    }
+
+    private class MyTableModel extends AbstractTableModel {
+        private String[] columnNames;
+        private Object[][] data;
+
+        MyTableModel() {
+            columnNames = new String[2];
+            columnNames[0] = PluginServices.getText(this,"campo");
+            columnNames[1] = PluginServices.getText(this,"Valor");
+            data = new Object[1][2];
+        }
+
+        public int getColumnCount() {
+            return columnNames.length;
+        }
+
+        public int getRowCount() {
+            return data.length;
+        }
+
+        public String getColumnName(int col) {
+            return columnNames[col];
+        }
+
+        public Object getValueAt(int row, int col) {
+            return data[row][col];
+        }
+
+        public void setData(String strCampos, String strValores, int numRows) {
+            // Fijamos columnNames y data en funci�n de strInfo.
+            // strInfo es una cabecera con los nombres de los campos separados
+            // por | y despu�s una l�nea por cada registro con los valores
+            // de los campos.			
+            data = new Object[numRows][2];
+            
+            if (strCampos == "") return; // Como si borraramos la tabla
+
+            int i;
+
+            StringTokenizer tkzCampos = new StringTokenizer(strCampos, "|");
+            i = 0;
+
+            while (tkzCampos.hasMoreTokens()) {
+                data[i][0] = tkzCampos.nextToken();
+                i++;
+            }
+
+            StringTokenizer tkzValores = new StringTokenizer(strValores, "|");
+            String strID = tkzValores.nextToken();
+            i = 0;
+
+            while (tkzValores.hasMoreTokens()) {
+                // m_grid->SetCellValue(i,1,tkzValores.GetNextToken());
+                data[i][1] = tkzValores.nextToken();
+                i++;
+            }
+        }
+    }
+     // MyTableModel
+
+    private final class MyTreeItem {
+        public int m_idNodo;
+        public int m_idSubNodo;
+        private String m_strVal;
+
+        public MyTreeItem(String str, int idN, int idSub) {
+            m_strVal = str;
+            m_idNodo = idN;
+            m_idSubNodo = idSub;
+        }
+
+        public String toString() {
+            return m_strVal;
+        }
+    }
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_ViewInfo=new ViewInfo(ViewInfo.MODELESSDIALOG|ViewInfo.RESIZABLE);
+			m_ViewInfo.setTitle(PluginServices.getText(this,"Identificar_Resultados"));
+return m_ViewInfo;
+		}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
+	 */
+	public Object getViewModel() {
+		return viewModel;
+	}
+
+    // End of variables declaration
+	/**
+	 * @param view
+	 */
+	public void setViewModel(ProjectView view) {
+		viewModel = view;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialogXML.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialogXML.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialogXML.java	(revision 1648)
@@ -0,0 +1,88 @@
+/*
+ * Created on 13-sep-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.gui.Dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.utiles.xmlViewer.XMLViewer;
+
+
+/**
+ * Di�logo utilizado para mostrar la infromaci�n.
+ *
+ * @author fernando To change the template for this generated type comment go
+ * 		   to Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
+ * 		   Comments
+ */
+public class FInfoDialogXML extends XMLViewer implements SingletonView {
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODELESSDIALOG |
+				ViewInfo.RESIZABLE);
+		m_viewinfo.setWidth(300);
+		m_viewinfo.setHeight(235);
+		m_viewinfo.setTitle(PluginServices.getText(this,
+				"Identificar_Resultados"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
+	 */
+	public Object getViewModel() {
+		return "FInfoDialogXML";
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Dialogs/FInfoDialogXML.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/FPanelAbout.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/FPanelAbout.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/FPanelAbout.java	(revision 1648)
@@ -0,0 +1,238 @@
+/*
+ * Created on 02-sep-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui.Panels;
+
+import java.awt.BorderLayout;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.StringTokenizer;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.event.HyperlinkEvent;
+
+import org.apache.log4j.Logger;
+
+import com.hardcode.gdbms.engine.instruction.Utilities;
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+/**
+ * @author FJP
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class FPanelAbout extends JPanel implements View {
+
+	private static Logger logger = Logger.getLogger(FPanelAbout.class.getName());
+	private JEditorPane jEditorPane = null;
+	private JScrollPane jScrollPane = null;
+	private JEditorPane jEditorPane1 = null;
+	private JPanel jPanel = null;
+	private JButton jButton = null;
+	
+	private JLabel jLblVersion = null;
+	/**
+	 * This is the default constructor
+	 * @throws FileNotFoundException
+	 */
+	public FPanelAbout(){
+		super();
+		initialize();
+	}
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 * @throws FileNotFoundException
+	 */
+	private  void initialize(){
+		this.setLayout(new BorderLayout());
+		this.setSize(600, 450);
+		this.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
+		this.add(getJPanel(), java.awt.BorderLayout.SOUTH);
+		try {
+			// Leemos el n� de versi�n y se lo pegamos a jLblVersion
+			BufferedReader fich = new BufferedReader(
+					new FileReader(FPanelAbout.class.getResource("/build.number").getFile()));
+			fich.readLine();
+			fich.readLine();
+			String strVer = fich.readLine();
+			StringTokenizer strTokenizer = new StringTokenizer(strVer);
+			String strToken = strTokenizer.nextToken("=");
+			strToken = strTokenizer.nextToken();
+			jLblVersion.setText(jLblVersion.getText() + " (" + strToken + ")");
+			fich.close();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * This method initializes jScrollPane	
+	 * 	
+	 * @return javax.swing.JScrollPane	
+	 */    
+	private JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new JScrollPane();
+			jScrollPane.setPreferredSize(new java.awt.Dimension(300,400));
+			jScrollPane.setViewportView(getJEditorPane());
+		}
+		return jScrollPane;
+	}
+	/**
+	 * This method initializes jEditorPane1	
+	 * 	
+	 * @return javax.swing.JEditorPane	
+	 */    
+		private JEditorPane getJEditorPane() {
+			if (jEditorPane == null) {
+				jEditorPane = new JEditorPane();
+				
+				jEditorPane.setEditable(false);
+				jEditorPane.setContentType("text/html");
+				jEditorPane.setPreferredSize(new java.awt.Dimension(300,200));
+				
+				java.net.URL aboutURL = FPanelAbout.class.getResource(
+				                                "/about.htm");
+				if (aboutURL != null) {
+				    try {
+				    	jEditorPane.setPage(aboutURL);
+				    	jEditorPane.addHyperlinkListener(new javax.swing.event.HyperlinkListener() { 
+				    		public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e) {
+				    			if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
+				    			{
+				    	 		      JEditorPane pane = (JEditorPane) e.getSource();
+				    	 		      System.out.println("hyperlinkUpdate()"); // TODO Auto-generated Event stub hyperlinkUpdate()
+				    	 		      BrowserControl.displayURL(e.getURL().toString());
+				    	 		      // if (e instanceof HTMLFrameHyperlinkEvent) {
+				    			}
+
+				    			
+				    		}
+				    	});
+				    } catch (IOException e) {
+				        System.err.println("Attempted to read a bad URL: " + aboutURL);
+				    }
+				} else {
+				    System.err.println("Couldn't find file: about.html" + aboutURL.getPath());
+				}
+				
+			}
+			return jEditorPane;
+		}
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private JPanel getJPanel() {
+		if (jPanel == null) {
+			jLblVersion = new JLabel();
+			jPanel = new JPanel();
+			jPanel.setLayout(null);
+			jPanel.setPreferredSize(new java.awt.Dimension(10,50));
+			jLblVersion.setBounds(31, 20, 172, 17);
+			jLblVersion.setText("Version 0.3  ");
+			jPanel.add(getJButton(), null);
+			jPanel.add(jLblVersion, null);
+		}
+		return jPanel;
+	}
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJButton() {
+		if (jButton == null) {
+			jButton = new JButton();
+			jButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+			jButton.setText("Cerrar");
+			jButton.setBounds(266, 12, 94, 25);
+			jButton.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
+					if (PluginServices.getMainFrame() != null)
+					{
+						PluginServices.getMDIManager().closeView(FPanelAbout.this);
+					}
+					else 
+					{
+						((JDialog) (getParent().getParent().getParent().getParent())).dispose();
+					}
+					
+				}
+			});
+		}
+		return jButton;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_ViewInfo = new ViewInfo(ViewInfo.MODALDIALOG|ViewInfo.RESIZABLE);
+		m_ViewInfo.setTitle(PluginServices.getText(this,"acerca_de"));
+
+		return m_ViewInfo;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+		// TODO Auto-generated method stub
+		
+	}
+}  //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/FPanelAbout.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorChooserPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorChooserPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorChooserPanel.java	(revision 1648)
@@ -0,0 +1,204 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+/* 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.gui.Panels;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JColorChooser;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+
+/**
+ * A custom Colour Scheme Browser - custom choices based on JColorChooser.
+ */
+
+public class ColorChooserPanel extends JPanel {
+    GridBagLayout gridBagLayout1 = new GridBagLayout();
+    JButton changeButton = new JButton();
+
+
+    //{DEFECT-PREVENTION} In accessors, it's better to use "workbench = newWorkbench"
+    //rather than "this.workbench = workbench", because otherwise if you misspell the
+    //argument, Java won't complain! We should do this everywhere. [Jon Aquino]
+    JPanel outerColorPanel = new JPanel();
+    ColorPanel colorPanel = new ColorPanel();
+    GridBagLayout gridBagLayout2 = new GridBagLayout();
+    private Color color = Color.black;
+    private int alpha;
+    private ArrayList actionListeners = new ArrayList();
+
+    public ColorChooserPanel() {
+        try {
+            jbInit();
+            colorPanel.setLineColor(null);
+            changeButton.setToolTipText("Browse");
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    void jbInit() throws Exception {
+        this.setLayout(gridBagLayout1);
+        changeButton.setMargin(new Insets(0, 0, 0, 0));
+        changeButton.setText("   ...   ");
+        changeButton.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    changeButton_actionPerformed(e);
+                }
+            });
+        outerColorPanel.setBorder(BorderFactory.createLoweredBevelBorder());
+        outerColorPanel.setPreferredSize(new Dimension(60, 20));
+        outerColorPanel.setBackground(Color.white);
+        outerColorPanel.setLayout(gridBagLayout2);
+        colorPanel.setMargin(0);
+        colorPanel.setPreferredSize(new Dimension(45, 8));
+        this.add(changeButton,
+            new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.CENTER, GridBagConstraints.NONE,
+                new Insets(0, 2, 0, 0), 0, 0));
+        this.add(outerColorPanel,
+            new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.CENTER, GridBagConstraints.NONE,
+                new Insets(0, 0, 0, 0), 0, 0));
+        outerColorPanel.add(colorPanel,
+            new GridBagConstraints(0, 0, 1, 1, 0, 0,
+                GridBagConstraints.CENTER, GridBagConstraints.NONE,
+                new Insets(0, 0, 0, 0), 0, 0));
+    }
+
+    void changeButton_actionPerformed(ActionEvent e) {
+        Color newColor = JColorChooser.showDialog(SwingUtilities.windowForComponent(this), "Choose Colour", color);
+
+        if (newColor == null) {
+            return;
+        }
+
+        setColor(newColor);
+        fireActionPerformed();
+    }
+
+    public void setColor(Color color) {
+        this.color = color;
+        updateColorPanel();
+    }
+
+    private void updateColorPanel() {
+    	
+        colorPanel.setFillColor(new Color(color.getRed(), color.getGreen(), color.getBlue(),alpha));
+		
+        
+        colorPanel.repaint();
+    }
+
+    public void addActionListener(ActionListener l) {
+        actionListeners.add(l);
+    }
+
+    public void removeActionListener(ActionListener l) {
+        actionListeners.remove(l);
+    }
+
+    protected void fireActionPerformed() {
+        for (Iterator i = actionListeners.iterator(); i.hasNext();) {
+            ActionListener l = (ActionListener) i.next();
+            l.actionPerformed(new ActionEvent(this, 0, null));
+        }
+    }
+
+    public Color getColor() {
+        return color;
+    }
+
+    //{CLARITY} Might be clearer to say "alpha" rather than "alpha".
+    //This occurs in other places too. [Jon Aquino]
+    public void setAlpha(int alpha) {
+        this.alpha = alpha;
+        updateColorPanel();
+    }
+
+    public void setEnabled(boolean newEnabled) {
+        changeButton.setEnabled(newEnabled);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorChooserPanel.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/AdjustTransparencyPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/AdjustTransparencyPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/AdjustTransparencyPanel.java	(revision 1648)
@@ -0,0 +1,195 @@
+/*
+ * Created on 18-sep-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.gui.Panels;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+import javax.swing.JTextField;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.fmap.layers.FLyrDefault;
+import com.iver.cit.gvsig.gui.GUIUtil;
+import com.iver.cit.gvsig.gui.ValidatingTextField;
+/**
+ * Panel de Ajuste de Transparencia.
+ * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
+ */
+public class AdjustTransparencyPanel extends JPanel implements View  {
+	JDialog dlg = null;
+	private JLabel jLabel = null;
+	private JSlider jSlider = null;
+	private ValidatingTextField jTxtTransparency = null;
+	private JButton jOkButton = null;
+	private FLyrDefault fLayer = null;
+	
+	private ViewInfo m_ViewInfo = null;
+	
+	public AdjustTransparencyPanel(FLyrDefault layer) {
+		super();
+		initialize(layer);
+	}
+	private void initialize(FLyrDefault layer) {
+		jLabel = new JLabel();
+		setSize(255, 127);
+		setMinimumSize(new java.awt.Dimension(220,80));
+        setLayout(null);
+
+        setFLayer(layer);
+        jLabel.setBounds(15, 17, 195, 21);
+        jLabel.setText("Nivel de transparencia:");
+        this.add(jLabel, null);
+        this.add(getJSlider(), null);
+        this.add(getJTxtTransparency(), null);
+        this.add(getJOkButton(), null);
+        jLabel.setText(PluginServices.getText(this, "Nivel_de_transparencia")+":");
+        jOkButton.setText(PluginServices.getText(this, "Aceptar"));
+	}
+	
+	public void setFLayer(FLyrDefault f) {
+		fLayer = f;
+		setAlpha(255 - fLayer.getTransparency());
+	}
+	public void setAlpha(int alpha) {
+		getJSlider().setValue(alpha);
+	}
+
+	public int getAlpha() {
+		return getJSlider().getValue();
+	}
+
+	/**
+	 * This method initializes jSlider	
+	 * 	
+	 * @return javax.swing.JSlider	
+	 */    
+	private JSlider getJSlider() {
+		if (jSlider == null) {
+			jSlider = new JSlider();
+			jSlider.setBounds(20, 59, 163, 21);
+			jSlider.setMaximum(255);
+			jSlider.setMajorTickSpacing(10);
+		}
+		return jSlider;
+	}
+	/**
+	 * This method initializes jTextField	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */    
+	private JTextField getJTxtTransparency() {
+		if (jTxtTransparency == null) {
+			jTxtTransparency = GUIUtil.createSyncdTextField(jSlider, 3);
+			jTxtTransparency.setBounds(192, 55, 41, 25);
+			//jTxtTransparency.setText("" + getAlpha());
+		}
+		return jTxtTransparency;
+	}
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJOkButton() {
+		if (jOkButton == null) {
+			jOkButton = new JButton();
+			jOkButton.setBounds(88, 98, 94, 19);
+			jOkButton.setText("Aceptar");
+			jOkButton.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					AdjustTransparencyPanel.this.closeJDialog();
+				}
+			});
+
+		}
+		return jOkButton;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		if (m_ViewInfo==null){
+			m_ViewInfo=new ViewInfo(ViewInfo.MODELESSDIALOG | ViewInfo.RESIZABLE);
+			m_ViewInfo.setTitle(PluginServices.getText(this,"Ajustar_transparencia"));
+		}
+		return m_ViewInfo;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+		// TODO Auto-generated method stub
+		
+	}
+	public void openJDialog() {
+		if (PluginServices.getMainFrame() == null) {
+			dlg = new JDialog();
+			
+			setPreferredSize(getSize());
+			dlg.getContentPane().add(this);
+			dlg.setModal(false);			
+			dlg.pack();
+			dlg.show();
+			
+		} else
+			PluginServices.getMDIManager().addView(this);
+	}
+	public void closeJDialog() {
+		fLayer.setTransparency(255 - getAlpha());
+		if (PluginServices.getMainFrame() == null) {
+			dlg.hide();
+			dlg.dispose();
+			dlg = null;
+		} else
+			PluginServices.getMDIManager().closeView(this);
+
+		
+	}
+
+   }  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/AdjustTransparencyPanel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/BrowserControl.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/BrowserControl.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/BrowserControl.java	(revision 1648)
@@ -0,0 +1,172 @@
+/*
+ * Created on 18-oct-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui.Panels;
+
+/**
+ * @author Steven Spencer
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+import java.io.IOException;
+
+/**
+* A simple, static class to display a URL in the system browser.
+
+
+*
+* Under Unix, the system browser is hard-coded to be 'netscape'.
+* Netscape must be in your PATH for this to work.  This has been
+* tested with the following platforms: AIX, HP-UX and Solaris.
+
+
+*
+* Under Windows, this will bring up the default browser under windows,
+* usually either Netscape or Microsoft IE.  The default browser is
+* determined by the OS.  This has been tested under Windows 95/98/NT.
+
+
+*
+* Examples:
+
+
+* 
+BrowserControl.displayURL("http://www.javaworld.com")
+* 
+BrowserControl.displayURL("file://c:\\docs\\index.html")
+* 
+BrowserContorl.displayURL("file:///user/joe/index.html");
+* 
+
+* Note - you must include the url type -- either "http://" or
+* "file://".
+*/
+public class BrowserControl
+{
+    /**
+     * Display a file in the system browser.  If you want to display a
+     * file, you must include the absolute path name.
+     *
+     * @param url the file's url (the url must start with either "http://"
+or
+     * "file://").
+     */
+    public static void displayURL(String url)
+    {
+        boolean windows = isWindowsPlatform();
+        String cmd = null;
+        try
+        {
+            if (windows)
+            {
+                // cmd = 'rundll32 url.dll,FileProtocolHandler http://...'
+                cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
+                Process p = Runtime.getRuntime().exec(cmd);
+            }
+            else
+            {
+                // Under Unix, Netscape has to be running for the "-remote"
+                // command to work.  So, we try sending the command and
+                // check for an exit value.  If the exit command is 0,
+                // it worked, otherwise we need to start the browser.
+                // cmd = 'netscape -remote openURL(http://www.javaworld.com)'
+                cmd = UNIX_PATH + " " + UNIX_FLAG + "(" + url + ")";
+                Process p = Runtime.getRuntime().exec(cmd);
+                try
+                {
+                    // wait for exit code -- if it's 0, command worked,
+                    // otherwise we need to start the browser up.
+                    int exitCode = p.waitFor();
+                    if (exitCode != 0)
+                    {
+                        // Command failed, start up the browser
+                        // cmd = 'netscape http://www.javaworld.com'
+                        cmd = UNIX_PATH + " "  + url;
+                        p = Runtime.getRuntime().exec(cmd);
+                    }
+                }
+                catch(InterruptedException x)
+                {
+                    System.err.println("Error bringing up browser, cmd='" +
+                                       cmd + "'");
+                    System.err.println("Caught: " + x);
+                }
+            }
+        }
+        catch(IOException x)
+        {
+            // couldn't exec browser
+            System.err.println("Could not invoke browser, command=" + cmd);
+            System.err.println("Caught: " + x);
+        }
+    }
+    /**
+     * Try to determine whether this application is running under Windows
+     * or some other platform by examing the "os.name" property.
+     *
+     * @return true if this application is running under a Windows OS
+     */
+    public static boolean isWindowsPlatform()
+    {
+        String os = System.getProperty("os.name");
+        if ( os != null && os.startsWith(WIN_ID))
+            return true;
+        else
+            return false;
+
+    }
+    // Used to identify the windows platform.
+    private static final String WIN_ID = "Windows";
+    // The default system browser under windows.
+    private static final String WIN_PATH = "rundll32";
+    // The flag to display a url.
+    private static final String WIN_FLAG = "url.dll,FileProtocolHandler";
+    // The default browser under unix.
+    private static final String UNIX_PATH = "netscape";
+    // The flag to display a url.
+    private static final String UNIX_FLAG = "-remote openURL";
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/BrowserControl.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/TransparencyPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/TransparencyPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/TransparencyPanel.java	(revision 1648)
@@ -0,0 +1,124 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+/* 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.gui.Panels;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+
+
+public class TransparencyPanel extends JPanel {
+    JPanel opaquePanel = new JPanel();
+    JPanel transparentPanel = new JPanel();
+    GridBagLayout gridBagLayout3 = new GridBagLayout();
+    JSlider transparencySlider = new JSlider();
+
+    public TransparencyPanel() {
+        transparencySlider.setMaximum(255);
+        transparencySlider.setPreferredSize(new Dimension(100, 24));
+        setLayout(gridBagLayout3);
+        add(opaquePanel,
+            new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.CENTER, GridBagConstraints.NONE,
+                new Insets(0, 0, 0, 0), 0, 0));
+        add(transparencySlider,
+            new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.CENTER, GridBagConstraints.NONE,
+                new Insets(0, 0, 0, 0), 0, 0));
+        add(transparentPanel,
+            new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.CENTER, GridBagConstraints.NONE,
+                new Insets(0, 0, 0, 0), 0, 0));
+        opaquePanel.setBackground(Color.black);
+        opaquePanel.setMinimumSize(new Dimension(11, 11));
+        opaquePanel.setMaximumSize(new Dimension(11, 11));
+        opaquePanel.setPreferredSize(new Dimension(11, 11));
+        transparentPanel.setBackground(Color.white);
+        transparentPanel.setForeground(Color.white);
+        transparentPanel.setMaximumSize(new Dimension(11, 11));
+        transparentPanel.setMinimumSize(new Dimension(11, 11));
+        transparentPanel.setPreferredSize(new Dimension(11, 11));
+    }
+
+    public void setColor(Color color) {
+        opaquePanel.setBackground(color);
+    }
+
+    public JSlider getSlider() {
+        return transparencySlider;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/TransparencyPanel.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/LinkPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/LinkPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/LinkPanel.java	(revision 1648)
@@ -0,0 +1,273 @@
+/* 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.gui.Panels;
+
+import java.awt.BorderLayout;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.event.HyperlinkEvent;
+
+import org.apache.log4j.Logger;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+
+/**
+ * Vista donde mostrar el fichero del hiperlink.
+ *
+ * @author Vicente Caballero Navarro
+ * 
+ */
+public class LinkPanel extends JPanel implements View {
+	private static Logger logger = Logger.getLogger(LinkPanel.class.getName());
+	private JPanel jPane = null;
+	private JScrollPane jScrollPane = null;
+	private JEditorPane jEditorPane1 = null;
+	private JPanel jPanel = null; //  @jve:decl-index=0:visual-constraint="220,10"
+	private JButton jButton = null;
+	private String field;
+	private String value;
+	private String ext="";
+	private int type=0;
+	/**
+	 * This is the default constructor
+	 */
+	public LinkPanel(String f,String v,String e,int t) {
+		super();
+		field=f;
+		value=v;
+		ext=e;
+		type=t;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(new BorderLayout());
+		this.setSize(600, 450);
+		this.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
+		this.add(getJPanel(), java.awt.BorderLayout.SOUTH);
+	}
+
+	
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new JScrollPane();
+			jScrollPane.setPreferredSize(new java.awt.Dimension(300, 400));
+			jScrollPane.setViewportView(getJPane());
+		}
+
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes jEditorPane1
+	 *
+	 * @return javax.swing.JEditorPane
+	 */
+	private JPanel getJPane() {
+		
+		if (jPane == null) {
+			jPane=new JPanel();
+			
+			//if (ext.equals(".htm") || ext.equals(".HTM") || ext.equals(".html") || ext.equals(".HTML") || ext.equals(".xml") || ext.equals(".XML") || ext.equals(".txt") || ext.equals(".TXT")){
+			if (type==1){
+				JEditorPane jEditorPane = new JEditorPane();
+				jEditorPane.setAutoscrolls(true);
+				jEditorPane.setEditable(false);
+				jEditorPane.setContentType("text/html");
+				//jEditorPane.setPreferredSize(new java.awt.Dimension(300, 200));
+				String auxext="";
+				if (!ext.equals("")){
+					auxext="."+ext;
+				}
+				//URL url = LinkPanel.class.getResource(("/"+value+auxext));
+				URL url=null;
+				File file =new File(value+auxext);
+				try {
+					url = file.toURL();
+				} catch (MalformedURLException e1) {
+					e1.printStackTrace();
+				}
+			if (url != null) {
+				try {
+					jEditorPane.setPage(url);
+					jEditorPane.addHyperlinkListener(new javax.swing.event.HyperlinkListener() {
+							public void hyperlinkUpdate(
+								javax.swing.event.HyperlinkEvent e) {
+								if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+									JEditorPane pane = (JEditorPane) e.getSource();
+									System.out.println("hyperlinkUpdate()");
+									BrowserControl.displayURL(e.getURL()
+															   .toString());
+
+								}
+							}
+						});
+				} catch (IOException e) {
+					System.err.println("Attempted to read a bad URL: " +
+						url);
+				}
+				jPane.add(jEditorPane);
+			} else {
+				System.err.println("Couldn't find file: " + value+auxext);
+			}
+		}else if (type==0){
+			String auxext="";
+			if (!ext.equals("")){
+				auxext="."+ext;
+			}
+			//java.net.URL url = LinkPanel.class.getResource(("/" + value + auxext));
+			URL url=null;
+			File file =new File(value+auxext);
+			try {
+				url = file.toURL();
+			} catch (MalformedURLException e1) {
+				e1.printStackTrace();
+			}
+			ImageIcon image = null;
+
+			if (url == null) {
+				System.err.println("Couldn't find file: " + value+auxext);
+			} else {
+				image = new ImageIcon(url);
+			}
+			JLabel label = new JLabel(image);
+			jPane.add(label);
+			
+			jPane.setVisible(true);
+			
+		}
+		}
+
+		return jPane;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel() {
+		if (jPanel == null) {
+			JLabel name = new JLabel();
+			jPanel = new JPanel();
+			jPanel.setLayout(null);
+			jPanel.setPreferredSize(new java.awt.Dimension(10, 50));
+			jPanel.setSize(411, 50);
+			name.setBounds(31, 20, 172, 17);
+			String auxext="";
+			if (!ext.equals("")){
+				auxext="."+ext;
+			}
+			name.setText(field + " : " + value+auxext);
+			jPanel.add(getJButton(), null);
+			jPanel.add(name, null);
+		}
+
+		return jPanel;
+	}
+
+	/**
+	 * This method initializes jButton
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getJButton() {
+		if (jButton == null) {
+			jButton = new JButton();
+			jButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+			jButton.setText("Cerrar");
+			jButton.setBounds(266, 12, 94, 25);
+			jButton.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
+
+						if (PluginServices.getMainFrame() != null) {
+							PluginServices.getMDIManager().closeView(LinkPanel.this);
+						} else {
+							((JDialog) (getParent().getParent().getParent()
+											.getParent())).dispose();
+						}
+					}
+				});
+		}
+
+		return jButton;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_ViewInfo = new ViewInfo(ViewInfo.MODALDIALOG |
+				ViewInfo.RESIZABLE);
+		m_ViewInfo.setTitle("HiperLink");
+
+		return m_ViewInfo;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+		// TODO Auto-generated method stub
+	}
+} //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/LinkPanel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ProjChooserPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ProjChooserPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ProjChooserPanel.java	(revision 1648)
@@ -0,0 +1,131 @@
+/*
+ * Created on 30-ene-2005
+ */
+package com.iver.cit.gvsig.gui.Panels;
+
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.cresques.cts.IProjection;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.gui.Dialogs.CSSelectionDialog;
+
+/**
+ * @author Luis W. Sevilla (sevilla_lui@gva.es)
+ */
+public class ProjChooserPanel extends JPanel {
+    private IProjection curProj=null;
+	private JLabel jLblProj = null;
+	private JLabel jLblProjName = null;
+	private JButton jBtnChangeProj = null;
+	private JPanel jPanelProj = null;
+	private boolean okPressed = false;
+	
+	private ActionListener actionListener = null;
+
+	/**
+	 * 
+	 */
+	public ProjChooserPanel(IProjection proj) {
+		super();
+		setCurProj(proj);
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+        setPreferredSize(new java.awt.Dimension(330,35));
+		add(getJLblProjName(), null);
+		add(getJLblProj(), null);
+		add(getJBtnChangeProj(), null);
+		initBtnChangeProj();
+	}
+	
+	private void initBtnChangeProj() {
+		getJBtnChangeProj().addActionListener(new java.awt.event.ActionListener() { 
+			public void actionPerformed(java.awt.event.ActionEvent e) {
+				okPressed = false;
+				CSSelectionDialog csSelect = new CSSelectionDialog();
+				csSelect.setProjection(curProj);
+				
+		        PluginServices.getMDIManager().addView(csSelect);
+		        
+		        if (csSelect.isOkPressed()) {
+		        	curProj = csSelect.getProjection();
+		        	jLblProj.setText(curProj.getAbrev());
+		        	okPressed = true;
+		        	if (actionListener != null) {
+		        		actionListener.actionPerformed(e);
+		        	}
+		        }
+			}
+		});
+	}
+
+	public JLabel getJLblProjName() {
+		if (jLblProjName == null) {
+	        jLblProjName = new JLabel();
+			jLblProjName.setPreferredSize(new java.awt.Dimension(95,15));
+			jLblProjName.setText("Proyecci�n actual:");
+		}
+		return jLblProjName;
+	}
+
+	public JLabel getJLblProj() {
+		if (jLblProj == null) {
+	        jLblProj = new JLabel();
+			jLblProj.setPreferredSize(new java.awt.Dimension(180,20));
+			jLblProj.setText(curProj.getAbrev());
+		}
+		return jLblProj;
+	}
+	public void addBtnChangeProjActionListener(java.awt.event.ActionListener al) {
+		jBtnChangeProj.addActionListener(al);
+	}
+	
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	public JButton getJBtnChangeProj() {
+		if (jBtnChangeProj == null) {
+			jBtnChangeProj = new JButton();
+			jBtnChangeProj.setText("...");
+			jBtnChangeProj.setPreferredSize(new java.awt.Dimension(34,16));
+		}
+		return jBtnChangeProj;
+	}
+	/**
+	 * @return Returns the curProj.
+	 */
+	public IProjection getCurProj() {
+		return curProj;
+	}
+	/**
+	 * @param curProj The curProj to set.
+	 */
+	public void setCurProj(IProjection curProj) {
+		this.curProj = curProj;
+	}
+	/**
+	 * @return Returns the okPressed.
+	 */
+	public boolean isOkPressed() {
+		return okPressed;
+	}
+	/**
+	 * @param actionListener The actionListener to set.
+	 */
+	public void addActionListener(ActionListener actionListener) {
+		this.actionListener = actionListener;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ProjChooserPanel.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorPanel.java	(revision 1648)
@@ -0,0 +1,165 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+/* 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.gui.Panels;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+
+import javax.swing.JPanel;
+
+
+/**
+ * Displays a colour.
+ */
+public class ColorPanel extends JPanel {
+    private Color fillColor = Color.red;
+    private Color lineColor = Color.green;
+    private int margin = 0;
+
+    public ColorPanel() {
+        setBackground(Color.white);
+    }
+
+    protected void paintComponent(Graphics g) {
+        super.paintComponent(g);
+
+        //Before I simply set the ColorPanel's background colour. But I found this
+        //caused weird paint effects e.g. a second copy of the panel appearing
+        //at the top left corner of the rendered image. [Jon Aquino].
+        //<<TODO:DESIGN>> Use the GraphicsState class [Jon Aquino]
+        Color originalColor = g.getColor();
+        g.setColor(getBackground());
+        ((Graphics2D)g).setStroke(fillStroke);
+        g.fillRect(0, 0, getWidth() - 1, getHeight() - 1);
+        g.setColor(fillColor);
+        g.fillRect(margin, margin, getWidth() - 1 - margin - margin,
+            getHeight() - 1 - margin - margin);
+
+        if (lineColor != null) {
+            g.setColor(lineColor);
+            ((Graphics2D)g).setStroke(lineStroke);
+
+            //-1 to ensure the rectangle doesn't extend past the panel [Jon Aquino]
+            g.drawRect(margin, margin, getWidth() - 1 - margin - margin,
+                getHeight() - 1 - margin - margin);
+        }
+
+        //<<TODO:DESIGN>> Put the next line in a finally block [Jon Aquino]
+        g.setColor(originalColor);
+    }
+
+    /** Workaround for bug 4238829 in the Java bug database */
+    public void setBounds(int x, int y, int w, int h) {
+        super.setBounds(x, y, w, h);
+        validate();
+    }
+
+    public void setFillColor(Color fillColor) {
+        this.fillColor = fillColor;
+    }
+
+    /**
+     * @param lineColor the new line colour, or null to not draw the line
+     */
+    public void setLineColor(Color lineColor) {
+        this.lineColor = lineColor;
+    }
+
+    public void setMargin(int margin) {
+        this.margin = margin;
+    }
+    public Color getFillColor() {
+        return fillColor;
+    }
+
+    public Color getLineColor() {
+        return lineColor;
+    }
+    
+    private BasicStroke fillStroke = new BasicStroke(1);
+    private int lineWidth = 1;
+    private BasicStroke lineStroke = new BasicStroke(lineWidth);
+    
+    public void setLineWidth(int lineWidth) {
+        lineStroke = new BasicStroke(lineWidth);
+        this.lineWidth = lineWidth;
+    }
+    
+    public int getLineWidth() {
+        return lineWidth;
+    }
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/ColorPanel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/MapOverview.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/MapOverview.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/MapOverview.java	(revision 1648)
@@ -0,0 +1,191 @@
+/*
+ * Created on 21-jun-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui;
+
+import com.iver.cit.gvsig.fmap.ColorEvent;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.ExtentEvent;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.ViewPortListener;
+import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior;
+import com.iver.cit.gvsig.gui.toolListeners.MapOverviewListener;
+import com.iver.cit.gvsig.gui.toolListeners.StatusBarListener;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author FJP TODO To change the template for this generated type comment go
+ * 		   to Window - Preferences - Java - Code Generation - Code and
+ * 		   Comments
+ */
+public class MapOverview extends MapControl implements ViewPortListener {
+	private MapControl m_MapAssoc;
+	boolean first = true;
+
+	/**
+	 * Crea un nuevo MapOverview.
+	 *
+	 * @param mapAssoc DOCUMENT ME!
+	 */
+	public MapOverview(MapControl mapAssoc) {
+		super();
+
+		// super.vp.setBackColor(new Color(230,230,230));
+		m_MapAssoc = mapAssoc;
+
+		// setModel((FMap) m_MapAssoc.getMapContext().clone()); // Lo inicializamos con
+		// los mismos temas que tenga el grande.
+		MapOverviewListener movl = new MapOverviewListener(this);
+		addMapTool("zoomtopoint", new PointBehavior(movl));
+		setCursor(movl.getCursor());
+
+		pushTool("zoomtopoint");
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public FMap getAssociatedMapContext() {
+		return m_MapAssoc.getMapContext();
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.opensig.gui.IMapExtentListener#extentChanged(java.awt.geom.Rectangle2D)
+	 */
+	public void extentChanged(ExtentEvent evExtent) {
+		// Nos llega el nuevo extent del FMap asociado, as� que dibujamos nuestro 
+		// rect�ngulo para mostrar la zona de dibujo del otro mapa.
+		repaint();
+	}
+
+	/**
+	 * Recalcula el extent a aplicar de las capas que estan a�adidas.
+	 */
+	public void refreshExtent() {
+		try {
+				this.getMapContext().getViewPort().setExtent(this.getMapContext().getFullExtent());
+			} catch (DriverException e1) {
+				e1.printStackTrace();
+			}
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
+	 */
+	protected void paintComponent(Graphics g) {
+		super.paintComponent(g);
+
+		if ((m_MapAssoc.getMapContext().getViewPort().getExtent() != null) &&
+				(getMapContext().getViewPort().getExtent() != null)) {
+			if (first) {
+				first = false;
+				repaint();
+
+				return;
+			} else {
+				first = true;
+			}
+
+			ViewPort vp = getMapContext().getViewPort();
+			ViewPort vpOrig = m_MapAssoc.getMapContext().getViewPort();
+			Graphics2D g2 = (Graphics2D) g;
+			g2.setColor(Color.black);
+			g2.setXORMode(Color.white);
+
+			// Dibujamos el extent del mapa asociado.
+			g2.setTransform(vp.getAffineTransform());
+
+			g2.fill(vpOrig.getAdjustedExtent());
+			// dibujamos las l�neas vertical y horizontal
+			Point2D pRightUp = vp.toMapPoint(getWidth(), 0);
+			Line2D.Double linVert = new Line2D.Double(vpOrig.getExtent()
+															.getCenterX(),
+					vp.getExtent().getMinY(), vpOrig.getExtent().getCenterX(),
+					pRightUp.getY());
+			Line2D.Double linHoriz = new Line2D.Double(vp.getExtent().getMinX(),
+					vpOrig.getExtent().getCenterY(), pRightUp.getX(),
+					vpOrig.getExtent().getCenterY());
+
+			g2.draw(linVert);
+			g2.draw(linHoriz);
+
+			g2.setTransform(new AffineTransform());
+
+			// System.out.println("Dibujo el extent " + m_MapAssoc.getExtent().toString());
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param model DOCUMENT ME!
+	 */
+	public void setModel(FMap model) {
+		this.setMapContext(model);
+		m_MapAssoc.getMapContext().getViewPort().addViewPortListener(this);
+		getMapContext().getViewPort().addViewPortListener(this);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.ViewPortListener#backColorChanged(com.iver.cit.gvsig.fmap.ColorEvent)
+	 */
+	public void backColorChanged(ColorEvent e) {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/MapOverview.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/DnDJTree.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/DnDJTree.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/DnDJTree.java	(revision 1648)
@@ -0,0 +1,396 @@
+/*
+ * Created on 02-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.gui.toc;
+/*
+**  This is version II of DnDJTree. The first version allowed for what I 
+**  thought was a JDK oversight. However, we can set the cursor appropriately,
+**  relative to whether the current cursor location is a valid drop target.
+**
+**  If this is your first time reading the source code. Just ignore the above
+**  comment and ignore the "CHANGED" comments below. Otherwise, the 
+**  "CHANGED" comments will show where the code has changed.
+**
+**  Credit for finding this shortcoming in my code goes Laurent Hubert.
+**  Thanks Laurent.
+**
+**  Rob. [ rkenworthy@hotmail.com ]
+*/
+
+
+import java.awt.Cursor;
+import java.awt.Point;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragGestureRecognizer;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceContext;
+import java.awt.dnd.DragSourceDragEvent;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceEvent;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.InputEvent;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+public class DnDJTree extends JTree
+                  implements TreeSelectionListener, 
+                  DragGestureListener, DropTargetListener,
+                  DragSourceListener {
+
+  protected ArrayList m_Listeners = new ArrayList();
+	
+  /** Stores the parent Frame of the component */
+  // private Frame Parent = null;
+
+  /** Stores the selected node info */
+  protected TreePath SelectedTreePath = null;
+  protected DefaultMutableTreeNode SelectedNode = null;
+
+  /** Variables needed for DnD */
+  private DragSource dragSource = null;
+  private DragSourceContext dragSourceContext = null;
+
+
+  /** Constructor 
+  @param root The root node of the tree
+  @param parent Parent JFrame of the JTree */
+  public DnDJTree(TreeModel treeModel) {
+    super(treeModel);
+    // Parent = parent;
+
+    addTreeSelectionListener(this);
+
+		/* ********************** CHANGED ********************** */
+    dragSource = DragSource.getDefaultDragSource() ;
+		/* ****************** END OF CHANGE ******************** */
+    
+    DragGestureRecognizer dgr = 
+      dragSource.createDefaultDragGestureRecognizer(
+        this,                             //DragSource
+        DnDConstants.ACTION_COPY_OR_MOVE, //specifies valid actions
+        this                              //DragGestureListener
+      );
+
+
+    /* Eliminates right mouse clicks as valid actions - useful especially
+     * if you implement a JPopupMenu for the JTree
+     */
+    dgr.setSourceActions(dgr.getSourceActions() & ~InputEvent.BUTTON3_MASK);
+
+    /* First argument:  Component to associate the target with
+     * Second argument: DropTargetListener 
+    */
+    DropTarget dropTarget = new DropTarget(this, this);
+
+  }
+
+  /** Returns The selected node */
+  public DefaultMutableTreeNode getSelectedNode() {
+    return SelectedNode;
+  }
+
+  ///////////////////////// Interface stuff ////////////////////
+
+
+  /** DragGestureListener interface method */
+  public void dragGestureRecognized(DragGestureEvent e) {
+    //Get the selected node
+    DefaultMutableTreeNode dragNode = getSelectedNode();
+    if (dragNode != null) {
+
+      
+      if (!(dragNode.getUserObject() instanceof Transferable)) return;
+      
+//    Get the Transferable Object
+      Transferable transferable = (Transferable) dragNode.getUserObject();
+      
+			/* ********************** CHANGED ********************** */
+
+      //Select the appropriate cursor;
+      Cursor cursor = DragSource.DefaultCopyNoDrop;
+      int action = e.getDragAction();
+      if (action == DnDConstants.ACTION_MOVE) 
+        cursor = DragSource.DefaultMoveDrop;
+        
+        
+      //In fact the cursor is set to NoDrop because once an action is rejected
+      // by a dropTarget, the dragSourceListener are no more invoked.
+      // Setting the cursor to no drop by default is so more logical, because 
+      // when the drop is accepted by a component, then the cursor is changed by the
+      // dropActionChanged of the default DragSource.
+			/* ****************** END OF CHANGE ******************** */
+   
+      //begin the drag
+      dragSource.startDrag(e, cursor, transferable, this);
+    }
+  }
+
+  /** DragSourceListener interface method */
+  public void dragDropEnd(DragSourceDropEvent dsde) {
+  }
+
+  /** DragSourceListener interface method */
+  public void dragEnter(DragSourceDragEvent dsde) {
+		/* ********************** CHANGED ********************** */
+		/* ****************** END OF CHANGE ******************** */
+  }
+
+  /** DragSourceListener interface method */
+  public void dragOver(DragSourceDragEvent dsde) {
+		/* ********************** CHANGED ********************** */
+		/* ****************** END OF CHANGE ******************** */
+  }
+
+  /** DragSourceListener interface method */
+  public void dropActionChanged(DragSourceDragEvent dsde) {
+  }
+
+  /** DragSourceListener interface method */
+  public void dragExit(DragSourceEvent dsde) {
+  }
+
+  
+  
+  
+  /** DropTargetListener interface method - What we do when drag is released */
+  public void drop(DropTargetDropEvent e) {
+    try {
+      Transferable tr = e.getTransferable();
+
+      //flavor not supported, reject drop
+      if (!tr.isDataFlavorSupported( TocItemBranch.INFO_FLAVOR)) e.rejectDrop();
+      
+
+      //cast into appropriate data type
+      TocItemBranch childInfo = 
+        (TocItemBranch) tr.getTransferData( TocItemBranch.INFO_FLAVOR ); 
+
+      //get new parent node
+      Point loc = e.getLocation();
+      TreePath destinationPath = getPathForLocation(loc.x, loc.y);
+
+      final String msg = testDropTarget(destinationPath, SelectedTreePath);
+      if (msg != null) {
+        e.rejectDrop();
+
+        SwingUtilities.invokeLater(new Runnable() {
+          public void run() {
+                 System.err.println(msg);
+          }
+        });
+        return;
+      }
+
+      int posActual,newPos;
+      
+      
+      DefaultMutableTreeNode nodoTocado =
+        (DefaultMutableTreeNode) destinationPath.getLastPathComponent(); 
+      
+      // Para no tener en cuenta los nodos de s�mbolos:
+      if (!(nodoTocado.getUserObject() instanceof TocItemBranch))
+      {
+      		nodoTocado = (DefaultMutableTreeNode) nodoTocado.getParent();
+      }
+
+      //get old parent node
+      DefaultMutableTreeNode oldParent = (DefaultMutableTreeNode) getSelectedNode().getParent();
+      posActual = oldParent.getIndex(getSelectedNode());
+      newPos = oldParent.getIndex(nodoTocado);
+      
+      
+
+      int action = e.getDropAction();
+      boolean copyAction = (action == DnDConstants.ACTION_COPY);
+
+      //make new child node
+      DefaultMutableTreeNode newChild = new DefaultMutableTreeNode(childInfo);
+
+      try { 
+        if (!copyAction) oldParent.remove(getSelectedNode());
+        oldParent.insert(newChild,newPos);
+        // newParent.add(newChild);
+          
+        if (copyAction) e.acceptDrop (DnDConstants.ACTION_COPY);
+        else e.acceptDrop (DnDConstants.ACTION_MOVE);
+      }
+      catch (java.lang.IllegalStateException ils) {
+        e.rejectDrop();
+      }
+
+      e.getDropTargetContext().dropComplete(true);
+      
+      //expand nodes appropriately - this probably isnt the best way...
+      DefaultTreeModel model = (DefaultTreeModel) getModel();
+      model.reload(oldParent);
+      
+      callListeners(posActual, newPos);
+      /* model.reload(newParent);
+      TreePath parentPath = new TreePath(newParent.getPath());
+      expandPath(parentPath); */
+    }
+    catch (IOException io) { e.rejectDrop(); }
+    catch (UnsupportedFlavorException ufe) {e.rejectDrop();}
+  } //end of method
+
+
+  /** DropTaregetListener interface method */
+  public void dragEnter(DropTargetDragEvent e) {
+  }
+
+  /** DropTaregetListener interface method */
+  public void dragExit(DropTargetEvent e) { 
+  }
+
+  /** DropTaregetListener interface method */
+  public void dragOver(DropTargetDragEvent e) {
+		/* ********************** CHANGED ********************** */
+    //set cursor location. Needed in setCursor method
+    Point cursorLocationBis = e.getLocation();
+        TreePath destinationPath = 
+      getPathForLocation(cursorLocationBis.x, cursorLocationBis.y);
+
+
+    // if destination path is okay accept drop...
+    if (testDropTarget(destinationPath, SelectedTreePath) == null){
+    	e.acceptDrag(DnDConstants.ACTION_MOVE) ;
+    }
+    // ...otherwise reject drop
+    else {
+    	e.rejectDrag() ;
+    }
+		/* ****************** END OF CHANGE ******************** */
+  }
+
+  /** DropTaregetListener interface method */
+  public void dropActionChanged(DropTargetDragEvent e) {
+  }
+
+
+  /** TreeSelectionListener - sets selected node */
+  public void valueChanged(TreeSelectionEvent evt) {
+    SelectedTreePath = evt.getNewLeadSelectionPath();
+    if (SelectedTreePath == null) {
+      SelectedNode = null;
+      return;
+    }
+    SelectedNode = 
+      (DefaultMutableTreeNode)SelectedTreePath.getLastPathComponent();
+  }
+
+  /** Convenience method to test whether drop location is valid
+  @param destination The destination path 
+  @param dropper The path for the node to be dropped
+  @return null if no problems, otherwise an explanation
+  */
+  private String testDropTarget(TreePath destination, TreePath dropper) {
+    //Typical Tests for dropping
+ 
+    //Test 1.
+    boolean destinationPathIsNull = destination == null;
+    if (destinationPathIsNull) 
+      return "Invalid drop location.";
+
+    //Test 2.
+    DefaultMutableTreeNode node = (DefaultMutableTreeNode) destination.getLastPathComponent();
+    if ( !node.getAllowsChildren() )
+      return "This node does not allow children";
+
+    if (destination.equals(dropper))
+      return "Destination cannot be same as source";
+
+    //Test 3.
+    /* if ( dropper.isDescendant(destination)) 
+       return "Destination node cannot be a descendant.";
+
+    //Test 4.
+    if ( dropper.getParentPath().equals(destination)) 
+       return "Destination node cannot be a parent."; */
+
+    return null;
+  }
+
+	/**
+	 * @param arg0
+	 * @return
+	 */
+	public boolean addOrderListener(ITocOrderListener arg0) {
+		return m_Listeners.add(arg0);
+	}
+	/**
+	 * @param arg0
+	 * @return
+	 */
+	public boolean removeOrderListener(ITocOrderListener arg0) {
+		return m_Listeners.remove(arg0);
+	}
+	private void callListeners(int oldPos, int newPos)
+	{
+		for (int i=0; i < m_Listeners.size(); i++)
+		{
+			ITocOrderListener listener = (ITocOrderListener) m_Listeners.get(i);
+			listener.orderChanged(oldPos, newPos);
+		}
+	}
+  
+
+} //end of DnDJTree

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/DnDJTree.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocOrderListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocOrderListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocOrderListener.java	(revision 1648)
@@ -0,0 +1,57 @@
+/*
+ * Created on 03-jun-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui.toc;
+
+/**
+ * @author fjp
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public interface ITocOrderListener {
+	void orderChanged(int oldPos, int newPos);
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocOrderListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemBranch.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemBranch.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemBranch.java	(revision 1648)
@@ -0,0 +1,139 @@
+/*
+ * Created on 03-dic-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui.toc;
+
+import java.awt.Dimension;
+import java.awt.Image;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.UIManager;
+
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+
+/**
+ * @author FJP
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class TocItemBranch implements ITocItem {
+
+	private final Icon icolayer = new ImageIcon("images/icolayer.png");
+	
+	private FLayer lyr;
+	
+	private Dimension sz;
+	
+    final public static DataFlavor INFO_FLAVOR =
+	    new DataFlavor(TocItemBranch.class, "ItemBranch");
+    static DataFlavor flavors[] = {INFO_FLAVOR };
+	
+	public TocItemBranch(FLayer lyr)
+	{
+		this.lyr = lyr;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#getLabel()
+	 */
+	public String getLabel() {
+		return lyr.getName();
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#getIcon()
+	 */
+	public Icon getIcon() {
+		// TODO Pedirle el icono a la capa. Por defecto habr� un icono
+		// para vectoriales y otro para raster, pero se podr�n cambiar.
+		return icolayer;
+	}
+
+	public FLayer getLayer() {
+		return lyr;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
+	 */
+	public DataFlavor[] getTransferDataFlavors() {
+		return flavors;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.awt.datatransfer.Transferable#isDataFlavorSupported(java.awt.datatransfer.DataFlavor)
+	 */
+	public boolean isDataFlavorSupported(DataFlavor dF) {
+		return dF.equals(INFO_FLAVOR);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.awt.datatransfer.Transferable#getTransferData(java.awt.datatransfer.DataFlavor)
+	 */
+	public Object getTransferData(DataFlavor dF) throws UnsupportedFlavorException, IOException {
+	    if (dF.equals(INFO_FLAVOR)) {
+	        return this;
+	      }
+	      else throw new UnsupportedFlavorException(dF);
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#getSize()
+	 */
+	public Dimension getSize() {
+		return sz;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#setSize(java.awt.Dimension)
+	 */
+	public void setSize(Dimension sz) {
+		this.sz = sz;
+	}
+	
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemBranch.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOC.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOC.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOC.java	(revision 1648)
@@ -0,0 +1,621 @@
+/*
+ * Created on 13-may-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.toc;
+
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.JColorChooser;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.event.TreeExpansionEvent;
+import javax.swing.event.TreeExpansionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.AtomicEvent;
+import com.iver.cit.gvsig.fmap.AtomicEventListener;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.layers.CancelationException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent;
+import com.iver.cit.gvsig.fmap.layers.LayerCollectionListener;
+import com.iver.cit.gvsig.fmap.layers.LayerPositionEvent;
+import com.iver.cit.gvsig.fmap.layers.LegendListener;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.Classifiable;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.LayerCollection;
+import com.iver.cit.gvsig.fmap.rendering.ClassifiedLegendInfo;
+import com.iver.cit.gvsig.fmap.rendering.Legend;
+import com.iver.cit.gvsig.fmap.rendering.LegendChangedEvent;
+
+/**
+ * @author fjp
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+public class TOC extends JComponent implements ITocOrderListener, 
+			LegendListener, LayerCollectionListener,
+			TreeExpansionListener, ComponentListener {
+	private FMap mapContext;
+	private DnDJTree m_Tree;
+	private DefaultTreeModel m_TreeModel;
+	private DefaultMutableTreeNode m_Root;
+	private TOCRenderer m_TocRenderer;
+	private JScrollPane m_Scroller;
+	private ArrayList m_Listeners;
+	private HashMap m_ItemsExpanded = new HashMap();
+	
+	/**
+	 * Clase Listener que reacciona al pulsar sobre el checkbox de un nodo y
+	 * crea un popupmenu al pulsar el bot�n derecho.
+	 */
+	class NodeSelectionListener extends MouseAdapter implements ActionListener {
+		JTree tree;
+		JDialog dlg;
+		JColorChooser colorChooser;
+		FPopupMenu popmenu = null; 
+
+		NodeSelectionListener(JTree tree) {
+			this.tree = tree;
+		}
+
+		public void mouseClicked(MouseEvent e) {
+			int x = e.getX();
+			int y = e.getY();
+			int row = tree.getRowForLocation(x, y);
+			TreePath path = tree.getPathForRow(row);
+			LayerCollection layers = mapContext.getLayers();
+			// System.out.println(e.getSource());
+
+			if (path != null) {
+				DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
+				// System.out.println("Evento de rat�n originado por " + e.getSource().getClass().toString());
+
+				if (node.getUserObject() instanceof TocItemBranch) {
+					
+					TocItemBranch elTema = (TocItemBranch) node.getUserObject(); 
+		        	FLayer lyr = elTema.getLayer();
+		        	lyr.getFMap().beginAtomicEvent();
+					// Si tenemos may�sculas apretadas es que queremos activar m�s temas.
+					// Si no, primero desactivamos temas
+					if (!((e.getModifiers() & InputEvent.SHIFT_MASK) != 0))
+					{
+						layers.setAllActives(false);
+						
+					}
+		        	
+		        	lyr.setActive(true);
+					// Si pertenece a un grupo, lo ponemos activo tambi�n.
+		        	FLayer parentLayer = lyr.getParentLayer();
+		        	if (parentLayer != null){
+			        	parentLayer.setActive(true);
+		        	}
+		        	
+					Point layerNodeLocation = tree.getUI()
+												  .getPathBounds(tree, path)
+												  .getLocation();
+
+					//Rect�ngulo que representa el checkbox
+					Rectangle checkBoxBounds = m_TocRenderer.getCheckBoxBounds();
+					checkBoxBounds.translate((int) layerNodeLocation.getX(),
+						(int) layerNodeLocation.getY());
+
+					if (checkBoxBounds.contains(e.getPoint())) {
+						lyr.setVisible(!lyr.isVisible());
+					}
+					
+					//Boton derecho sobre un nodo del arbol
+					if ((e.getModifiers() & InputEvent.META_MASK) != 0) {
+						popmenu = new FPopupMenu(mapContext, node);
+						tree.add(popmenu);
+
+						//System.out.println("boton derecho");
+						popmenu.show(e.getComponent(), e.getX(), e.getY());
+					}
+					
+					lyr.getFMap().endAtomicEvent();
+					
+				}
+				
+
+				if (node.getUserObject() instanceof TocItemLeaf)
+				{
+					//Boton derecho sobre un Simbolo
+					TocItemLeaf auxLeaf = (TocItemLeaf) node.getUserObject();
+					FSymbol theSym = auxLeaf.getSymbol();
+					
+					if ((e.getModifiers() & InputEvent.META_MASK) != 0) {
+						popmenu = new FPopupMenu(mapContext, node);
+						tree.add(popmenu);
+						popmenu.show(e.getComponent(), e.getX(), e.getY());
+					}
+				}				
+
+				((DefaultTreeModel) tree.getModel()).nodeChanged(node);
+
+				if (row == 0) {
+					tree.revalidate();
+					tree.repaint();
+				}
+				if (PluginServices.getMainFrame() != null)
+					PluginServices.getMainFrame().enableControls();
+			}
+		}
+
+		public void actionPerformed(ActionEvent arg0) {
+		}
+	}
+	
+	
+	public TOC() {
+
+		this.setLayout(new BorderLayout());
+		this.setMinimumSize(new Dimension(100,80));
+		this.setPreferredSize(new Dimension(100,80));
+		
+		//Construct the tree.
+		m_Root = new DefaultMutableTreeNode(java.lang.Object.class);
+		m_TreeModel = new DefaultTreeModel(m_Root);
+		m_Tree = new DnDJTree(m_TreeModel);
+		
+		m_TocRenderer = new TOCRenderer();
+		m_Tree.setCellRenderer(m_TocRenderer);
+		
+		m_Tree.setRootVisible(false);
+		// m_Tree.setExpandsSelectedPaths(true);
+		// m_Tree.setAutoscrolls(true);
+		m_Tree.setShowsRootHandles(true);
+		//Posibilidad de seleccionar de forma aleatoria nodos de la leyenda.
+		m_Tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
+		m_Tree.addMouseListener(new NodeSelectionListener(m_Tree));
+		m_Tree.setBackground(UIManager.getColor("Button.background"));
+		m_Tree.setBorder(BorderFactory.createEtchedBorder());
+		
+		this.addComponentListener(this);	
+		
+		m_Tree.addTreeExpansionListener(this);
+		
+		m_Tree.addOrderListener(this);
+		
+		m_Tree.setRowHeight(0); // Para que lo determine el renderer
+		
+		
+		m_Scroller = new JScrollPane(m_Tree);
+  		m_Scroller.setBorder(BorderFactory.createEmptyBorder());
+  
+		// scrollPane.setPreferredSize(new Dimension(80,80));
+
+		//Add everything to this panel.
+		/* GridBagLayout gridbag = new GridBagLayout();
+		GridBagConstraints c = new GridBagConstraints();
+
+		setLayout(gridbag);
+
+		c.fill = GridBagConstraints.BOTH;
+		c.weightx = 1.0;
+		gridbag.setConstraints(check,c); */
+		
+		add(m_Scroller); //, BorderLayout.WEST);
+		
+//		refresh();
+		
+	}
+
+	
+
+	public void setMapContext(FMap mc) {		
+		mapContext = mc;
+		mapContext.addAtomicEventListener(new AtomicEventListener() {
+			/**
+			 * @see com.iver.cit.gvsig.fmap.AtomicEventListener#atomicEvent(com.iver.cit.gvsig.fmap.AtomicEvent)
+			 */
+			public void atomicEvent(AtomicEvent e) {
+				if ((e.getLayerCollectionEvents().length > 0) ||
+						(e.getLegendEvents().length > 0))
+					SwingUtilities.invokeLater(new Runnable() {
+						public void run() {
+							refresh();
+						}
+					});
+				if (e.getLayerEvents().length > 0) {
+					repaint();
+				}
+				if (e.getExtentEvents().length > 0) {
+					repaint();
+				}
+				
+			}
+		});
+		
+		SwingUtilities.invokeLater(new Runnable() {
+			public void run() {
+				refresh();
+			}
+		});
+	}
+	
+	private void setExpandedNodes()
+	{
+		int i = 0;
+		// Las claves sobrantes de m_ItemsExpanded (provocadas
+		// por layerRemove, se quitan en el evento layerRemoved
+		// de este TOC
+		DefaultMutableTreeNode n;
+		Enumeration enum = m_Root.children();
+		while (enum.hasMoreElements())
+		{
+			n =  (DefaultMutableTreeNode) enum.nextElement();
+			TreePath path = new TreePath(m_TreeModel.getPathToRoot(n));
+			ITocItem item = (ITocItem) n.getUserObject();
+			Boolean b = (Boolean) m_ItemsExpanded.get(item.getLabel());
+			if (b == null) // No estaba en el hash todav�a: valor por defecto
+			{
+				// System.out.println("Primera expansi�n de " + item.getLabel());
+				m_Tree.expandPath(path);
+				return;
+			}
+			if (b.booleanValue())
+			{
+				// System.out.println("Expansi�n de " + item.getLabel());
+				m_Tree.expandPath(path);
+			}
+			else
+			{
+				// System.out.println("Colapso de " + item.getLabel());
+				m_Tree.collapsePath(path);
+			}
+		} 
+
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.iver.cit.opensig.gui.IToc#refresh()
+	 */
+	public void refresh() {
+		LayerCollection theLayers = mapContext.getLayers();
+		m_Root.removeAllChildren();
+		m_Root.setAllowsChildren(true);
+		System.out.println("Refresh del toc");
+		doRefresh(theLayers, m_Root);
+		
+		m_TreeModel.reload();
+		
+		setExpandedNodes();
+	}
+	private void doRefresh(LayerCollection theLayers, DefaultMutableTreeNode parentNode)
+	{
+		Dimension sizeLeaf = new Dimension(m_Tree.getWidth(), 15);
+		Dimension sizeBranch = new Dimension(m_Tree.getWidth(), 25);
+		for (int i=theLayers.getLayersCount()-1;i>=0; i--)
+		{
+			FLayer lyr = theLayers.getLayer(i);
+			TocItemBranch elTema = new TocItemBranch(lyr);
+			elTema.setSize(sizeBranch);
+			DefaultMutableTreeNode nodeLayer = new DefaultMutableTreeNode(elTema);
+			
+			m_TreeModel.insertNodeInto(nodeLayer, parentNode, parentNode.getChildCount());
+			TreePath path = new TreePath(m_TreeModel.getPathToRoot(nodeLayer));
+			// m_Tree.makeVisible(path);
+			if (lyr instanceof LayerCollection)
+			{
+				LayerCollection group = (LayerCollection) lyr;
+				doRefresh(group, nodeLayer);
+			}
+			else
+			{
+				if (lyr instanceof Classifiable)
+				{
+					Classifiable aux = (Classifiable) lyr;
+					Legend legendInfo = aux.getLegend();
+					try {					
+						if (legendInfo instanceof ClassifiedLegendInfo)
+						{
+							ClassifiedLegendInfo cl = (ClassifiedLegendInfo) legendInfo;
+							String[] descriptions = cl.getDescriptions();
+							FSymbol[] symbols = cl.getSymbols();
+							for (int j=0; j<descriptions.length;j++)
+							{					
+								TocItemLeaf itemLeaf;
+								itemLeaf = new TocItemLeaf(symbols[j],descriptions[j], aux.getShapeType());
+								itemLeaf.setSize(sizeLeaf);
+								DefaultMutableTreeNode nodeValue = new DefaultMutableTreeNode(itemLeaf);
+								m_TreeModel.insertNodeInto(nodeValue, nodeLayer, nodeLayer.getChildCount());
+								TreePath pathSymbol = new TreePath(m_TreeModel.getPathToRoot(nodeValue));
+								// m_Tree.makeVisible(pathSymbol);							
+							}						
+						}
+						if (legendInfo.getDefaultSymbol() != null)
+						{
+							TocItemLeaf itemLeaf;					
+							itemLeaf = new TocItemLeaf(legendInfo.getDefaultSymbol(),"Default", aux.getShapeType());
+							itemLeaf.setSize(sizeLeaf);
+							DefaultMutableTreeNode nodeValue = new DefaultMutableTreeNode(itemLeaf);
+							m_TreeModel.insertNodeInto(nodeValue, nodeLayer, nodeLayer.getChildCount());
+							TreePath pathSymbol = new TreePath(m_TreeModel.getPathToRoot(nodeValue));
+							// m_Tree.makeVisible(pathSymbol);
+						}
+					} catch (DriverException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+					
+			} // if instanceof layers
+			
+		}
+		
+	}
+
+	/**
+	 * @see com.iver.cit.opensig.gui.toc.ITocOrderListener#orderChanged(int, int)
+	 */
+	public void orderChanged(int oldPos, int newPos) {
+		LayerCollection layers = mapContext.getLayers();
+		// El orden es el contrario, hay que traducir.
+		// El orden es el contrario, hay que traducir.
+		oldPos = layers.getLayersCount() -1 - oldPos;
+		newPos = layers.getLayersCount() -1 - newPos;
+		try {
+			layers.moveTo(oldPos, newPos);
+		} catch (CancelationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		// No hace falta un refresh, lo hace mediante eventos.
+		// refresh();
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent)
+	 */
+	public void componentHidden(ComponentEvent e) {
+
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent)
+	 */
+	public void componentMoved(ComponentEvent e) {
+
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
+	 */
+	public void componentResized(ComponentEvent e) {
+		System.out.println("Cambiando tama�o.");
+		
+		int i = 0;
+		DefaultMutableTreeNode n;
+		Enumeration enum = m_Root.children();
+		while (enum.hasMoreElements())
+		{
+			n =  (DefaultMutableTreeNode) enum.nextElement();
+			if (n.getUserObject() instanceof TocItemBranch)
+			{
+				
+		       	ITocItem item = (ITocItem) n.getUserObject();
+		       	Dimension szAnt = item.getSize();
+		       	item.setSize(new Dimension(this.getWidth()-40,szAnt.height));
+			}						
+			System.out.println("i=" + i++);
+		} 
+		// m_Tree.setSize(this.getSize());
+		
+		System.out.println("Ancho del tree=" + m_Tree.getWidth() + " " + m_Tree.getComponentCount());
+		System.out.println("Ancho del TOC=" + this.getWidth());
+		// m_Tree.repaint();
+		
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent)
+	 */
+	public void componentShown(ComponentEvent e) {
+
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerListener#legendChanged(com.iver.cit.gvsig.fmap.rendering.LegendChangedEvent)
+	 */
+	public void legendChanged(LegendChangedEvent e) {
+		System.out.println("Refrescando TOC");
+		refresh();		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerAdded(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerAdded(LayerCollectionEvent e) {
+		refresh();
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerMoved(com.iver.cit.gvsig.fmap.layers.LayerPositionEvent)
+	 */
+	public void layerMoved(LayerPositionEvent e) {
+		refresh();		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerRemoved(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerRemoved(LayerCollectionEvent e) {
+		m_ItemsExpanded.remove(e.getAffectedLayer().getName());
+		refresh();
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerAdding(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerAdding(LayerCollectionEvent e) throws CancelationException {
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerMoving(com.iver.cit.gvsig.fmap.layers.LayerPositionEvent)
+	 */
+	public void layerMoving(LayerPositionEvent e) throws CancelationException {
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerRemoving(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerRemoving(LayerCollectionEvent e) throws CancelationException {
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#activationChanged(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void activationChanged(LayerCollectionEvent e) throws CancelationException {
+		repaint();
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#visibilityChanged(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void visibilityChanged(LayerCollectionEvent e) throws CancelationException {
+		repaint();
+		
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see javax.swing.event.TreeExpansionListener#treeCollapsed(javax.swing.event.TreeExpansionEvent)
+	 */
+	public void treeCollapsed(TreeExpansionEvent event) {
+		TreePath path = event.getPath();		
+		DefaultMutableTreeNode n = (DefaultMutableTreeNode)path.getLastPathComponent();
+		if (n.getUserObject() instanceof ITocItem)
+		{
+			ITocItem item = (ITocItem) n.getUserObject();
+			Boolean b = Boolean.FALSE;
+			// System.out.println("Collapsed: " + item.getLabel());
+			m_ItemsExpanded.put(item.getLabel(), b);
+		}
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see javax.swing.event.TreeExpansionListener#treeExpanded(javax.swing.event.TreeExpansionEvent)
+	 */
+	public void treeExpanded(TreeExpansionEvent event) {
+		TreePath path = event.getPath();		
+		DefaultMutableTreeNode n = (DefaultMutableTreeNode)path.getLastPathComponent();
+		if (n.getUserObject() instanceof ITocItem)
+		{
+			ITocItem item = (ITocItem) n.getUserObject();
+			Boolean b = Boolean.TRUE;
+			// System.out.println("Expanded: " + item.getLabel());
+			m_ItemsExpanded.put(item.getLabel(), b);
+		}
+		
+	}
+
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOC.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOCRenderer.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOCRenderer.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOCRenderer.java	(revision 1648)
@@ -0,0 +1,261 @@
+/*
+ * Created on 23-feb-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.toc;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Rectangle;
+
+import javax.swing.BorderFactory;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTree;
+import javax.swing.SpringLayout;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreeCellRenderer;
+
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+
+
+
+/**
+ * Renderer que actua sobre el TOC.
+ *
+ * @author vcn
+ */
+public class TOCRenderer extends JPanel implements TreeCellRenderer {
+    public Border bordeSeleccionado = BorderFactory.createEtchedBorder();
+
+    /*public Border bordeSeleccionado = BorderFactory.createBevelBorder(BevelBorder.RAISED,
+            SystemColor.black, SystemColor.lightGray, SystemColor.gray,
+            SystemColor.lightGray);
+    */
+    private Border bordeNormal = BorderFactory.createEmptyBorder();
+    
+	private JCheckBox check;
+	private JLabel label;
+
+	private static final Font BIGGER_FONT = 
+									  new Font("SansSerif", Font.BOLD, 12);
+
+	GridBagLayout gridbag = new GridBagLayout();
+	GridBagConstraints c = new GridBagConstraints();
+    /**
+     * Creates a new TOCRenderer object.
+     */
+    public TOCRenderer() {
+        this.setBackground(Color.lightGray);
+        // this.setLayout(new BorderLayout());
+        
+		check = new JCheckBox();
+		label = new JLabel();
+		
+
+
+		/* this.setLayout(gridbag);
+
+		c.fill = GridBagConstraints.NONE;
+		c.weightx = 1.0;
+		c.anchor = GridBagConstraints.WEST;
+		// c.weightx = check.getWidth();
+		gridbag.setConstraints(check,c);
+		this.add(check);
+		c.anchor = GridBagConstraints.WEST;
+		gridbag.setConstraints(colorPanel,c);
+		// c.weightx = colorPanel.getWidth();
+		this.add(colorPanel);
+		c.gridwidth = GridBagConstraints.REMAINDER; //end row
+		c.fill = GridBagConstraints.HORIZONTAL;		
+		gridbag.setConstraints(label,c);
+		this.add(label); */ 
+
+
+
+		/* this.setLayout(new FlowLayout(FlowLayout.LEFT));
+		this.add(check);
+		this.add(colorPanel);
+		this.add(label); */
+		
+		/* this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
+		this.add(check);
+		this.add(colorPanel);
+		this.add(label); */  
+
+		SpringLayout theLayout = new SpringLayout();		 
+		this.setLayout(theLayout);
+
+		int rows = 1;
+		int cols = 2;
+				
+		/* this.setLayout(new BorderLayout());
+		
+		this.add(check, BorderLayout.WEST);
+		this.add(label, BorderLayout.CENTER);
+		*/ 
+		/*
+		GridBagLayout gridbag = new GridBagLayout();
+        GridBagConstraints c = new GridBagConstraints();
+        
+        this.setLayout(gridbag);
+        this.add(check);
+        c.gridwidth = GridBagConstraints.REMAINDER;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        this.add(label, c);
+        */
+		
+//		Adjust constraints for the text field so it's at
+//		(<label's right edge> + 5, 5).
+		this.add(check);
+		this.add(label);  
+
+		theLayout.putConstraint(SpringLayout.WEST, label,
+						   5,
+						   SpringLayout.EAST, check); 
+
+		this.setBorder(bordeSeleccionado);
+
+        check.setBackground(UIManager.getColor("Button.background"));
+        label.setForeground(UIManager.getColor("Tree.textForeground"));
+        
+        
+    }
+
+    /**
+     * M�todo llamado una vez por cada nodo, y todas las veces que se redibuja
+     * en pantalla el TOC.
+     *
+     * @param tree
+     * @param value
+     * @param isSelected
+     * @param expanded
+     * @param leaf
+     * @param row
+     * @param hasFocus
+     *
+     * @return
+     */
+    public Component getTreeCellRendererComponent(JTree tree, Object value,
+        boolean isSelected, boolean expanded, boolean leaf, int row,
+        boolean hasFocus) {
+                
+        DefaultMutableTreeNode n = (DefaultMutableTreeNode) value;
+		String stringValue = "";
+		this.setBackground(UIManager.getColor("Button.background"));
+		this.label.setFont(tree.getFont());
+		// System.out.println("ancho tree=" + tree.getWidth());
+
+		if (n.getUserObject() instanceof ITocItem)
+		{
+			
+	       	ITocItem item = (ITocItem) n.getUserObject();	       	
+			stringValue = item.getLabel();
+			
+	        Dimension sizeNode = item.getSize(); // Se fija en el resize del TOC
+	        
+			this.setPreferredSize(sizeNode);
+			
+			if (item instanceof TocItemBranch)
+			{
+				TocItemBranch branch = (TocItemBranch) item;
+				FLayer lyr = branch.getLayer();
+				check.setVisible(true);
+				check.setSelected(lyr.isVisible());
+				check.setEnabled(true);
+			    if (!lyr.isWithinScale())
+			        check.setEnabled(false);
+				
+				if (lyr.isActive())
+				{				
+					this.setBorder(bordeSeleccionado);
+					this.label.setFont(BIGGER_FONT);
+				}
+				else
+				{				
+					this.setBorder(bordeNormal);
+				}				
+	        }
+			else
+			{
+				check.setVisible(false);
+				this.setBorder(bordeNormal);			
+				
+			}
+	        label.setText(stringValue);
+	        if (item.getIcon() != null)
+	        {
+	        	label.setIcon(item.getIcon());
+	        	// System.out.println("Pongo etiqueta " + stringValue + " con icono " + item.getIcon().toString());
+	        }
+	        this.setPreferredSize(sizeNode);
+		}		
+		// this.setPreferredSize(new Dimension(tree.getWidth()-60,24)); // sizeNode);
+
+        if (leaf) {
+            // label.setIcon(UIManager.getIcon("Tree.leafIcon"));
+            
+        } else if (expanded) {
+            //label.setIcon(UIManager.getIcon("Tree.openIcon"));
+        } else {
+            //label.setIcon(UIManager.getIcon("Tree.closedIcon"));
+        }
+
+        return this;
+    }
+
+	public Rectangle getCheckBoxBounds() {
+		return check.getBounds();
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TOCRenderer.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemLeaf.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemLeaf.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemLeaf.java	(revision 1648)
@@ -0,0 +1,178 @@
+/*
+ * Created on 03-dic-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui.toc;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D;
+import com.iver.cit.gvsig.fmap.rendering.styling.SymbolPreviewDrawer;
+
+/**
+ * @author FJP
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class TocItemLeaf implements ITocItem {
+
+	private FSymbol symbol;
+	private String description;
+	private int layerType;
+	private static int w_1symbol = 20;
+	private static int h_1symbol = 15;
+	
+	private Dimension sz;
+	
+	private static SymbolPreviewDrawer pSD = new SymbolPreviewDrawer();
+	
+    final public static DataFlavor INFO_FLAVOR =
+	    new DataFlavor(TocItemLeaf.class, "ItemLeaf");
+
+	static DataFlavor flavors[] = {INFO_FLAVOR };
+	
+	
+	public TocItemLeaf(FSymbol symbol, String description, int layerType)
+	{
+		this.symbol = symbol;
+		this.description = description;
+		this.layerType = layerType;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#getLabel()
+	 */
+	public String getLabel() {
+		return description;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#getIcon()
+	 */
+	public Icon getIcon() {
+		// System.out.println("Dentro de getIcon: layerType=" + layerType);
+		BufferedImage img = null;
+		
+		switch (layerType)
+		{
+			case FShape.POINT:
+			case FShape.LINE:
+			case FShape.POLYGON:
+				img = new BufferedImage(w_1symbol, h_1symbol, BufferedImage.TYPE_INT_ARGB);
+				Graphics2D g2 = img.createGraphics();
+				Rectangle r = new Rectangle(w_1symbol, h_1symbol);				
+				FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, symbol);
+				break;									
+			case FShape.MULTI:
+				img = new BufferedImage(3*w_1symbol, h_1symbol, BufferedImage.TYPE_INT_ARGB);
+				g2 = img.createGraphics();
+				r = new Rectangle(3*w_1symbol, h_1symbol);
+				
+				FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, symbol);
+				break;					
+			
+		}
+		
+		return new ImageIcon(img);
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
+	 */
+	public DataFlavor[] getTransferDataFlavors() {
+		return flavors;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.awt.datatransfer.Transferable#isDataFlavorSupported(java.awt.datatransfer.DataFlavor)
+	 */
+	public boolean isDataFlavorSupported(DataFlavor dF) {
+		return dF.equals(INFO_FLAVOR);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.awt.datatransfer.Transferable#getTransferData(java.awt.datatransfer.DataFlavor)
+	 */
+	public Object getTransferData(DataFlavor dF) throws UnsupportedFlavorException, IOException {
+	    if (dF.equals(INFO_FLAVOR)) {
+	        return this;
+	      }
+	      else throw new UnsupportedFlavorException(dF);
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#getSize()
+	 */
+	public Dimension getSize() {
+		return sz;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.ITocItem#setSize(java.awt.Dimension)
+	 */
+	public void setSize(Dimension sz) {
+		this.sz = sz;
+		
+	}
+	
+
+	/**
+	 * @return Returns the symbol.
+	 */
+	public FSymbol getSymbol() {
+		return symbol;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemLeaf.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocMenuEntry.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocMenuEntry.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocMenuEntry.java	(revision 1648)
@@ -0,0 +1,101 @@
+/*
+ * Created on 20-dic-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.gui.toc;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+
+/**
+ * @author Luis W. Sevilla (sevilla_lui@gva.es)
+ */
+public abstract class TocMenuEntry implements ActionListener {
+	private FPopupMenu menu;
+	//private Class [] layerTypes = null;
+	public TocMenuEntry() {
+	}
+	
+	/**
+	 * Se utiliza para inicializar el menu. Dentro comprobar�
+	 * encima de qu� tipo de tocItem hemos pinchado, y se
+	 * mostrar� la opci�n de menu o no en funci�n de si
+	 * es un branch o un leaf, o incluso de alg�n otro
+	 * par�metro interno. 
+	 * @param menu
+	 */
+	public void initialize(FPopupMenu m) {
+		menu = m;
+	}
+	
+	/**
+	 * C�digo que se ejecuta cuando selecciona una opci�n
+	 * de menu. Recibe el tocItem sobre el que has pinchado.
+	 * @param tocItem
+	 */
+	public abstract void actionPerformed(ActionEvent e);
+	
+	public FPopupMenu getMenu() { return menu; }
+	
+	public FMap getMapContext() {
+		return menu.mapContext;
+	}
+	public Object getNodeUserObject() {
+		return menu.nodo.getUserObject();
+	}
+	
+	public FLayer getNodeLayer() {
+		if (isTocItemBranch())
+			return ((TocItemBranch) getNodeUserObject()).getLayer();
+		return null;
+	}
+	public boolean isTocItemLeaf() {
+		return getNodeUserObject() instanceof TocItemLeaf;
+	}
+	
+	public boolean isTocItemBranch() {
+		return getNodeUserObject() instanceof TocItemBranch;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocMenuEntry.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocItem.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocItem.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocItem.java	(revision 1648)
@@ -0,0 +1,67 @@
+/*
+ * Created on 03-dic-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui.toc;
+
+import java.awt.Dimension;
+import java.awt.datatransfer.Transferable;
+
+import javax.swing.Icon;
+
+/**
+ * @author FJP
+ * Siguiendo el Patr�n COMPOSITE: la rama ser� la capa (FLayer) y la
+ * hoja ser� el s�mbolo (FStyle2D)
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public interface ITocItem extends Transferable {
+	String getLabel();
+	Icon getIcon();
+	Dimension getSize();
+	void setSize(Dimension sz);
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/ITocItem.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java	(revision 1648)
@@ -0,0 +1,347 @@
+/*
+ * Created on 02-mar-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.gui.toc;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.tree.DefaultMutableTreeNode;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.layers.CancelationException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLyrDefault;
+import com.iver.cit.gvsig.fmap.layers.FLyrRaster;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial;
+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.AdjustTransparencyPanel;
+import com.iver.cit.gvsig.gui.legendmanager.FLegendManagerWindow;
+
+/**
+ * Realiza el cambio de color si se pulsa OK
+ * @author Luis W. Sevilla (sevilla_lui@gva.es)
+ */
+class FSymbolChangeColorTocMenuEntry extends TocMenuEntry {
+    private JMenuItem color;    
+	public void initialize(FPopupMenu m) {
+		super.initialize(m);
+		boolean bShow = false;
+		if (isTocItemBranch())
+		{
+			FLayer lyr = getNodeLayer();
+    		if ((lyr instanceof ClassifiableVectorial))
+    		{
+    		    ClassifiableVectorial lyrVect = (ClassifiableVectorial) lyr;
+    		    if (lyrVect.getLegend() instanceof SingleSymbolLegend)
+    		        bShow = true;
+    		}
+		}
+		else
+		    bShow = true;
+		if (bShow)
+		{
+        	color = new JMenuItem(PluginServices.getText(this, "Cambio_Color"));
+        	color.setFont(FPopupMenu.theFont);
+        	getMenu().add(color);        
+        	getMenu().enable();
+	        //Cambio color
+	        color.addActionListener(this);
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.TocMenuEntry#execute(com.iver.cit.gvsig.gui.toc.ITocItem)
+	 */
+	public void actionPerformed(ActionEvent e) {
+		ITocItem tocItem = (ITocItem) getNodeUserObject();
+        
+        Color newColor = JColorChooser.showDialog(null,                
+                PluginServices.getText(this, "Elegir_Color"),
+                null);
+        if (newColor != null)
+        {
+			if (isTocItemBranch())
+			{
+				FLayer lyr = getNodeLayer();
+	    		if ((lyr instanceof ClassifiableVectorial))
+	    		{
+	    		    ClassifiableVectorial lyrVect = (ClassifiableVectorial) lyr;
+	    		    if (lyrVect.getLegend() instanceof SingleSymbolLegend)
+	    		    {
+	    		        SingleSymbolLegend leg = (SingleSymbolLegend) lyrVect.getLegend();
+                        leg.getDefaultSymbol().setColor(newColor);
+                    } 
+	    		}
+			}
+			else
+			{
+    	        TocItemLeaf leaf = (TocItemLeaf) tocItem;
+    	        FSymbol sym = leaf.getSymbol();
+    	        sym.setColor(newColor);
+    	        			    
+			}
+	        // TRUCO PARA REFRESCAR.
+	        getMapContext().invalidate();                    
+
+        }
+        
+	}
+}
+
+class FLyrVectChangeStyleTocMenuEntry extends TocMenuEntry {
+    private JMenuItem estilo;
+	public void initialize(FPopupMenu m) {
+		super.initialize(m);
+		FLayer lyr = null;
+		
+		if (isTocItemBranch()) {
+			lyr = getNodeLayer();
+			if (lyr instanceof ClassifiableVectorial) {
+		    	estilo = new JMenuItem(PluginServices.getText(this, "Cambio_Estilo"));
+				getMenu().add(estilo);
+				estilo.setFont(FPopupMenu.theFont);
+				//Cambio estilo
+				estilo.addActionListener(this);
+			}
+		}
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.TocMenuEntry#execute(com.iver.cit.gvsig.gui.toc.ITocItem)
+	 */
+	public void actionPerformed(ActionEvent e) {
+		FLegendManagerWindow m_LegendEditor = new FLegendManagerWindow();
+		try {
+			m_LegendEditor.setMapContext(getMapContext());
+		} catch (com.iver.cit.gvsig.fmap.DriverException e1) {
+			e1.printStackTrace();
+		}
+		if (PluginServices.getMainFrame() == null) {
+			JDialog dlg = new JDialog();
+			    							
+			m_LegendEditor.setPreferredSize(m_LegendEditor.getSize());
+			dlg.getContentPane().add(m_LegendEditor);
+			dlg.setModal(false);			
+			dlg.pack();
+			dlg.show();
+			
+		} else
+			PluginServices.getMDIManager().addView(m_LegendEditor);
+	}
+}
+
+
+class FLyrRasterAdjustTransparencyTocMenuEntry extends TocMenuEntry {
+	private JMenuItem transparency;
+	FLayer lyr = null;
+	public void initialize(FPopupMenu m) {
+		super.initialize(m);
+		
+		if (isTocItemBranch()) {
+			lyr = getNodeLayer();
+    		// Opcciones para capas raster
+    		if ((lyr instanceof FLyrRaster)) {
+    		    transparency = new JMenuItem(PluginServices.getText(this, "adjust_transparency"));
+    			getMenu().add( transparency );
+    			transparency.setFont(FPopupMenu.theFont);
+    			getMenu().enable();
+    			getMenu().addSeparator();
+    	        //Cambio color
+    	        transparency.addActionListener(this);
+     		}
+		}
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.TocMenuEntry#execute(com.iver.cit.gvsig.gui.toc.ITocItem)
+	 */
+	public void actionPerformed(ActionEvent e) {
+       	lyr = getNodeLayer();
+        AdjustTransparencyPanel transPanel = new AdjustTransparencyPanel((FLyrDefault) lyr);
+        //transPanel.setFLayer((FLyrDefault) lyr);
+		transPanel.openJDialog();
+        /*dlg = JColorChooser.createDialog((JFrame) null,
+                PluginServices.getText(this, "adjust_transparency"),
+                true, panel, null, null);
+        dlg.show(true);*/
+		/*JDialog dlg = new JDialog();
+		
+		transPanel.setPreferredSize(transPanel.getSize());
+		dlg.getContentPane().add(transPanel);
+		dlg.setModal(true);			
+		dlg.pack();
+		dlg.show();
+        */
+        //((FLyrDefault) lyr).setTransparency(transPanel.getAlpha());
+        //view.repaintMap();
+		
+        // TRUCO PARA REFRESCAR.
+        getMapContext().invalidate();                    
+	}
+}
+
+class ZoomAlTemaTocMenuEntry extends TocMenuEntry {
+    private JMenuItem zoom;
+	public void initialize(FPopupMenu m) {
+		super.initialize(m);
+		
+		if (isTocItemBranch()) {
+			zoom = new JMenuItem(PluginServices.getText(this, "Zoom_al_Tema"));
+			getMenu().add(zoom);
+			zoom.setFont(FPopupMenu.theFont);
+            
+	        zoom.addActionListener(this);
+		}
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.TocMenuEntry#execute(com.iver.cit.gvsig.gui.toc.ITocItem)
+	 */
+	public void actionPerformed(ActionEvent e) {
+    	FLayer lyr = getNodeLayer();
+
+        try {
+        	getMapContext().getViewPort().setExtent(lyr.getFullExtent());
+		} catch (com.iver.cit.gvsig.fmap.DriverException e1) {
+			e1.printStackTrace();
+		}
+
+		
+	}
+}
+
+class EliminarCapaTocMenuEntry extends TocMenuEntry {
+    private JMenuItem removeLayer;
+	public void initialize(FPopupMenu m) {
+		super.initialize(m);
+		
+		if (getNodeUserObject() instanceof TocItemBranch) {
+			getMenu().addSeparator();
+			removeLayer = new JMenuItem(PluginServices.getText(this, "eliminar_capa"));
+			getMenu().add(removeLayer);
+			removeLayer.setFont(FPopupMenu.theFont);
+			removeLayer.addActionListener(this);
+		}
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.toc.TocMenuEntry#execute(com.iver.cit.gvsig.gui.toc.ITocItem)
+	 */
+	public void actionPerformed(ActionEvent e) {
+    	FLayer lyr = getNodeLayer();
+
+        try {
+        	getMapContext().getLayers().removeLayer(lyr);
+        	if (getMapContext().getLayers().getLayersCount()==0)PluginServices.getMainFrame().enableControls();
+		} catch (CancelationException e1) {
+			e1.printStackTrace();
+		}
+    }
+
+}
+
+/**
+ * Menu de bot�n derecho para el TOC.
+ * Se pueden a�adir entradas facilmente desde una extensi�n,
+ * creando una clase derivando de TocMenuEntry, y a�adiendola en
+ * est�tico (o en tiempo de carga de la extensi�n) a FPopupMenu.
+ * (Las entradas actuales est�n hechas de esa manera).
+ *
+ * @author vcn To change the template for this generated type comment go to
+ *         Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
+ *         Comments
+ */
+
+public class FPopupMenu extends JPopupMenu {
+	private static ArrayList menuEntrys = null;
+    public DefaultMutableTreeNode nodo;
+    protected FMap mapContext;
+    //private JMenuItem capa;
+    // Lo de fijar la fuente es porque en linux se ve�a mal si no se fija.
+    // TODO: Esto no funcionar� para idiomas como el chino. Hay que cambiarlo.
+    public final static Font theFont = new Font("SansSerif", Font.PLAIN, 10);
+    
+    static {
+    	menuEntrys = new ArrayList();
+    	menuEntrys.add(new FSymbolChangeColorTocMenuEntry());
+    	menuEntrys.add(new FLyrVectChangeStyleTocMenuEntry());
+    	menuEntrys.add(new FLyrRasterAdjustTransparencyTocMenuEntry());
+    	menuEntrys.add(new ZoomAlTemaTocMenuEntry());
+    	menuEntrys.add(new EliminarCapaTocMenuEntry());
+    }
+
+    public static void addEntry(TocMenuEntry entry) {
+    	menuEntrys.add(entry);
+    }
+    
+    /**
+     * Creates a new FPopupMenu object.
+     *
+     * @param nodo DOCUMENT ME!
+     * @param vista DOCUMENT ME!
+     */
+    public FPopupMenu(FMap mc, DefaultMutableTreeNode node) {
+        //super();
+        this.mapContext = mc;
+        this.nodo = node;
+ 
+        //salir = new MenuItem("Salir");
+
+        for (int i=0; i<menuEntrys.size(); i++) {
+        	((TocMenuEntry) menuEntrys.get(i)).initialize(this);
+        }
+    }
+    
+    public FMap getMapContext() { return mapContext; }
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/PanelColor.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/PanelColor.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/PanelColor.java	(revision 1648)
@@ -0,0 +1,123 @@
+/*
+ * Created on 27-feb-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.toc;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+
+import javax.swing.JPanel;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author vcn To change the template for this generated type comment go to
+ *         Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
+ *         Comments
+ */
+public class PanelColor extends JPanel {
+    public Color[] m_colores = new Color[100];
+    public Color m_color;
+    private Integer numReg;
+    private int numreg;
+    public int a = 155;
+    public int b = 205;
+    public int c = 255;
+
+    /**
+     * Creates a new PanelColor object.
+     *
+     * @param numReg DOCUMENT ME!
+     */
+    public PanelColor(int numReg) {
+        //numReg=numReg+1;
+        //m_color = new Color((numReg*numReg+100)%255,(numReg+(3*numReg+100))%255,numReg%255);
+        //this.setBackground(m_color);
+        setLayout(new BorderLayout());
+		
+        //add(oneColorPanel);
+        setMaximumSize(new Dimension(12, 12));
+        setMinimumSize(new Dimension(12, 12));
+        setPreferredSize(new Dimension(12, 12));
+    }
+
+    //private ColorPanel oneColorPanel = new ColorPanel();
+    //private FourColorPanel fourColorPanel = new LayerColorPanel.FourColorPanel();
+    public void setColor(Color color) {
+        m_color = color;
+        a=color.getRed();
+        System.out.println("a=color.getRed();"+a);
+		b=color.getGreen();
+		System.out.println("b=color.getGreen();"+b);
+        c=color.getBlue();
+		System.out.println("c=color.getBlue();"+c);
+        this.setBackground(color);
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void setColorinicial() {
+        a=155;
+		b=205;
+		c=255;
+        m_color = new Color(a, b, c);
+        this.setBackground(m_color);
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void setColorfin() {
+        this.m_color = new Color(45, 95, 145);
+        a=45;
+        b=95;
+        c=145;
+        this.setBackground(m_color);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/PanelColor.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterException.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterException.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterException.java	(revision 1648)
@@ -0,0 +1,75 @@
+/* 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.gui.filter;
+
+
+public class FilterException extends Exception {
+
+	/**
+	 * 
+	 */
+	public FilterException() {
+		super();
+
+	}
+	/**
+	 * @param message
+	 */
+	public FilterException(String message) {
+		super(message);
+
+	}
+	/**
+	 * @param message
+	 * @param cause
+	 */
+	public FilterException(String message, Throwable cause) {
+		super(message, cause);
+
+	}
+	/**
+	 * @param cause
+	 */
+	public FilterException(Throwable cause) {
+		super(cause);
+
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterException.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionListener.java	(revision 1648)
@@ -0,0 +1,47 @@
+/* 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.gui.filter;
+
+public interface ExpressionListener {
+	public void newSet(String expression);
+	public void addToSet(String expression);
+	public void fromSet(String expression);
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterDialog.java	(revision 1648)
@@ -0,0 +1,1104 @@
+/* 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.gui.filter;
+
+import com.hardcode.gdbms.engine.instruction.IncompatibleTypesException;
+import com.hardcode.gdbms.engine.values.BooleanValue;
+import com.hardcode.gdbms.engine.values.DateValue;
+import com.hardcode.gdbms.engine.values.StringValue;
+import com.hardcode.gdbms.engine.values.Value;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.gui.Table;
+
+import com.iver.utiles.DefaultCharSet;
+import com.iver.utiles.StringUtilities;
+import com.iver.utiles.exceptionHandling.ExceptionHandlingSupport;
+import com.iver.utiles.exceptionHandling.ExceptionListener;
+
+import com.lamatek.swingextras.JDateChooser;
+
+import org.apache.log4j.Logger;
+
+import java.text.DateFormat;
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JPanel;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class FilterDialog extends JPanel implements View {
+	private static Logger logger = Logger.getLogger(Table.class.getName());
+	private ArrayList expressionListeners = new ArrayList();
+	private int position = 0;
+	private DefaultListModel fieldListModel = new DefaultListModel();
+	private DefaultListModel valuesListModel = new DefaultListModel();
+	private NumberFormat nf = NumberFormat.getNumberInstance();
+	private DateFormat df = DateFormat.getDateInstance();
+	private ArrayList variables = new ArrayList();
+	private ExpressionDataSource model = null;
+	private javax.swing.JPanel jPanel = null;
+	private javax.swing.JPanel jPanel1 = null;
+	private javax.swing.JPanel jPanel2 = null;
+	private javax.swing.JPanel jPanel3 = null;
+	private javax.swing.JPanel jPanel4 = null;
+	private javax.swing.JLabel jLabel = null;
+	private javax.swing.JScrollPane jScrollPane = null;
+	private javax.swing.JList lstCampos = null;
+	private javax.swing.JButton btnIgual = null;
+	private javax.swing.JButton btnMayor = null;
+	private javax.swing.JButton btnNot = null;
+	private javax.swing.JButton btnDistinto = null;
+	private javax.swing.JButton btnMenor = null;
+	private javax.swing.JButton btnMayorIgual = null;
+	private javax.swing.JButton btnMenorIgual = null;
+	private javax.swing.JButton btnAnd = null;
+	private javax.swing.JButton btnOr = null;
+	private javax.swing.JTextArea txtExpression = null;
+	private javax.swing.JPanel jPanel5 = null;
+	private javax.swing.JButton btnNuevo = null;
+	private javax.swing.JButton btnAdd = null;
+	private javax.swing.JButton btnName = null;
+	private javax.swing.JButton btnFromSet = null;
+	private javax.swing.JScrollPane jScrollPane1 = null;
+	private javax.swing.JLabel jLabel1 = null;
+	private javax.swing.JList lstValores = null;
+	private javax.swing.JScrollPane jScrollPane2 = null;
+	private javax.swing.JButton btnParentesis = null;
+	private ExceptionHandlingSupport exceptionHandlingSupport = new ExceptionHandlingSupport();
+
+	/*
+	 * TODO Eliminar si est� comentado
+	 *
+	      public class ComparableValue {
+	              public Value value;
+	
+	
+	                  public boolean equals(Object obj) {
+	                          Value v = (Value) obj;
+	                          return v.equals(obj);
+	                  }
+	      }
+	 */
+
+	/**
+	 * This is the default constructor
+	 */
+	public FilterDialog() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param t DOCUMENT ME!
+	 */
+	public void setModel(ExpressionDataSource t) {
+		model = t;
+		fieldListModel.clear();
+
+		try {
+			for (int i = 0; i < model.getFieldCount(); i++) {
+				fieldListModel.addElement(model.getFieldName(i));
+			}
+		} catch (FilterException e) {
+			throwException(e);
+		}
+	}
+
+	/**
+	 * Rellena la lista con los valores del campo seleccionado
+	 *
+	 * @param timeOut DOCUMENT ME!
+	 */
+	private void fillValues(int timeOut) {
+		int index = lstCampos.getSelectedIndex();
+
+		//Index es ahora el �ndice del campo seleccionado
+		//Se eliminan los duplicados
+		TreeSet conjunto = new TreeSet(new Comparator() {
+					public int compare(Object o1, Object o2) {
+						int resul = -1;
+
+						if ((o1 != null) && (o2 != null)) {
+							Value v2 = (Value) o2;
+							Value v1 = (Value) o1;
+							BooleanValue boolVal;
+
+							try {
+								boolVal = (BooleanValue) (v1.greater(v2));
+
+								if (boolVal.getValue()) {
+									return 1;
+								}
+
+								boolVal = (BooleanValue) (v1.less(v2));
+
+								if (boolVal.getValue()) {
+									return -1;
+								}
+							} catch (IncompatibleTypesException e) {
+								// TODO Auto-generated catch block
+								e.printStackTrace();
+							}
+						}
+
+						return 0;
+					}
+				}); // Para poder ordenar
+
+		valuesListModel.clear();
+
+		try {
+			for (int i = 0; i < model.getRowCount(); i++) {
+				Value value = model.getFieldValue(i, index);
+
+				if (!conjunto.contains(value)) {
+					conjunto.add(value);
+				}
+			}
+
+			Iterator it = conjunto.iterator();
+
+			while (it.hasNext())
+				valuesListModel.addElement(it.next());
+		} catch (FilterException e) {
+			throwException(e);
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param expresion DOCUMENT ME!
+	 * @param substring DOCUMENT ME!
+	 * @param startingPos DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	private int getIndex(String expresion, String substring, int startingPos) {
+		int index = startingPos;
+
+		do {
+			index = expresion.indexOf(substring, index);
+		} while ((StringUtilities.isBetweenSymbols(expresion, index, "\"")) &&
+				(index != -1));
+
+		return index;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param expresion DOCUMENT ME!
+	 * @param word DOCUMENT ME!
+	 * @param translation DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws ParseException DOCUMENT ME!
+	 */
+	private String translateWord(String expresion, String word,
+		String translation) throws ParseException {
+		int booleanIndex = 0;
+		int endIndex = 0;
+		StringBuffer res = new StringBuffer();
+
+		while ((booleanIndex = getIndex(expresion, word, booleanIndex)) != -1) {
+			res.append(expresion.substring(endIndex, booleanIndex));
+			endIndex = booleanIndex + word.length();
+			booleanIndex++;
+			res.append(translation);
+		}
+
+		if (endIndex < expresion.length()) {
+			res.append(expresion.substring(endIndex));
+		}
+
+		return res.toString();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param expresion DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws ParseException DOCUMENT ME!
+	 */
+	private String translateDates(String expresion) throws ParseException {
+		//Se obtiene el valor de la fecha
+		String date = StringUtilities.substringDelimited(expresion, "Date(",
+				")", 0);
+
+		if (date == null) {
+			return expresion;
+		}
+
+		//Se comprueba que no est� entre comillas 
+		int startIndex = expresion.indexOf(date);
+
+		while (startIndex != -1) {
+			if (!StringUtilities.isBetweenSymbols(expresion, startIndex, "\"")) {
+				//Se sustituye por el valor ordinal de la fecha
+				expresion = expresion.substring(0, startIndex - 5) +
+					expresion.substring(startIndex).replaceFirst(date + "\\)",
+						new Long((df.parse(date)).getTime()).toString());
+				;
+			} else {
+				startIndex += date.length();
+			}
+
+			//Se obtiene el valor de la fecha
+
+			/*            date = StringUtilities.substringDelimited(expresion, "Date(", ")",
+			   startIndex);
+			 */
+			if (date == null) {
+				return expresion;
+			}
+
+			startIndex = expresion.indexOf(date, startIndex);
+		}
+
+		return expresion;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param expresion DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws ParseException DOCUMENT ME!
+	 */
+	public String translateNumber(String expresion) throws ParseException {
+		DefaultCharSet ss = new DefaultCharSet();
+		ss.addInterval('0', '9');
+		ss.addCharacter(',');
+		ss.addCharacter('.');
+
+		String number = StringUtilities.substringWithSymbols(expresion, ss, 0);
+
+		if (number == null) {
+			return expresion;
+		}
+
+		int startIndex = expresion.indexOf(number);
+
+		while (startIndex != -1) {
+			Number n = nf.parse(number);
+
+			if (!StringUtilities.isBetweenSymbols(expresion, startIndex, "\"")) {
+				//Se sustituye por el valor ordinal de la fecha
+				expresion = expresion.substring(0, startIndex) +
+					expresion.substring(startIndex).replaceFirst(number,
+						n.toString());
+			} else {
+				startIndex += n.toString().length();
+			}
+
+			number = StringUtilities.substringWithSymbols(expresion, ss,
+					startIndex);
+
+			if (number == null) {
+				return expresion;
+			}
+
+			startIndex = expresion.indexOf(number, startIndex);
+		}
+
+		return expresion;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws ParseException DOCUMENT ME!
+	 */
+	private String validateExpression() throws ParseException {
+		String expression = txtExpression.getText();
+		HashSet variablesIndexes = new HashSet();
+
+		StringBuffer traducida = new StringBuffer();
+
+		//Se transforman los nombres de los campos en las variables xix que analizar�n
+		//Se quitan los Date(fecha) y se mete la fecha correspondiente
+		expression = translateDates(expression);
+		expression = translateNumber(expression);
+		expression = translateWord(expression, "true", "1");
+		expression = translateWord(expression, "false", "0");
+
+		String replacement;
+		Pattern patron = Pattern.compile("[^<>!]=");
+		Matcher m = patron.matcher(expression);
+		int index = 0;
+
+		while (m.find(index)) {
+			index = m.start();
+			replacement = expression.charAt(index) + "==";
+			m.replaceFirst(replacement);
+			index++;
+		}
+
+		expression = expression.replaceAll("[^<>!]=", "==");
+
+		logger.debug(expression);
+
+		return expression;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param symbol DOCUMENT ME!
+	 */
+	private void putSymbol(String symbol) {
+		int position = txtExpression.getCaretPosition();
+		txtExpression.setText(StringUtilities.insert(txtExpression.getText(),
+				position, symbol));
+
+		if (symbol.equals(" () ")) {
+			position = position + 2;
+		} else {
+			position = position + symbol.length();
+		}
+
+		txtExpression.setCaretPosition(position);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(new java.awt.BorderLayout());
+		this.add(getJPanel(), java.awt.BorderLayout.CENTER);
+		this.add(getJPanel1(), java.awt.BorderLayout.SOUTH);
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel() {
+		if (jPanel == null) {
+			jPanel = new javax.swing.JPanel();
+			jPanel.setLayout(new java.awt.BorderLayout());
+			jPanel.add(getJPanel2(), java.awt.BorderLayout.WEST);
+			jPanel.add(getJPanel3(), java.awt.BorderLayout.CENTER);
+			jPanel.add(getJPanel4(), java.awt.BorderLayout.EAST);
+		}
+
+		return jPanel;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel1() {
+		if (jPanel1 == null) {
+			jPanel1 = new javax.swing.JPanel();
+			jPanel1.add(getJScrollPane2(), null);
+			jPanel1.add(getJPanel5(), null);
+			jPanel1.setPreferredSize(new java.awt.Dimension(10, 110));
+		}
+
+		return jPanel1;
+	}
+
+	/**
+	 * This method initializes jPanel2
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel2() {
+		if (jPanel2 == null) {
+			jPanel2 = new javax.swing.JPanel();
+			jPanel2.add(getJLabel(), null);
+			jPanel2.add(getJScrollPane(), null);
+			jPanel2.setPreferredSize(new java.awt.Dimension(150, 170));
+		}
+
+		return jPanel2;
+	}
+
+	/**
+	 * This method initializes jPanel3
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel3() {
+		if (jPanel3 == null) {
+			jPanel3 = new javax.swing.JPanel();
+			jPanel3.add(getBtnIgual(), null);
+			jPanel3.add(getBtnDistinto(), null);
+			jPanel3.add(getBtnMayor(), null);
+			jPanel3.add(getBtnMenor(), null);
+			jPanel3.add(getBtnMenorIgual(), null);
+			jPanel3.add(getBtnMayorIgual(), null);
+			jPanel3.add(getBtnAnd(), null);
+			jPanel3.add(getBtnOr(), null);
+			jPanel3.add(getBtnNot(), null);
+			jPanel3.add(getBtnParentesis(), null);
+			jPanel3.add(getBtnName(), null);
+			jPanel3.setPreferredSize(new java.awt.Dimension(180, 36));
+		}
+
+		return jPanel3;
+	}
+
+	/**
+	 * This method initializes jPanel4
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel4() {
+		if (jPanel4 == null) {
+			jPanel4 = new javax.swing.JPanel();
+			jPanel4.add(getJLabel1(), null);
+			jPanel4.add(getJScrollPane1(), null);
+			jPanel4.setPreferredSize(new java.awt.Dimension(150, 10));
+		}
+
+		return jPanel4;
+	}
+
+	/**
+	 * This method initializes jLabel
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel() {
+		if (jLabel == null) {
+			jLabel = new javax.swing.JLabel();
+			jLabel.setText(PluginServices.getText(this, "Campos") + ":");
+		}
+
+		return jLabel;
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new javax.swing.JScrollPane();
+			jScrollPane.setViewportView(getLstCampos());
+			jScrollPane.setPreferredSize(new java.awt.Dimension(135, 120));
+		}
+
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes lstCampos
+	 *
+	 * @return javax.swing.JList
+	 */
+	private javax.swing.JList getLstCampos() {
+		if (lstCampos == null) {
+			lstCampos = new javax.swing.JList();
+			lstCampos.setModel(fieldListModel);
+			lstCampos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+			lstCampos.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+					public void valueChanged(
+						javax.swing.event.ListSelectionEvent e) {
+						PluginServices.backgroundExecution(new Runnable() {
+							public void run() {
+								fillValues(0);
+							}
+						});
+					}
+				});
+			lstCampos.addMouseListener(new java.awt.event.MouseAdapter() {
+					public void mouseClicked(java.awt.event.MouseEvent e) {
+						if (e.getClickCount() == 2) {
+							putSymbol((String) fieldListModel.getElementAt(
+									getLstCampos().getSelectedIndex()));
+						}
+					}
+				});
+		}
+
+		return lstCampos;
+	}
+
+	/**
+	 * This method initializes btnIgual
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnIgual() {
+		if (btnIgual == null) {
+			btnIgual = new javax.swing.JButton();
+			btnIgual.setText("=");
+			btnIgual.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnIgual.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnIgual.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" = ");
+					}
+				});
+		}
+
+		return btnIgual;
+	}
+
+	/**
+	 * This method initializes btnMayor
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnMayor() {
+		if (btnMayor == null) {
+			btnMayor = new javax.swing.JButton();
+			btnMayor.setText(">");
+			btnMayor.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnMayor.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnMayor.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" > ");
+					}
+				});
+		}
+
+		return btnMayor;
+	}
+
+	/**
+	 * This method initializes btnNot
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnNot() {
+		if (btnNot == null) {
+			btnNot = new javax.swing.JButton();
+			btnNot.setText("Not");
+			btnNot.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnNot.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnNot.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" not ");
+					}
+				});
+		}
+
+		return btnNot;
+	}
+
+	/**
+	 * This method initializes btnDistinto
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnDistinto() {
+		if (btnDistinto == null) {
+			btnDistinto = new javax.swing.JButton();
+			btnDistinto.setText("!=");
+			btnDistinto.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnDistinto.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnDistinto.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" <> ");
+					}
+				});
+		}
+
+		return btnDistinto;
+	}
+
+	/**
+	 * This method initializes btnMenor
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnMenor() {
+		if (btnMenor == null) {
+			btnMenor = new javax.swing.JButton();
+			btnMenor.setText("<");
+			btnMenor.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnMenor.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnMenor.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" < ");
+					}
+				});
+		}
+
+		return btnMenor;
+	}
+
+	/**
+	 * This method initializes btnMayorIgual
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnMayorIgual() {
+		if (btnMayorIgual == null) {
+			btnMayorIgual = new javax.swing.JButton();
+			btnMayorIgual.setText(">=");
+			btnMayorIgual.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnMayorIgual.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnMayorIgual.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" >= ");
+					}
+				});
+		}
+
+		return btnMayorIgual;
+	}
+
+	/**
+	 * This method initializes btnMenorIgual
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnMenorIgual() {
+		if (btnMenorIgual == null) {
+			btnMenorIgual = new javax.swing.JButton();
+			btnMenorIgual.setText("<=");
+			btnMenorIgual.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnMenorIgual.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnMenorIgual.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" <= ");
+					}
+				});
+		}
+
+		return btnMenorIgual;
+	}
+
+	/**
+	 * This method initializes btnAnd
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnAnd() {
+		if (btnAnd == null) {
+			btnAnd = new javax.swing.JButton();
+			btnAnd.setText("And");
+			btnAnd.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnAnd.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnAnd.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" and ");
+					}
+				});
+		}
+
+		return btnAnd;
+	}
+
+	/**
+	 * This method initializes btnOr
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnOr() {
+		if (btnOr == null) {
+			btnOr = new javax.swing.JButton();
+			btnOr.setText("Or");
+			btnOr.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnOr.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnOr.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" or ");
+					}
+				});
+		}
+
+		return btnOr;
+	}
+
+	/**
+	 * This method initializes txtExpression
+	 *
+	 * @return javax.swing.JTextArea
+	 */
+	private javax.swing.JTextArea getTxtExpression() {
+		if (txtExpression == null) {
+			txtExpression = new javax.swing.JTextArea();
+			txtExpression.setLineWrap(true);
+		}
+
+		return txtExpression;
+	}
+
+	/**
+	 * This method initializes jPanel5
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel5() {
+		if (jPanel5 == null) {
+			jPanel5 = new javax.swing.JPanel();
+			jPanel5.add(getBtnNuevo(), null);
+			jPanel5.add(getBtnAdd(), null);
+			jPanel5.add(getBtnFromSet(), null);
+			jPanel5.setPreferredSize(new java.awt.Dimension(190, 100));
+		}
+
+		return jPanel5;
+	}
+
+	/**
+	 * This method initializes btnNuevo
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnNuevo() {
+		if (btnNuevo == null) {
+			btnNuevo = new javax.swing.JButton();
+			btnNuevo.setText(PluginServices.getText(this, "Nuevo_conjunto"));
+			btnNuevo.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnNuevo.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						final String expr = "select * from " +
+							model.getDataSourceName() + " where " +
+							getTxtExpression().getText() + ";";
+
+						logger.debug(expr);
+
+						PluginServices.backgroundExecution(new Runnable() {
+							public void run() {
+								for (int i = 0; i < expressionListeners.size(); i++) {
+									ExpressionListener l = (ExpressionListener) expressionListeners.get(i);
+									l.newSet(expr);
+								}
+							}
+						});
+					}
+				});
+		}
+
+		return btnNuevo;
+	}
+
+	/**
+	 * This method initializes btnAdd
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnAdd() {
+		if (btnAdd == null) {
+			btnAdd = new javax.swing.JButton();
+			btnAdd.setText(PluginServices.getText(this, "Anadir_al_conjunto"));
+			btnAdd.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnAdd.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						final String expr = "select * from " +
+							model.getDataSourceName() + " where " +
+							getTxtExpression().getText() + ";";
+
+						logger.debug(expr);
+
+						PluginServices.backgroundExecution(new Runnable() {
+								public void run() {
+									for (int i = 0;
+											i < expressionListeners.size();
+											i++) {
+										ExpressionListener l = (ExpressionListener) expressionListeners.get(i);
+										l.addToSet(expr);
+									}
+								}
+							});
+					}
+				});
+		}
+
+		return btnAdd;
+	}
+
+	/**
+	 * This method initializes btnFromSet
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnFromSet() {
+		if (btnFromSet == null) {
+			btnFromSet = new javax.swing.JButton();
+			btnFromSet.setText(PluginServices.getText(this,
+					"Seleccionar_del_conjunto"));
+			btnFromSet.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnFromSet.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						final String expr = "select * from " +
+							model.getDataSourceName() + " where " +
+							getTxtExpression().getText() + ";";
+
+						logger.debug(expr);
+
+						PluginServices.backgroundExecution(new Runnable() {
+							public void run() {
+								for (int i = 0; i < expressionListeners.size(); i++) {
+									ExpressionListener l = (ExpressionListener) expressionListeners.get(i);
+									l.fromSet(expr);
+								}
+							}
+						});
+					}
+				});
+		}
+
+		return btnFromSet;
+	}
+
+	/**
+	 * This method initializes jScrollPane1
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane1() {
+		if (jScrollPane1 == null) {
+			jScrollPane1 = new javax.swing.JScrollPane();
+			jScrollPane1.setViewportView(getLstValores());
+			jScrollPane1.setPreferredSize(new java.awt.Dimension(140, 120));
+		}
+
+		return jScrollPane1;
+	}
+
+	/**
+	 * This method initializes jLabel1
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel1() {
+		if (jLabel1 == null) {
+			jLabel1 = new javax.swing.JLabel();
+			jLabel1.setText(PluginServices.getText(this, "Valores") + ":");
+		}
+
+		return jLabel1;
+	}
+
+	/**
+	 * This method initializes lstValores
+	 *
+	 * @return javax.swing.JList
+	 */
+	private javax.swing.JList getLstValores() {
+		if (lstValores == null) {
+			lstValores = new javax.swing.JList();
+			lstValores.setModel(valuesListModel);
+			lstValores.addMouseListener(new java.awt.event.MouseAdapter() {
+					public void mouseClicked(java.awt.event.MouseEvent e) {
+						if (e.getClickCount() == 2) {
+							Value valor = (Value) valuesListModel.getElementAt(getLstValores()
+																				   .getSelectedIndex());
+
+							if (valor instanceof DateValue) {
+								putSymbol("date('" + valor + "')");
+							} else if (valor instanceof BooleanValue) {
+								putSymbol("boolean('" + valor.toString() +
+									"')");
+							} else if (valor instanceof StringValue) {
+								putSymbol("'" + valor + "'");
+							} else {
+								putSymbol(valor.toString());
+							}
+						}
+					}
+				});
+		}
+
+		return lstValores;
+	}
+
+	/**
+	 * This method initializes jScrollPane2
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane2() {
+		if (jScrollPane2 == null) {
+			jScrollPane2 = new javax.swing.JScrollPane();
+			jScrollPane2.setViewportView(getTxtExpression());
+			jScrollPane2.setPreferredSize(new java.awt.Dimension(250, 100));
+			jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+		}
+
+		return jScrollPane2;
+	}
+
+	/**
+	 * This method initializes btnParentesis
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnParentesis() {
+		if (btnParentesis == null) {
+			btnParentesis = new javax.swing.JButton();
+			btnParentesis.setText("()");
+			btnParentesis.setMargin(new java.awt.Insets(2, 2, 2, 2));
+			btnParentesis.setPreferredSize(new java.awt.Dimension(40, 20));
+			btnParentesis.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						putSymbol(" () ");
+					}
+				});
+		}
+
+		return btnParentesis;
+	}
+
+	/**
+	 * This method initializes btnName
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnName() {
+		if (btnName == null) {
+			btnName = new javax.swing.JButton();
+			btnName.setText("Date");
+			btnName.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						JDateChooser chooser = new JDateChooser();
+
+						PluginServices.getMDIManager().addView(chooser);
+
+						Date selectedDate = chooser.getSelectedDate().getTime();
+
+						if (selectedDate != null) {
+							putSymbol("Date(" + df.format(selectedDate) + ")");
+						}
+					}
+				});
+		}
+
+		return btnName;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param arg0
+	 *
+	 * @return
+	 */
+	public boolean addExpressionListener(ExpressionListener arg0) {
+		return expressionListeners.add(arg0);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param arg0
+	 *
+	 * @return
+	 */
+	public boolean removeExpressionListener(ExpressionListener arg0) {
+		return expressionListeners.remove(arg0);
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo vi = new ViewInfo(ViewInfo.ICONIFIABLE);
+		vi.setWidth(480);
+		vi.setHeight(362);
+
+		return vi;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param o DOCUMENT ME!
+	 */
+	public void addExceptionListener(ExceptionListener o) {
+		exceptionHandlingSupport.addExceptionListener(o);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param o DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public boolean removeExceptionListener(ExceptionListener o) {
+		return exceptionHandlingSupport.removeExceptionListener(o);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param t DOCUMENT ME!
+	 */
+	private void throwException(Throwable t) {
+		exceptionHandlingSupport.throwException(t);
+	}
+}
+
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionDataSource.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionDataSource.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionDataSource.java	(revision 1648)
@@ -0,0 +1,100 @@
+/* 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.gui.filter;
+
+import com.hardcode.gdbms.engine.values.Value;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public interface ExpressionDataSource {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param row DOCUMENT ME!
+	 * @param idField DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws FilterException DOCUMENT ME!
+	 */
+	public Value getFieldValue(int row, int idField) throws FilterException;
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws FilterException DOCUMENT ME!
+	 */
+	public int getFieldCount() throws FilterException;
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param idField DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws FilterException DOCUMENT ME!
+	 */
+	public String getFieldName(int idField) throws FilterException;
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws FilterException DOCUMENT ME!
+	 */
+	public int getRowCount() throws FilterException;
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public String getDataSourceName();
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/ExpressionDataSource.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/DefaultExpressionDataSource.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/DefaultExpressionDataSource.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/DefaultExpressionDataSource.java	(revision 1648)
@@ -0,0 +1,129 @@
+/* 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.gui.filter;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.data.DriverException;
+import com.hardcode.gdbms.engine.values.Value;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class DefaultExpressionDataSource implements ExpressionDataSource {
+    private SelectableDataSource tabla = null;
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param table DOCUMENT ME!
+     */
+    public void setTable(SelectableDataSource table) {
+        this.tabla = table;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param idField
+     *
+     * @return
+     * @throws FilterException
+     */
+    public String getFieldName(int idField) throws FilterException {
+        try {
+			return tabla.getFieldName(idField);
+		} catch (DriverException e) {
+			throw new FilterException(e);
+		}
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     * @throws FilterException
+     */
+    public int getFieldCount() throws FilterException {
+        try {
+			return tabla.getFieldCount();
+		} catch (DriverException e) {
+			throw new FilterException(e);
+		}
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param field
+     *
+     * @return
+     * @throws FilterException
+     */
+    public Value getFieldValue(int row, int field) throws FilterException {
+    	try {
+			return tabla.getFieldValue((long) row, field);
+		} catch (DriverException e) {
+			throw new FilterException(e);
+		}
+    }
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.filter.ExpressionDataSource#getRowCount()
+	 */
+	public int getRowCount() throws FilterException {
+		try {
+			return (int) tabla.getRowCount();
+		} catch (DriverException e) {
+			throw new FilterException(e);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.filter.ExpressionDataSource#getDataSourceName()
+	 */
+	public String getDataSourceName() {
+		return tabla.getName();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/DefaultExpressionDataSource.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FThemePropertiesDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FThemePropertiesDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FThemePropertiesDialog.java	(revision 1648)
@@ -0,0 +1,536 @@
+/*
+ * Created on 31-may-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui;
+
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.data.DriverException;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.project.ProjectView;
+/**
+ * Di�logo de propiedades del tema.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FThemePropertiesDialog extends JPanel implements View {
+	private javax.swing.JPanel jContentPane = null;
+	private javax.swing.JTabbedPane jTabbedPane = null;
+	private javax.swing.JPanel phiperenlace = null;
+	private javax.swing.JPanel phnorte = null;
+	private javax.swing.JPanel phsur = null;
+	private javax.swing.JLabel jLabel = null;
+	private javax.swing.JComboBox jComboBox = null;
+	private javax.swing.JLabel jLabel1 = null;
+	private javax.swing.JComboBox jComboBox1 = null;
+	private javax.swing.JPanel pbotones = null;
+	private javax.swing.JButton baceptar = null;
+	private javax.swing.JButton bcancelar = null;
+	private javax.swing.JPanel pvisualizacion = null;
+	private FLayer m_layer;
+	private javax.swing.JPanel pvnorte = null;
+	private javax.swing.JPanel pvsur = null;
+	private javax.swing.JLabel jLabel2 = null;
+	private javax.swing.JLabel jLabel3 = null;
+	private javax.swing.JTextField tminEscala = null;
+	private javax.swing.JTextField tMaxScale = null;
+	private ProjectView view;
+
+	private JLabel jLabel4 = null;
+	private JTextField jTextField2 = null;
+	private JPanel pvCenter = null;
+	private JLabel jLabel5 = null;
+	private JLabel jLabel6 = null;
+	
+	private NumberFormat nf = NumberFormat.getInstance();
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layer DOCUMENT ME!
+	 * @param view DOCUMENT ME!
+	 */
+	public FThemePropertiesDialog(FLayer layer, ProjectView view) {
+		super();
+		this.view = view;
+		m_layer = layer;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setSize(367, 184);
+		this.add(getJContentPane());
+		if (m_layer.getMinScale() != -1)
+		    getTminEscala().setText(nf.format(m_layer.getMinScale()));
+		if (m_layer.getMaxScale() != -1)
+		    getTMaxScale().setText(nf.format(m_layer.getMaxScale()));
+	}
+
+	/**
+	 * This method initializes jContentPane
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJContentPane() {
+		if (jContentPane == null) {
+			jContentPane = new javax.swing.JPanel();
+			jContentPane.setLayout(new java.awt.BorderLayout());
+			jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
+			jContentPane.add(getPbotones(), java.awt.BorderLayout.SOUTH);
+		}
+
+		return jContentPane;
+	}
+
+	/**
+	 * This method initializes jTabbedPane
+	 *
+	 * @return javax.swing.JTabbedPane
+	 */
+	private javax.swing.JTabbedPane getJTabbedPane() {
+		if (jTabbedPane == null) {
+			jTabbedPane = new javax.swing.JTabbedPane();
+			jTabbedPane.setPreferredSize(new java.awt.Dimension(320,140));
+			jTabbedPane.addTab(PluginServices.getText(this, "Hiperenlace"),
+				null, getPhiperenlace(), null);
+			jTabbedPane.addTab(PluginServices.getText(this, "Visualizacion"),
+				null, getPvisualizacion(), null);
+		}
+
+		return jTabbedPane;
+	}
+
+	/**
+	 * This method initializes phiperenlace
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPhiperenlace() {
+		if (phiperenlace == null) {
+			phiperenlace = new javax.swing.JPanel();
+			phiperenlace.setLayout(new java.awt.BorderLayout());
+			phiperenlace.setPreferredSize(new java.awt.Dimension(300,150));
+			phiperenlace.add(getPhnorte(), java.awt.BorderLayout.NORTH);
+			phiperenlace.add(getPhsur(), java.awt.BorderLayout.CENTER);
+			phiperenlace.setVisible(true);
+		}
+
+		return phiperenlace;
+	}
+
+	/**
+	 * This method initializes phnorte
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPhnorte() {
+		if (phnorte == null) {
+			jLabel4 = new JLabel();
+			phnorte = new javax.swing.JPanel();
+			jLabel4.setText(PluginServices.getText(this,"extension"));
+			phnorte.add(getJLabel(), null);
+			phnorte.add(getJComboBox(), null);
+			phnorte.add(jLabel4, null);
+			phnorte.add(getJTextField2(), null);
+		}
+
+		return phnorte;
+	}
+
+	/**
+	 * This method initializes phsur
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPhsur() {
+		if (phsur == null) {
+			phsur = new javax.swing.JPanel();
+			phsur.add(getJLabel1(), null);
+			phsur.add(getJComboBox1(), null);
+		}
+
+		return phsur;
+	}
+
+	/**
+	 * This method initializes jLabel
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel() {
+		if (jLabel == null) {
+			jLabel = new javax.swing.JLabel();
+			jLabel.setText(PluginServices.getText(this, "Campo") + "   ");
+		}
+
+		return jLabel;
+	}
+
+	/**
+	 * This method initializes jComboBox
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getJComboBox() {
+		if (jComboBox == null) {
+			try {
+				if (m_layer instanceof AlphanumericData) {
+					AlphanumericData layer = (AlphanumericData) m_layer;
+					DataSource ds;
+					ds = layer.getRecordset();
+
+					String[] names = new String[ds.getFieldCount()];
+
+					for (int i = 0; i < ds.getFieldCount(); i++) {
+						names[i] = ds.getFieldName(i);
+					}
+
+					jComboBox = new javax.swing.JComboBox(names);
+
+					if (view.getSelectedField() != null) {
+						jComboBox.setSelectedItem(view.getSelectedField());
+					}
+				}else{
+					jComboBox = new javax.swing.JComboBox();
+				}
+			} catch (DriverException e) {
+				NotificationManager.addError("No se pudo obtener la tabla", e);
+			} catch (com.iver.cit.gvsig.fmap.DriverException e) {
+				NotificationManager.addError("Error accediendo a los datos", e);
+			}
+		}
+
+		return jComboBox;
+	}
+
+	/**
+	 * This method initializes jLabel1
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel1() {
+		if (jLabel1 == null) {
+			jLabel1 = new javax.swing.JLabel();
+			jLabel1.setText(PluginServices.getText(this, "Accion_Predefinida") +
+				"  ");
+		}
+
+		return jLabel1;
+	}
+
+	/**
+	 * This method initializes jComboBox1
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getJComboBox1() {
+		if (jComboBox1 == null) {
+			jComboBox1 = new javax.swing.JComboBox();
+			jComboBox1.addItem(PluginServices.getText(this,
+					"Enlazar_a_ficheros_de_imagen"));
+			jComboBox1.addItem(PluginServices.getText(this,
+			"Enlazar_a_fichero_de_texto"));
+			if (view.getSelectedField() != null) {
+				jComboBox1.setSelectedIndex(view.getTypeLink());
+			}
+		}
+
+		return jComboBox1;
+	}
+
+	/**
+	 * This method initializes pbotones
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPbotones() {
+		if (pbotones == null) {
+			pbotones = new javax.swing.JPanel();
+			pbotones.add(getBaceptar(), null);
+			pbotones.add(getBcancelar(), null);
+		}
+
+		return pbotones;
+	}
+
+	/**
+	 * This method initializes baceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBaceptar() {
+		if (baceptar == null) {
+			baceptar = new javax.swing.JButton();
+			baceptar.setText(PluginServices.getText(this, "Aceptar"));
+			baceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						view.setTypeLink(jComboBox1.getSelectedIndex());
+						view.setSelectedField((jComboBox.getSelectedItem()).toString()
+											   .trim());
+						view.setExtLink(getJTextField2().getText());
+						try
+						{
+							m_layer.setMinScale((nf.parse(getTminEscala().getText())).doubleValue());						
+						}
+						catch (ParseException ex)
+						{
+						    // No hacemos nada. Si mete algo mal, pasamos de 
+						    // lo que haya metido y a otra cosa.
+						    if (getTminEscala().getText().compareTo("") == 0)
+						        m_layer.setMinScale(-1);
+						    else
+						        System.err.print(ex.getLocalizedMessage());
+						}
+						try
+						{
+						    m_layer.setMaxScale((nf.parse(getTMaxScale().getText())).doubleValue());						
+						}
+						catch (ParseException ex)
+						{
+						    if (getTMaxScale().getText().compareTo("") == 0)
+						        m_layer.setMaxScale(-1);
+						    else
+						        System.err.print(ex.getLocalizedMessage());
+
+						}		
+						PluginServices.getMDIManager().closeView(FThemePropertiesDialog.this);
+						m_layer.getFMap().invalidate();
+					}
+				});
+		}
+
+		return baceptar;
+	}
+
+	/**
+	 * This method initializes bcancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBcancelar() {
+		if (bcancelar == null) {
+			bcancelar = new javax.swing.JButton();
+			bcancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bcancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						//					View view =(View)App.instance.getMDIContext().getActiveView();
+						//view.getMapControl().setTool(MapControl.);
+						PluginServices.getMDIManager().closeView(FThemePropertiesDialog.this);
+					}
+				});
+		}
+
+		return bcancelar;
+	}
+
+	/**
+	 * This method initializes pvisualizacion
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPvisualizacion() {
+		if (pvisualizacion == null) {
+			pvisualizacion = new javax.swing.JPanel();
+			pvisualizacion.setLayout(new java.awt.BorderLayout());
+			pvisualizacion.setPreferredSize(new java.awt.Dimension(300,60));
+			pvisualizacion.add(getPvnorte(), java.awt.BorderLayout.NORTH);
+			pvisualizacion.add(getPvCenter(), java.awt.BorderLayout.CENTER);
+			pvisualizacion.add(getPvsur(), java.awt.BorderLayout.SOUTH);
+		}
+
+		return pvisualizacion;
+	}
+
+	/**
+	 * This method initializes pvnorte
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPvnorte() {
+		if (pvnorte == null) {
+			jLabel6 = new JLabel();
+			jLabel5 = new JLabel();
+			pvnorte = new javax.swing.JPanel();
+			jLabel5.setText(m_layer.getName());
+			jLabel6.setText("Nombre del tema : ");
+			pvnorte.add(jLabel6, null);
+			pvnorte.add(jLabel5, null);
+		}
+
+		return pvnorte;
+	}
+
+	/**
+	 * This method initializes pvsur
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPvsur() {
+		if (pvsur == null) {
+			pvsur = new javax.swing.JPanel();
+			pvsur.add(getJLabel3(), null);
+			pvsur.add(getTMaxScale(), null);
+		}
+
+		return pvsur;
+	}
+
+	/**
+	 * This method initializes jLabel2
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel2() {
+		if (jLabel2 == null) {
+			jLabel2 = new javax.swing.JLabel();
+			jLabel2.setText(PluginServices.getText(this, "Escala_Minima") +
+				"  1:");
+		}
+
+		return jLabel2;
+	}
+
+	/**
+	 * This method initializes jLabel3
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel3() {
+		if (jLabel3 == null) {
+			jLabel3 = new javax.swing.JLabel();
+			jLabel3.setText(PluginServices.getText(this, "Escala_Maxima") +
+				"  1:");
+		}
+
+		return jLabel3;
+	}
+
+	/**
+	 * This method initializes tminEscala
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTminEscala() {
+		if (tminEscala == null) {
+			tminEscala = new javax.swing.JTextField();
+			tminEscala.setPreferredSize(new java.awt.Dimension(150, 20));
+		}
+
+		return tminEscala;
+	}
+
+	/**
+	 * This method initializes jTextField1
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTMaxScale() {
+		if (tMaxScale == null) {
+			tMaxScale = new javax.swing.JTextField();
+			tMaxScale.setPreferredSize(new java.awt.Dimension(150, 20));
+		}
+
+		return tMaxScale;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_tema"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+	/**
+	 * This method initializes jTextField2	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */    
+	private JTextField getJTextField2() {
+		if (jTextField2 == null) {
+			jTextField2 = new JTextField();
+			jTextField2.setPreferredSize(new java.awt.Dimension(40,20));
+			if (view.getSelectedField() != null) {
+				jTextField2.setText(view.getExtLink());
+			}
+		}
+		return jTextField2;
+	}
+	/**
+	 * This method initializes pvCenter	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private JPanel getPvCenter() {
+		if (pvCenter == null) {
+			pvCenter = new JPanel();
+			pvCenter.add(getJLabel2(), null);
+			pvCenter.add(getTminEscala(), null);
+		}
+		return pvCenter;
+	}
+  } //  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FThemePropertiesDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/DataBaseOpenDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/DataBaseOpenDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/DataBaseOpenDialog.java	(revision 1648)
@@ -0,0 +1,268 @@
+/* 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.gui;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.JTextField;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class DataBaseOpenDialog extends JPanel{
+    private JLabel jLabel = null;
+    private JTextField txtHost = null;
+    private JLabel jLabel1 = null;
+    private JTextField txtUser = null;
+    private JComboBox cmbDriver = null;
+    private JLabel jLabel2 = null;
+
+	private JLabel jLabel3 = null;
+	private JTextField txtTable = null;
+	private JLabel jLabel4 = null;
+	private JTextField txtPort = null;
+	private JLabel jLabel5 = null;
+	private JPasswordField txtPassword = null;
+	private JLabel jLabel6 = null;
+	private JTextField txtDB = null;
+    /**
+     * This is the default constructor
+     */
+    public DataBaseOpenDialog() {
+        super();
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        jLabel6 = new JLabel();
+        jLabel5 = new JLabel();
+        jLabel4 = new JLabel();
+        jLabel3 = new JLabel();
+        jLabel2 = new JLabel();
+        jLabel1 = new JLabel();
+        jLabel = new JLabel();
+        this.setLayout(null);
+        this.setSize(348, 243);
+        jLabel.setBounds(10, 12, 99, 20);
+        jLabel.setText("URL del servidor:");
+        jLabel1.setBounds(58, 140, 51, 20);
+        jLabel1.setText("Usuario:");
+        jLabel2.setBounds(62, 204, 47, 20);
+        jLabel2.setText("Driver:");
+        jLabel3.setBounds(70, 108, 39, 20);
+        jLabel3.setText("Tabla:");
+        jLabel4.setBounds(66, 44, 43, 20);
+        jLabel4.setText("Puerto:");
+        jLabel5.setBounds(44, 172, 65, 20);
+        jLabel5.setText("Password:");
+        jLabel6.setBounds(25, 76, 84, 20);
+        jLabel6.setText("Base de datos:");
+        this.add(jLabel, null);
+        this.add(getTxtHost(), null);
+        this.add(jLabel1, null);
+        this.add(getTxtUser(), null);
+        this.add(getCmbDriver(), null);
+        this.add(jLabel2, null);
+        this.add(jLabel3, null);
+        this.add(getTxtTable(), null);
+        this.add(jLabel4, null);
+        this.add(getTxtPort(), null);
+        this.add(jLabel5, null);
+        this.add(getTxtPassword(), null);
+        this.add(jLabel6, null);
+        this.add(getTxtDB(), null);
+    }
+
+    /**
+     * This method initializes txtHost
+     *
+     * @return javax.swing.JTextField
+     */
+    private JTextField getTxtHost() {
+        if (txtHost == null) {
+            txtHost = new JTextField();
+            txtHost.setBounds(118, 12, 203, 20);
+        }
+
+        return txtHost;
+    }
+
+    /**
+     * This method initializes txtUser
+     *
+     * @return javax.swing.JTextField
+     */
+    private JTextField getTxtUser() {
+        if (txtUser == null) {
+            txtUser = new JTextField();
+            txtUser.setBounds(118, 140, 126, 20);
+        }
+
+        return txtUser;
+    }
+
+    /**
+     * This method initializes cmbDriver
+     *
+     * @return javax.swing.JComboBox
+     */
+    private JComboBox getCmbDriver() {
+        if (cmbDriver == null) {
+            cmbDriver = new JComboBox();
+            cmbDriver.setBounds(118, 204, 186, 20);
+        }
+
+        return cmbDriver;
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.gui.OpenLayerPanel#getDriverNames()
+     */
+    public String getDriverName() {
+        return cmbDriver.getSelectedItem().toString();
+    }
+    
+    public void setClasses(Class[] classes){
+        	DefaultComboBoxModel model = new DefaultComboBoxModel();
+			String[] driverNames = LayerFactory.getDM().getDriverNames();
+			for (int i = 0; i < driverNames.length; i++) {
+				boolean is = false;
+				for (int j = 0; j < classes.length; j++) {
+					if (LayerFactory.getDM().isA(driverNames[i], classes[j])){
+						model.addElement(driverNames[i]);
+					}
+				}
+			}
+			cmbDriver.setModel(model);
+    }
+    
+    public String getHost(){
+    	return txtHost.getText();
+    }
+    
+    public String getUser(){
+    	return txtUser.getText();
+    }
+    
+    public String getPassword(){
+    	char[] buffer = txtPassword.getPassword();
+    	
+    	String str = new String(buffer);
+    	
+    	for (int i = 0; i < buffer.length; i++) {
+    		buffer[i] = '\0';
+    	}
+    	
+    	return str;			
+    }
+    
+    public String getTable(){
+    	return txtTable.getText();
+    }
+    
+    public String getDataBase(){
+    	return txtDB.getText();
+    }
+    
+    public String getPort(){
+    	return txtPort.getText();
+    }
+    
+    /**
+	 * This method initializes txtTable	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */    
+	private JTextField getTxtTable() {
+		if (txtTable == null) {
+			txtTable = new JTextField();
+			txtTable.setBounds(118, 108, 194, 20);
+		}
+		return txtTable;
+	}
+	/**
+	 * This method initializes txtPort	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */    
+	private JTextField getTxtPort() {
+		if (txtPort == null) {
+			txtPort = new JTextField();
+			txtPort.setBounds(118, 44, 46, 20);
+		}
+		return txtPort;
+	}
+	/**
+	 * This method initializes txtPassword	
+	 * 	
+	 * @return javax.swing.JPasswordField	
+	 */    
+	private JPasswordField getTxtPassword() {
+		if (txtPassword == null) {
+			txtPassword = new JPasswordField();
+			txtPassword.setBounds(118, 172, 126, 20);
+		}
+		return txtPassword;
+	}
+	/**
+	 * This method initializes txtDB	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */    
+	private JTextField getTxtDB() {
+		if (txtDB == null) {
+			txtDB = new JTextField();
+			txtDB.setBounds(118, 76, 137, 20);
+		}
+		return txtDB;
+	}
+} //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/DataBaseOpenDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadTool.java	(revision 1648)
@@ -0,0 +1,97 @@
+/* Generated by Together */
+package com.iver.cit.gvsig.gui.cad;
+
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Color;
+import java.awt.Graphics;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ */
+public interface CadTool {
+	public static FSymbol drawingSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT,
+			Color.RED);
+	public static FSymbol modifySymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT,
+			Color.GRAY);
+	public static FSymbol selectSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT,
+			Color.ORANGE);
+	
+	/**
+	 * Indica una transici�n de un estado a otro. En �ste m�todo se deber�
+	 * comprobar si el estado al que se llega con la transici�n es un estado
+	 * en el que hay que modificar, a�adir o eliminar una geometr�a.
+	 *
+	 * @param text DOCUMENT ME!
+	 * @param editingSource DOCUMENT ME!
+	 * @param selectedGeometries DOCUMENT ME!
+	 * @param ds DOCUMENT ME!
+	 *
+	 * @return El valor de retorno es el mismo que en el
+	 * caso com.iver.fsac.Automaton.transition(string)
+	 */
+	int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] ds);
+
+	/**
+	 * Recibe un graphics en el que se encuentra dibujada la
+	 * EditableFeatureSource que se pasa como par�metro. En este m�todo, la
+	 * herramienta ha de implementar el dibujado de la operaci�n que se est�
+	 * realizando dependiendo del estado. Por ejemplo al dibujar un c�rculo
+	 * mediante 3 puntos, cuando la herramienta se encuentre en el estado en
+	 * el que s�lo falta un punto, se dibujar� el c�rculo teniendo en cuenta
+	 * como tercer punto el puntero del rat�n (pasado en los par�metros x e
+	 * y). Este m�todo es invocado tras cada transici�n y cada vez que se
+	 * mueve el rat�n.
+	 *
+	 * @param g DOCUMENT ME!
+	 * @param efs DOCUMENT ME!
+	 * @param selectedGeometries DOCUMENT ME!
+	 * @param x DOCUMENT ME!
+	 * @param y DOCUMENT ME!
+	 */
+	void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y);
+
+	/**
+	 * Obtiene la pregunta que saldr� en la consola relativa al estado en el
+	 * que se encuentra la herramienta
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	String getQuestion();
+
+	/**
+	 * Inicializa el estado del aut�mata de la herramienta
+	 */
+	void initializeStatus();
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param cta DOCUMENT ME!
+	 */
+	public void setCadToolAdapter(CADToolAdapter cta);
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public CADToolAdapter getCadToolAdapter();
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public Automaton getAutomaton();
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CADToolAdapter.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CADToolAdapter.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CADToolAdapter.java	(revision 1648)
@@ -0,0 +1,608 @@
+package com.iver.cit.gvsig.gui.cad;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.util.Stack;
+
+import org.apache.log4j.Logger;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.core.FGeometry;
+import com.iver.cit.gvsig.fmap.core.Handler;
+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.FSymbol;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.TrigonometricalFunctions;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.fmap.tools.BehaviorException;
+import com.iver.cit.gvsig.fmap.tools.Behavior.Behavior;
+import com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener;
+import com.iver.cit.gvsig.gui.cad.tools.SelectionCadTool;
+import com.iver.fsac.Automaton;
+import com.iver.utiles.console.InvalidResponseException;
+import com.iver.utiles.console.JConsole;
+import com.iver.utiles.console.ResponseListener;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class CADToolAdapter extends Behavior {
+	private static Logger logger = Logger.getLogger(CADToolAdapter.class.getName());
+	private Stack cadToolStack = new Stack();
+	private FBitSet selection;
+	private EditableFeatureSource editableFeatureSource;
+
+	//Para pasarle las coordenadas cuando se produce un evento textEntered
+	private int lastX;
+	private int lastY;
+	private FSymbol symbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, Color.RED);
+	private JConsole console;
+	private Point2D mapAdjustedPoint;
+	private CadMapControl cadMapControl;
+	private boolean questionAsked = false;
+	private CadGrid grid = new CadGrid();
+	private Point adjustedPoint;
+	private boolean snapping=false;
+	private boolean adjustSnapping=false;
+	
+	/**
+	 * Pinta de alguna manera especial las geometrias seleccionadas para la
+	 * edici�n. En caso de que el snapping est� activado, pintar� el efecto
+	 * del mismo.
+	 *
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics)
+	 */
+	public void paintComponent(Graphics g) {
+		super.paintComponent(g);
+
+		/*
+		   for (int i = selection.nextSetBit(0); i >= 0;
+		                   i = selection.nextSetBit(i + 1)) {
+		           try {
+		                   IGeometry geom = editableFeatureSource.getGeometry(i);
+		                   Handler[] handlers=geom.getHandlers();
+		                   geom.draw((Graphics2D) g, getMapControl().getViewPort(), symbol);
+		                   FGraphicUtilities.DrawHandlers((Graphics2D)g,getMapControl().getViewPort().getAffineTransform(),handlers);
+		           } catch (IOException e) {
+		                   e.printStackTrace();
+		           } catch (DriverIOException e) {
+		                   e.printStackTrace();
+		           }
+		   }
+		 */
+		grid.drawGrid(g);
+		drawCursor(g);
+		
+		if (adjustedPoint!=null){
+		Point2D p = getMapControl().getViewPort().toMapPoint((int) adjustedPoint.getX(),
+				(int) adjustedPoint.getY());
+		((CadTool) cadToolStack.peek()).drawOperation(g, editableFeatureSource,
+			selection, p.getX(), p.getY());
+		}
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+	 */
+	public void mouseClicked(MouseEvent e) throws BehaviorException {
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
+	 */
+	public void mouseEntered(MouseEvent e) throws BehaviorException {
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
+	 */
+	public void mouseExited(MouseEvent e) throws BehaviorException {
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public void mousePressed(MouseEvent e) throws BehaviorException {
+		if (e.getButton() == MouseEvent.BUTTON1) {
+			ViewPort vp = getMapControl().getMapContext().getViewPort();
+		Point2D p;
+
+			if (mapAdjustedPoint != null) {
+				p = mapAdjustedPoint;
+			} else {
+				p = vp.toMapPoint(adjustedPoint);
+			}
+
+			transition("punto", editableFeatureSource, selection,
+				new double[] { p.getX(), p.getY() });
+		}
+	}
+
+	
+	/**
+	 * Ajusta un punto de la imagen que se pasa como  par�metro al grid si �ste
+	 * est� activo y devuelve la distancia de un punto al punto ajustado
+	 *
+	 * @param point
+	 *
+	 * @return Distancia del punto que se pasa como par�metro al punto ajustado
+	 */
+	private double adjustToHandler(Point point, Point2D mapHandlerAdjustedPoint) {
+		//if (selection.cardinality() > 0) {
+			try {
+				Point2D mapPoint = getMapControl().getViewPort().toMapPoint(point);
+
+				Rectangle2D r = new Rectangle2D.Double(mapPoint.getX() - 1,
+						mapPoint.getY() - 1, 2, 2);
+
+				int[] indexes = editableFeatureSource.getGeometriesIndexes(r);
+				
+				double min = Double.MAX_VALUE;
+				Point2D argmin = null;
+				Point2D mapArgmin = null;
+
+				for (int i = 0; i < indexes.length; i++) {
+					//if (!selection.get(indexes[i])) continue;
+					IGeometry geom;
+					geom = editableFeatureSource.getGeometry(indexes[i]);
+
+					Handler[] handlers = geom.getHandlers(FGeometry.STRETCHINGHANDLER);
+
+					for (int j = 0; j < handlers.length; j++) {
+						Point2D handlerPoint = handlers[j].getPoint();
+						Point2D handlerImagePoint = getMapControl().getViewPort().fromMapPoint(handlerPoint);
+						double dist = handlerImagePoint.distance(point);
+
+						if ((dist < SelectionCadTool.tolerance) &&
+								(dist < min)) {
+							min = dist;
+							argmin = handlerImagePoint;
+							mapArgmin = handlerPoint;
+						}
+					}
+				}
+
+				if (argmin != null) {
+					point.setLocation(argmin);
+
+					//Se hace el casting porque no se quiere redondeo
+					point.setLocation((int)argmin.getX(),
+							(int) argmin.getY());
+					
+					mapHandlerAdjustedPoint.setLocation(mapArgmin);
+					return min;
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			}
+		//}
+
+		return Double.MAX_VALUE;
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+	}
+
+	/**
+	 * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
+	 */
+	public void mouseDragged(MouseEvent e) throws BehaviorException {
+		lastX = e.getX();
+		lastY = e.getY();
+
+		calculateSnapPoint(e.getPoint());
+	}
+
+	/**
+	 * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent)
+	 */
+	public void mouseMoved(MouseEvent e) throws BehaviorException {
+		lastX = e.getX();
+		lastY = e.getY();
+
+		calculateSnapPoint(e.getPoint());
+
+		getMapControl().repaint();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param g DOCUMENT ME!
+	 */
+	private void drawCursor(Graphics g) {
+		Point p = adjustedPoint;
+		if (p==null) grid.setViewPort(cadMapControl.getMapControl().getViewPort());
+		
+		int size1 = 15;
+		int size2 = 3;
+		g.drawLine((int) (p.getX() - size1), (int) (p.getY()),
+			(int) (p.getX() + size1), (int) (p.getY()));
+		g.drawLine((int) (p.getX()), (int) (p.getY() - size1),
+			(int) (p.getX()), (int) (p.getY() + size1));
+		if (adjustedPoint!=null){
+			if (adjustSnapping){
+				g.setColor(Color.ORANGE);
+				g.drawRect((int)(adjustedPoint.getX()-5),(int)(adjustedPoint.getY()-5),10,10);
+				g.drawRect((int)(adjustedPoint.getX()-3),(int)(adjustedPoint.getY()-3),6,6);
+				g.setColor(Color.MAGENTA);
+				g.drawRect((int)(adjustedPoint.getX()-4),(int)(adjustedPoint.getY()-4),8,8);
+				
+				adjustSnapping=false;
+			}else{
+				g.drawRect((int) (p.getX() - size2), (int) (p.getY() - size2),
+						(int) (size2 * 2), (int) (size2 * 2));
+			}
+		}
+	}
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param point
+	 */
+	private void calculateSnapPoint(Point point) {
+		//Se comprueba el ajuste a rejilla
+		Point gridAdjustedPoint = (Point) point.clone();
+		double minDistance = grid.adjustToGrid(gridAdjustedPoint);
+		if (minDistance < Double.MAX_VALUE) {
+			adjustedPoint = gridAdjustedPoint;
+			mapAdjustedPoint = getMapControl().getViewPort().toMapPoint(adjustedPoint);
+		}
+		
+		//Se comprueba el ajuste a los handlers
+		Point handlerAdjustedPoint = (Point) point.clone();
+		Point2D mapPoint = new Point2D.Double();
+		double distance = adjustToHandler(handlerAdjustedPoint, mapPoint);
+		if (distance < minDistance) {
+			adjustSnapping=true;
+			adjustedPoint = handlerAdjustedPoint;
+			mapAdjustedPoint = mapPoint;
+			minDistance = distance;
+		}
+
+		//Si no hay ajuste
+		if (minDistance == Double.MAX_VALUE) {
+			adjustedPoint = point;
+			mapAdjustedPoint = null;
+		}
+	}
+
+
+	/**
+	 * @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent)
+	 */
+	public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException {
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param text DOCUMENT ME!
+	 */
+	public void textEntered(String text) {
+		text = text.trim();
+
+		String[] numbers = text.split(",");
+		double[] values = null;
+
+		try {
+			if (numbers.length == 2) {
+				//punto
+				values = new double[] {
+						Double.parseDouble(numbers[0]),
+						Double.parseDouble(numbers[1])
+					};
+				transition("punto", editableFeatureSource, selection, values);
+			} else if (numbers.length == 1) {
+				//valor
+				values = new double[] { Double.parseDouble(numbers[0]) };
+				transition("numero", editableFeatureSource, selection, values);
+			}
+		} catch (NumberFormatException e) {
+			transition(text, editableFeatureSource, selection, new double[0]);
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param text DOCUMENT ME!
+	 */
+	public void transition(String text) {
+		transition(text, editableFeatureSource, selection, new double[0]);
+		configureMenu();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	private void configureMenu() {
+		String[] desc = ((CadTool) cadToolStack.peek()).getAutomaton()
+						 .getCurrentTransitionDescriptions();
+		String[] labels = ((CadTool) cadToolStack.peek()).getAutomaton()
+						   .getCurrentTransitions();
+		getCadMapControl().clearMenu();
+
+		for (int i = 0; i < desc.length; i++) {
+			if (desc[i] != null) {
+				getCadMapControl().addMenuEntry(desc[i], labels[i]);
+			}
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param text DOCUMENT ME!
+	 * @param source DOCUMENT ME!
+	 * @param sel DOCUMENT ME!
+	 * @param values DOCUMENT ME!
+	 */
+	private void transition(String text, EditableFeatureSource source,
+		FBitSet sel, double[] values) {
+		questionAsked = false;
+		logger.debug(text);
+
+		int ret = ((CadTool) cadToolStack.peek()).transition(text, source, sel,
+				values);
+
+		if ((ret & Automaton.AUTOMATON_FINISHED) == Automaton.AUTOMATON_FINISHED) {
+			popCadTool();
+
+			if (cadToolStack.isEmpty()) {
+				pushCadTool(new SelectionCadTool());
+				PluginServices.getMainFrame().selectTool("selection");
+			}
+
+			askQuestion();
+
+			getMapControl().drawMap(false);
+		} else {
+			if (((CadTool) cadToolStack.peek()).getAutomaton().checkState('c')) {
+				getMapControl().drawMap(false);
+			}
+
+			if (!questionAsked) {
+				askQuestion();
+			}
+		}
+
+		configureMenu();
+		PluginServices.getMainFrame().enableControls();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param value DOCUMENT ME!
+	 */
+	public void setGrid(boolean value) {
+		grid.setUseGrid(value);
+		grid.setViewPort(cadMapControl.getMapControl().getViewPort());
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param activated DOCUMENT ME!
+	 */
+	public void setSnapping(boolean activated) {
+		snapping=activated;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param x DOCUMENT ME!
+	 * @param y DOCUMENT ME!
+	 */
+	public void getSnapPoint(double x, double y,double dist) {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return new ToolListener() {
+				/**
+				 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+				 */
+				public Cursor getCursor() {
+					return null;
+				}
+
+				/**
+				 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+				 */
+				public boolean cancelDrawing() {
+					return false;
+				}
+			};
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public CadTool getCadTool() {
+		return (CadTool) cadToolStack.peek();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param cadTool DOCUMENT ME!
+	 */
+	public void pushCadTool(CadTool cadTool) {
+		cadToolStack.push(cadTool);
+		cadTool.setCadToolAdapter(this);
+		cadTool.initializeStatus();
+		int ret = cadTool.transition(null, editableFeatureSource, selection, new double[0]);
+		if ((ret & Automaton.AUTOMATON_FINISHED) == Automaton.AUTOMATON_FINISHED) {
+			popCadTool();
+
+			if (cadToolStack.isEmpty()) {
+				pushCadTool(new SelectionCadTool());
+				PluginServices.getMainFrame().selectTool("selection");
+			}
+
+			askQuestion();
+
+			getMapControl().drawMap(false);
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	public void popCadTool() {
+		console.cancelQuestion();
+		cadToolStack.pop();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	private void askQuestion() {
+		console.askQuestion(((CadTool) cadToolStack.peek()).getQuestion(),
+			new ResponseListener() {
+				public void acceptResponse(String response,
+					boolean userCancelled) throws InvalidResponseException {
+					if (response != null) {
+						if ("".equals(response)) {
+							transition("aceptar");
+						}
+
+						textEntered(response);
+					} else if (userCancelled) {
+						transition("cancel");
+					}
+				}
+			});
+		questionAsked = true;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param cadTool DOCUMENT ME!
+	 */
+	public void setCadTool(CadTool cadTool) {
+		cadToolStack.clear();
+		pushCadTool(cadTool);
+		askQuestion();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public EditableFeatureSource getEditableFeatureSource() {
+		return editableFeatureSource;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param editableFeatureSource DOCUMENT ME!
+	 * @param selection DOCUMENT ME!
+	 */
+	public void setEditableFeatureSource(
+		EditableFeatureSource editableFeatureSource, FBitSet selection) {
+		this.editableFeatureSource = editableFeatureSource;
+		this.selection = selection;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param console
+	 */
+	public void setConsole(JConsole console) {
+		this.console = console;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public CadMapControl getCadMapControl() {
+		return cadMapControl;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param cadMapControl DOCUMENT ME!
+	 */
+	public void setCadMapControl(CadMapControl cadMapControl) {
+		this.cadMapControl = cadMapControl;
+	}
+
+	/**
+	 * Elimina las geometr�as seleccionadas actualmente
+	 */
+	private void delete() {
+		editableFeatureSource.startComplexGeometry();
+		try {
+		for (int i = selection.nextSetBit(0); i >= 0;
+				i = selection.nextSetBit(i + 1)) {
+				editableFeatureSource.removeGeometry(i);
+		}
+		} catch (DriverIOException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		} finally {
+		try {
+			editableFeatureSource.endComplexGeometry();
+		} catch (IOException e1) {
+			e1.printStackTrace();
+		} catch (DriverIOException e1) {
+			e1.printStackTrace();
+		}
+		}
+		selection.clear();
+		getCadMapControl().getMapControl().drawMap(false);
+	}
+
+	/**
+	 * @param b
+	 */
+	public void setAdjustGrid(boolean b) {
+		grid.setAdjustGrid(b);
+	}
+
+	/**
+	 * @param actionCommand
+	 */
+	public void keyPressed(String actionCommand) {
+		if (actionCommand.equals("eliminar")){
+			delete();
+		}else if (actionCommand.equals("escape")){
+			transition("cancel");
+		}
+		PluginServices.getMainFrame().enableControls();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CADToolAdapter.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadMapControl.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadMapControl.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadMapControl.java	(revision 1648)
@@ -0,0 +1,418 @@
+/*
+ * Created on 04-feb-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.gui.cad;
+
+import java.awt.BorderLayout;
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionListener;
+import java.awt.image.MemoryImageSource;
+import java.util.HashMap;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JSplitPane;
+import javax.swing.KeyStroke;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.layers.CancelationException;
+import com.iver.cit.gvsig.fmap.layers.EditionEvent;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent;
+import com.iver.cit.gvsig.fmap.layers.LayerCollectionListener;
+import com.iver.cit.gvsig.fmap.layers.LayerPositionEvent;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.EditableVectorialLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.EditionListener;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.Selectable;
+import com.iver.cit.gvsig.fmap.tools.Behavior.Behavior;
+import com.iver.cit.gvsig.gui.cad.automaton.Simetria;
+import com.iver.cit.gvsig.gui.cad.tools.ArcCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.CircleCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.CopyCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.EllipseCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.ExploitCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.LineCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.PointCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.PolyLineCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.PolygonCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.RectangleCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.RotateCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.ScaleCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.SelectionCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.SplineCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.SymmetryCadTool;
+import com.iver.cit.gvsig.gui.cad.tools.StretchingCadTool;
+import com.iver.utiles.console.JConsole;
+public class CadMapControl extends JPanel {
+	private HashMap namesCadTools = new HashMap();
+	private CADToolAdapter cadToolAdapter = new CADToolAdapter();
+	private LayerEditionListener layerEditionListener = new LayerEditionListener();
+	private LayerColListener layerListener = new LayerColListener();
+	private MapControl mapControl = null;
+	private JConsole jConsole = null;
+	private JSplitPane jSplitPane = null;
+	
+	//Menu contextual
+	private JPopupMenu popup = new JPopupMenu();
+
+	/**
+	 * This is the default constructor
+	 */
+	public CadMapControl() {
+		super();
+		initialize();
+	}
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private  void initialize() {
+        // Herramienta de edici�n de CAD
+        getMapControl().addMapTool("cadEdition", cadToolAdapter);
+        
+        cadToolAdapter.setConsole(getConsole());
+        cadToolAdapter.setCadMapControl(this);
+        
+        //Herramienta de CAD de a�adir punto
+        PointCadTool pointCADTool = new PointCadTool();
+        addCadTool("point", pointCADTool);
+        //Herramienta de CAD de a�adir l�nea
+        LineCadTool lineCADTool = new LineCadTool();
+        addCadTool("line", lineCADTool);
+        //Herramienta de CAD de a�adir c�rculo
+        addCadTool("circle", new CircleCadTool());
+        //Herramienta de CAD de a�adir c�rculo
+        addCadTool("ellipse", new EllipseCadTool());
+        //Herramienta de CAD de a�adir c�rculo
+        addCadTool("arc", new ArcCadTool());
+        //Herramienta de CAD de a�adir polyl�nea
+        PolyLineCadTool polylineCADTool = new PolyLineCadTool();
+        addCadTool("polyline", polylineCADTool);
+        //Herramienta de CAD de a�adir rect�ngulo.
+        RectangleCadTool rectangleCADTool = new RectangleCadTool();
+        addCadTool("rectangle", rectangleCADTool);
+        //Herramienta de CAD de a�adir pol�gono.
+        PolygonCadTool polygonCADTool = new PolygonCadTool();
+        addCadTool("polygon", polygonCADTool);
+        //Herramienta de CAD para seleccionar geometr�as.
+        SelectionCadTool selectionCADTool = new SelectionCadTool();
+        addCadTool("selection", selectionCADTool);
+        //Herramienta de CAD para copiar una geometria.
+        CopyCadTool copyCADTool = new CopyCadTool();
+        addCadTool("copy", copyCADTool);
+        //Herramienta de CAD para girar una geometria.
+        RotateCadTool rotateCADTool = new RotateCadTool();
+        addCadTool("rotate", rotateCADTool);
+        //Herramienta de CAD para escalar una geometria.
+        ScaleCadTool scaleCADTool = new ScaleCadTool();
+        addCadTool("scale", scaleCADTool);
+        //Herramienta de CAD para extirar una geometria.
+        StretchingCadTool stretchingCADTool = new StretchingCadTool();
+        addCadTool("stretching", stretchingCADTool);
+        
+        //Herramienta de CAD para crear una simetria de una geometria.
+        SymmetryCadTool symmetryCADTool = new SymmetryCadTool();
+        addCadTool("symmetry", symmetryCADTool);
+        
+//      Herramienta de CAD para explotar una geometria.
+        ExploitCadTool exploitCADTool = new ExploitCadTool();
+        addCadTool("exploit", exploitCADTool);
+        
+//      Herramienta de CAD para crear un spline geometria.
+        SplineCadTool splainCADTool = new SplineCadTool();
+        addCadTool("spline", splainCADTool);
+        
+        addMenuEntry("aceptar", "aceptar");
+        addMenuEntry("cancelar", "cancelar");
+        
+        this.setLayout(new BorderLayout());
+		this.setSize(300,200);
+		this.add(getJSplitPane(), java.awt.BorderLayout.CENTER);
+
+        this.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "elimina");
+        this.getActionMap().put("elimina", new MyAction("eliminar"));
+        this.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "escape");
+        this.getActionMap().put("escape", new MyAction("escape"));
+	}
+	
+	class MyAction extends AbstractAction{
+		private String actionCommand;
+		
+		public MyAction(String command){
+			actionCommand = command;
+		}
+
+		/**
+		 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+		 */
+		public void actionPerformed(ActionEvent e) {
+			cadToolAdapter.keyPressed(actionCommand);
+		}
+		
+	}
+	
+	/**
+	 * This method initializes mapControl	
+	 * 	
+	 * @return com.iver.cit.gvsig.fmap.MapControl	
+	 */    
+	public MapControl getMapControl() {
+		if (mapControl == null) {
+			mapControl = new MapControl();
+			mapControl.addMouseMotionListener(new MouseMotionListener(){
+
+				public void mouseDragged(MouseEvent arg0) {
+				}
+
+				public void mouseMoved(MouseEvent arg0) {
+					//CadMapControl.this.setCursor(cadToolAdapter.getCursor());
+					clearMouseImage();
+				}
+				
+			});
+			mapControl.addMouseListener(new java.awt.event.MouseAdapter() { 
+				public void mousePressed(java.awt.event.MouseEvent e) {
+					show(e);
+				}
+				public void mouseReleased(java.awt.event.MouseEvent e) {
+					show(e);
+				}
+				private void show(java.awt.event.MouseEvent e){
+			        if (e.isPopupTrigger() && (mapControl.getCurrentMapTool() == cadToolAdapter)) {
+			            popup.show(e.getComponent(),
+			                       e.getX(), e.getY());
+			        }
+				}
+			});
+		}
+		return mapControl;
+	}
+	/**
+	 * This method initializes jConsole	
+	 * 	
+	 * @return com.iver.utiles.console.JConsole	
+	 */    
+	public JConsole getConsole() {
+		if (jConsole == null) {
+			jConsole = new JConsole();
+			jConsole.setPreferredSize(new java.awt.Dimension(3,35));
+			jConsole.addFocusListener(new FocusListener() {
+				public void focusGained(FocusEvent e) {
+				}
+
+				public void focusLost(FocusEvent e) {
+					jConsole.requestFocus();
+					jConsole.requestFocusInWindow();
+				}
+			});
+			jConsole.requestFocus();
+			jConsole.requestFocusInWindow();
+		}
+		return jConsole;
+	}
+	/**
+	 * This method initializes jSplitPane	
+	 * 	
+	 * @return javax.swing.JSplitPane	
+	 */    
+	private JSplitPane getJSplitPane() {
+		if (jSplitPane == null) {
+			jSplitPane = new JSplitPane();
+			jSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
+			jSplitPane.setTopComponent(getMapControl());
+			jSplitPane.setBottomComponent(getConsole());
+			jSplitPane.setDividerLocation(130);
+			jSplitPane.setResizeWeight(0.85);
+		}
+		return jSplitPane;
+	}
+	public FMap getMapContext() {
+		return mapControl.getMapContext();
+	}
+	
+	public void addMapTool(String name, Behavior tool) {
+		mapControl.addMapTool(name, tool);
+	}
+	
+	public void addMapTool(String name, Behavior[] tools) {
+		mapControl.addMapTool(name, tools);
+	}
+	public void setMapContext(FMap model) {
+		mapControl.getMapContext().getLayers().removeLayerCollectionListener(layerListener);
+		mapControl.setMapContext(model);
+		mapControl.getMapContext().getLayers().addLayerCollectionListener(layerListener);
+	}
+
+	public void addCadTool(String name, CadTool c){
+		namesCadTools.put(name, c);
+	}
+	
+	public void setCadTool(String text){
+		CadTool ct = (CadTool) namesCadTools.get(text);
+		if (ct == null) throw new RuntimeException("No such cad tool");
+		
+		cadToolAdapter.setCadTool(ct);
+		getMapControl().setTool("cadEdition");
+		//clearMouseImage();
+	}
+	private void clearMouseImage(){
+		int[] pixels = new int[16 * 16];
+		Image image = Toolkit.getDefaultToolkit().createImage(
+			new MemoryImageSource(16, 16, pixels, 0, 16));
+		Cursor transparentCursor =
+			Toolkit.getDefaultToolkit().createCustomCursor
+			    (image, new Point(0,0), "invisiblecursor");
+		this.setCursor(transparentCursor);
+	}
+	public void clearMenu(){
+		popup.removeAll();
+	}
+
+	public void addMenuEntry(String text, String actionCommand){
+		JMenuItem menu = new JMenuItem(text);
+		menu.setActionCommand(actionCommand);
+		menu.setEnabled(true);
+		menu.setVisible(true);
+		menu.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent e) {
+				cadToolAdapter.transition(e.getActionCommand());
+			}
+		});
+		
+		popup.add(menu);
+	}
+	public CADToolAdapter getCadToolAdapter(){
+		return cadToolAdapter;
+	}
+private class LayerColListener implements LayerCollectionListener{
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerAdded(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerAdded(LayerCollectionEvent e) {
+		if (e.getAffectedLayer() instanceof EditableVectorialLayer){
+			((EditableVectorialLayer) e.getAffectedLayer()).addEditionListener(layerEditionListener);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerMoved(com.iver.cit.gvsig.fmap.layers.LayerPositionEvent)
+	 */
+	public void layerMoved(LayerPositionEvent e) {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerRemoved(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerRemoved(LayerCollectionEvent e) {
+		if (e.getAffectedLayer() instanceof EditableVectorialLayer){
+			((EditableVectorialLayer) e.getAffectedLayer()).removeEditionListener(layerEditionListener);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerAdding(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerAdding(LayerCollectionEvent e) throws CancelationException {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerMoving(com.iver.cit.gvsig.fmap.layers.LayerPositionEvent)
+	 */
+	public void layerMoving(LayerPositionEvent e) throws CancelationException {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#layerRemoving(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void layerRemoving(LayerCollectionEvent e) throws CancelationException {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#activationChanged(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void activationChanged(LayerCollectionEvent e) throws CancelationException {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerCollectionListener#visibilityChanged(com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent)
+	 */
+	public void visibilityChanged(LayerCollectionEvent e) throws CancelationException {
+	}
+	
+}
+	
+private class LayerEditionListener implements EditionListener{
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerListener#activationChanged(com.iver.cit.gvsig.fmap.layers.LayerEvent)
+	 */
+	public void startEdition(EditionEvent e) {
+		FLayer lyr = e.getSource();
+		cadToolAdapter.setEditableFeatureSource(e.getEditingAdapter(), ((Selectable)lyr).getSelection());		
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.EditionListener#stopEdition(com.iver.cit.gvsig.fmap.layers.EditionEvent)
+	 */
+	public void stopEdition(EditionEvent layer) {
+		CadMapControl.this.getMapControl().setTool("zoomIn");
+	}
+	
+}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadMapControl.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Punto.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Punto.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Punto.java	(revision 1648)
@@ -0,0 +1,120 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Punto implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "c".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Punto.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Alargar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Alargar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Alargar.java	(revision 1648)
@@ -0,0 +1,187 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Alargar implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("aceptar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "aceptar", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Aceptar", "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Alargar.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Estirar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Estirar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Estirar.java	(revision 1648)
@@ -0,0 +1,210 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Estirar implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("aceptar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 0;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "aceptar", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Aceptar", "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Estirar.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Escalar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Escalar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Escalar.java	(revision 1648)
@@ -0,0 +1,173 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Escalar implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "numero", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Escalar.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Polilinea.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Polilinea.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Polilinea.java	(revision 1648)
@@ -0,0 +1,275 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Polilinea implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("A".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cerrar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("aceptar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 5;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("N".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("N".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cerrar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("aceptar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 5;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 5:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 5){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "A", "cerrar", "aceptar", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"N", "punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"punto", "N", "cerrar", "aceptar", "cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 5){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Arco", "Cerrar", "Aceptar", "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Linea", null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, "Linea", "Cerrar", "Aceptar", "Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 5){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Polilinea.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Simetria.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Simetria.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Simetria.java	(revision 1648)
@@ -0,0 +1,203 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Simetria implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("S".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("N".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"S", "N", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Borrar", "Copiar", "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Simetria.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Copiar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Copiar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Copiar.java	(revision 1648)
@@ -0,0 +1,143 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Copiar implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Copiar.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Elipse.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Elipse.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Elipse.java	(revision 1648)
@@ -0,0 +1,203 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Elipse implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "numero", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Elipse.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Recortar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Recortar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Recortar.java	(revision 1648)
@@ -0,0 +1,187 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Recortar implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("aceptar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "aceptar", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Aceptar", "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Recortar.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Equidistancia.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Equidistancia.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Equidistancia.java	(revision 1648)
@@ -0,0 +1,217 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Equidistancia implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "numero", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Equidistancia.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Arco.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Arco.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Arco.java	(revision 1648)
@@ -0,0 +1,173 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Arco implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Arco.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Poligono.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Poligono.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Poligono.java	(revision 1648)
@@ -0,0 +1,277 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Poligono implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("I".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("C".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 5;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 6;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 5;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 6;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 5:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 6:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 5){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 6){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"numero", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"I", "C", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"numero", "punto", "cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"numero", "punto", "cancel"};
+		}
+		
+		if (status == 5){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 6){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Inscrito", "Circunscrito", "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 5){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 6){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Poligono.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Linea.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Linea.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Linea.java	(revision 1648)
@@ -0,0 +1,261 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Linea implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 5;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("end".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("end".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 5:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "c".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 5){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "numero", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"numero", "punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"end", "cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"end", "cancel"};
+		}
+		
+		if (status == 5){
+			return new String[]{"punto", "numero", "cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 5){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Linea.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Spline.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Spline.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Spline.java	(revision 1648)
@@ -0,0 +1,150 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Spline implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cerrar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cerrar", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cerrar", "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Spline.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Unir_partir.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Unir_partir.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Unir_partir.java	(revision 1648)
@@ -0,0 +1,143 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Unir_partir implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Unir_partir.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Explotar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Explotar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Explotar.java	(revision 1648)
@@ -0,0 +1,113 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Explotar implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("aceptar".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"aceptar", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"Aceptar", "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Explotar.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Circulo.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Circulo.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Circulo.java	(revision 1648)
@@ -0,0 +1,293 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Circulo implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("3P".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 6;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 7;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 5;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 5:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 6:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 7:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 5){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 6){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 7){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "3P", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"numero", "punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 5){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 6){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 7){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 5){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 6){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 7){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Circulo.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Rectangulo.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Rectangulo.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Rectangulo.java	(revision 1648)
@@ -0,0 +1,203 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Rectangulo implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("C".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"C", "punto", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{"Cuadrado", null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Rectangulo.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Seleccion.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Seleccion.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Seleccion.java	(revision 1648)
@@ -0,0 +1,261 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Seleccion implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("no_sel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("sel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 0;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("handler".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 4;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("sel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 0;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("no_sel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 0;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 4:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 5;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 5:
+				
+				if ("done".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 0;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "c".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 4){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 5){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"no_sel", "sel", "handler", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"sel", "no_sel", "cancel"};
+		}
+		
+		if (status == 4){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 5){
+			return new String[]{"done", "cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, null, null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 4){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 5){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Seleccion.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Girar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Girar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Girar.java	(revision 1648)
@@ -0,0 +1,173 @@
+package com.iver.cit.gvsig.gui.cad.automaton;
+
+public class Girar implements com.iver.fsac.Automaton{
+	private int previousStatus = com.iver.fsac.Automaton.FINISHED;
+	private int status = 0;
+
+	public void initialize() {
+		status = 0;
+	}
+
+	public int transition(String label){
+		switch (status){
+		
+			case -1:
+				
+				break;
+		
+			case 0:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 1;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 1:
+				
+				if ("punto".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 2;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("numero".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = 3;
+					
+					return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
+				}
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 2:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+			case 3:
+				
+				if ("cancel".equalsIgnoreCase(label)){
+					previousStatus = status;
+					status = -1;
+					
+					return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
+				}
+				
+				break;
+		
+		}
+		
+		return com.iver.fsac.Automaton.TRANSITION_FAILED;
+	}
+	
+	public int getPreviousStatus(){
+		return previousStatus;
+	}
+	
+	public int getStatus(){
+		return status;
+	}
+	
+	public boolean checkState(char c){
+		
+		if (status == -1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 0){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 1){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 2){
+			return "".indexOf(c) != -1;
+		}
+		
+		if (status == 3){
+			return "".indexOf(c) != -1;
+		}
+		
+		
+		return false;
+	}
+	
+	public String[] getCurrentTransitions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{"punto", "cancel"};
+		}
+		
+		if (status == 1){
+			return new String[]{"punto", "numero", "cancel"};
+		}
+		
+		if (status == 2){
+			return new String[]{"cancel"};
+		}
+		
+		if (status == 3){
+			return new String[]{"cancel"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+	
+	public String[] getCurrentTransitionDescriptions(){
+		
+		if (status == -1){
+			return new String[]{};
+		}
+		
+		if (status == 0){
+			return new String[]{null, "Cancelar"};
+		}
+		
+		if (status == 1){
+			return new String[]{null, null, "Cancelar"};
+		}
+		
+		if (status == 2){
+			return new String[]{"Cancelar"};
+		}
+		
+		if (status == 3){
+			return new String[]{"Cancelar"};
+		}
+		
+		
+		throw new RuntimeException("Bug!");
+	}
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Girar.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadGrid.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadGrid.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadGrid.java	(revision 1648)
@@ -0,0 +1,152 @@
+/* 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.gui.cad;
+
+import com.iver.cit.gvsig.fmap.ViewPort;
+
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * Clase encargada de gestionar las diferentes operaciones que se realizan
+ * sobre el grid.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class CadGrid {
+	private boolean grid = false;
+	private int gridSize = 1000;
+	private ViewPort viewport;
+	private boolean adjustGrid;
+
+	/**
+	 * Inserta el viewPort.
+	 *
+	 * @param vp
+	 */
+	public void setViewPort(ViewPort vp) {
+		viewport = vp;
+		gridSize=(int)viewport.toMapDistance(20);
+	}
+
+	/**
+	 * Ajusta un punto de la imagen que se pasa como  par�metro al handler m�s
+	 * cercano si se encuentra lo suficientemente  cerca y devuelve la
+	 * distancia del punto original al punto ajustado
+	 *
+	 * @param point
+	 *
+	 * @return Distancia del punto que se pasa como par�metro al punto ajustado
+	 */
+	public double adjustToGrid(Point point) {
+		if (grid && adjustGrid) {
+			Point2D auxp = new Point2D.Double(0, 0);
+			Point2D po = viewport.toMapPoint(point);
+			Rectangle2D extent = viewport.getAdjustedExtent();
+			double x = ((po.getX() + gridSize) % gridSize) -
+				((auxp.getX()) % gridSize);
+			double y = ((po.getY() + gridSize) % gridSize) -
+				((auxp.getY()) % gridSize);
+			Point2D p = new Point(point);
+			point.x = (int) (p.getX() - viewport.fromMapDistance(x));
+			point.y = (int) (p.getY() + viewport.fromMapDistance(y));
+
+			return p.distance(point);
+		}
+
+		return Double.MAX_VALUE;
+	}
+
+	/**
+	 * Dibuja el grid sobre el graphics que se pasa como par�metro
+	 *
+	 * @param g Graphics sobre el que dibujar el grid.
+	 */
+	public void drawGrid(Graphics g) {
+		if (!grid) {
+			return;
+		}
+
+		Rectangle2D extent = viewport.getAdjustedExtent();
+		Point2D auxp = new Point2D.Double(0, 0);
+
+		for (int i = (int) extent.getMinX(); i < (extent.getMaxX() + gridSize);
+				i += gridSize) {
+			for (int j = (int) extent.getMinY();
+					j < (extent.getMaxY() + gridSize); j += gridSize) {
+				Point2D po = new Point2D.Double(i, j);
+				Point2D point = viewport.fromMapPoint(po);
+				double x = ((po.getX() + gridSize) % gridSize) -
+					((auxp.getX()) % gridSize);
+				double y = ((po.getY() + gridSize) % gridSize) -
+					((auxp.getY()) % gridSize);
+				x = (int) (point.getX() - viewport.fromMapDistance(x));
+				y = (int) (point.getY() + viewport.fromMapDistance(y));
+				if (viewport.fromMapDistance(gridSize)>3){
+					g.drawOval((int) x, (int) y, 1, 1);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Inserta un boolean que indica si se utiliza o no el grid y de esta forma
+	 * dibujarse.
+	 *
+	 * @param b boolean
+	 */
+	public void setUseGrid(boolean b) {
+		grid = b;
+	}
+
+	/**
+	 * Inserta un boolean que indica si se ajusta o no al grid y de esta forma
+	 * dibujarse.
+	 *
+	 * @param b boolean
+	 */
+	public void setAdjustGrid(boolean b) {
+		adjustGrid = b;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/CadGrid.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CircleCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CircleCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CircleCadTool.java	(revision 1648)
@@ -0,0 +1,206 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.edition.cad.TrigonometricalFunctions;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Circulo;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para crear una circunferencia a partir de tres puntos o del
+ * centro y el radio.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class CircleCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise punto central o [3P]"),
+			new Status("Precise radio"),
+			new Status("Precise primer punto del c�rculo"),
+			new Status("Precise segundo punto del c�rculo"),
+			new Status("Precise tercer punto del c�rculo"),
+		};
+	private Circulo circleStatus = new Circulo();
+	private Point2D center;
+	private Point2D p1;
+	private Point2D p2;
+	private Point2D p3;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = circleStatus.transition(text);
+
+		int status = circleStatus.getStatus();
+
+		if (status == 0) {
+		} else if (status == 1) {
+			center = new Point2D.Double(values[0], values[1]);
+		} else if (status == 2) {
+		} else if (status == 3) {
+			p1 = new Point2D.Double(values[0], values[1]);
+		} else if (status == 4) {
+			p2 = new Point2D.Double(values[0], values[1]);
+		} else if (status == 5) {
+			p3 = new Point2D.Double(values[0], values[1]);
+			center = TrigonometricalFunctions.getCircleCenter(p1, p2, p3);
+
+			double radio = center.distance(p1);
+
+			try {
+				editingSource.addGeometry(ShapeFactory.createCircle(center,
+						radio));
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			ret = ret | circleStatus.transition("cancel");
+		} else if (status == 6) {
+			try {
+				editingSource.addGeometry(ShapeFactory.createCircle(center,
+						values[0]));
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			ret = ret | circleStatus.transition("cancel");
+		} else if (status == 7) {
+			try {
+				editingSource.addGeometry(ShapeFactory.createCircle(center,
+						new Point2D.Double(values[0], values[1])));
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			ret = ret | circleStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = circleStatus.getStatus();
+
+		if (status == 1) {
+			Point2D currentPoint = new Point2D.Double(x, y);
+			double dist = currentPoint.distance(center);
+			ShapeFactory.createCircle(center, dist).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+		} else if (status == 2) {
+		} else if (status == 3) {
+			drawLine((Graphics2D) g, p1, new Point2D.Double(x, y));
+		} else if (status == 4) {
+			Point2D currentPoint = new Point2D.Double(x, y);
+
+			if (p1.getX() == p2.getX()) {
+				p2 = new Point2D.Double(p2.getX() + 0.0000001, p2.getY());
+			} else if (p1.getY() == p2.getY()) {
+				p2 = new Point2D.Double(p2.getX(), p2.getY() + 0.0000001);
+			} /*if (currentPoint.getX()==p1.getX()){
+			   currentPoint=new Point2D.Double(currentPoint.getX()+0.0000001,currentPoint.getY());
+			   }else if (currentPoint.getY()==p1.getY()){
+			           currentPoint=new Point2D.Double(currentPoint.getX(),currentPoint.getY()+0.0000001);
+			   }if (currentPoint.getX()==p2.getX()){
+			           currentPoint=new Point2D.Double(currentPoint.getX()+0.0000001,currentPoint.getY());
+			   }else if (currentPoint.getY()==p2.getY()){
+			           currentPoint=new Point2D.Double(currentPoint.getX(),currentPoint.getY()+0.0000001);
+			   }*/
+			Point2D currentCenter = TrigonometricalFunctions.getCircleCenter(p1,
+					p2, currentPoint);
+			double radio = currentCenter.distance(p1);
+			ShapeFactory.createCircle(currentCenter, radio).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[circleStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		circleStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return circleStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CircleCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/AbstractCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/AbstractCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/AbstractCadTool.java	(revision 1648)
@@ -0,0 +1,76 @@
+/*
+ * Created on 09-feb-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.gui.cad.tools;
+
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.gui.cad.CADToolAdapter;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+
+
+public abstract class AbstractCadTool implements CadTool {
+	private CADToolAdapter cadToolAdapter;
+	public void setCadToolAdapter(CADToolAdapter cta){
+		cadToolAdapter = cta;
+	}
+	
+	public CADToolAdapter getCadToolAdapter(){
+		return cadToolAdapter;
+	}
+	
+	public void drawLine(Graphics2D g, Point2D firstPoint, Point2D endPoint){
+		GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+				2);
+		elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+		elShape.lineTo(endPoint.getX(), endPoint.getY());
+		ShapeFactory.createPolyline2D(elShape).draw(g,
+			getCadToolAdapter().getMapControl().getViewPort(),
+			CadTool.drawingSymbol);
+		
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/AbstractCadTool.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RectangleCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RectangleCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RectangleCadTool.java	(revision 1648)
@@ -0,0 +1,276 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.FGeometryCollection;
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Rectangulo;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+import java.util.ArrayList;
+
+
+/**
+ * Herramienta para a�adir una geometr�a rectangulo o cuadrado.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class RectangleCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise primer punto de esquina"),
+			new Status("Precise esquina opuesta o tipo Cuadrado(C)"),
+			new Status("Precise esquina opuesta")
+		};
+	private Rectangulo rectangleStatus = new Rectangulo();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+	private ArrayList list = new ArrayList();
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = rectangleStatus.transition(text);
+
+		int status = rectangleStatus.getStatus();
+
+		if (status == 0) {
+			//firstPoint=new FPoint2D(values[0], values[1]);
+		} else if (status == 1) {
+			if (values.length != 0) {
+				firstPoint = new Point2D.Double(values[0], values[1]);
+			}
+
+			System.out.println("1");
+		} else if (status == 2) {
+			System.out.println("2");
+		} else if (status == 3) {
+			System.out.println("3");
+
+			if (values.length != 0) {
+				lastPoint = new Point2D.Double(values[0], values[1]);
+			}
+
+			/*GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+			   4);
+			   elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			   elShape.lineTo(lastPoint.getX(), firstPoint.getY());
+			   elShape.lineTo(lastPoint.getX(), lastPoint.getY());
+			   elShape.lineTo(firstPoint.getX(), lastPoint.getY());
+			   elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			   editingSource.addGeometry(ShapeFactory.createPolyline2D(
+			                   elShape));
+			 */
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					2);
+			elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			elShape.lineTo(lastPoint.getX(), firstPoint.getY());
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 2);
+			elShape.moveTo(lastPoint.getX(), firstPoint.getY());
+			elShape.lineTo(lastPoint.getX(), lastPoint.getY());
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 2);
+			elShape.moveTo(lastPoint.getX(), lastPoint.getY());
+			elShape.lineTo(firstPoint.getX(), lastPoint.getY());
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 2);
+			elShape.moveTo(firstPoint.getX(), lastPoint.getY());
+			elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			IGeometry[] geoms = (IGeometry[]) list.toArray(new IGeometry[0]);
+
+			FGeometryCollection fgc = new FGeometryCollection(geoms);
+
+			try {
+				editingSource.addGeometry(fgc);
+			} catch (DriverIOException e1) {
+				e1.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+			list.clear();
+			ret = ret | rectangleStatus.transition("cancel");
+		} else if (status == 4) {
+			System.out.println("4");
+
+			if (values.length != 0) {
+				lastPoint = new Point2D.Double(values[0], values[1]);
+			}
+
+			/*
+			   try {
+			           GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+			                           4);
+			           elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			           elShape.lineTo(lastPoint.getX(), firstPoint.getY());
+			           elShape.lineTo(lastPoint.getX(),firstPoint.getY()-(lastPoint.getX()-firstPoint.getX()));
+			           elShape.lineTo(firstPoint.getX(), firstPoint.getY()-(lastPoint.getX()-firstPoint.getX()));
+			           elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			           editingSource.addGeometry(ShapeFactory.createPolyline2D(
+			                           elShape));
+			   } catch (DriverIOException e) {
+			           e.printStackTrace();
+			   } catch (IOException e) {
+			           e.printStackTrace();
+			   }
+			 */
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					2);
+			elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			elShape.lineTo(lastPoint.getX(), firstPoint.getY());
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 2);
+			elShape.moveTo(lastPoint.getX(), firstPoint.getY());
+			elShape.lineTo(lastPoint.getX(),
+				firstPoint.getY() - (lastPoint.getX() - firstPoint.getX()));
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 2);
+			elShape.moveTo(lastPoint.getX(),
+				firstPoint.getY() - (lastPoint.getX() - firstPoint.getX()));
+			elShape.lineTo(firstPoint.getX(),
+				firstPoint.getY() - (lastPoint.getX() - firstPoint.getX()));
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 2);
+			elShape.moveTo(firstPoint.getX(),
+				firstPoint.getY() - (lastPoint.getX() - firstPoint.getX()));
+			elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			IGeometry[] geoms = (IGeometry[]) list.toArray(new IGeometry[0]);
+
+			FGeometryCollection fgc = new FGeometryCollection(geoms);
+
+			try {
+				editingSource.addGeometry(fgc);
+			} catch (DriverIOException e1) {
+				e1.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			list.clear();
+			ret = ret | rectangleStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = rectangleStatus.getStatus();
+
+		if (status == 1) {
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					4);
+			elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			elShape.lineTo(x, firstPoint.getY());
+			elShape.lineTo(x, y);
+			elShape.lineTo(firstPoint.getX(), y);
+			elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			ShapeFactory.createPolyline2D(elShape).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+		} else if (status == 2) {
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					4);
+			elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			elShape.lineTo(x, firstPoint.getY());
+			elShape.lineTo(x, firstPoint.getY() - (x - firstPoint.getX()));
+			elShape.lineTo(firstPoint.getX(),
+				firstPoint.getY() - (x - firstPoint.getX()));
+			elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			ShapeFactory.createPolyline2D(elShape).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[rectangleStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		rectangleStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return rectangleStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RectangleCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ArcCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ArcCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ArcCadTool.java	(revision 1648)
@@ -0,0 +1,156 @@
+/* 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.gui.cad.tools;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.io.IOException;
+
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Arco;
+import com.iver.fsac.Automaton;
+
+
+/**
+ * Herramienta para crear un arco a partir de tres puntos.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ArcCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise punto inicial"),
+			new Status("Precise segundo punto"),
+			new Status("Precise punto final")
+		};
+	private Arco arcStatus = new Arco();
+	
+	private Point2D p1;
+	private Point2D p2;
+	private Point2D p3;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = arcStatus.transition(text);
+
+		int status = arcStatus.getStatus();
+
+		if (status == 0) {
+		} else if (status == 1) {
+			p1 = new Point2D.Double(values[0], values[1]);
+		} else if (status == 2) {
+			p2 = new Point2D.Double(values[0], values[1]);
+		} else if (status == 3) {
+			p3 = new Point2D.Double(values[0], values[1]);
+			try {
+				IGeometry ig = ShapeFactory.createArc(p1, p2, p3);
+				if (ig != null)
+				editingSource.addGeometry(ig);
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			ret = ret | arcStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = arcStatus.getStatus();
+		if (status==1){
+			drawLine((Graphics2D)g,p1,new Point2D.Double(x, y));
+		}else if (status == 2){
+			Point2D current = new Point2D.Double(x, y);
+			
+			IGeometry ig = ShapeFactory.createArc(p1, p2, current);
+			if (ig != null)
+			ig.draw((Graphics2D)g, getCadToolAdapter().getMapControl().getViewPort(), CadTool.modifySymbol);
+			
+			Point2D p = getCadToolAdapter().getMapControl().getViewPort().fromMapPoint(p1.getX(), p1.getY());
+			g.drawRect((int) p.getX(), (int) p.getY(), 1, 1);
+			p = getCadToolAdapter().getMapControl().getViewPort().fromMapPoint(p2.getX(), p2.getY());
+			g.drawRect((int) p.getX(), (int) p.getY(), 1, 1);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[arcStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		arcStatus.initialize();
+		p1 = null;
+		p2 = null;
+		p3 = null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return arcStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ArcCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CopyCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CopyCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CopyCadTool.java	(revision 1648)
@@ -0,0 +1,172 @@
+/* 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.gui.cad.tools;
+
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.geom.Point2D;
+import java.io.IOException;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.automaton.Copiar;
+import com.iver.fsac.Automaton;
+
+
+/**
+ * Herramienta para copiar una geometr�a.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class CopyCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precisar punto de desplazamiento"),
+			new Status("Precisar segundo punto del desplazamiento"),
+		};
+	private Copiar copyStatus = new Copiar();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+	
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, final EditableFeatureSource editingSource,
+		final FBitSet selectedGeometries, final double[] values) {
+		int ret = copyStatus.transition(text);
+
+		int status = copyStatus.getStatus();
+
+		if (status == 0) {
+			if (selectedGeometries.cardinality() == 0){
+				getCadToolAdapter().pushCadTool(new SelectionCadTool());
+			}
+		} else if (status == 1) {
+			firstPoint = new Point2D.Double(values[0], values[1]);
+		} else if (status == 2) {
+			PluginServices.getMDIManager().setWaitCursor();
+					lastPoint = new Point2D.Double(values[0], values[1]);
+					try {
+						editingSource.startComplexGeometry();
+						for (int i = selectedGeometries.nextSetBit(0);
+						i >= 0;
+						i = selectedGeometries.nextSetBit(i + 1)){
+					
+							IGeometry geometry = editingSource.getGeometry(i);
+								geometry.move(lastPoint.getX() - firstPoint.getX(),
+									lastPoint.getY() - firstPoint.getY());
+								editingSource.addGeometry(geometry);
+								
+						}
+						editingSource.endComplexGeometry();
+					} catch (DriverIOException e) {
+						e.printStackTrace();
+					} catch (IOException e1) {
+						e1.printStackTrace();
+					}
+					
+					selectedGeometries.clear();
+					PluginServices.getMDIManager().restoreCursor();
+			ret = ret | copyStatus.transition("cancel");
+		}
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = copyStatus.getStatus();
+
+		if (status == 1) {
+			int dx = getCadToolAdapter().getMapControl().getViewPort().fromMapDistance(x - firstPoint.getX());
+			int dy = -getCadToolAdapter().getMapControl().getViewPort().fromMapDistance(y - firstPoint.getY());
+			Image img = getCadToolAdapter().getEditableFeatureSource().getImage();
+			g.drawImage(img, dx, dy, null);
+/*			try {
+				for (int i = selectedGeometries.nextSetBit(0);
+				i >= 0;
+				i = selectedGeometries.nextSetBit(i + 1)){
+					IGeometry geometry = efs.getGeometry(i).cloneGeometry();
+					geometry.move(x - firstPoint.getX(),
+							y - firstPoint.getY());
+						geometry.draw((Graphics2D) g,
+							getCadToolAdapter().getMapControl().getViewPort(),
+							CadTool.drawingSymbol);
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			*/
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[copyStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		copyStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return copyStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/CopyCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/StretchingCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/StretchingCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/StretchingCadTool.java	(revision 1648)
@@ -0,0 +1,274 @@
+/* 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.gui.cad.tools;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.core.FGeometry;
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.Handler;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Estirar;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para estirar los handlers que seleccionemos previamente.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class StretchingCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Seleccione primer punto de zona a estirar"),
+			new Status("Seleccione segundo punto de zona a estirar"),
+			new Status("Precise punto de estiramiento"),
+			new Status("Precise segundo punto")
+		};
+	private Estirar stretchingStatus = new Estirar();
+	private Point2D selfirstPoint;
+	private Point2D sellastPoint;
+	private Point2D movefirstPoint;
+	private Point2D movelastPoint;
+	private Rectangle2D rect = null;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text,
+		final EditableFeatureSource editingSource,
+		final FBitSet selectedGeometries, final double[] ds) {
+		int ret = stretchingStatus.transition(text);
+
+		int status = stretchingStatus.getStatus();
+
+		if (status == 0) {
+			if (selectedGeometries.cardinality() == 0) {
+				getCadToolAdapter().pushCadTool(new SelectionCadTool());
+			}
+
+			if (ds.length != 0) {
+				sellastPoint = new Point2D.Double(ds[0], ds[1]);
+
+				double x;
+				double y;
+				double w;
+				double h;
+
+				if (selfirstPoint.getX() < sellastPoint.getX()) {
+					x = selfirstPoint.getX();
+					w = sellastPoint.getX() - selfirstPoint.getX();
+				} else {
+					x = sellastPoint.getX();
+					w = selfirstPoint.getX() - sellastPoint.getX();
+				}
+
+				if (selfirstPoint.getY() < sellastPoint.getY()) {
+					y = selfirstPoint.getY();
+					h = sellastPoint.getY() - selfirstPoint.getY();
+				} else {
+					y = sellastPoint.getY();
+					h = selfirstPoint.getY() - sellastPoint.getY();
+				}
+
+				rect = new Rectangle2D.Double(x, y, w, h);
+			}
+		} else if (status == 1) {
+			if (ds.length != 0) {
+				selfirstPoint = new Point2D.Double(ds[0], ds[1]);
+			}
+		} else if (status == 2) {
+		} else if (status == 3) {
+			movefirstPoint = new Point2D.Double(ds[0], ds[1]);
+		} else if (status == 4) {
+			PluginServices.getMDIManager().setWaitCursor();
+			movelastPoint = new Point2D.Double(ds[0], ds[1]);
+
+			Handler[] handlers = null;
+
+			for (int i = selectedGeometries.nextSetBit(0); i >= 0;
+					i = selectedGeometries.nextSetBit(i + 1)) {
+				IGeometry geometry = null;
+
+				try {
+					geometry = editingSource.getGeometry(i);
+				} catch (IOException e) {
+					e.printStackTrace();
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				}
+
+				handlers = geometry.getHandlers(FGeometry.STRETCHINGHANDLER);
+
+				for (int j = 0; j < handlers.length; j++) {
+					if (rect.contains(handlers[j].getPoint())) {
+						handlers[j].move(movelastPoint.getX() -
+							movefirstPoint.getX(),
+							movelastPoint.getY() - movefirstPoint.getY());
+					}
+				}
+
+				try {
+					editingSource.modifyGeometry(i, geometry);
+				} catch (IOException e1) {
+					e1.printStackTrace();
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				}
+			}
+
+			PluginServices.getMDIManager().restoreCursor();
+			ret = ret | stretchingStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		double dx;
+		double dy;
+		double dw;
+		double dh;
+		int status = stretchingStatus.getStatus();
+
+		if (status == 1) {
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					4);
+			elShape.moveTo(selfirstPoint.getX(), selfirstPoint.getY());
+			elShape.lineTo(x, selfirstPoint.getY());
+			elShape.lineTo(x, y);
+			elShape.lineTo(selfirstPoint.getX(), y);
+			elShape.lineTo(selfirstPoint.getX(), selfirstPoint.getY());
+			ShapeFactory.createPolyline2D(elShape).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+		} else if (status == 3) {
+			//	drawLine((Graphics2D)g, movefirstPoint, new Point2D.Double(x, y));
+			//}else if (status == 4){
+			if (selfirstPoint.getX() < x) {
+				dx = selfirstPoint.getX();
+				dw = x - selfirstPoint.getX();
+			} else {
+				dx = x;
+				dw = selfirstPoint.getX() - x;
+			}
+
+			if (selfirstPoint.getY() < sellastPoint.getY()) {
+				dy = selfirstPoint.getY();
+				dh = y - selfirstPoint.getY();
+			} else {
+				dy = y;
+				dh = selfirstPoint.getY() - y;
+			}
+
+			Rectangle2D rec = new Rectangle2D.Double(dx, dy, dw, dh);
+			Handler[] handlers = null;
+
+			for (int i = selectedGeometries.nextSetBit(0); i >= 0;
+					i = selectedGeometries.nextSetBit(i + 1)) {
+				IGeometry geometry = null;
+
+				try {
+					geometry = efs.getGeometry(i);
+				} catch (IOException e) {
+					e.printStackTrace();
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				}
+
+				handlers = geometry.getHandlers(FGeometry.STRETCHINGHANDLER);
+
+				for (int j = 0; j < handlers.length; j++) {
+					if (rect.contains(handlers[j].getPoint())) {
+						handlers[j].move(x - movefirstPoint.getX(),
+							y - movefirstPoint.getY());
+					}
+				}
+
+				geometry.draw((Graphics2D) g,
+					getCadToolAdapter().getMapControl().getViewPort(),
+					CadTool.modifySymbol);
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[stretchingStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		stretchingStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return stretchingStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/StretchingCadTool.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ExploitCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ExploitCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ExploitCadTool.java	(revision 1648)
@@ -0,0 +1,146 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.FGeometryCollection;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.automaton.Explotar;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+
+import java.io.IOException;
+
+
+/**
+ * Elimina la geometr�a compuesta y a�ade todas la geometr�as simples que la
+ * componen.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ExploitCadTool extends AbstractCadTool {
+	private static Status[] STATUS = { new Status("") };
+	private Explotar exploitStatus = new Explotar();
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] ds) {
+		int ret = exploitStatus.transition(text);
+		int status = exploitStatus.getStatus();
+
+		if (status == 0) {
+			if (selectedGeometries.cardinality() == 0) {
+				getCadToolAdapter().pushCadTool(new SelectionCadTool());
+			}
+
+			for (int i = selectedGeometries.nextSetBit(0); i >= 0;
+					i = selectedGeometries.nextSetBit(i + 1)) {
+				IGeometry geom = null;
+
+				try {
+					geom = editingSource.getGeometry(i);
+
+					if (geom instanceof FGeometryCollection) {
+						IGeometry[] geoms = ((FGeometryCollection) geom).getGeometries();
+						editingSource.removeGeometry(i);
+
+						for (int j = 0; j < geoms.length; j++) {
+							editingSource.addGeometry(geoms[j]);
+						}
+					}
+				} catch (IOException e) {
+					e.printStackTrace();
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				}
+			}
+
+			ret = ret | exploitStatus.transition("cancel");
+			selectedGeometries.clear();
+		} else if (status == 1) {
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		if (exploitStatus.getStatus() == -1) {
+			return "";
+		}
+
+		return STATUS[exploitStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		exploitStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return exploitStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ExploitCadTool.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SelectionCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SelectionCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SelectionCadTool.java	(revision 1648)
@@ -0,0 +1,342 @@
+/* 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.gui.cad.tools;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.core.FGeometry;
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.Handler;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Seleccion;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import java.io.IOException;
+
+import java.util.ArrayList;
+
+
+/**
+ * Herramienta para seleccionar las geometr�as por rectangulo o por hacer un
+ * click sobre ellas.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class SelectionCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status(""), new Status(""),
+			new Status("Siguiente punto del rect�ngulo de selecci�n"),
+			new Status(""), new Status("Precise punto de estiramiento"),
+		};
+	public final static int tolerance = 5;
+	private Seleccion selectionStatus = new Seleccion();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+	private ArrayList selectedHandler = new ArrayList();
+	private ArrayList selectedGeometry = new ArrayList();
+	private ArrayList selectedGeometryIndex = new ArrayList();
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text,
+		final EditableFeatureSource editingSource,
+		final FBitSet selectedGeometries, final double[] values) {
+		int ret = selectionStatus.transition(text);
+
+		int status = selectionStatus.getStatus();
+
+		if (status == 0) {
+		} else if (status == 1) {
+			firstPoint = new Point2D.Double(values[0], values[1]);
+
+			/*double tolerance = getCadToolAdapter().getMapControl().getViewPort()
+								   .toMapDistance(SelectionCadTool.tolerance);
+
+			Rectangle2D r = new Rectangle2D.Double(firstPoint.getX() -
+					tolerance, firstPoint.getY() - tolerance, tolerance * 2,
+					tolerance * 2);
+*/
+			if (selectedGeometries.cardinality() > 0) {
+				//Se comprueba si se pincha un handler. El m�s cercano (o los m�s cercanos si hay empate)
+				try {
+					selectedGeometry.clear();
+					selectedGeometryIndex.clear();
+					selectedHandler.clear();
+
+					double min = Double.MAX_VALUE;
+
+					for (int i = selectedGeometries.nextSetBit(0); i >= 0;
+							i = selectedGeometries.nextSetBit(i + 1)) {
+						Handler[] handlers = editingSource.getGeometry(i)
+														  .getHandlers(FGeometry.SELECTHANDLER);
+
+						IGeometry clonedGeometry = null;
+
+						for (int j = 0; j < handlers.length; j++) {
+							Point2D handlerPoint = handlers[j].getPoint();
+
+							//							if (r.contains(handlerPoint.getX(),
+							//									handlerPoint.getY())) {
+							double distance = firstPoint.distance(handlerPoint);
+
+							if ((distance <= min) && (distance < tolerance)) {
+								if (distance < min) {
+									selectedGeometry.clear();
+									selectedGeometryIndex.clear();
+									selectedHandler.clear();
+								}
+
+								min = distance;
+
+								if (clonedGeometry == null) {
+									clonedGeometry = editingSource.getGeometry(i)
+																  .cloneGeometry();
+								}
+
+								selectedGeometry.add(clonedGeometry);
+								selectedHandler.add(clonedGeometry.getHandlers(
+										FGeometry.SELECTHANDLER)[j]);
+								selectedGeometryIndex.add(new Integer(i));
+							}
+						}
+					}
+
+					if (selectedGeometry.size() > 0) {
+						ret = ret | selectionStatus.transition("handler");
+					}
+				} catch (IOException e) {
+					e.printStackTrace();
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				}
+			}
+
+			if ((selectedGeometry.size() == 0) ||
+					(selectedGeometries.cardinality() == 0)) {
+				// Se comprueba si se pincha en una gemometr�a
+				PluginServices.getMDIManager().setWaitCursor();
+
+				double tam = getCadToolAdapter().getMapControl().getViewPort()
+								 .toMapDistance(SelectionCadTool.tolerance);
+				Rectangle2D rect = new Rectangle2D.Double(firstPoint.getX() -
+						tam, firstPoint.getY() - tam, tam*2, tam*2);
+				int[] indexes = editingSource.getGeometriesIndexes(rect);
+
+				selectedGeometries.clear();
+
+				try {
+					for (int i = 0; i < indexes.length; i++) {
+						if (editingSource.getGeometry(indexes[i])
+											 .fastIntersects(rect.getX(),
+									rect.getY(), rect.getWidth(),
+									rect.getHeight())) {
+							selectedGeometries.set(indexes[i], true);
+						}
+					}
+				} catch (IOException e) {
+					e.printStackTrace();
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				}
+
+				PluginServices.getMDIManager().restoreCursor();
+
+				if (selectedGeometries.cardinality() > 0) {
+					ret = ret | selectionStatus.transition("sel");
+				} else {
+					ret = ret | selectionStatus.transition("no_sel");
+				}
+			}
+
+			return ret;
+		} else if (status == 3) {
+			PluginServices.getMDIManager().setWaitCursor();
+
+			if (values.length != 0) {
+				lastPoint = new Point2D.Double(values[0], values[1]);
+			}
+
+			selectedGeometries.clear();
+
+			try {
+				double x;
+				double y;
+				double w;
+				double h;
+
+				if (firstPoint.getX() < lastPoint.getX()) {
+					x = firstPoint.getX();
+					w = lastPoint.getX() - firstPoint.getX();
+				} else {
+					x = lastPoint.getX();
+					w = firstPoint.getX() - lastPoint.getX();
+				}
+
+				if (firstPoint.getY() < lastPoint.getY()) {
+					y = firstPoint.getY();
+					h = lastPoint.getY() - firstPoint.getY();
+				} else {
+					y = lastPoint.getY();
+					h = firstPoint.getY() - lastPoint.getY();
+				}
+
+				Rectangle2D rect = new Rectangle2D.Double(x, y, w, h);
+
+				int[] indexes = editingSource.getGeometriesIndexes(new Rectangle2D.Double(
+							x, y, w, h));
+
+				for (int i = 0; i < indexes.length; i++) {
+					if (rect.contains(editingSource.getGeometry(indexes[i])
+													   .getBounds2D())) {
+						selectedGeometries.set(indexes[i], true);
+					}
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			PluginServices.getMDIManager().restoreCursor();
+
+			if (selectedGeometries.cardinality() > 0) {
+				ret = ret | selectionStatus.transition("sel");
+			} else {
+				ret = ret | selectionStatus.transition("no_sel");
+			}
+
+			return ret;
+		} else if (status == 5) {
+			for (int i = 0; i < selectedGeometry.size(); i++) {
+				Handler h = (Handler) selectedHandler.get(i);
+				IGeometry geom = (IGeometry) selectedGeometry.get(i);
+				int index = ((Integer) selectedGeometryIndex.get(i)).intValue();
+
+				h.set(values[0], values[1]);
+
+				try {
+					editingSource.modifyGeometry(index, geom);
+				} catch (IOException e) {
+					e.printStackTrace();
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				}
+			}
+
+			ret = ret | selectionStatus.transition("done");
+
+			return ret;
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = selectionStatus.getStatus();
+
+		if (status == 2) {
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					4);
+			elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			elShape.lineTo(x, firstPoint.getY());
+			elShape.lineTo(x, y);
+			elShape.lineTo(firstPoint.getX(), y);
+			elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			ShapeFactory.createPolyline2D(elShape).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.selectSymbol);
+		} else if (status == 4) {
+			for (int i = 0; i < selectedGeometry.size(); i++) {
+				Handler h = (Handler) selectedHandler.get(i);
+				IGeometry geom = ((IGeometry) selectedGeometry.get(i)).cloneGeometry();
+				int index = ((Integer) selectedGeometryIndex.get(i)).intValue();
+				g.setColor(Color.gray);
+				h.set(x, y);
+				geom.draw((Graphics2D) g,
+					getCadToolAdapter().getCadMapControl().getMapControl()
+						.getViewPort(), CadTool.modifySymbol);
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[selectionStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		selectionStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return selectionStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SelectionCadTool.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/LineCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/LineCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/LineCadTool.java	(revision 1648)
@@ -0,0 +1,211 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.edition.cad.TrigonometricalFunctions;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.automaton.Linea;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para a�adir una geometr�a de tipo linea.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class LineCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise primer punto"),
+			new Status("Precise punto siguiente o �ngulo"),
+			new Status("Precise longitud o punto"), null, null,
+			new Status("Precise punto siguiente o �ngulo")
+		};
+	private Linea lineStatus = new Linea();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+	private double angle;
+	private double length;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = lineStatus.transition(text);
+
+		int status = lineStatus.getStatus();
+
+		if (status == 0) {
+		} else if (status == 1) {
+			if ((lineStatus.getPreviousStatus() == 5) ||
+					(lineStatus.getPreviousStatus() == 1)) {
+				lastPoint = new Point2D.Double(values[0], values[1]);
+
+				try {
+					GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+							2);
+					elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+					elShape.lineTo(lastPoint.getX(), lastPoint.getY());
+					editingSource.addGeometry(ShapeFactory.createPolyline2D(
+							elShape));
+				} catch (DriverIOException e) {
+					e.printStackTrace();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+
+				firstPoint = (Point2D) lastPoint.clone();
+			}
+		} else if (status == 2) {
+			angle = values[0];
+		} else if (status == 3) {
+			length = values[0];
+
+			double w = Math.cos(Math.toRadians(angle)) * length;
+			double h = Math.sin(Math.toRadians(angle)) * length;
+			lastPoint = new Point2D.Double(firstPoint.getX() + w,
+					firstPoint.getY() + h);
+
+			try {
+				GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+						2);
+				elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+				elShape.lineTo(lastPoint.getX(), lastPoint.getY());
+				editingSource.addGeometry(ShapeFactory.createPolyline2D(elShape));
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			firstPoint = (Point2D) lastPoint.clone();
+			ret = ret | lineStatus.transition("end");
+		} else if (status == 4) {
+			length = firstPoint.distance(values[0], values[1]);
+
+			double w = (Math.cos(Math.toRadians(angle))) * length;
+			double h = (Math.sin(Math.toRadians(angle))) * length;
+			lastPoint = new Point2D.Double(firstPoint.getX() + w,
+					firstPoint.getY() + h);
+
+			try {
+				GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+						2);
+				elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+				elShape.lineTo(lastPoint.getX(), lastPoint.getY());
+				editingSource.addGeometry(ShapeFactory.createPolyline2D(elShape));
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			firstPoint = (Point2D) lastPoint.clone();
+			ret = ret | lineStatus.transition("end");
+		} else if (status == 5) {
+			firstPoint = new Point2D.Double(values[0], values[1]);
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = lineStatus.getStatus();
+
+		if ((status == 1) || (status == 5)) {
+			drawLine((Graphics2D) g, firstPoint, new Point2D.Double(x, y));
+			System.err.println("angulo: " +
+				TrigonometricalFunctions.getAngle(firstPoint,
+					new Point2D.Double(x, y)));
+		} else if (status == 2) {
+			length = firstPoint.distance(x, y);
+
+			double w = (Math.cos(Math.toRadians(angle))) * length;
+			double h = (Math.sin(Math.toRadians(angle))) * length;
+			drawLine((Graphics2D) g, firstPoint,
+				new Point2D.Double(firstPoint.getX() + w, firstPoint.getY() +
+					h));
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[lineStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		lineStatus.initialize();
+		firstPoint = null;
+		lastPoint = null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return lineStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/LineCadTool.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolygonCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolygonCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolygonCadTool.java	(revision 1648)
@@ -0,0 +1,272 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.FGeometryCollection;
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.edition.cad.TrigonometricalFunctions;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Poligono;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para crear un pol�gono regular inscrito o circunscrito a una
+ * circunferencia.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class PolygonCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Indique n�mero de lados"),
+			new Status("Precise centro del pol�gono"),
+			new Status("Inscrito en el c�rculo[I] o Circunscrito[C]"),
+			new Status("Precise r�dio"), new Status("Precise r�dio")
+		};
+	private Poligono polygonStatus = new Poligono();
+	private int numLines = 4;
+	private Point2D center;
+	private double radio;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = polygonStatus.transition(text);
+
+		int status = polygonStatus.getStatus();
+
+		if (status == 0) {
+		} else if (status == 1) {
+			numLines = (int) values[0];
+		} else if (status == 2) {
+			if (values.length != 0) {
+				center = new Point2D.Double(values[0], values[1]);
+			}
+		} else if (status == 3) {
+		} else if (status == 4) {
+		} else if (status == 5) {
+			double radio = values[0];
+
+			//Pol�gono a partir de radio.
+			Point2D point = TrigonometricalFunctions.getPoint(center,
+					new Point2D.Double(center.getX(), center.getY() + 10), radio);
+
+			try {
+				if (polygonStatus.getPreviousStatus() == 3) {
+					editingSource.addGeometry(getIPolygon(point, radio));
+				} else {
+					editingSource.addGeometry(getCPolygon(point, radio));
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			ret = ret | polygonStatus.transition("cancel");
+		} else if (status == 6) {
+			Point2D point = new Point2D.Double(values[0], values[1]);
+
+			//Pol�gono a partir de la circunferencia.
+			try {
+				if (polygonStatus.getPreviousStatus() == 3) {
+					editingSource.addGeometry(getIPolygon(point,
+							point.distance(center)));
+				} else {
+					editingSource.addGeometry(getCPolygon(point,
+							point.distance(center)));
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			ret = ret | polygonStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * Devuelve la geometr�a con el poligono regular inscrito en la
+	 * circunferencia.
+	 *
+	 * @param point Puntero del rat�n.
+	 * @param radio Radio
+	 *
+	 * @return GeometryCollection con las geometr�as del pol�gono.
+	 */
+	private IGeometry getIPolygon(Point2D point, double radio) {
+		IGeometry[] geoms = new IGeometry[numLines];
+		Point2D p1 = TrigonometricalFunctions.getPoint(center, point, radio);
+		double initangle = TrigonometricalFunctions.getAngle(center, point);
+		Point2D antPoint = p1;
+		double an = (Math.PI * 2) / numLines;
+
+		for (int i = 1; i < (numLines + 1); i++) {
+			Point2D p2 = TrigonometricalFunctions.getPoint(center,
+					(an * i) + initangle, radio);
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					2);
+			elShape.moveTo(antPoint.getX(), antPoint.getY());
+			elShape.lineTo(p2.getX(), p2.getY());
+
+			geoms[i - 1] = (ShapeFactory.createPolyline2D(elShape));
+			antPoint = p2;
+		}
+
+		return new FGeometryCollection(geoms);
+	}
+
+	/**
+	 * Devuelve la geometr�a con el poligono regular circunscrito a la
+	 * circunferencia formada por el punto central y el radio que se froma
+	 * entre este y el puntero del rat�n..
+	 *
+	 * @param point Puntero del rat�n.
+	 * @param radio Radio
+	 *
+	 * @return GeometryCollection con las geometr�as del pol�gono.
+	 */
+	private IGeometry getCPolygon(Point2D point, double radio) {
+		IGeometry[] geoms = new IGeometry[numLines];
+		Point2D p1 = TrigonometricalFunctions.getPoint(center, point, radio);
+
+		double initangle = TrigonometricalFunctions.getAngle(center, point);
+		Point2D antPoint = p1;
+		Point2D antInter = null;
+		double an = (Math.PI * 2) / numLines;
+
+		for (int i = 1; i < (numLines + 2); i++) {
+			Point2D p2 = TrigonometricalFunctions.getPoint(center,
+					(an * i) + initangle, radio);
+			Point2D[] ps1 = TrigonometricalFunctions.getPerpendicular(antPoint,
+					center, antPoint);
+			Point2D[] ps2 = TrigonometricalFunctions.getPerpendicular(p2,
+					center, p2);
+			Point2D inter = TrigonometricalFunctions.getIntersection(ps1[0],
+					ps1[1], ps2[0], ps2[1]);
+
+			if (antInter != null) {
+				GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+						2);
+				elShape.moveTo(antInter.getX(), antInter.getY());
+				elShape.lineTo(inter.getX(), inter.getY());
+
+				geoms[i - 2] = (ShapeFactory.createPolyline2D(elShape));
+			}
+
+			antInter = inter;
+			antPoint = p2;
+		}
+
+		return new FGeometryCollection(geoms);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = polygonStatus.getStatus();
+
+		if (status == 3) {
+			Point2D point = new Point2D.Double(x, y);
+			drawLine((Graphics2D) g, center, point);
+			getIPolygon(point, point.distance(center)).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+			ShapeFactory.createCircle(center, point.distance(center)).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.drawingSymbol);
+		} else if (status == 4) {
+			Point2D point = new Point2D.Double(x, y);
+			drawLine((Graphics2D) g, center, point);
+			getCPolygon(point, point.distance(center)).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+			ShapeFactory.createCircle(center, point.distance(center)).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.drawingSymbol);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[polygonStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		polygonStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return polygonStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolygonCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ScaleCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ScaleCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ScaleCadTool.java	(revision 1648)
@@ -0,0 +1,207 @@
+/* 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.gui.cad.tools;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Escalar;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para escalar las geometr�as seleccionadas.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ScaleCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise punto base"),
+			new Status("Precise factor de escala"),
+		};
+	private Escalar scaleStatus = new Escalar();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text,
+		final EditableFeatureSource editingSource,
+		final FBitSet selectedGeometries, final double[] ds) {
+		int ret = scaleStatus.transition(text);
+		int status = scaleStatus.getStatus();
+
+		if (status == 0) {
+			if (selectedGeometries.cardinality() == 0) {
+				getCadToolAdapter().pushCadTool(new SelectionCadTool());
+			}
+		} else if (status == 1) {
+			if (ds.length != 0) {
+				firstPoint = new Point2D.Double(ds[0], ds[1]);
+			}
+		} else if (status == 2) {
+			PluginServices.getMDIManager().setWaitCursor();
+			lastPoint = new Point2D.Double(ds[0], ds[1]);
+
+			double w;
+			double h;
+			w = lastPoint.getX() - firstPoint.getX();
+			h = lastPoint.getY() - firstPoint.getY();
+
+			try {
+				//ViewPort vp = getCadToolAdapter().getMapControl().getViewPort(); 
+				editingSource.startComplexGeometry();
+
+				for (int i = 0; i < editingSource.getGeometryCount(); i++) {
+					if (selectedGeometries.get(i)) {
+						IGeometry geometry = editingSource.getGeometry(i);
+						geometry.scale(firstPoint,
+							firstPoint.distance(lastPoint),
+							firstPoint.distance(lastPoint));
+						editingSource.modifyGeometry(i, geometry);
+					}
+				}
+
+				editingSource.endComplexGeometry();
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			PluginServices.getMDIManager().restoreCursor();
+			ret = ret | scaleStatus.transition("cancel");
+		} else if (status == 3) {
+			try {
+				for (int i = 0; i < editingSource.getGeometryCount(); i++) {
+					if (selectedGeometries.get(i)) {
+						IGeometry geometry = editingSource.getGeometry(i);
+						geometry.scale(firstPoint, ds[0], ds[0]);
+						editingSource.modifyGeometry(i, geometry);
+					}
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			ret = ret | scaleStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = scaleStatus.getStatus();
+
+		if (status == 1) {
+			double w;
+			double h;
+			w = x - firstPoint.getX();
+			h = y - firstPoint.getY();
+
+			try {
+				for (int i = 0; i < efs.getGeometryCount(); i++) {
+					if (selectedGeometries.get(i)) {
+						IGeometry geometry = efs.getGeometry(i);
+
+						Point2D currentPoint = new Point2D.Double(x, y);
+
+						geometry.scale(firstPoint,
+							firstPoint.distance(currentPoint),
+							firstPoint.distance(currentPoint));
+						geometry.draw((Graphics2D) g,
+							getCadToolAdapter().getMapControl().getViewPort(),
+							CadTool.modifySymbol);
+						drawLine((Graphics2D) g, firstPoint, currentPoint);
+					}
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[scaleStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		scaleStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return scaleStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ScaleCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SymmetryCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SymmetryCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SymmetryCadTool.java	(revision 1648)
@@ -0,0 +1,241 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.FGeometry;
+import com.iver.cit.gvsig.fmap.core.Handler;
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.edition.cad.TrigonometricalFunctions;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Simetria;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para crear una geometr�a simetr�ca a otra, con la posibilidad de
+ * borrar la original.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class SymmetryCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise primer punto de l�nea de simetr�a"),
+			new Status("Precise segundo punto de l�nea de simetr�a"),
+			new Status("�Suprimir objetos de origen?[Si(S) o No(N)]")
+		};
+	private Simetria symmetryStatus = new Simetria();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] ds) {
+		int ret = symmetryStatus.transition(text);
+		int status = symmetryStatus.getStatus();
+
+		if (status == 0) {
+			if (selectedGeometries.cardinality() == 0) {
+				getCadToolAdapter().pushCadTool(new SelectionCadTool());
+			}
+		} else if (status == 1) {
+			if (ds.length != 0) {
+				firstPoint = new Point2D.Double(ds[0], ds[1]);
+			}
+		} else if (status == 2) {
+			lastPoint = new Point2D.Double(ds[0], ds[1]);
+		} else if (status == 3) {
+			try {
+				editingSource.startComplexGeometry();
+
+				for (int i = 0; i < editingSource.getGeometryCount(); i++) {
+					if (selectedGeometries.get(i)) {
+						IGeometry geom = editingSource.getGeometry(i)
+													  .cloneGeometry();
+						Handler[] handlers = geom.getHandlers(FGeometry.SELECTHANDLER);
+
+						for (int j = 0; j < handlers.length; j++) {
+							Handler h = (Handler) handlers[j];
+							Point2D p = h.getPoint();
+							Point2D[] ps = TrigonometricalFunctions.getPerpendicular(firstPoint,
+									lastPoint, p);
+							Point2D inter = TrigonometricalFunctions.getIntersection(ps[0],
+									ps[1], firstPoint, lastPoint);
+							Point2D dif = new Point2D.Double(inter.getX() -
+									p.getX(), inter.getY() - p.getY());
+							h.set(inter.getX() + dif.getX(),
+								inter.getY() + dif.getY());
+						}
+
+						editingSource.removeGeometry(i);
+						editingSource.addGeometry(geom);
+					}
+				}
+
+				editingSource.endComplexGeometry();
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			selectedGeometries.clear();
+			ret = ret | symmetryStatus.transition("cancel");
+		} else if (status == 4) {
+			try {
+				editingSource.startComplexGeometry();
+
+				for (int i = 0; i < editingSource.getGeometryCount(); i++) {
+					if (selectedGeometries.get(i)) {
+						IGeometry geom = editingSource.getGeometry(i)
+													  .cloneGeometry();
+						Handler[] handlers = geom.getHandlers(FGeometry.SELECTHANDLER);
+
+						for (int j = 0; j < handlers.length; j++) {
+							Handler h = (Handler) handlers[j];
+							Point2D p = h.getPoint();
+							Point2D[] ps = TrigonometricalFunctions.getPerpendicular(firstPoint,
+									lastPoint, p);
+							Point2D inter = TrigonometricalFunctions.getIntersection(ps[0],
+									ps[1], firstPoint, lastPoint);
+							Point2D dif = new Point2D.Double(inter.getX() -
+									p.getX(), inter.getY() - p.getY());
+							h.set(inter.getX() + dif.getX(),
+								inter.getY() + dif.getY());
+						}
+
+						editingSource.addGeometry(geom);
+					}
+				}
+
+				editingSource.endComplexGeometry();
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			ret = ret | symmetryStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = symmetryStatus.getStatus();
+
+		if (status == 1) {
+			Point2D lP = new Point2D.Double(x, y);
+
+			try {
+				for (int i = 0; i < efs.getGeometryCount(); i++) {
+					if (selectedGeometries.get(i)) {
+						IGeometry geom = efs.getGeometry(i).cloneGeometry();
+						Handler[] handlers = geom.getHandlers(FGeometry.SELECTHANDLER);
+
+						for (int j = 0; j < handlers.length; j++) {
+							Handler h = (Handler) handlers[j];
+							Point2D p = h.getPoint();
+							Point2D[] ps = TrigonometricalFunctions.getPerpendicular(firstPoint,
+									lP, p);
+							Point2D inter = TrigonometricalFunctions.getIntersection(ps[0],
+									ps[1], firstPoint, lP);
+							Point2D dif = new Point2D.Double(inter.getX() -
+									p.getX(), inter.getY() - p.getY());
+							h.set(inter.getX() + dif.getX(),
+								inter.getY() + dif.getY());
+						}
+
+						drawLine((Graphics2D) g, firstPoint, lP);
+						geom.draw((Graphics2D) g,
+							getCadToolAdapter().getMapControl().getViewPort(),
+							CadTool.modifySymbol);
+					}
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[symmetryStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		symmetryStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return symmetryStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SymmetryCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PointCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PointCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PointCadTool.java	(revision 1648)
@@ -0,0 +1,127 @@
+/*
+ * Created on 07-feb-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.gui.cad.tools;
+
+import java.awt.Graphics;
+import java.io.IOException;
+
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.automaton.Punto;
+import com.iver.fsac.Automaton;
+
+
+/**
+ * Herramienta para a�adir una geometr�a de tipo punto.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class PointCadTool extends AbstractCadTool {
+	private static Status[] STATUS = { new Status("Precise un punto"),new Status("Precise un punto") };
+	private Punto pointStatus = new Punto();
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = pointStatus.transition(text);
+
+		int status = pointStatus.getStatus();
+		if (status == 0){
+			
+		}else if (status == 1) {
+			try {
+				if (values.length != 0) {
+					editingSource.addGeometry(ShapeFactory.createPoint2D(
+							values[0], values[1]));
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[pointStatus.getStatus()].getQuestion();
+	}
+	
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		pointStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return pointStatus;
+	}
+	
+	
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PointCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SplineCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SplineCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SplineCadTool.java	(revision 1648)
@@ -0,0 +1,227 @@
+/* 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.gui.cad.tools;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Spline;
+import com.iver.fsac.Automaton;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class SplineCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise primer punto"),
+			new Status("Precise siguiente punto"),
+		};
+	private Spline splineStatus = new Spline();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+	
+	int nParts_=-2;
+	double[] controlPoints_={20,30,0};
+	ArrayList points=new ArrayList();
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = splineStatus.transition(text);
+		int status = splineStatus.getStatus();
+		if (status == 0) {
+		} else if (status == 1) {
+				firstPoint = new Point2D.Double(values[0], values[1]);
+				points.add(firstPoint);
+		} else if (status == 2) {
+			lastPoint= new Point2D.Double(values[0], values[1]);
+			points.add(lastPoint);
+			nParts_++;
+		} else if (status==3){
+			Point2D[] ps=(Point2D[])points.toArray(new Point2D[0]);
+			controlPoints_=new double[ps.length*3];
+			for (int i=0;i<ps.length;i++){
+				controlPoints_[i]=ps[i].getX();
+				controlPoints_[i+1]=ps[i].getY();
+				controlPoints_[i+2]=0;
+			}
+			double[] spline=generate();
+		}
+		
+		return 0;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = splineStatus.getStatus();
+		if (status == 1) {
+			Point2D[] ps=(Point2D[])points.toArray(new Point2D[0]);
+			controlPoints_=new double[ps.length*3];
+			for (int i=0;i<ps.length;i+=3){
+				controlPoints_[i]=ps[i/3].getX();
+				controlPoints_[i+1]=ps[i/3].getY();
+				controlPoints_[i+2]=0;
+			}
+			double[] spline=generate();
+			Point2D[] ps2=new Point2D[ps.length];
+			for (int i=0;i<ps2.length;i+=3){
+				ps2[i/3]=new Point2D.Double(spline[i],spline[i+1]);
+			
+			}
+			for (int i=2;i<ps2.length;i++){
+				ShapeFactory.createArc(ps2[i-2],ps2[i-1],ps2[i]).draw((Graphics2D) g,
+						getCadToolAdapter().getMapControl().getViewPort(),
+						CadTool.modifySymbol);
+			}
+			
+		} 
+			
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[splineStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		splineStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return splineStatus;
+	}
+	
+	  
+	  /**
+	   * Generate this spline.
+	   * 
+	   * @return  Coordinates of the spline (x0,y0,z0,x1,y1,z1,...)
+	   */
+	  double[] generate()
+	  {
+	    if (controlPoints_.length < 9) {
+	      double[] copy = new double[controlPoints_.length];
+	      System.arraycopy (controlPoints_, 0, copy, 0, controlPoints_.length);
+	      return copy;
+	    }
+	    
+	    int n = controlPoints_.length / 3;
+	    int length = (n - 3) * nParts_ + 1;
+	    double spline[] = new double[length * 3];
+
+	    p (0, 0, controlPoints_, spline, 0);
+	      
+	    int index = 3;
+	    for (int i = 0; i < n - 3; i += 3) {
+	      for (int j = 1; j <= nParts_; j++) {
+	        p (i, j / (double) nParts_, controlPoints_, spline, index);
+	        index += 3;
+	      }
+	    }
+	      
+	    return spline;      
+	  }
+
+	    
+	    
+	  private void p (int i, double t, double cp[], double spline[], int index)
+	  {
+	    double x = 0.0;
+	    double y = 0.0;
+	    double z = 0.0;
+	      
+	    int k = i;
+	    for (int j = 0; j <= 3; j++) {
+	      double b = blend (j, t);
+	      
+	      x += b * cp[k++];
+	      y += b * cp[k++];
+	      z += b * cp[k++];
+	    }
+	      
+	    spline[index + 0] = x;
+	    spline[index + 1] = y;
+	    spline[index + 2] = z;    
+	  }
+
+
+
+	  private double blend (int i, double t)
+	  {
+	    if      (i == 0) return (1 - t) * (1 - t) * (1 - t);
+	    else if (i == 1) return 3 * t * (1 - t) * (1 - t);
+	    else if (i == 2) return 3 * t * t * (1 - t);
+	    else             return t * t * t;
+	  }
+	
+
+
+}
+
+
+
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/SplineCadTool.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolyLineCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolyLineCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolyLineCadTool.java	(revision 1648)
@@ -0,0 +1,444 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.FGeometryCollection;
+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.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.edition.cad.TrigonometricalFunctions;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Polilinea;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+import java.util.ArrayList;
+
+
+/**
+ * CadTool para crear una polilinea formada por lineas y arcos simples que se
+ * almacenan en una GeometryCollection.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class PolyLineCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise punto inicial"),
+			new Status("Precise punto siguiente o Arco(A)"),
+			new Status("Precise punto siguiente o L�nea(N)"),
+			new Status("Precise punto siguiente o L�nea(N)"),
+			new Status("Precise punto siguiente"),
+		};
+	private Polilinea polylineStatus = new Polilinea();
+	private int antStatus = 0;
+	private Point2D antCenter;
+	private Point2D antInter;
+	private ArrayList list = new ArrayList();
+	private Point2D antPoint;
+	private Point2D antantPoint;
+	private Point2D firstPoint;
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.edition.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = polylineStatus.transition(text);
+
+		int status = polylineStatus.getStatus();
+
+		if (status == 0) {
+			antStatus = status;
+		} else if (status == 1) {
+			if (values.length != 0) {
+				Point2D point = new Point2D.Double(values[0], values[1]);
+
+				if (firstPoint == null) {
+					firstPoint = point;
+				}
+
+				if (antPoint != null) {
+					GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+							2);
+					elShape.moveTo(antPoint.getX(), antPoint.getY());
+					elShape.lineTo(point.getX(), point.getY());
+					list.add(ShapeFactory.createPolyline2D(elShape));
+				}
+
+				if (antPoint != null) {
+					antantPoint = antPoint;
+				}
+
+				antPoint = point;
+			}
+
+			antStatus = status;
+		} else if (status == 2) {
+		} else if (status == 3) {
+			Point2D point = new Point2D.Double(values[0], values[1]);
+			Point2D lastp = antPoint; //(Point2D)points.get(i-1);
+
+			if (antantPoint == null) {
+				antantPoint = new Point2D.Double(lastp.getX() +
+						(point.getX() / 2), lastp.getY() + (point.getY() / 2));
+			}
+
+			if (((point.getY() == lastp.getY()) &&
+					(point.getX() < lastp.getX())) ||
+					((point.getX() == lastp.getX()) &&
+					(point.getY() < lastp.getY()))) {
+			} else {
+				if (point.getX() == lastp.getX()) {
+					point = new Point2D.Double(point.getX() + 0.00000001,
+							point.getY());
+				} else if (point.getY() == lastp.getY()) {
+					point = new Point2D.Double(point.getX(),
+							point.getY() + 0.00000001);
+				}
+
+				if (point.getX() == antantPoint.getX()) {
+					point = new Point2D.Double(point.getX() + 0.00000001,
+							point.getY());
+				} else if (point.getY() == antantPoint.getY()) {
+					point = new Point2D.Double(point.getX(),
+							point.getY() + 0.00000001);
+				}
+
+				if (!(list.size() > 0) ||
+						(((IGeometry) list.get(list.size() - 1)).getGeometryType() == FShape.LINE)) {
+					Point2D[] ps1 = TrigonometricalFunctions.getPerpendicular(antantPoint,
+							lastp, lastp);
+					Point2D mediop = new Point2D.Double((point.getX() +
+							lastp.getX()) / 2, (point.getY() + lastp.getY()) / 2);
+					Point2D[] ps2 = TrigonometricalFunctions.getPerpendicular(lastp,
+							point, mediop);
+					Point2D interp = TrigonometricalFunctions.getIntersection(ps1[0],
+							ps1[1], ps2[0], ps2[1]);
+					antInter = interp;
+
+					double radio = interp.distance(lastp);
+
+					if (TrigonometricalFunctions.isLowAngle(antantPoint, lastp,
+								interp, point)) {
+						radio = -radio;
+					}
+
+					Point2D centerp = TrigonometricalFunctions.getPoint(interp,
+							mediop, radio);
+					antCenter = centerp;
+
+					IGeometry ig = ShapeFactory.createArc(lastp, centerp, point);
+
+					if (ig != null) {
+						list.add(ig);
+					}
+				} else {
+					Point2D[] ps1 = TrigonometricalFunctions.getPerpendicular(lastp,
+							antInter, lastp);
+					double a1 = TrigonometricalFunctions.getAngle(ps1[0], ps1[1]);
+					double a2 = TrigonometricalFunctions.getAngle(ps1[1], ps1[0]);
+					double angle = TrigonometricalFunctions.getAngle(antCenter,
+							lastp);
+					Point2D ini1 = null;
+					Point2D ini2 = null;
+
+					if (TrigonometricalFunctions.absoluteAngleDistance(angle, a1) > TrigonometricalFunctions.absoluteAngleDistance(
+								angle, a2)) {
+						ini1 = ps1[0];
+						ini2 = ps1[1];
+					} else {
+						ini1 = ps1[1];
+						ini2 = ps1[0];
+					}
+
+					Point2D unit = TrigonometricalFunctions.getUnitVector(ini1,
+							ini2);
+					Point2D correct = new Point2D.Double(lastp.getX() +
+							unit.getX(), lastp.getY() + unit.getY());
+
+					Point2D[] ps = TrigonometricalFunctions.getPerpendicular(lastp,
+							correct, lastp);
+					Point2D mediop = new Point2D.Double((point.getX() +
+							lastp.getX()) / 2, (point.getY() + lastp.getY()) / 2);
+					Point2D[] ps2 = TrigonometricalFunctions.getPerpendicular(lastp,
+							point, mediop);
+					Point2D interp = TrigonometricalFunctions.getIntersection(ps[0],
+							ps[1], ps2[0], ps2[1]);
+					antInter = interp;
+
+					double radio = interp.distance(lastp);
+
+					if (TrigonometricalFunctions.isLowAngle(correct, lastp,
+								interp, point)) {
+						radio = -radio;
+					}
+
+					Point2D centerp = TrigonometricalFunctions.getPoint(interp,
+							mediop, radio);
+					antCenter = centerp;
+					list.add(ShapeFactory.createArc(lastp, centerp, point));
+				}
+
+				antantPoint = antPoint;
+				antPoint = point;
+				antStatus = status;
+			}
+		} else if (status == 4) {
+			GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+					2);
+			elShape.moveTo(antPoint.getX(), antPoint.getY());
+			elShape.lineTo(firstPoint.getX(), firstPoint.getY());
+			
+			list.add(ShapeFactory.createPolyline2D(elShape));
+			list.add(ShapeFactory.createPolyline2D(elShape));
+
+			IGeometry[] geoms = (IGeometry[]) list.toArray(new IGeometry[0]);
+			FGeometryCollection fgc = new FGeometryCollection(geoms);
+
+			try {
+				editingSource.addGeometry(fgc);
+			} catch (DriverIOException e1) {
+				e1.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			ret = ret | polylineStatus.transition("cancel");
+			antStatus = status;
+		} else if (status == 5) {
+			IGeometry[] geoms = (IGeometry[]) list.toArray(new IGeometry[0]);
+
+			if (geoms.length > 0) {
+				FGeometryCollection fgc = new FGeometryCollection(geoms);
+
+				try {
+					editingSource.addGeometry(fgc);
+				} catch (DriverIOException e1) {
+					e1.printStackTrace();
+				} catch (IOException e1) {
+					e1.printStackTrace();
+				}
+			}
+
+			ret = ret | polylineStatus.transition("cancel");
+			antStatus = status;
+		}
+
+		return ret;
+	}
+
+	/*private GeneralPathX getGeneralPath(Point2D[] paux){
+	   int numPoints=paux.length;
+	   GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 0);
+	   elShape.moveTo(paux[0].getX(), paux[0].getY());
+	   for (i = 1; i < numPoints; i++) {
+	           Point2D p = paux[i];
+	           elShape.lineTo(p.getX(), p.getY());
+	   }
+	   return elShape;
+	   }
+	 */
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.edition.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = polylineStatus.getStatus();
+
+		if (status == 1) {
+			for (int i = 0; i < list.size(); i++) {
+				((IGeometry) list.get(i)).cloneGeometry().draw((Graphics2D) g,
+					getCadToolAdapter().getMapControl().getViewPort(),
+					CadTool.modifySymbol);
+			}
+
+			drawLine((Graphics2D) g, antPoint, new Point2D.Double(x, y));
+		} else if ((status == 2) || (status == 3)) {
+			for (int i = 0; i < list.size(); i++) {
+				((IGeometry) list.get(i)).cloneGeometry().draw((Graphics2D) g,
+					getCadToolAdapter().getMapControl().getViewPort(),
+					CadTool.modifySymbol);
+			}
+
+			Point2D point = new Point2D.Double(x, y);
+			Point2D lastp = antPoint;
+
+			if (!(list.size() > 0) ||
+					(((IGeometry) list.get(list.size() - 1)).getGeometryType() == FShape.LINE)) {
+				if (antantPoint == null) {
+					drawArc(point, lastp,
+						new Point2D.Double(lastp.getX() + (point.getX() / 2),
+							lastp.getY() + (point.getY() / 2)), g);
+				} else {
+					drawArc(point, lastp, antantPoint, g);
+				}
+			} else {
+				if (antInter != null) {
+					Point2D[] ps1 = TrigonometricalFunctions.getPerpendicular(lastp,
+							antInter, lastp);
+					double a1 = TrigonometricalFunctions.getAngle(ps1[0], ps1[1]);
+					double a2 = TrigonometricalFunctions.getAngle(ps1[1], ps1[0]);
+					double angle = TrigonometricalFunctions.getAngle(antCenter,
+							lastp);
+					Point2D ini1 = null;
+					Point2D ini2 = null;
+
+					if (TrigonometricalFunctions.absoluteAngleDistance(angle, a1) > TrigonometricalFunctions.absoluteAngleDistance(
+								angle, a2)) {
+						ini1 = ps1[0];
+						ini2 = ps1[1];
+					} else {
+						ini1 = ps1[1];
+						ini2 = ps1[0];
+					}
+
+					Point2D unit = TrigonometricalFunctions.getUnitVector(ini1,
+							ini2);
+					Point2D correct = new Point2D.Double(lastp.getX() +
+							unit.getX(), lastp.getY() + unit.getY());
+					drawArc(point, lastp, correct, g);
+				}
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.edition.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		if (polylineStatus.getStatus() == -1) {
+			polylineStatus.initialize();
+		}
+
+		return STATUS[polylineStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.edition.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		polylineStatus.initialize();
+		list.clear();
+		antantPoint = antPoint = firstPoint = null;
+	}
+
+	/**
+	 * Dibuja el arco sobre el graphics.
+	 *
+	 * @param point Puntero del rat�n.
+	 * @param lastp �ltimo punto de la polilinea.
+	 * @param antp Punto antepenultimo.
+	 * @param g Graphics sobre el que se dibuja.
+	 */
+	private void drawArc(Point2D point, Point2D lastp, Point2D antp, Graphics g) {
+		if (((point.getY() == lastp.getY()) && (point.getX() < lastp.getX())) ||
+				((point.getX() == lastp.getX()) &&
+				(point.getY() < lastp.getY()))) {
+		} else {
+			if (point.getX() == lastp.getX()) {
+				point = new Point2D.Double(point.getX() + 0.00000001,
+						point.getY());
+			} else if (point.getY() == lastp.getY()) {
+				point = new Point2D.Double(point.getX(),
+						point.getY() + 0.00000001);
+			}
+
+			if (point.getX() == antp.getX()) {
+				point = new Point2D.Double(point.getX() + 0.00000001,
+						point.getY());
+			} else if (point.getY() == antp.getY()) {
+				point = new Point2D.Double(point.getX(),
+						point.getY() + 0.00000001);
+			}
+
+			Point2D[] ps1 = TrigonometricalFunctions.getPerpendicular(lastp,
+					antp, lastp);
+			Point2D mediop = new Point2D.Double((point.getX() + lastp.getX()) / 2,
+					(point.getY() + lastp.getY()) / 2);
+			Point2D[] ps2 = TrigonometricalFunctions.getPerpendicular(lastp,
+					point, mediop);
+			Point2D interp = TrigonometricalFunctions.getIntersection(ps1[0],
+					ps1[1], ps2[0], ps2[1]);
+
+			double radio = interp.distance(lastp);
+
+			if (TrigonometricalFunctions.isLowAngle(antp, lastp, interp, point)) {
+				radio = -radio;
+			}
+
+			Point2D centerp = TrigonometricalFunctions.getPoint(interp, mediop,
+					radio);
+
+			drawLine((Graphics2D) g, lastp, point);
+
+			IGeometry ig = ShapeFactory.createArc(lastp, centerp, point);
+
+			if (ig != null) {
+				ig.draw((Graphics2D) g,
+					getCadToolAdapter().getMapControl().getViewPort(),
+					CadTool.modifySymbol);
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return polylineStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/PolyLineCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/EllipseCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/EllipseCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/EllipseCadTool.java	(revision 1648)
@@ -0,0 +1,186 @@
+/* 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.gui.cad.tools;
+
+import com.iver.cit.gvsig.fmap.core.ShapeFactory;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.CadTool;
+import com.iver.cit.gvsig.gui.cad.automaton.Elipse;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para la creaci�n de una elipse a partir de dos puntos y la
+ * distancia del eje mayor.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class EllipseCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise punto inicial de eje de elipse"),
+			new Status("Precise punto final de eje"),
+			new Status("Precise distancia otro eje")
+		};
+	private Elipse ellipseStatus = new Elipse();
+	private Point2D startAxis;
+	private Point2D endAxis;
+	private double distance;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text, EditableFeatureSource editingSource,
+		FBitSet selectedGeometries, double[] values) {
+		int ret = ellipseStatus.transition(text);
+
+		int status = ellipseStatus.getStatus();
+
+		if (status == 0) {
+		} else if (status == 1) {
+			startAxis = new Point2D.Double(values[0], values[1]);
+		} else if (status == 2) {
+			endAxis = new Point2D.Double(values[0], values[1]);
+		} else if (status == 3) {
+			Point2D middle = new Point2D.Double((startAxis.getX() +
+					endAxis.getX()) / 2, (startAxis.getY() + endAxis.getY()) / 2);
+
+			Point2D third = new Point2D.Double(values[0], values[1]);
+
+			distance = middle.distance(third);
+
+			try {
+				editingSource.addGeometry(ShapeFactory.createEllipse(
+						startAxis, endAxis, distance));
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			ret = ret | ellipseStatus.transition("cancel");
+		} else if (status == 4) {
+			distance = values[0];
+
+			try {
+				editingSource.addGeometry(ShapeFactory.createEllipse(
+						startAxis, endAxis, distance));
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			ret = ret | ellipseStatus.transition("cancel");
+		}
+
+		System.err.println(startAxis);
+		System.err.println(endAxis);
+		System.err.println(distance);
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = ellipseStatus.getStatus();
+
+		if (status == 0) {
+		} else if (status == 1) {
+			drawLine((Graphics2D) g, startAxis, new Point2D.Double(x, y));
+		} else if (status == 2) {
+			Point2D middle = new Point2D.Double((startAxis.getX() +
+					endAxis.getX()) / 2, (startAxis.getY() + endAxis.getY()) / 2);
+
+			Point2D third = new Point2D.Double(x, y);
+
+			distance = middle.distance(third);
+
+			ShapeFactory.createEllipse(startAxis, endAxis, distance).draw((Graphics2D) g,
+				getCadToolAdapter().getMapControl().getViewPort(),
+				CadTool.modifySymbol);
+
+			Point2D mediop = new Point2D.Double((startAxis.getX() +
+					endAxis.getX()) / 2, (startAxis.getY() + endAxis.getY()) / 2);
+			drawLine((Graphics2D) g, mediop, third);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[ellipseStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		startAxis = null;
+		endAxis = null;
+		distance = 0;
+		ellipseStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return ellipseStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/EllipseCadTool.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RotateCadTool.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RotateCadTool.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RotateCadTool.java	(revision 1648)
@@ -0,0 +1,224 @@
+/* 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.gui.cad.tools;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.core.IGeometry;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.edition.EditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.cad.Status;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.gui.cad.automaton.Girar;
+
+import com.iver.fsac.Automaton;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+
+import java.io.IOException;
+
+
+/**
+ * Herramienta para rotar las geometr�as seleccionadas.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class RotateCadTool extends AbstractCadTool {
+	private static Status[] STATUS = {
+			new Status("Precise punto base"),
+			new Status("Precise angulo de rotacion"),
+		};
+	private Girar rotateStatus = new Girar();
+	private Point2D firstPoint;
+	private Point2D lastPoint;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#transition(java.lang.String,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double[])
+	 */
+	public int transition(String text,
+		final EditableFeatureSource editingSource,
+		final FBitSet selectedGeometries, final double[] ds) {
+		int ret = rotateStatus.transition(text);
+		int status = rotateStatus.getStatus();
+
+		if (status == 0) {
+			if (selectedGeometries.cardinality() == 0) {
+				getCadToolAdapter().pushCadTool(new SelectionCadTool());
+			}
+		} else if (status == 1) {
+			if (ds.length != 0) {
+				firstPoint = new Point2D.Double(ds[0], ds[1]);
+			}
+		} else if (status == 2) {
+			PluginServices.getMDIManager().setWaitCursor();
+			lastPoint = new Point2D.Double(ds[0], ds[1]);
+
+			double w;
+			double h;
+			w = lastPoint.getX() - firstPoint.getX();
+			h = lastPoint.getY() - firstPoint.getY();
+
+			try {
+				editingSource.startComplexGeometry();
+
+				for (int i = selectedGeometries.nextSetBit(0); i >= 0;
+						i = selectedGeometries.nextSetBit(i + 1)) {
+					IGeometry geometry = editingSource.getGeometry(i);
+					geometry.rotate(-Math.atan2(w, h) + (Math.PI / 2),
+						firstPoint.getX(), firstPoint.getY());
+					editingSource.modifyGeometry(i, geometry);
+				}
+
+				editingSource.endComplexGeometry();
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			PluginServices.getMDIManager().restoreCursor();
+			ret = ret | rotateStatus.transition("cancel");
+		} else if (status == 3) {
+			try {
+				for (int i = 0; i < editingSource.getGeometryCount(); i++) {
+					if (selectedGeometries.get(i)) {
+						IGeometry geometry = editingSource.getGeometry(i);
+						geometry.rotate(Math.toRadians(ds[0]),
+							firstPoint.getX(), firstPoint.getY());
+						editingSource.modifyGeometry(i, geometry);
+					}
+				}
+			} catch (DriverIOException e) {
+				e.printStackTrace();
+			} catch (IOException e1) {
+				e1.printStackTrace();
+			}
+
+			ret = ret | rotateStatus.transition("cancel");
+		}
+
+		return ret;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#drawOperation(java.awt.Graphics,
+	 * 		com.iver.cit.gvsig.fmap.edition.EditableFeatureSource,
+	 * 		com.iver.cit.gvsig.fmap.layers.FBitSet, double, double)
+	 */
+	public void drawOperation(Graphics g, EditableFeatureSource efs,
+		FBitSet selectedGeometries, double x, double y) {
+		int status = rotateStatus.getStatus();
+
+		if (status == 1) {
+			Point2D point = getCadToolAdapter().getMapControl().getViewPort()
+								.fromMapPoint(firstPoint.getX(),
+					firstPoint.getY());
+			double w;
+			double h;
+			w = x - firstPoint.getX();
+			h = y - firstPoint.getY();
+
+			AffineTransform at = AffineTransform.getRotateInstance(+Math.atan2(
+						w, h) - (Math.PI / 2), (int) point.getX(),
+					(int) point.getY());
+			Image img = getCadToolAdapter().getEditableFeatureSource().getImage();
+
+			((Graphics2D) g).drawImage(img, at, null);
+
+			drawLine((Graphics2D) g, firstPoint, new Point2D.Double(x, y));
+
+			/*
+			   try {
+			           for (int i = selectedGeometries.nextSetBit(0);
+			           i >= 0;
+			           i = selectedGeometries.nextSetBit(i + 1)){
+			                   IGeometry geometry = efs.getGeometry(i);
+			
+			                   geometry.rotate(-Math.atan2(w,h)+Math.PI/2,firstPoint.getX(),firstPoint.getY());
+			                   geometry.draw((Graphics2D) g,
+			                                   getCadToolAdapter().getMapControl().getViewPort(),
+			                                   CadTool.drawingSymbol);
+			                   GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD,
+			                                   2);
+			                   elShape.moveTo(firstPoint.getX(), firstPoint.getY());
+			                   elShape.lineTo(x, y);
+			                   ShapeFactory.createPolyline2D(
+			                                   elShape).draw((Graphics2D) g,
+			                                                   getCadToolAdapter().getMapControl().getViewPort(),
+			                                                   CadTool.drawingSymbol);
+			
+			   }
+			   } catch (DriverIOException e) {
+			           e.printStackTrace();
+			   } catch (IOException e) {
+			           e.printStackTrace();
+			   }
+			 */
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getQuestion()
+	 */
+	public String getQuestion() {
+		return STATUS[rotateStatus.getStatus()].getQuestion();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#initializeStatus()
+	 */
+	public void initializeStatus() {
+		rotateStatus.initialize();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.cad.CadTool#getAutomaton()
+	 */
+	public Automaton getAutomaton() {
+		return rotateStatus;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/RotateCadTool.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Encuadrator.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Encuadrator.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Encuadrator.java	(revision 1648)
@@ -0,0 +1,87 @@
+/* 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.gui;
+
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.project.Project;
+import com.iver.cit.gvsig.project.ProjectExtent;
+import com.iver.cit.gvsig.project.ProjectFactory;
+
+
+public class Encuadrator implements ListSelectorListener {
+
+	private Project project;
+	private View vista;
+	private FMap mapa;
+
+	public Encuadrator(Project project, FMap map, View vista){
+		this.project = project;
+		this.vista = vista;
+		mapa = map;
+	}
+
+	/**
+	 * @see com.iver.utiles.ListSelectorListener#indexesSelected(int[])
+	 */
+	public void indexesSelected(int[] indices) {
+		mapa.getViewPort().setExtent(project.getExtents()[indices[0]].getExtent());
+	}
+
+	/**
+	 * @see com.iver.utiles.ListSelectorListener#indexesRemoved(int[])
+	 */
+	public void indexesRemoved(int[] indices) {
+		for (int i = 0; i < indices.length; i++){
+			project.removeExtent(indices[i]);		
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.utiles.ListSelectorListener#newElement(java.lang.String)
+	 */
+	public void newElement(String name) {
+		ProjectExtent extent = ProjectFactory.createExtent();
+		extent.setDescription(name);
+		extent.setExtent(mapa.getViewPort().getExtent());
+		project.addExtent(extent);
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Encuadrator.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendDefault.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendDefault.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendDefault.java	(revision 1648)
@@ -0,0 +1,1106 @@
+/*
+ * Created on 30-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+import java.awt.BasicStroke;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.Paint;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Line2D;
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+import javax.swing.JTextField;
+import javax.swing.ListCellRenderer;
+import javax.swing.UIManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.plaf.basic.BasicComboBoxEditor;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.cit.gvsig.fmap.core.FPoint2D;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbolFactory;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.rendering.Legend;
+import com.iver.cit.gvsig.fmap.rendering.SingleSymbolLegend;
+import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
+import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D;
+import com.iver.cit.gvsig.gui.GUIUtil;
+import com.iver.cit.gvsig.gui.Panels.ColorChooserPanel;
+import com.iver.cit.gvsig.gui.Panels.TransparencyPanel;
+import com.iver.utiles.ImageFilter;
+import com.vividsolutions.jump.util.StringUtil;
+/**
+ * @author fjp
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+
+
+public class FPanelLegendDefault extends JPanel implements ILegendPanel {
+	
+	private FSymbol m_FSymbol = null;
+	
+	
+	protected static final int SLIDER_TEXT_FIELD_COLUMNS = 3;
+	protected static final Dimension SLIDER_DIMENSION = new Dimension(130, 49);
+	// private Paint[] fillPatterns = new FillPatternFactory().createFillPatterns();
+	private JPanel centerPanel = new JPanel();
+	// private AbstractPalettePanel palettePanel;
+	protected JCheckBox fillCheckBox = new JCheckBox();
+	protected JCheckBox lineCheckBox = new JCheckBox();
+	protected TransparencyPanel transparencyPanel = new TransparencyPanel();
+	protected JLabel transparencyLabel = new JLabel();
+	protected ColorChooserPanel lineColorChooserPanel = new ColorChooserPanel();
+	protected ColorChooserPanel fillColorChooserPanel = new ColorChooserPanel();
+	protected ColorChooserPanel pointColorChooserPanel = new ColorChooserPanel();
+	protected FPreviewSymbol m_previewSymbol = new FPreviewSymbol();
+	protected JLabel lineWidthLabel = new JLabel();
+	protected JCheckBox synchronizeCheckBox = new JCheckBox();
+	private JCheckBox linePatternCheckBox = new JCheckBox();
+	private JCheckBox fillPatternCheckBox = new JCheckBox();
+	private Paint[] fillPatterns = FSymbolFactory.createPatternFills(Color.GRAY);	
+	private String[] linePatterns = new String[] {
+			"1", "3", "5", "5,1", "7", "7,12", "9", "9,2", "15,6", "20,3"
+		};
+	
+	private Integer[] pointTypes = new Integer[] {
+			new Integer(FStyle2D.SYMBOL_STYLE_MARKER_SQUARE),
+			new Integer(FStyle2D.SYMBOL_STYLE_MARKER_CIRCLE),
+			new Integer(FStyle2D.SYMBOL_STYLE_MARKER_TRIANGLE),
+			new Integer(FStyle2D.SYMBOL_STYLE_MARKER_CROSS),
+			new Integer(FStyle2D.SYMBOL_STYLE_MARKER_IMAGEN)
+		};
+	
+	protected String pointTypeToString(Integer pointType)
+	{
+		String resul = "No reconocido";
+		switch (pointType.intValue())
+		{
+			case FStyle2D.SYMBOL_STYLE_MARKER_SQUARE:
+				resul = "Cuadrado";
+				break;
+			case FStyle2D.SYMBOL_STYLE_MARKER_CIRCLE:
+				resul = "C�rculo";
+				break;
+			case FStyle2D.SYMBOL_STYLE_MARKER_TRIANGLE:
+				resul = "Tri�ngulo";
+				break;
+			case FStyle2D.SYMBOL_STYLE_MARKER_CROSS:
+				resul = "Cruz";
+				break;
+			case FStyle2D.SYMBOL_STYLE_MARKER_IMAGEN:
+				resul = "Imagen";
+				break;
+				
+		}
+		return resul;
+	}
+	protected Integer pointTypeToInt(String pointType)
+	{
+		if (pointType.compareTo("Cuadrado")== 0)
+			return new Integer(FStyle2D.SYMBOL_STYLE_MARKER_SQUARE);
+		if (pointType.compareTo("C�rculo")== 0)
+			return new Integer(FStyle2D.SYMBOL_STYLE_MARKER_CIRCLE);
+		if (pointType.compareTo("Tri�ngulo")== 0)
+			return new Integer(FStyle2D.SYMBOL_STYLE_MARKER_TRIANGLE);
+		if (pointType.compareTo("Cruz")== 0)
+			return new Integer(FStyle2D.SYMBOL_STYLE_MARKER_CROSS);
+		if (pointType.compareTo("Imagen")== 0)
+			return new Integer(FStyle2D.SYMBOL_STYLE_MARKER_IMAGEN);
+		return new Integer(-1);
+	}	
+	private JComboBox pointTypeComboBox = new JComboBox(pointTypes) {
+
+		{
+			BasicComboBoxEditor editor = new BasicComboBoxEditor();
+			
+			setEditor(editor);
+			setEditable(true);
+			addActionListener(new ActionListener() {
+					public void actionPerformed(ActionEvent e) {
+						updateControls(false);
+						if (getSelectedItem() instanceof Integer)
+						{
+							setSelectedItem(pointTypeToString((Integer) getSelectedItem()));
+							
+							updateControls(false);
+						}
+					}
+				});
+			setRenderer(new ListCellRenderer() {
+				private Integer pointType;
+				private FSymbol myFSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT);
+					private JPanel panel = new JPanel() {
+
+							protected void paintComponent(Graphics g) {
+								super.paintComponent(g);
+
+								Graphics2D g2 = (Graphics2D) g;
+								AffineTransform mT = new AffineTransform();
+								mT.setToIdentity();
+
+								FPoint2D shp = new FPoint2D(panel.getWidth()/2, 
+										panel.getHeight()/2);
+								if (m_FSymbol !=null){
+								myFSymbol.setColor(m_FSymbol.getColor());
+								FGraphicUtilities.DrawShape(g2,mT, shp,myFSymbol);
+								}
+							}
+						};
+					
+
+					public Component getListCellRendererComponent(
+						JList list, Object value, int index,
+						boolean isSelected, boolean cellHasFocus) {
+						pointType = (Integer) value;
+						myFSymbol.setStyle(pointType.intValue());
+						// Le hacemos que se dibuje siempre con 10 pixels
+						
+						myFSymbol.setSizeInPixels(true);
+						myFSymbol.setSize(10);
+						myFSymbol.setStroke(new BasicStroke());
+						panel.setForeground(UIManager.getColor(isSelected
+								? "ComboBox.selectionForeground"
+								: "ComboBox.foreground"));
+						panel.setBackground(UIManager.getColor(isSelected
+								? "ComboBox.selectionBackground"
+								: "ComboBox.background"));
+						
+						return panel;
+					}
+				});
+		}
+	};
+	
+	/**
+	 * Converts the comma-delimited string into a List of trimmed strings.
+	 *
+	 * @param linePattern a String with comma-delimited values
+	 * @param lineWidth DOCUMENT ME!
+	 *
+	 * @return a List of the Strings that were delimited by commas
+	 *
+	 * @throws IllegalArgumentException DOCUMENT ME!
+	 */
+	private static float[] toArray(String linePattern, float lineWidth) {
+		List strings = StringUtil.fromCommaDelimitedString(linePattern);
+		float[] array = new float[strings.size()];
+
+		for (int i = 0; i < strings.size(); i++) {
+			String string = (String) strings.get(i);
+			array[i] = Float.parseFloat(string) * lineWidth;
+
+			if (array[i] <= 0) {
+				throw new IllegalArgumentException("Negative dash length");
+			}
+		}
+
+		return array;
+	}
+		
+	protected JSlider lineWidthSlider = new JSlider() {
+
+			{
+				addChangeListener(new ChangeListener() {
+						public void stateChanged(ChangeEvent e) {
+							updateControls(false);
+						}
+					});
+			}
+		};
+	private JComboBox linePatternComboBox = new JComboBox(linePatterns) { 
+	{
+				BasicComboBoxEditor editor = new BasicComboBoxEditor();
+				setEditor(editor);
+				setEditable(true);
+				addActionListener(new ActionListener() {
+						public void actionPerformed(ActionEvent e) {
+							updateControls(false);
+						}
+					});
+				setRenderer(new ListCellRenderer() {
+						private JPanel panel = new JPanel() {
+								private int lineWidth = 2;
+
+								protected void paintComponent(Graphics g) {
+									super.paintComponent(g);
+
+									Graphics2D g2 = (Graphics2D) g;
+									g2.setStroke(new BasicStroke(lineWidth,
+											BasicStroke.CAP_BUTT,
+											BasicStroke.JOIN_BEVEL, 1.0f,
+											toArray(linePattern, lineWidth), 0));
+									g2.draw(new Line2D.Double(0,
+											panel.getHeight() / 2.0,
+											panel.getWidth(),
+											panel.getHeight() / 2.0));
+								}
+							};
+
+						private String linePattern;
+
+						public Component getListCellRendererComponent(
+							JList list, Object value, int index,
+							boolean isSelected, boolean cellHasFocus) {
+							linePattern = (String) value;
+							panel.setForeground(UIManager.getColor(isSelected
+									? "ComboBox.selectionForeground"
+									: "ComboBox.foreground"));
+							panel.setBackground(UIManager.getColor(isSelected
+									? "ComboBox.selectionBackground"
+									: "ComboBox.background"));
+
+							return panel;
+						}
+					});
+			}
+		};
+
+		
+	private JComboBox fillPatternComboBox = new JComboBox(fillPatterns) {
+
+			{
+				// setMaximumRowCount(fillPatterns.length);
+				setEditable(false);
+				addActionListener(new ActionListener() {
+						public void actionPerformed(ActionEvent e) {
+							updateControls(true);
+						}
+					});
+				setRenderer(new ListCellRenderer() {
+						private Paint fillPattern;
+						private JLabel label = new JLabel(" ");
+						private JPanel panel = new JPanel(new BorderLayout()) {
+
+								{
+									label.setPreferredSize(new Dimension(150,
+											(int) label.getPreferredSize()
+													   .getHeight()));
+									add(label, BorderLayout.CENTER);
+								}
+
+								protected void paintComponent(Graphics g) {
+									super.paintComponent(g);
+									((Graphics2D) g).setPaint(fillPattern);
+									((Graphics2D) g).fill(new Rectangle2D.Double(
+											0, 0, getWidth(), getHeight()));
+								}
+							};
+
+						public Component getListCellRendererComponent(
+							JList list, Object value, int index,
+							boolean isSelected, boolean cellHasFocus) {
+							fillPattern = (Paint) value;
+							// label.setText("" +(1 +
+							// 	CollectionUtil.indexOf(fillPattern, fillPatterns))); 
+							label.setForeground(UIManager.getColor(isSelected
+									? "ComboBox.selectionForeground"
+									: "ComboBox.foreground"));
+							panel.setBackground(UIManager.getColor(isSelected
+									? "ComboBox.selectionBackground"
+									: "ComboBox.background"));
+
+							return panel;
+						}
+					});
+			}
+		};
+		
+
+	private javax.swing.JPanel jPanelPoint = null;  //
+	private javax.swing.JLabel jLabel = null;
+	private javax.swing.JLabel jLabel1 = null;
+	private javax.swing.JCheckBox jCheckBox = null;
+	private javax.swing.JTextField jTextField_Size = null;
+	private javax.swing.JComboBox jComboBox_Symbol_Type = null;
+	private javax.swing.JLabel jLabel2 = null;
+	private JLabel jLblImagen = null;
+	private JTextField jTxtImagen = null;
+	private JButton jBtnImagen = null;
+	/**
+	 * 
+	 */
+	public FPanelLegendDefault() {
+		super();
+		try {
+			jbInit();
+			linePatternCheckBox.setSelected(false);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		transparencyPanel.getSlider().getModel().addChangeListener(new ChangeListener() {
+				public void stateChanged(ChangeEvent e) {
+					updateControls(true);
+				}
+			});
+		/* palettePanel.add(new GridPalettePanel.Listener() {
+				public void basicStyleChosen(BasicStyle basicStyle) {
+					//Preserve some settings e.g. line and fill patterns, alpha;
+					BasicStyle newBasicStyle = getBasicStyle();
+					newBasicStyle.setFillColor(basicStyle.getFillColor());
+					newBasicStyle.setLineColor(basicStyle.getLineColor());
+					newBasicStyle.setLineWidth(basicStyle.getLineWidth());
+					newBasicStyle.setRenderingFill(basicStyle.isRenderingFill());
+					newBasicStyle.setRenderingLine(basicStyle.isRenderingLine());
+					setBasicStyle(newBasicStyle);
+				}
+			}); */
+		updateControls(false);
+
+	}
+	
+	void jbInit() throws Exception {
+		java.awt.GridBagConstraints consGridBagConstraints2 = new java.awt.GridBagConstraints();
+
+		lineWidthSlider.setPreferredSize(SLIDER_DIMENSION);
+		lineWidthSlider.setPaintLabels(true);
+		lineWidthSlider.setValue(1);
+		lineWidthSlider.setLabelTable(lineWidthSlider.createStandardLabels(10));
+		lineWidthSlider.setMajorTickSpacing(5);
+		lineWidthSlider.setMaximum(30);
+		lineWidthSlider.setMinorTickSpacing(1);
+		
+		
+		JPanel globalPanel = new JPanel();
+		globalPanel.setLayout(new GridBagLayout());
+		
+		linePatternCheckBox.setText(PluginServices.getText(this,"tipo_linea"));
+		fillPatternCheckBox.setText(PluginServices.getText(this,"tipo_relleno"));
+		linePatternCheckBox.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					linePatternCheckBox_actionPerformed(e);
+				}
+			});
+		fillPatternCheckBox.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					fillPatternCheckBox_actionPerformed(e);
+				}
+			});
+		// add(getJPanelPoint());
+		globalPanel.add(getCenterPanel(),
+			new GridBagConstraints(0, 0, 1, 2, 0, 0, GridBagConstraints.WEST,
+				GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
+		
+		/*globalPanel.add(new JPanel(),
+			new GridBagConstraints(3, 0, 1, 1, 1, 0, GridBagConstraints.WEST,
+				GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0)); */
+		/* globalPanel.add(new JLabel("Previsualizaci�n de s�mbolo:"),
+			new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
+				GridBagConstraints.NONE, new Insets(0, 30, 0, 0), 0, 0)); */
+				
+		JPanel panelAux = new JPanel();
+		panelAux.add(new JLabel(PluginServices.getText(this,"Previsualizacion_de_simbolo")));
+		panelAux.add(m_previewSymbol );
+		/* globalPanel.add(panelAux, new 
+				GridBagConstraints(2, 1, 1, 1, 1, 1, GridBagConstraints.WEST,
+				GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); */
+		
+		
+		m_previewSymbol.setPreferredSize(new Dimension(80,60));
+		m_previewSymbol.setMinimumSize(new Dimension(80,60));
+
+		setLayout(null);
+		globalPanel.setBounds(0,0,350,250);
+		
+		getJPanelPoint().setBounds(0,0,350,250);
+		add(getJPanelPoint()); //, BorderLayout.WEST); //, consGridBagConstraints2);
+		add(globalPanel); // , BorderLayout.WEST);
+		
+		panelAux.setBounds(350,0,150,100);
+		
+		add(panelAux) ; //,BorderLayout.EAST); // Contiene el preview
+		
+		/* globalPanel.setBackground(Color.RED);
+		getJPanelPoint().setBackground(Color.BLUE);
+		panelAux.setBackground(Color.GREEN); */
+		
+		getCenterPanel().setLayout(new GridBagLayout());
+		setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
+		this.setSize(419, 293);
+ 		fillColorChooserPanel.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					fillColorChooserPanel_actionPerformed(e);
+				}
+			});
+		lineColorChooserPanel.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					lineColorChooserPanel_actionPerformed(e);
+				}
+			}); 
+		
+		synchronizeCheckBox.setText(PluginServices.getText(this,"sincronizar_color_borde_relleno"));
+		synchronizeCheckBox.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					synchronizeCheckBox_actionPerformed(e);
+				}
+			});
+		fillCheckBox.setText(PluginServices.getText(this,"relleno"));
+		fillCheckBox.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					fillCheckBox_actionPerformed(e);
+				}
+			});
+		lineCheckBox.setText(PluginServices.getText(this,"linea"));
+		lineCheckBox.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					lineCheckBox_actionPerformed(e);
+				}
+			});
+		getCenterPanel().add(GUIUtil.createSyncdTextField(
+				transparencyPanel.getSlider(), SLIDER_TEXT_FIELD_COLUMNS),
+			new GridBagConstraints(2, 21, 1, 1, 0.0, 0.0,
+				GridBagConstraints.CENTER, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(lineWidthSlider,
+			new GridBagConstraints(1, 19, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(GUIUtil.createSyncdTextField(lineWidthSlider,
+				SLIDER_TEXT_FIELD_COLUMNS),
+			new GridBagConstraints(2, 19, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		fillColorChooserPanel.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					fillColorChooserPanel_actionPerformed(e);
+				}
+			}); 
+		lineWidthLabel.setText(PluginServices.getText(this,"grosor_linea"));
+		transparencyLabel.setText(PluginServices.getText(this,"transparencia"));
+		consGridBagConstraints2.gridx = 0;
+		consGridBagConstraints2.gridy = 0;
+		consGridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;
+		consGridBagConstraints2.fill = java.awt.GridBagConstraints.NONE;
+		getCenterPanel().add(synchronizeCheckBox,
+			new GridBagConstraints(0, 18, 3, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(transparencyLabel,
+			new GridBagConstraints(0, 21, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(fillColorChooserPanel,
+			new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		
+		
+		getCenterPanel().add(lineColorChooserPanel, 
+			new GridBagConstraints(1, 11, 2, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0)); 
+		getCenterPanel().add(transparencyPanel,
+			new GridBagConstraints(1, 21, 1, 1, 0.0, 0.0,
+				GridBagConstraints.CENTER, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(fillCheckBox,
+			new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(lineCheckBox,
+			new GridBagConstraints(0, 11, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(lineWidthLabel,
+			new GridBagConstraints(0, 19, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(linePatternCheckBox,
+			new GridBagConstraints(0, 16, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(fillPatternCheckBox,
+			new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(linePatternComboBox,
+			new GridBagConstraints(1, 16, 2, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 2, 2), 0, 0));
+		getCenterPanel().add(fillPatternComboBox,
+			new GridBagConstraints(1, 7, 2, 1, 0.0, 0.0,
+				GridBagConstraints.WEST, GridBagConstraints.NONE,
+				new Insets(2, 2, 0, 2), 0, 0));
+		
+		pointTypeComboBox.setBounds(143, 25, 120, 20);
+		pointColorChooserPanel.addActionListener(new java.awt.event.ActionListener() {			
+			public void actionPerformed(ActionEvent e) {
+				updateControls(false);
+			}
+		}); 
+		
+		// this.setSize(348, 243);
+		
+	}
+	
+	protected void setAlpha(int alpha) {
+		transparencyPanel.getSlider().setValue(255 - alpha);
+	}
+
+	protected int getAlpha() {
+		return 255 - transparencyPanel.getSlider().getValue();
+	}
+	
+	void fillCheckBox_actionPerformed(ActionEvent e) {
+		updateControls(false);
+	}
+	
+	void lineCheckBox_actionPerformed(ActionEvent e) {
+		updateControls(false);
+	}
+
+	private void setSynchronizingLineColor(boolean newSynchronizingLineColor) {
+		synchronizeCheckBox.setSelected(newSynchronizingLineColor);
+	}
+
+	protected void synchronizeCheckBox_actionPerformed(ActionEvent e) {
+		if (synchronizeCheckBox.isSelected()) {
+			syncLineColor();
+		}
+
+		updateControls(false);
+	}
+
+	private JCheckBox getSynchronizeCheckBox() {
+		return synchronizeCheckBox;
+	}
+
+	void linePatternCheckBox_actionPerformed(ActionEvent e) {
+		updateControls(false);
+	}
+	void lineColorChooserPanel_actionPerformed(ActionEvent e) {
+		if (synchronizeCheckBox.isSelected()) {
+			fillColorChooserPanel.setColor(lineColorChooserPanel.getColor()
+																.brighter());
+		}
+
+		updateControls(false);
+	}
+	void fillColorChooserPanel_actionPerformed(ActionEvent e) {
+		if (synchronizeCheckBox.isSelected()) {
+			syncLineColor();
+		}
+
+		updateControls(true);
+	}
+	private void syncLineColor() {
+		lineColorChooserPanel.setColor(fillColorChooserPanel.getColor().darker());
+	}
+
+	void fillPatternCheckBox_actionPerformed(ActionEvent e) {
+		updateControls(false);
+	}
+	private void updateFillPatternColors() {
+		if ((m_FSymbol != null) && (m_FSymbol.getColor() != null))
+		{ 
+			fillPatterns = FSymbolFactory.createPatternFills(m_FSymbol.getColor());
+			fillPatternComboBox.setModel(new DefaultComboBoxModel(fillPatterns));
+			fillPatternComboBox.getModel().setSelectedItem(m_FSymbol.getFill());
+			// fillPatternComboBox.setSelectedItem(m_FSymbol.m_Fill);					
+		}
+		
+	}
+
+	public void updateControls(boolean bInternal) {
+		linePatternComboBox.setEnabled(linePatternCheckBox.isSelected());
+		fillPatternComboBox.setEnabled(fillPatternCheckBox.isSelected());
+		lineColorChooserPanel.setEnabled(lineCheckBox.isSelected());
+		fillColorChooserPanel.setEnabled(fillCheckBox.isSelected());
+		fillColorChooserPanel.setAlpha(getAlpha());
+		lineColorChooserPanel.setAlpha(getAlpha());
+		Color theColor = (lineCheckBox.isSelected() &&
+		!fillCheckBox.isSelected()) ? lineColorChooserPanel.getColor()
+									: fillColorChooserPanel.getColor(); 
+		transparencyPanel.setColor(theColor);
+		if (jTxtImagen != null)
+		{
+			jTxtImagen.setVisible(false);
+			jLblImagen.setVisible(false);
+			jBtnImagen.setVisible(false);
+		}
+		if (m_FSymbol != null)
+		{		
+			if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
+			{
+				m_FSymbol.setSize(Integer.parseInt(getJTextField().getText()));
+				 
+				//System.out.println("Asigno el m_Size = " + getJTextField().getText());
+				
+				if (pointTypeComboBox.getSelectedItem() instanceof Integer)
+				{
+					Integer styleSelected = (Integer) pointTypeComboBox.getSelectedItem();
+					m_FSymbol.setStyle(styleSelected.intValue());
+				}
+				else
+				{
+					Integer styleSelected = pointTypeToInt((String) pointTypeComboBox.getSelectedItem());
+					m_FSymbol.setStyle(styleSelected.intValue());
+				}
+				if (m_FSymbol.getStyle() == FConstant.SYMBOL_STYLE_MARKER_IMAGEN)
+				{
+					jTxtImagen.setVisible(true);
+					jLblImagen.setVisible(true);
+					jBtnImagen.setVisible(true);
+					if (jTxtImagen.getText().compareTo("") != 0)
+					{
+						m_FSymbol.setIcon(new ImageIcon(jTxtImagen.getText()).getImage());
+					}
+				}
+				m_FSymbol.setColor(pointColorChooserPanel.getColor());
+				m_FSymbol.setSizeInPixels(!getJCheckBox().isSelected());
+				pointColorChooserPanel.repaint();
+				m_previewSymbol.setSymbol(m_FSymbol);				
+				return;
+			}
+			m_FSymbol.setOutlined(lineCheckBox.isSelected());
+			m_FSymbol.setOutlineColor(lineColorChooserPanel.getColor());
+			if (fillCheckBox.isSelected())
+			{			
+				m_FSymbol.setColor(new Color(theColor.getRed(),
+											theColor.getGreen(),
+											  theColor.getBlue(),
+											  	getAlpha()));
+			}
+			else
+			{
+				m_FSymbol.setColor(null);
+			}
+			if (fillPatternCheckBox.isSelected())
+			{	
+				Paint fillAux = (Paint) fillPatternComboBox.getSelectedItem();
+				if ((fillAux != null) && (fillPatternComboBox.getSelectedIndex() != -1))
+				{				
+					m_FSymbol.setFill((Paint) fillPatternComboBox.getSelectedItem());
+					// Rellenamos el m_Style para que luego podamos escribir
+					// el tipo de relleno que lleva.
+					m_FSymbol.setStyle(fillPatternComboBox.getSelectedIndex()+3);
+					System.out.println("Asigno Style=" + m_FSymbol.getStyle());
+				}
+			}	
+			else
+			    if (bInternal == false)
+			        m_FSymbol.setFill(null);
+				 
+			float lineWidth = lineWidthSlider.getValue();
+			if (linePatternCheckBox.isSelected())
+			{			
+				String linePattern = (String) linePatternComboBox.getSelectedItem();
+				// System.out.println(m_FSymbol.m_Stroke.toString());
+				m_FSymbol.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
+											BasicStroke.JOIN_BEVEL, 1.0f,
+												toArray(linePattern, lineWidth), 0));
+												
+				m_FSymbol.m_LinePattern = linePattern;
+			}
+			else
+			{	
+				if (lineWidth <=1)		
+					m_FSymbol.setStroke(null);
+				else
+					m_FSymbol.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
+								BasicStroke.JOIN_BEVEL));
+			}
+			// System.out.println(fillPatternComboBox.getSelectedItem().toString() + " " + linePatternComboBox.getSelectedItem().toString());
+			// JOptionPane.showMessageDialog(this,"HOla","Colega", JOptionPane.INFORMATION_MESSAGE);
+			m_previewSymbol.setSymbol(m_FSymbol);  
+		} 
+		
+		updateFillPatternColors();		
+		fillPatternComboBox.repaint(); 
+	}
+	
+	public void setFSymbol(FSymbol s)
+	{
+		if (s==null)
+		{
+			m_FSymbol = new FSymbol(FShape.MULTI);
+		}
+		m_FSymbol = s.fastCloneSymbol();
+		m_previewSymbol.setSymbol(m_FSymbol);
+		if ((m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_FILL) || (m_FSymbol.getSymbolType() == FShape.MULTI))
+		{		
+			// Deber�amos habilitar la pesta�a de pol�gonos
+			getJPanelPoint().setVisible(false);
+			getCenterPanel().setVisible(true);
+			fillCheckBox.setText(PluginServices.getText(this,"relleno"));
+			synchronizeCheckBox.setVisible(true);
+			fillPatternCheckBox.setVisible(true);
+			fillPatternComboBox.setVisible(true);
+			lineCheckBox.setVisible(true);
+			lineColorChooserPanel.setVisible(true);
+			
+			lineCheckBox.setSelected(m_FSymbol.isOutlined());
+			lineColorChooserPanel.setColor(m_FSymbol.getOutlineColor());
+			if (m_FSymbol.getColor() != null)
+			{
+				fillCheckBox.setSelected(true);		
+				fillColorChooserPanel.setColor(m_FSymbol.getColor());
+				setAlpha(m_FSymbol.getColor().getAlpha());
+				fillColorChooserPanel.setAlpha(getAlpha());
+				lineColorChooserPanel.setAlpha(getAlpha());			
+			}
+			else
+			{
+				fillCheckBox.setSelected(false);
+			}
+			
+			linePatternCheckBox.setSelected(false);
+			if (m_FSymbol.getStroke() != null)
+			{
+				BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
+				if (aux.getDashArray() != null)
+				{			
+					linePatternCheckBox.setSelected(true);		
+					linePatternComboBox.setSelectedItem(m_FSymbol.m_LinePattern);
+				}
+			}
+			if (m_FSymbol.getFill() != null)
+			{
+			    fillPatternCheckBox.setSelected(true);
+			    fillPatternComboBox.setSelectedItem(new Integer(m_FSymbol.getStyle()));
+			}
+			
+		}
+		if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_LINE)
+		{
+			getJPanelPoint().setVisible(false);
+			getCenterPanel().setVisible(true);			
+			fillCheckBox.setText(PluginServices.getText(this,"linea"));	// Lo vamos a usar como color de l�nea	
+			fillCheckBox.setSelected(true); 
+			synchronizeCheckBox.setVisible(false);
+			fillPatternCheckBox.setVisible(false);
+			fillPatternComboBox.setVisible(false);
+			lineCheckBox.setSelected(true);
+			lineCheckBox.setVisible(false);
+			fillColorChooserPanel.setColor(m_FSymbol.getColor());
+			lineColorChooserPanel.setVisible(false);
+			if (m_FSymbol.getColor() != null)
+			{
+				lineColorChooserPanel.setColor(m_FSymbol.getColor());
+				setAlpha(m_FSymbol.getColor().getAlpha());
+				lineColorChooserPanel.setAlpha(getAlpha());			
+			}
+			linePatternCheckBox.setSelected(false);
+			if (m_FSymbol.getStroke() != null)
+			{
+				BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
+				if (aux.getDashArray() != null)
+				{			
+					linePatternCheckBox.setSelected(true);		
+					linePatternComboBox.setSelectedItem(m_FSymbol.m_LinePattern);
+				}
+			}
+		}
+		if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
+		{
+			getCenterPanel().setVisible(false);
+			getJPanelPoint().setVisible(true);
+			if (m_FSymbol.getColor()!=null){
+			pointColorChooserPanel.setColor(m_FSymbol.getColor());
+			}
+			getJTextField().setText("" + m_FSymbol.getSize());
+			getJCheckBox().setSelected(!m_FSymbol.isSizeInPixels());
+			getJComboBox_pointType().setSelectedItem(new Integer(m_FSymbol.getStyle()));
+			
+		}
+		
+		// setAlpha(255 - m_FSymbol.m_Transparency);
+		
+	}
+
+	/**
+	 * @return
+	 */
+	public FSymbol getFSymbol() {
+		updateControls(false);
+		return m_FSymbol;
+	}
+
+	protected void setCenterPanel(JPanel centerPanel) {
+		this.centerPanel = centerPanel;
+	}
+
+	protected JPanel getCenterPanel() {
+		return centerPanel;
+	}
+
+	/**
+
+	 * This method initializes jPanel	
+
+	 * 	
+
+	 * @return javax.swing.JPanel	
+
+	 */    
+	protected javax.swing.JPanel getJPanelPoint() {
+		if (jPanelPoint == null) {
+			jLblImagen = new JLabel();
+			jPanelPoint = new javax.swing.JPanel();
+			jPanelPoint.setLayout(null);
+			jPanelPoint.setPreferredSize(new Dimension(300,200));
+			jPanelPoint.setBounds(0, 2, 336, 217);
+			jLblImagen.setBounds(25, 139, 71, 18);
+			jLblImagen.setText(PluginServices.getText(this,"imagen"));
+			jPanelPoint.add(getJLabel2(), null);
+			jPanelPoint.add(getJLabel(), null);
+			jPanelPoint.add(getJLabel1(), null);
+			jPanelPoint.add(getJCheckBox(), null);
+			jPanelPoint.add(getJTextField(), null);
+			jPanelPoint.add(getJComboBox_pointType(), null);
+			pointColorChooserPanel.setBounds(143, 54, 98, 22);
+			pointColorChooserPanel.setAlpha(255);
+			jPanelPoint.add(pointColorChooserPanel);
+			jPanelPoint.add(jLblImagen, null);
+			jPanelPoint.add(getJTextField2(), null);
+			jPanelPoint.add(getJBtnImagen(), null);
+		}
+		return jPanelPoint;
+	}
+
+	/**
+
+	 * This method initializes jLabel	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel() {
+		if (jLabel == null) {
+			jLabel = new javax.swing.JLabel();
+			jLabel.setText(PluginServices.getText(this,"tipo_simbolo"));
+			jLabel.setBounds(25, 23, 113, 22);
+		}
+		return jLabel;
+	}
+
+	/**
+
+	 * This method initializes jLabel1	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel1() {
+		if (jLabel1 == null) {
+			jLabel1 = new javax.swing.JLabel();
+			jLabel1.setBounds(25, 84, 77, 22);
+			jLabel1.setText(PluginServices.getText(this,"tamano"));
+		}
+		return jLabel1;
+	}
+
+	/**
+
+	 * This method initializes jCheckBox	
+
+	 * 	
+
+	 * @return javax.swing.JCheckBox	
+
+	 */    
+	private javax.swing.JCheckBox getJCheckBox() {
+		if (jCheckBox == null) {
+			jCheckBox = new javax.swing.JCheckBox();
+			jCheckBox.setBounds(143, 115, 145, 19);
+			jCheckBox.setText(PluginServices.getText(this,"tamano_metros"));
+		}
+		return jCheckBox;
+	}
+
+	/**
+
+	 * This method initializes jTextField	
+
+	 * 	
+
+	 * @return javax.swing.JTextField	
+
+	 */    
+	private javax.swing.JTextField getJTextField() {
+		if (jTextField_Size == null) {
+			jTextField_Size = new javax.swing.JTextField();
+			jTextField_Size.setBounds(143, 86, 76, 20);
+			jTextField_Size.setText("12");
+			jTextField_Size.addActionListener(new java.awt.event.ActionListener() {
+				public void actionPerformed(ActionEvent arg0) {
+					updateControls(false);
+				}
+			});
+		}
+		return jTextField_Size;
+	}
+
+	/**
+
+	 * This method initializes jComboBox	
+
+	 * 	
+
+	 * @return javax.swing.JComboBox	
+
+	 */    
+	private javax.swing.JComboBox getJComboBox_pointType() {
+		if (jComboBox_Symbol_Type == null) {
+			jComboBox_Symbol_Type = new javax.swing.JComboBox();
+			jComboBox_Symbol_Type.setBounds(143, 25, 120, 20);
+		}
+		// return jComboBox_Symbol_Type;
+		return pointTypeComboBox;
+	}
+
+	/**
+
+	 * This method initializes jLabel2	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel2() {
+		if (jLabel2 == null) {
+			jLabel2 = new javax.swing.JLabel();
+			jLabel2.setBounds(25, 54, 68, 22);
+			jLabel2.setText(PluginServices.getText(this,"color"));
+		}
+		return jLabel2;
+	}
+
+	/**
+	 * This method initializes jTextField	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */    
+	private JTextField getJTextField2() {
+		if (jTxtImagen == null) {
+			jTxtImagen = new JTextField();
+			jTxtImagen.setBounds(103, 139, 168, 18);
+		}
+		return jTxtImagen;
+	}
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJBtnImagen() {
+		if (jBtnImagen == null) {
+			jBtnImagen = new JButton();
+			jBtnImagen.setBounds(279, 139, 33, 18);
+			jBtnImagen.setText("...");
+			jBtnImagen.setToolTipText(PluginServices.getText(this,"browse"));
+			jBtnImagen.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {  
+					JFileChooser tempChooser = new JFileChooser();
+					ImageFilter filter = new ImageFilter();
+				    tempChooser.setFileFilter(filter);
+
+                    int result = tempChooser.showOpenDialog((Component) e.getSource());
+                    tempChooser.setMultiSelectionEnabled(false);
+                    if (result == JFileChooser.APPROVE_OPTION) {
+                		File newFile = tempChooser.getSelectedFile();
+                		jTxtImagen.setText(newFile.getAbsolutePath());
+                	}
+				}
+			});
+		}
+		return jBtnImagen;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#setLayer(com.iver.cit.gvsig.fmap.layers.FLayer, com.iver.cit.gvsig.fmap.rendering.Legend)
+	 */
+	public void setLayer(FLayer lyr, Legend legend) {
+		FSymbol aux;
+		if (legend.getDefaultSymbol() == null)
+			aux = new FSymbol(((VectorialLegend)legend).getShapeType());
+		else
+
+		setFSymbol(legend.getDefaultSymbol());
+		
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#getLegend()
+	 */
+	public Legend getLegend() {
+		return new SingleSymbolLegend(getFSymbol());
+	}
+   }  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendDefault.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/PanelEditInterval.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/PanelEditInterval.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/PanelEditInterval.java	(revision 1648)
@@ -0,0 +1,115 @@
+/*
+ * Created on 24-may-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+import java.awt.GridLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import com.iver.cit.gvsig.fmap.rendering.FInterval;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author fjp To change the template for this generated type comment go to
+ *         Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
+ *         Comments
+*/
+public class PanelEditInterval extends JPanel {
+	JTextField m_txtMin = new JTextField(10);
+	JTextField m_txtMax = new JTextField(10);
+	
+	
+	
+    /**
+     * This is the default constructor
+     */
+    public PanelEditInterval() {
+        super();
+        initialize();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param i DOCUMENT ME!
+     */
+    public void setFInterval(FInterval i) {
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public FInterval getFInterval() {
+        double from = 0;
+        double to = 0;
+        FInterval i = new FInterval(from, to);
+
+        return i;
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.setSize(300, 200);
+        GridLayout grid = new GridLayout(2,2);
+        JLabel lblMin = new JLabel("Valor m�nimo:");
+		JLabel lblMax = new JLabel("Valor m�ximo:");
+		this.add(lblMin);
+		this.add(m_txtMin);
+		this.add(lblMax);
+		this.add(m_txtMax);
+		
+        
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/PanelEditInterval.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellEditor.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellEditor.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellEditor.java	(revision 1648)
@@ -0,0 +1,147 @@
+/*
+ * Created on 27-abr-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.gui.legendmanager.panels;
+
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.table.TableCellEditor;
+
+
+/**
+ * Clase utilizada para editar un registro.
+ *
+ * @author fjp
+ */
+public class FCellEditor extends AbstractCellEditor implements TableCellEditor,
+	ActionListener {
+	protected static final String EDIT = "edit";
+	FSymbol currentSymbol;
+	JButton button;
+
+	// JColorChooser colorChooser;
+	FPanelLegendDefault m_panelDefault;
+	JDialog dialog;
+
+	/**
+	 * Crea un nuevo FCellEditor.
+	 */
+	public FCellEditor() {
+		button = new JButton();
+		button.setActionCommand(EDIT);
+		button.addActionListener(this);
+		button.setBorderPainted(false);
+
+		//Set up the dialog that the button brings up.
+		dialog = new JDialog();
+		m_panelDefault = new FPanelLegendDefault();
+
+		// m_panelDefault.setMinimumSize(new Dimension(300,20));
+		m_panelDefault.setPreferredSize(new Dimension(500, 300));
+
+		// m_panelDefault.setBounds(0,0,400,260);
+		dialog.getContentPane().setLayout(new BorderLayout());
+
+		// m_panelDefault.setBackground(Color.YELLOW);
+		dialog.getContentPane().add(m_panelDefault, BorderLayout.NORTH);
+
+		// Botones
+		JPanel pButtons = new JPanel();
+		JButton btnOk = new JButton("Aceptar");
+		btnOk.addActionListener(this);
+		btnOk.setActionCommand("OK");
+		pButtons.add(btnOk);
+		dialog.getContentPane().add(pButtons, BorderLayout.SOUTH);
+
+		// dialog.setSize(new Dimension(500,400));
+		dialog.setModal(true);
+		dialog.pack();
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (EDIT.equals(e.getActionCommand())) {
+			//The user has clicked the cell, so
+			//bring up the dialog.
+			button.setBackground(currentSymbol.getColor());
+			m_panelDefault.setVisible(true);
+			m_panelDefault.setFSymbol(currentSymbol);
+
+			// colorChooser.setColor(currentSymbol.m_Color);
+			dialog.setVisible(true);
+
+			fireEditingStopped(); //Make the renderer reappear.
+		} else { //User pressed dialog's "OK" button.
+
+			// currentSymbol.m_Color = colorChooser.getColor();
+			currentSymbol = m_panelDefault.getFSymbol();
+			dialog.dispose();
+		}
+	}
+
+	//Implement the one CellEditor method that AbstractCellEditor doesn't.
+	public Object getCellEditorValue() {
+		return currentSymbol;
+	}
+
+	//Implement the one method defined by TableCellEditor.
+	public Component getTableCellEditorComponent(JTable table, Object value,
+		boolean isSelected, int row, int column) {
+		System.out.println(value.toString());
+		currentSymbol = (FSymbol) value;
+
+		// button.setBackground(currentSymbol.m_Color);
+		return button;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellEditor.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellRenderer.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellRenderer.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellRenderer.java	(revision 1648)
@@ -0,0 +1,119 @@
+/*
+ * Created on 27-abr-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.gui.legendmanager.panels;
+
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+
+import java.awt.Component;
+
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.border.Border;
+import javax.swing.table.TableCellRenderer;
+
+
+/**
+ * Renderer de la edici�n de un registro de la tabla de s�mbolos.
+ *
+ * @author fjp
+ */
+public class FCellRenderer extends JPanel implements TableCellRenderer {
+	Border unselectedBorder = null;
+	Border selectedBorder = null;
+	boolean isBordered = true;
+	protected FPreviewSymbol m_previewPanel = new FPreviewSymbol();
+
+	/**
+	 * Crea un nuevo FCellRenderer.
+	 *
+	 * @param isBordered DOCUMENT ME!
+	 */
+	public FCellRenderer(boolean isBordered) {
+		this.isBordered = isBordered;
+		setOpaque(true); //MUST do this for background to show up.
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param table DOCUMENT ME!
+	 * @param value DOCUMENT ME!
+	 * @param isSelected DOCUMENT ME!
+	 * @param hasFocus DOCUMENT ME!
+	 * @param row DOCUMENT ME!
+	 * @param column DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public Component getTableCellRendererComponent(JTable table, Object value,
+		boolean isSelected, boolean hasFocus, int row, int column) {
+		// System.out.println(value.getClass().toString());								
+		m_previewPanel.setSymbol((FSymbol) value);
+
+		// Color newColor = m_FSymbol.m_Color;
+		// setBackground(newColor);
+		if (isBordered) {
+			if (isSelected) {
+				if (selectedBorder == null) {
+					selectedBorder = BorderFactory.createMatteBorder(2, 5, 2,
+							5, table.getSelectionBackground());
+				}
+
+				setBorder(selectedBorder);
+			} else {
+				if (unselectedBorder == null) {
+					unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2,
+							5, table.getBackground());
+				}
+
+				setBorder(unselectedBorder);
+			}
+		}
+
+		// setToolTipText("RGB value: " + newColor.getRed() + ", " + newColor.getGreen() + ", " + newColor.getBlue());
+		return m_previewPanel;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellRenderer.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendBreaks.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendBreaks.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendBreaks.java	(revision 1648)
@@ -0,0 +1,667 @@
+/*
+ * Created on 30-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.TreeMap;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.apache.log4j.Logger;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.values.DoubleValue;
+import com.hardcode.gdbms.engine.values.FloatValue;
+import com.hardcode.gdbms.engine.values.IntValue;
+import com.hardcode.gdbms.engine.values.LongValue;
+import com.hardcode.gdbms.engine.values.NullValue;
+import com.hardcode.gdbms.engine.values.Value;
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+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.FInterval;
+import com.iver.cit.gvsig.fmap.rendering.Legend;
+import com.iver.cit.gvsig.fmap.rendering.LegendFactory;
+import com.iver.cit.gvsig.fmap.rendering.VectorialIntervalLegend;
+import com.iver.cit.gvsig.gui.Panels.ColorChooserPanel;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author fjp To change the template for this generated type comment go to
+ * 		   Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
+ * 		   Comments
+ */
+public class FPanelLegendBreaks extends JPanel implements ILegendPanel {
+	private static Logger logger = Logger.getLogger(FPanelLegendBreaks.class.getName());
+	final static int EQUAL_INTERVALS = 0;
+	final static int NATURAL_INTERVALS = 1;
+	final static int QUANTILE_INTERVALS = 2;
+	private MyListener listener = new MyListener();
+
+	// private TOC m_TOC;
+	private VectorialIntervalLegend m_Renderer;
+	private ClassifiableVectorial m_lyr;
+	private FSymbolTable m_symbolTable = new FSymbolTable();
+	private JComboBox m_cboFields;
+	private JTextField m_txtNumIntervals;
+	private ColorChooserPanel m_colorChooser1;
+	private ColorChooserPanel m_colorChooser2;
+	private JButton m_btnDeleteAll;
+	private JButton m_btnDelete;
+	private FInterval[] intervals;
+
+	/**
+	 *
+	 */
+	public FPanelLegendBreaks() {
+		super();
+		initComponents();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param numIntervals DOCUMENT ME!
+	 * @param minValue DOCUMENT ME!
+	 * @param maxValue DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	static FInterval[] calculateEqualIntervals(int numIntervals,
+		double minValue, double maxValue) {
+		FInterval[] theIntervalArray = new FInterval[numIntervals];
+		double step = (maxValue - minValue) / numIntervals;
+
+		for (int i = 0; i < numIntervals; i++) {
+			theIntervalArray[i] = new FInterval(minValue + (i * step),
+					minValue + ((i + 1) * step));
+		}
+
+		return theIntervalArray;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	protected void initComponents() {
+		/* JLabel label = new JLabel();
+		   label.setIcon(new javax.swing.ImageIcon(Abrir.class.getClassLoader()
+		                                                                                                      .getResource("images/ValoresUnicos.png")));
+		   limagen[1] = new JLabel();
+		   limagen[1] = label; */
+		JPanel botonestabla = new JPanel();
+
+		JButton btnAddAll = new JButton(PluginServices.getText(this,
+					"Calcular_intervalos"));
+		btnAddAll.setActionCommand("ADD_ALL_VALUES");
+		botonestabla.add(btnAddAll);
+
+		JButton btnAdd = new JButton(PluginServices.getText(this, "Anadir"));
+		btnAdd.setActionCommand("ADD_VALUE");
+		btnAdd.addActionListener(listener);
+		botonestabla.add(btnAdd);
+
+		m_btnDeleteAll = new JButton(PluginServices.getText(this, "Quitar_todos"));
+		m_btnDeleteAll.setActionCommand("REMOVE_ALL");
+		m_btnDeleteAll.addActionListener(listener);
+		botonestabla.add(m_btnDeleteAll);
+
+		m_btnDelete = new JButton(PluginServices.getText(this, "Quitar"));
+		m_btnDelete.setActionCommand("REMOVE");
+		m_btnDelete.addActionListener(listener);
+		botonestabla.add(m_btnDelete);
+
+		m_btnDeleteAll.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
+				public void propertyChange(java.beans.PropertyChangeEvent e) {
+					if ((e.getPropertyName().equals("enabled"))) {
+						System.out.println("propertyChange(enabled)"); // TODO Auto-generated property Event stub "enabled" 
+					}
+				}
+			});
+		m_btnDelete.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
+				public void propertyChange(java.beans.PropertyChangeEvent e) {
+					if ((e.getPropertyName().equals("enabled"))) {
+						System.out.println("propertyChange(enabled)"); // TODO Auto-generated property Event stub "enabled" 
+					}
+				}
+			});
+		btnAddAll.addActionListener(listener);
+
+		JPanel ptabla = new JPanel();
+		ptabla.setLayout(new BorderLayout());
+
+		m_cboFields = new JComboBox();
+		m_cboFields.setActionCommand("FIELD_SELECTED");
+		m_cboFields.addActionListener(listener);
+		m_cboFields.setVisible(true);
+
+		JPanel pAux1 = new JPanel();
+
+		/* pAux1.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
+		   "Campo de clasificaci�n",
+		   javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+		   javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); */
+
+		// pAux1.setPreferredSize(new Dimension(300,50));
+		GridBagLayout gridBag = new GridBagLayout();
+		pAux1.setLayout(gridBag);
+
+		GridBagConstraints c = new GridBagConstraints();
+
+		c.anchor = GridBagConstraints.WEST;
+
+		JLabel lblFieldClassification = new JLabel(PluginServices.getText(this,
+					"Campo_de_clasificacion"));
+		c.gridx = 0;
+		c.gridy = 0;
+		c.insets = new Insets(5, 5, 2, 2);
+		c.gridwidth = 1;
+		gridBag.setConstraints(lblFieldClassification, c);
+		pAux1.add(lblFieldClassification);
+
+		c.gridx = 1;
+		c.gridy = 0;
+		gridBag.setConstraints(m_cboFields, c);
+		pAux1.add(m_cboFields);
+
+		JLabel lblNumIntervals = new JLabel(PluginServices.getText(this,
+					"No_de_intervalos") + ":");
+		c.gridx = 3;
+		c.gridy = 0;
+		gridBag.setConstraints(lblNumIntervals, c);
+		pAux1.add(lblNumIntervals);
+
+		m_txtNumIntervals = new JTextField(4);
+		c.gridx = 4;
+		c.gridy = 0;
+		gridBag.setConstraints(m_txtNumIntervals, c);
+		m_txtNumIntervals.setText("5");
+		pAux1.add(m_txtNumIntervals);
+
+		c.insets = new Insets(2, 2, 2, 2);
+
+		JLabel lblColor1 = new JLabel(PluginServices.getText(this, "Color_inicio") +
+				":");
+		c.gridx = 0;
+		c.gridy = 1;
+		gridBag.setConstraints(lblColor1, c);
+		pAux1.add(lblColor1);
+
+		m_colorChooser1 = new ColorChooserPanel();
+		m_colorChooser1.setColor(Color.red);
+		m_colorChooser1.setAlpha(255);
+		c.gridx = 1;
+		c.gridy = 1;
+		gridBag.setConstraints(m_colorChooser1, c);
+		pAux1.add(m_colorChooser1);
+
+		JLabel lblColor2 = new JLabel(PluginServices.getText(this, "Color_final") +
+				":");
+		c.gridx = 3;
+		c.gridy = 1;
+		gridBag.setConstraints(lblColor2, c);
+		pAux1.add(lblColor2);
+
+		m_colorChooser2 = new ColorChooserPanel();
+		m_colorChooser2.setColor(Color.blue);
+		m_colorChooser2.setAlpha(255);
+		c.gridx = 4;
+		c.gridy = 1;
+		gridBag.setConstraints(m_colorChooser2, c);
+		pAux1.add(m_colorChooser2);
+
+		ptabla.add(m_symbolTable, BorderLayout.CENTER);
+		this.setLayout(new BorderLayout());
+		this.add(pAux1, BorderLayout.NORTH);
+		this.add(ptabla, BorderLayout.CENTER);
+		this.add(botonestabla, BorderLayout.SOUTH);
+	}
+
+	/**
+	 * Damos una primera pasada para saber los l�mites inferior y superior y
+	 * rellenar un array con los valores. Luego dividimos ese array en
+	 * intervalos.
+	 */
+	private void fillTableValues() {
+		FInterval[] arrayIntervalos = null;
+		DataSource elRs;
+		m_symbolTable.removeAllItems();
+		
+		try {
+			elRs = ((AlphanumericData) m_lyr).getRecordset();
+			logger.debug("elRs.start()");
+			elRs.start();
+
+			int idField = -1;
+
+			int numIntervalos = Integer.parseInt(m_txtNumIntervals.getText());
+			int tipoClasificacion = EQUAL_INTERVALS;
+
+			String fieldName = (String) m_cboFields.getSelectedItem();
+			System.out.println("Nombre del campo de clasificaci�n: " +
+				fieldName);
+			m_Renderer.setFieldName(fieldName);
+
+			String nomField = m_Renderer.getFieldName();
+
+			// Cogemos el tipo de gradaci�n de colores que quiere el usuario y 
+			// Creamos el primer y �ltimo color.
+			Color startColor = m_colorChooser1.getColor();
+			m_Renderer.setStartColor(startColor);
+			Color endColor = m_colorChooser2.getColor();
+			m_Renderer.setEndColor(endColor);
+			int r;
+			int g;
+			int b;
+			int stepR;
+			int stepG;
+			int stepB;
+			r = startColor.getRed();
+			g = startColor.getGreen();
+			b = startColor.getBlue();
+			stepR = (endColor.getRed() - r) / numIntervalos;
+			stepG = (endColor.getGreen() - g) / numIntervalos;
+			stepB = (endColor.getBlue() - b) / numIntervalos;
+
+			for (int i = 0; i < elRs.getFieldCount(); i++) {
+				String nomAux = elRs.getFieldName(i).trim();
+
+				if (nomField.compareToIgnoreCase(nomAux) == 0) {
+					idField = i;
+
+					break;
+				}
+			}
+
+			if (idField == -1) {
+				System.err.println("Campo no reconocido " + nomField);
+
+				return;
+			}
+
+			///m_symbolTable.removeAllItems();
+			///m_valuesCache = new Object[m_lyr.getSource().getShapeCount()];
+
+			int numSymbols = 0;
+			FSymbol theSymbol;
+			Date valorDate;
+			double minValue = Double.MAX_VALUE;
+			double maxValue = Double.MIN_VALUE;
+			Date minValueDate = null;
+			Date maxValueDate = null;
+
+			VectorialIntervalLegend auxLegend;
+			auxLegend = LegendFactory.createVectorialIntervalLegend(m_lyr.getShapeType());
+			
+			Value clave;
+			Object resul;
+			int symbolType = 0;
+			
+
+			for (int j = 0; j < elRs.getRowCount(); j++) {
+				clave = elRs.getFieldValue(j, idField);
+
+				FInterval interval = auxLegend.getInterval(clave);
+
+				////Comprobar que no esta repetido y no hace falta introducir en el hashtable el campo junto con el simbolo.
+				if (auxLegend.getSymbolByInterval(interval) == null) {
+					//si no esta creado el simbolo se crea
+					double valor=0;
+					symbolType = m_lyr.getShapeType();
+
+					if (clave.getClass().getName() == "com.hardcode.gdbms.engine.values.IntValue") {
+						valor = ((IntValue) clave).getValue();
+					} else if (clave.getClass().getName() == "com.hardcode.gdbms.engine.values.DoubleValue") {
+						valor = ((DoubleValue) clave).getValue();
+					} else if (clave.getClass().getName() == "com.hardcode.gdbms.engine.values.FloatValue") {
+						valor = ((FloatValue) clave).getValue();
+					} else if (clave.getClass().getName() == "com.hardcode.gdbms.engine.values.LongValue") {
+						valor = ((LongValue) clave).getValue();
+					} else if (clave.getClass().getName() == "com.hardcode.gdbms.engine.values.DateValue") {
+						//TODO POR IMPLEMENTAR
+						///valorDate = elRs.getFieldValueAsDate(idField);
+						///if (valorDate.before(minValueDate)) minValueDate = valorDate;
+						///if (valorDate.after(maxValueDate)) maxValueDate = valorDate;
+					}
+					if (valor < minValue) {
+						minValue = (double) valor;
+					}
+					if (valor > maxValue) {
+						maxValue = (double) valor;
+					}
+				}
+			}
+
+			switch (tipoClasificacion) {
+				case EQUAL_INTERVALS:
+					arrayIntervalos = calculateEqualIntervals(numIntervalos,
+							minValue, maxValue);
+
+					break;
+
+				case NATURAL_INTERVALS:
+
+					// POR HACER
+					break;
+			}
+
+			intervals = arrayIntervalos;
+
+			FInterval elIntervalo;
+			NumberFormat.getInstance().setMaximumFractionDigits(2);
+			m_Renderer.clear();
+			for (int k = 0; k < arrayIntervalos.length; k++) {
+				elIntervalo = arrayIntervalos[k];
+
+				// clave = elIntervalo; // elIntervalo.getMin() + " - " + elIntervalo.getMax();
+				// System.out.println("k = " + k + " clave = " + clave);
+				////Comprobar que no esta repetido y no hace falta introducir en el hashtable el campo junto con el simbolo.
+				// if (!m_Renderer.m_symbolList.containsKey(elIntervalo)) {
+				//si no esta creado el simbolo se crea
+				theSymbol = new FSymbol(symbolType, new Color(r, g, b));
+				theSymbol.setDescription(NumberFormat.getInstance().format(elIntervalo.getMin()) +
+					" - " +
+					NumberFormat.getInstance().format(elIntervalo.getMax()));
+
+				//////////////////////////////////////
+				// CALCULAMOS UN COLOR APROPIADO
+				r = r + stepR;
+				g = g + stepG;
+				b = b + stepB;
+
+				/////////////////////////////////
+				m_Renderer.addSymbol(elIntervalo, theSymbol);
+				System.out.println("addSymbol = "+elIntervalo+" theSymbol = "+theSymbol.getDescription());
+				numSymbols++;
+
+				if (numSymbols > 100) {
+					JOptionPane.showMessageDialog(this,
+						"M�s 100 de s�mbolos no aportan informaci�n en un plano. Por favor, revise el campo seleccionado.");
+
+					break;
+				}
+
+				// }
+			} // for
+
+			System.out.println("Num. Simbolos = " +
+				m_Renderer.getValues().length);
+			m_symbolTable.fillTableFromSymbolList(m_Renderer.getSymbols(),
+				m_Renderer.getValues(), m_Renderer.getDescriptions());
+			elRs.stop();
+		} catch (DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (com.hardcode.gdbms.engine.data.DriverException e) {
+			e.printStackTrace();
+		}
+
+		m_btnDeleteAll.setEnabled(true);
+		m_btnDelete.setEnabled(true);
+	}
+
+	/**
+	 * A partir de los registros de la tabla, regenera el FRenderer. (No solo
+	 * el symbolList, si no tambi�n el arrayKeys y el defaultRenderer
+	 */
+	private void fillSymbolListFromTable() {
+		String clave;
+		FSymbol theSymbol;
+		FInterval theInterval = null;
+
+		// Borramos las anteriores listas:
+		m_Renderer.clear();
+
+		boolean bRestoValores = false; // PONERLO EN UN CHECKBOX
+		double from = 0;
+		double to = 0;
+		String[] arraySplit = new String[2];
+		int hasta;
+		String fieldName = (String) m_cboFields.getSelectedItem();
+		m_Renderer.setFieldName(fieldName);
+
+		if (bRestoValores) {
+			hasta = m_symbolTable.getRowCount() - 1;
+		} else {
+			hasta = m_symbolTable.getRowCount();
+		}
+
+		for (int row = 0; row < m_symbolTable.getRowCount(); row++) {
+			// clave = m_symbolTable.getFieldValue(row,1);
+			theInterval = (FInterval) m_symbolTable.getFieldValue(row, 1);
+			theSymbol = (FSymbol) m_symbolTable.getFieldValue(row, 0);
+			theSymbol.setDescription((String) m_symbolTable.getFieldValue(row, 2));
+			m_Renderer.addSymbol(theInterval, theSymbol);
+
+			///m_Renderer.m_legendIntervals.add(theInterval);
+		}
+
+		if (bRestoValores) {
+			//m_Renderer.m_bUseDefaultSymbol = true;
+			theSymbol = (FSymbol) m_symbolTable.getFieldValue(hasta, 0);
+			m_Renderer.setDefaultSymbol(theSymbol);
+		}
+	}
+
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	private void fillFieldNames() {
+		DataSource rs = null;
+		ArrayList nomFields = null;
+
+		try {
+			rs = ((AlphanumericData) m_lyr).getRecordset();
+			logger.debug("rs.start()");
+			rs.start();
+
+			nomFields = new ArrayList();
+			Value val;
+
+			for (int i = 0; i < rs.getFieldCount(); i++) {
+				//TODO deber�a de existir un getFieldType
+				val = rs.getFieldValue(0,i);
+				if (val.getClass() == NullValue.class) continue;
+				if ((val.getClass() == IntValue.class) ||
+						(val.getClass() == DoubleValue.class) ||
+						(val.getClass() == FloatValue.class) ||
+						(val.getClass() == LongValue.class)) {
+					nomFields.add(rs.getFieldName(i).trim());
+				}
+			}
+
+			rs.stop();
+		} catch (com.hardcode.gdbms.engine.data.DriverException e1) {
+			e1.printStackTrace();
+		} catch (DriverException e) {
+			e.printStackTrace();
+		}
+
+		/*        ArrayList nomFields = new ArrayList();
+		   for (int i = 0; i < rs.getFieldsCount(); i++) {
+		           if ((rs.getFieldType(i) == FRecordset.INTEGER) ||
+		                   (rs.getFieldType(i) == FRecordset.DECIMAL) ||
+		                   (rs.getFieldType(i) == FRecordset.DATE))
+		           {
+		                   nomFields.add(rs.getFieldName(i).trim());
+		           }
+		
+		   }
+		 */
+		DefaultComboBoxModel cM = new DefaultComboBoxModel(nomFields.toArray());
+		m_cboFields.setModel(cM);
+
+		// fieldsListValor.setSelectedIndex(0);
+		m_symbolTable.removeAllItems();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#setLayer(com.iver.cit.gvsig.fmap.layers.FLayer,
+	 * 		com.iver.cit.gvsig.fmap.rendering.Legend)
+	 */
+	public void setLayer(FLayer lyr, Legend r) {
+		//		 m_TOC = t;
+		// OJO, COMPROBAR ANTES SI ES DE TIPO VECTORIAL
+		// m_lyr = (FLyrVect) t.getFirstLyrVectSelected();
+		m_lyr = (ClassifiableVectorial) lyr;
+		fillFieldNames();
+
+		if (r instanceof VectorialIntervalLegend) {
+			m_Renderer = (VectorialIntervalLegend) r;
+			m_cboFields.getModel().setSelectedItem(m_Renderer.getFieldName());
+			m_symbolTable.fillTableFromSymbolList(m_Renderer.getSymbols(),
+				m_Renderer.getValues(), m_Renderer.getDescriptions());
+			m_colorChooser1.setColor(m_Renderer.getStartColor());
+			m_colorChooser2.setColor(m_Renderer.getEndColor());
+			m_colorChooser1.repaint();
+			m_colorChooser2.repaint();
+		} else {
+			try {
+				// Si la capa viene con otro tipo de leyenda, creamos
+				// una nueva del tipo que maneja este panel
+				m_Renderer = new VectorialIntervalLegend(m_lyr.getShapeType());
+			} catch (DriverException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#getLegend()
+	 */
+	public Legend getLegend() {
+		fillSymbolListFromTable();
+
+		return m_Renderer;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @author Vicente Caballero Navarro
+	 */
+	class MyListener implements ActionListener {
+		//private FLyrShp m_layer;
+		// private FPanelLegendValues m_Parent;
+		public MyListener() { // FPanelLegendValues p) {
+
+			// m_Parent = p;
+		}
+
+		/**
+		 * DOCUMENT ME!
+		 *
+		 * @param e DOCUMENT ME!
+		 */
+		public void actionPerformed(ActionEvent e) {
+			// rellenarValue();
+			System.out.println("ActionEvent con " + e.getActionCommand());
+
+			//modificar el combobox de valor
+			if (e.getActionCommand() == "FIELD_SELECTED") {
+				JComboBox cb = (JComboBox) e.getSource();
+				String fieldName = (String) cb.getSelectedItem();
+				System.out.println("Nombre del campo: " + fieldName);
+				m_symbolTable.removeAllItems();
+
+				m_Renderer.setFieldName(fieldName);
+			}
+
+			//A�adir todos los elementos por valor
+			if (e.getActionCommand() == "ADD_ALL_VALUES") {
+				fillTableValues();
+			}
+
+			//A�adir un �nico elemento
+			if (e.getActionCommand() == "ADD_VALUE") {
+				/*        a�adir("Nuevo_Valor");
+				   aceptar.setEnabled(true);
+				   quitartodo.setEnabled(true);
+				   quitar.setEnabled(true); */
+			}
+
+			//Vacia la tabla
+			if (e.getActionCommand() == "REMOVE_ALL") {
+				m_symbolTable.removeAllItems();
+
+				// aceptar.setEnabled(false);
+			}
+
+			//Quitar solo el elemento seleccionado
+			if (e.getActionCommand() == "REMOVE") {
+				m_symbolTable.removeSelectedRows();
+			}
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendBreaks.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPreviewSymbol.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPreviewSymbol.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPreviewSymbol.java	(revision 1648)
@@ -0,0 +1,167 @@
+/*
+ * Created on 28-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.JComponent;
+
+import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+
+
+/**
+ * @author fjp
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+public class FPreviewSymbol extends JComponent {
+	
+	private  FSymbol m_FSymbol;
+	private String m_Str;
+	private boolean m_bUseFSymbol;
+	
+
+	/**
+	 * 
+	 */
+	public FPreviewSymbol() {
+		super();
+			initialize();
+	// this.setDoubleBuffered(true);		
+		this.setBackground(Color.WHITE);
+		this.setForeground(Color.BLACK);
+	}
+
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+        this.setSize(70, 52);
+			
+	}
+	protected void paintComponent(Graphics g) {		
+		super.paintComponent(g);
+		if (m_FSymbol == null)
+		{
+			return;
+		}
+		// Seg�n el tipo de s�mbolo, creamos un shape u otro y utilizamos
+		// la funci�n com�n de dibujado de shape sobre un graphics con un simbolo
+		
+		Graphics2D g2 = (Graphics2D) g;
+		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		
+		
+		g.setClip(0,0,getWidth(), getHeight());
+		Rectangle r = g.getClipBounds(); //getClipRect();
+		// g.clipRect(r.x, r.y, r.width, r.height);
+		// g.setColor(Color.WHITE);
+		// g2.fillRect(0, 0,getWidth(), getHeight());
+		if (m_bUseFSymbol)
+		{
+			AffineTransform mT2 = AffineTransform.getScaleInstance(0.8, 0.8);
+			mT2.concatenate(AffineTransform.getTranslateInstance(r.width * 0.1, r.height * 0.1 ));				
+			       
+			FGraphicUtilities.DrawSymbol((Graphics2D)g,mT2,r,m_FSymbol);	
+		}
+		else
+		{
+			FontMetrics metrics = g2.getFontMetrics();
+			int width = metrics.stringWidth(m_Str );
+			int height = metrics.getMaxAscent();
+			// g2.setFont(theSymbol.m_Font);
+
+			g2.drawString(m_Str, (float) r.getCenterX()-width/2, (float) r.getCenterY() +3);			
+		}
+		
+	}
+
+	/**
+	 * @param symbol
+	 */
+	public void setSymbol(FSymbol symbol) {
+		// Lo clonamos para que si viene en coordenadas de mundo real
+		// (m_bUseSize = true), dibujarlo con un tama�o fijo en pixels.
+		
+		FSymbol cloneSym = symbol.fastCloneSymbol();
+		if (!cloneSym.isSizeInPixels())
+		{
+			cloneSym.setSizeInPixels(true);
+			cloneSym.setSize(10); // pixels
+		}
+		
+		m_FSymbol = cloneSym;
+		m_bUseFSymbol = true;
+		
+		repaint();
+	}
+	
+	public void setTextDescrip(String str)
+	{
+		m_bUseFSymbol = false;
+		m_Str = str;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.awt.Component#isShowing()
+	 */
+	public boolean isShowing() {
+		// TODO Auto-generated method stub
+		return true; // super.isShowing();
+	}
+}  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPreviewSymbol.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FIntervalCellEditor.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FIntervalCellEditor.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FIntervalCellEditor.java	(revision 1648)
@@ -0,0 +1,135 @@
+/*
+ * Created on 27-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.table.TableCellEditor;
+
+import com.iver.cit.gvsig.fmap.rendering.FInterval;
+
+/**
+ * @author fjp
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+public class FIntervalCellEditor  extends AbstractCellEditor
+						 implements TableCellEditor,
+									ActionListener {
+	FInterval currentInterval;
+	PanelEditInterval m_panelDefault;
+	JButton button;
+	JDialog m_dlgEditor;
+	protected static final String EDIT = "edit";
+
+	public FIntervalCellEditor() {
+		button = new JButton();
+		button.setActionCommand(EDIT);
+		button.addActionListener(this);
+		button.setBorderPainted(false);
+
+		//Set up the dialog that the button brings up.
+		m_dlgEditor = new JDialog();
+		m_panelDefault = new PanelEditInterval();
+		m_dlgEditor.getContentPane().add(m_panelDefault, BorderLayout.NORTH);
+		
+		// Botones
+		JPanel pButtons = new JPanel();
+		JButton btnOk = new JButton("Aceptar");
+		btnOk.addActionListener(this);
+		btnOk.setActionCommand("OK");
+		pButtons.add(btnOk);
+		m_dlgEditor.getContentPane().add(pButtons,BorderLayout.SOUTH);
+		m_dlgEditor.setSize(new Dimension(500,400));
+		m_dlgEditor.setModal(true);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (EDIT.equals(e.getActionCommand())) {
+			//The user has clicked the cell, so
+			//bring up the dialog.
+			m_panelDefault.setFInterval(currentInterval);
+			m_dlgEditor.setVisible(true);
+
+			fireEditingStopped(); //Make the renderer reappear.
+
+		} else { //User pressed dialog's "OK" button.
+			currentInterval = m_panelDefault.getFInterval();
+			m_dlgEditor.dispose();
+		}
+	}
+
+	//Implement the one CellEditor method that AbstractCellEditor doesn't.
+	public Object getCellEditorValue() {
+		
+		return currentInterval;
+	}
+
+	//Implement the one method defined by TableCellEditor.
+	public Component getTableCellEditorComponent(JTable table,
+												 Object value,
+												 boolean isSelected,
+												 int row,
+												 int column) {
+												 	
+		System.out.println(value.toString());												 	
+		currentInterval = (FInterval )value;
+		// button.setBackground(currentSymbol.m_Color);
+		return button;
+	}
+}
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FIntervalCellEditor.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FSymbolTable.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FSymbolTable.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FSymbolTable.java	(revision 1648)
@@ -0,0 +1,311 @@
+/*
+ * Created on 27-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+/**
+ * @author fjp
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+
+/*
+ * TableRenderDemo.java is a 1.4 application that requires no other files.
+ */
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+
+
+
+public class FSymbolTable extends JPanel {
+
+	private boolean DEBUG = true;
+	
+	// private  MyTableModel m_TableModel;
+	
+	private JTable table;
+	
+	
+	public void addRow(Object[] vector)
+	{
+		MyTableModel m = (MyTableModel) table.getModel();
+		m.addRow(vector); 
+	}
+	public void removeSelectedRows()
+	{
+		MyTableModel m = (MyTableModel) table.getModel();
+		int [] selectedRows = table.getSelectedRows();
+		for (int i=selectedRows.length-1; i >= 0; i--)
+		{
+			m.removeRow(selectedRows[i]);
+		}
+	}
+	
+	public void fillTableFromSymbolList(FSymbol[] symbols, Object[] values, String[] descriptions)
+	{	
+		// Object clave;
+		FSymbol theSymbol; 
+
+		for (int i=0; i < symbols.length; i++)
+		{ 
+			theSymbol = symbols[i];
+			Object[] theRow = new Object[3];
+			theRow[0] = theSymbol;
+			theRow[1] = values[i];
+			theRow[2] = descriptions[i];
+			addRow(theRow);
+		}
+		
+	}
+	
+	
+	public Object getFieldValue(int row, int col)
+	{
+		MyTableModel m = (MyTableModel) table.getModel();
+		return m.getValueAt(row, col); 
+	}
+	public int getRowCount()
+	{
+		MyTableModel m = (MyTableModel) table.getModel();
+		return m.getRowCount(); 
+	}
+	
+	public void removeAllItems()
+	{
+		table.setModel(new MyTableModel());
+		setUpSymbolColumn(table, table.getColumnModel().getColumn(0));		
+	}
+
+	public FSymbolTable() {
+		super(new GridLayout(1,0));
+		
+
+		table = new JTable(new MyTableModel());
+		table.setPreferredScrollableViewportSize(new Dimension(500, 70));
+
+		//Create the scroll pane and add the table to it.
+		JScrollPane scrollPane = new JScrollPane(table);
+
+		//Set up column sizes.
+		initColumnSizes(table);
+		
+		setUpSymbolColumn(table, table.getColumnModel().getColumn(0));
+
+		//Add the scroll pane to this panel.
+		add(scrollPane);
+		
+		table.setRowSelectionAllowed(true);
+	}
+
+	/*
+	 * This method picks good column sizes.
+	 * If all column heads are wider than the column's cells'
+	 * contents, then you can just use column.sizeWidthToFit().
+	 */
+	private void initColumnSizes(JTable table) {
+		MyTableModel model = (MyTableModel)table.getModel();
+		TableColumn column = null;
+		Component comp = null;
+		int headerWidth = 0;
+		int cellWidth = 0;
+		TableCellRenderer headerRenderer =
+			table.getTableHeader().getDefaultRenderer();
+
+		/* for (int i = 0; i < table.getColumnCount(); i++) {
+			column = table.getColumnModel().getColumn(i);
+
+			comp = headerRenderer.getTableCellRendererComponent(
+								 null, column.getHeaderValue(),
+								 false, false, 0, 0);
+			headerWidth = comp.getPreferredSize().width;
+
+			comp = table.getDefaultRenderer(model.getColumnClass(i)).
+							 getTableCellRendererComponent(
+								 table, longValues[i],
+								 false, false, 0, i);
+			cellWidth = comp.getPreferredSize().width;
+
+			if (DEBUG) {
+				System.out.println("Initializing width of column "
+								   + i + ". "
+								   + "headerWidth = " + headerWidth
+								   + "; cellWidth = " + cellWidth);
+			}
+
+			//XXX: Before Swing 1.1 Beta 2, use setMinWidth instead.
+			column.setPreferredWidth(Math.max(headerWidth, cellWidth));
+		} */
+	}
+
+	public void setUpSymbolColumn(JTable table,
+								 TableColumn m_FSymbolComlumn) {
+		//Set up the editor 
+		/* JComboBox comboBox = new JComboBox();
+		comboBox.addItem("Snowboarding");
+		comboBox.addItem("Rowing");
+		comboBox.addItem("Knitting");
+		comboBox.addItem("Speed reading");
+		comboBox.addItem("Pool");
+		comboBox.addItem("None of the above");
+		sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
+
+		//Set up tool tips 
+		DefaultTableCellRenderer renderer =
+				new DefaultTableCellRenderer();
+		renderer.setToolTipText("Click for combo box"); */
+		
+		
+		m_FSymbolComlumn.setMaxWidth(100);
+		m_FSymbolComlumn.setWidth(60);
+		m_FSymbolComlumn.setPreferredWidth(60);
+		m_FSymbolComlumn.setMinWidth(50);
+		
+		FCellEditor editor = new FCellEditor();
+		m_FSymbolComlumn.setCellEditor(editor);
+		
+		FCellRenderer renderer = new FCellRenderer(true);
+		m_FSymbolComlumn.setCellRenderer(renderer);
+	}
+
+	class MyTableModel extends DefaultTableModel { //  AbstractTableModel {
+	
+		private String[] columnNames = {PluginServices.getText(this,"Simbolo"),
+				PluginServices.getText(this,"Valor"),
+				PluginServices.getText(this,"Etiqueta") };
+
+		public int getColumnCount() {
+			return columnNames.length;
+		}
+
+		public String getColumnName(int col) {
+			return columnNames[col];
+		}
+
+		/*
+		 * JTable uses this method to determine the default renderer/
+		 * editor for each cell.  If we didn't implement this method,
+		 * then the last column would contain text ("true"/"false"),
+		 * rather than a check box.
+		 */
+		public Class getColumnClass(int c) {
+			return getValueAt(0, c).getClass();
+		}
+
+		/*
+		 * Don't need to implement this method unless your table's
+		 * editable.
+		 */
+		public boolean isCellEditable(int row, int col) {
+			//Note that the data/cell address is constant,
+			//no matter where the cell appears onscreen.
+			//if (col > 0) {
+				return true;
+			/* } else {
+				return false;
+			} */
+		}
+
+		/*
+		 * Don't need to implement this method unless your table's
+		 * data can change.
+		 */
+		/* public void setValueAt(Object value, int row, int col) {
+			if (DEBUG) {
+				System.out.println("Setting value at " + row + "," + col
+								   + " to " + value
+								   + " (an instance of "
+								   + value.getClass() + ")");
+			}
+			// FSymbol theSymbol;
+			switch (col)
+			{
+				case 0: // Simbolo
+					// m_FRenderer.setValueSymbol(row,(FSymbol) value);
+					break;
+				case 1: // Clave
+					FInterval newInterval = FInterval.parseString((String) value);
+					this.setValueAt(newInterval,row,col);
+					break;
+				case 2: // Etiqueta
+					// theSymbol = m_FRenderer.getSymbolByID(row);
+					// theSymbol.m_Descrip = (String) value;
+					
+			}
+			// data[row][col] = value;
+			fireTableCellUpdated(row, col); 
+
+		}  */
+
+		/* private void printDebugData() {
+			int numRows = getRowCount();
+			int numCols = getColumnCount();
+
+			for (int i=0; i < numRows; i++) {
+				System.out.print("    row " + i + ":");
+				for (int j=0; j < numCols; j++) {
+					System.out.print("  " + data[i][j]);
+				}
+				System.out.println();
+			}
+			System.out.println("--------------------------");
+		} */
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FSymbolTable.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendValues.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendValues.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendValues.java	(revision 1648)
@@ -0,0 +1,392 @@
+/*
+ * Created on 30-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.apache.log4j.Logger;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.data.DriverException;
+import com.hardcode.gdbms.engine.instruction.FieldNotFoundException;
+import com.hardcode.gdbms.engine.values.Value;
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+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.Legend;
+import com.iver.cit.gvsig.fmap.rendering.LegendFactory;
+import com.iver.cit.gvsig.fmap.rendering.VectorialUniqueValueLegend;
+
+/**
+ * @author fjp
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+public class FPanelLegendValues extends JPanel implements ILegendPanel {
+	private static Logger logger = Logger.getLogger(FPanelLegendValues.class.getName());
+	private MyListener listener = new MyListener();
+	// private TOC m_TOC;
+	private VectorialUniqueValueLegend m_Renderer;
+	private ClassifiableVectorial m_lyr;
+	private boolean m_bCacheDirty = true;
+	
+	private FSymbolTable m_symbolTable = new FSymbolTable();
+
+	private JComboBox m_cboFields;
+	
+	private JButton quitartodo;
+	private JButton quitar;
+	
+	
+	
+	class MyListener implements ActionListener 
+	{
+		//private FLyrShp m_layer;
+		// private FPanelLegendValues m_Parent;
+
+		public MyListener() { // FPanelLegendValues p) {
+			// m_Parent = p;
+		}
+
+		public void actionPerformed(ActionEvent e) {
+
+			// rellenarValue();
+			System.out.println("ActionEvent con " + e.getActionCommand());
+
+			//modificar el combobox de valor
+			if (e.getActionCommand() == "FIELD_SELECTED") {
+				JComboBox cb = (JComboBox) e.getSource();
+				String fieldName = (String) cb.getSelectedItem();
+				System.out.println("Nombre del campo: " + fieldName);
+				m_symbolTable.removeAllItems();
+				if (fieldName != m_Renderer.getFieldName())
+					m_bCacheDirty = true;
+				m_Renderer.setFieldName(fieldName);
+			}
+
+
+			//A�adir todos los elementos por valor
+			if (e.getActionCommand() == "ADD_ALL_VALUES") {
+				fillTableValues();
+			}
+
+			//A�adir un �nico elemento
+			if (e.getActionCommand() == "ADD_VALUE") {
+			/*	a�adir("Nuevo_Valor");
+				aceptar.setEnabled(true);
+				quitartodo.setEnabled(true);
+				quitar.setEnabled(true); */
+			}
+
+			//Vacia la tabla
+			if (e.getActionCommand() == "REMOVE_ALL") {
+				m_symbolTable.removeAllItems();
+				// aceptar.setEnabled(false);
+			}
+
+			//Quitar solo el elemento seleccionado
+			if (e.getActionCommand() == "REMOVE") {
+				m_symbolTable.removeSelectedRows();
+			}
+
+		}
+	}
+
+	/**
+	 * 
+	 */
+	public FPanelLegendValues() {
+		super();
+		initComponents();
+	}
+	protected void initComponents()
+	{
+		/* JLabel label = new JLabel();
+		label.setIcon(new javax.swing.ImageIcon(Abrir.class.getClassLoader()
+														   .getResource("images/ValoresUnicos.png")));
+		limagen[1] = new JLabel();
+		limagen[1] = label; */
+
+		JPanel botonestabla = new JPanel();
+		
+
+		JButton btnAddAll = new JButton(PluginServices.getText(this,"Anadir_todos"));
+		btnAddAll.setActionCommand("ADD_ALL_VALUES");
+		btnAddAll.addActionListener(listener);
+		botonestabla.add(btnAddAll);
+
+		JButton btnAdd = new JButton(PluginServices.getText(this,"Anadir"));
+		btnAdd.setActionCommand("ADD_VALUE");
+		btnAdd.addActionListener(listener);
+		botonestabla.add(btnAdd);
+
+		quitartodo = new JButton(PluginServices.getText(this,"Quitar_todos"));
+		quitartodo.setActionCommand("REMOVE_ALL");
+		quitartodo.addActionListener(listener);
+		botonestabla.add(quitartodo);
+
+		quitar = new JButton(PluginServices.getText(this,"Quitar"));
+		quitar.setActionCommand("REMOVE");
+		quitar.addActionListener(listener);
+		botonestabla.add(quitar);
+
+		
+		JPanel ptabla = new JPanel();		
+		ptabla.setLayout(new BorderLayout());
+		
+		m_cboFields = new JComboBox();
+		m_cboFields.setActionCommand("FIELD_SELECTED");
+		m_cboFields.addActionListener(listener);
+		m_cboFields.setVisible(true);
+		JPanel pAux1 = new JPanel();
+		/* pAux1.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
+				"Campo de clasificaci�n",
+				javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+				javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); */
+		pAux1.setPreferredSize(new Dimension(300,50));
+		JLabel lblFieldClassification = new JLabel(PluginServices.getText(this,"Campo_de_clasificacion"));
+		pAux1.add(lblFieldClassification); 		 
+		pAux1.add(m_cboFields);
+		
+		
+
+		
+		ptabla.add(m_symbolTable, BorderLayout.CENTER);
+		m_symbolTable.setPreferredSize(new Dimension(400, 200));
+		this.setLayout(new BorderLayout());
+		this.add(pAux1, BorderLayout.NORTH);
+		this.add(ptabla, BorderLayout.CENTER);
+		this.add(botonestabla, BorderLayout.SOUTH);
+	}
+	private void fillTableValues()
+	{
+		DataSource elRs;
+		try {
+			elRs = ((AlphanumericData)m_lyr).getRecordset();
+			logger.debug("elRs.start()");
+			elRs.start();
+			int idField = -1;
+			String fieldName = (String) m_cboFields.getSelectedItem();
+			System.out.println("Nombre del campo: " + fieldName);
+			idField = elRs.getFieldIndexByName(fieldName);
+			m_Renderer.setFieldName(fieldName);
+			long numReg = elRs.getRowCount();
+			
+			if (idField == -1)
+			{		
+				System.err.println("Campo no reconocido " + fieldName);
+				return;
+			}
+			
+			m_symbolTable.removeAllItems();
+			int numSymbols = 0;
+			FSymbol theSymbol = null;
+			
+			VectorialUniqueValueLegend auxLegend;
+			auxLegend = LegendFactory.createVectorialUniqueValueLegend(m_lyr.getShapeType());
+			Value clave;
+			Object resul;
+			
+			for (int j = 0; j < elRs.getRowCount(); j++)
+			{
+				clave = elRs.getFieldValue(j,idField);	
+				////Comprobar que no esta repetido y no hace falta introducir en el hashtable el campo junto con el simbolo.
+				if (auxLegend.getSymbolByValue(clave) == null) {
+					//si no esta creado el simbolo se crea
+					theSymbol = new FSymbol(m_lyr.getShapeType());
+									
+					theSymbol.setDescription(clave.toString());
+					auxLegend.addSymbol(clave,theSymbol);
+									
+					numSymbols++;
+	
+					if (numSymbols > 100) {
+						JOptionPane.showMessageDialog(this,
+							"M�s 100 de s�mbolos no aportan informaci�n en un plano. Por favor, revise el campo seleccionado.");
+						break;
+					}
+				}
+			} // for
+	
+			m_symbolTable.fillTableFromSymbolList(auxLegend.getSymbols(),
+				auxLegend.getValues(), auxLegend.getDescriptions());
+			elRs.stop();
+		} catch (DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (com.iver.cit.gvsig.fmap.DriverException e) {
+			e.printStackTrace();
+		} catch (FieldNotFoundException e) {
+			e.printStackTrace();
+		}
+
+		quitartodo.setEnabled(true);
+		quitar.setEnabled(true);	
+		
+		m_bCacheDirty = false;	
+			
+		
+	}
+	/**
+	 * A partir de los registros de la tabla, regenera el FRenderer. (No solo
+	 * el symbolList, si no tambi�n el arrayKeys y el defaultRenderer
+	 */
+	private void fillSymbolListFromTable()
+	{	
+		Value clave;
+		FSymbol theSymbol; 
+		
+		// Borramos las anteriores listas:
+		m_Renderer.clear();
+		boolean bRestoValores = false; // PONERLO EN UN CHECKBOX
+		int hasta;
+		String fieldName = (String) m_cboFields.getSelectedItem();
+		m_Renderer.setFieldName(fieldName);
+		
+		if (bRestoValores)
+			hasta = m_symbolTable.getRowCount() - 1;
+		else
+			hasta = m_symbolTable.getRowCount();
+		for (int row=0; row < m_symbolTable.getRowCount();row++)
+		{ 
+			clave = (Value) m_symbolTable.getFieldValue(row,1);
+			theSymbol = (FSymbol) m_symbolTable.getFieldValue(row,0);
+			theSymbol.setDescription((String) m_symbolTable.getFieldValue(row,2));
+			m_Renderer.addSymbol(clave,theSymbol);
+			System.out.println(clave);
+		}
+		if (bRestoValores)
+		{
+			theSymbol = (FSymbol) m_symbolTable.getFieldValue(hasta,0);
+			m_Renderer.setDefaultSymbol(theSymbol);
+		}
+				
+	}
+	
+	private void fillFieldNames() {
+
+		DataSource rs;
+		try {
+			rs = ((AlphanumericData)m_lyr).getRecordset();
+			logger.debug("rs.start()");
+			rs.start();
+			String[] nomFields = new String[rs.getFieldCount()];
+			for (int i = 0; i < rs.getFieldCount(); i++) {
+				nomFields[i] = rs.getFieldName(i).trim();
+			}
+			rs.stop();
+			DefaultComboBoxModel cM = new DefaultComboBoxModel(nomFields);
+			m_cboFields.setModel(cM);
+		// fieldsListValor.setSelectedIndex(0);
+		} catch (DriverException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (com.iver.cit.gvsig.fmap.DriverException e) {
+			e.printStackTrace();
+		}
+		
+		m_symbolTable.removeAllItems();
+
+	}
+	
+	public void setLayer(FLayer lyr, Legend r)
+	{
+		// OJO, COMPROBAR ANTES SI ES DE TIPO VECTORIAL
+		m_lyr = (ClassifiableVectorial) lyr;
+		fillFieldNames();					
+		
+		// Si es de valor �nico, rellenamos la tabla
+		// y seleccionamos el campo que estamos usando
+		m_symbolTable.removeAllItems();
+		if (r instanceof VectorialUniqueValueLegend)
+		{			
+			m_Renderer = (VectorialUniqueValueLegend) r;
+			m_cboFields.getModel().setSelectedItem(m_Renderer.getFieldName());
+			m_symbolTable.fillTableFromSymbolList(m_Renderer.getSymbols(),
+					m_Renderer.getValues(), m_Renderer.getDescriptions());
+		}
+		else
+		{
+			try {
+				// Si la capa viene con otro tipo de leyenda, creamos
+				// una nueva del tipo que maneja este panel
+				m_Renderer = new VectorialUniqueValueLegend(m_lyr.getShapeType());
+			} catch (com.iver.cit.gvsig.fmap.DriverException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+
+		
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#getLegend()
+	 */
+	public Legend getLegend() {
+		fillSymbolListFromTable();
+		return m_Renderer;
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendValues.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendLabels.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendLabels.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendLabels.java	(revision 1648)
@@ -0,0 +1,533 @@
+/*
+ * 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.gui.legendmanager.panels;
+
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.data.DriverException;
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+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.Legend;
+import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
+import com.iver.cit.gvsig.gui.Dialogs.FontChooser;
+import com.iver.cit.gvsig.gui.Panels.ColorChooserPanel;
+
+/**
+ * @author fjp
+ *
+ */
+public class FPanelLegendLabels extends JPanel implements ILegendPanel {
+	private static final Font DEFAULT_FONT = 
+		  new Font("SansSerif", Font.PLAIN, 9);
+	
+	
+	// private TOC m_TOC;
+	private VectorialLegend m_Renderer;
+	private ClassifiableVectorial m_lyr;
+	private FSymbol m_FSymbol;
+	
+	private ColorChooserPanel m_colorChooser = new ColorChooserPanel();
+	
+	
+	private javax.swing.JLabel jLabel = null;
+	private javax.swing.JCheckBox jCheckBox = null;
+	private javax.swing.JLabel jLabel1 = null;
+	private javax.swing.JComboBox jComboBox = null;
+	private javax.swing.JLabel jLabel2 = null;
+	private javax.swing.JComboBox jComboBox1 = null;
+	private javax.swing.JPanel jPanel = null;
+	private javax.swing.JTextField jTextField = null;
+	private javax.swing.JRadioButton jRadioButton = null;
+	private javax.swing.JRadioButton jRadioButton1 = null;
+	private FPreviewSymbol fPreviewSymbol = null;
+	private javax.swing.JLabel jLabel3 = null;
+	private javax.swing.JButton jButton = null;
+	
+	private Font labelFont = DEFAULT_FONT;
+	private JPanel parent;
+	private javax.swing.JLabel jLabel4 = null;
+	/**
+	 * This is the default constructor
+	 */
+	public FPanelLegendLabels(JPanel parent) {
+		super();
+		this.parent = parent;
+		initialize();
+	}
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private  void initialize() {
+		this.setLayout(null);
+		this.setSize(454, 230);
+		this.add(getJCheckBox(), null);
+		this.add(getJLabel1(), null);
+		this.add(getJComboBox(), null);
+		this.add(getJLabel2(), null);
+		this.add(getJComboBox1(), null);
+		this.add(getJPanel(), null);
+		this.add(getFPreviewSymbol(), null);
+		this.add(getJLabel3(), null);
+		this.add(getJButton(), null);
+		
+		// m_colorChooser = new ColorChooserPanel();
+		// m_colorChooser.setColor(Color.RED);
+		m_colorChooser.setAlpha(255);
+		m_colorChooser.setBounds(190, 103, 99, 34);
+		m_colorChooser.addActionListener(new java.awt.event.ActionListener() {
+			public void actionPerformed(ActionEvent e) {
+				updateControls();
+			}
+		}); 
+		this.add(getJLabel4(), null);
+		this.add(m_colorChooser);
+		
+	}
+	public void setLayer(FLayer lyr, Legend r)
+	{
+		m_lyr = (ClassifiableVectorial) lyr;
+		m_Renderer = (VectorialLegend)r;		
+
+		fillFieldNames();		
+		getJComboBox().getModel().setSelectedItem(m_Renderer.getLabelField());
+		setFSymbol(r.getDefaultSymbol());
+		
+		if (m_Renderer.getLabelField() != null)
+			getJCheckBox().setSelected(true);
+		else
+			getJCheckBox().setSelected(false);
+
+		
+		
+		
+	}
+	public void setFSymbol(FSymbol sym)
+	{
+		if (sym == null)
+		{
+			m_FSymbol = new FSymbol(FShape.MULTI);
+		}
+		else
+			m_FSymbol = sym;
+		
+		if (m_FSymbol.getFontColor()!=null){
+			m_colorChooser.setColor(m_FSymbol.getFontColor());
+		}
+		fPreviewSymbol.setSymbol(m_FSymbol);
+		
+		getJRadioButton1().setSelected(!m_FSymbol.isFontSizeInPixels());
+		getJTextField().setText("" + 
+				m_FSymbol.getFontSize());
+
+		
+	}
+
+	private void updateControls() {
+		getJComboBox().setEnabled(getJCheckBox().isSelected());
+		getJComboBox1().setEnabled(getJCheckBox().isSelected());
+		getJRadioButton().setEnabled(getJCheckBox().isSelected());
+		getJRadioButton1().setEnabled(getJCheckBox().isSelected());
+		getJTextField().setEnabled(getJCheckBox().isSelected());
+		if (getJCheckBox().isSelected())
+		{
+			FSymbol sym = m_FSymbol;
+			sym.setFont(labelFont);
+			sym.setFontColor(m_colorChooser.getColor());
+			fPreviewSymbol.setSymbol(sym);
+		}
+	}
+	private void updateValuesFromControls() {
+		if (getJCheckBox().isSelected())
+		{
+			m_Renderer.setLabelField((String) getJComboBox().getSelectedItem());
+			///m_Renderer.setLabelHeightField((String) getJComboBox1().getSelectedItem());
+			m_FSymbol.setFontColor(m_colorChooser.getColor());
+			if (!getJRadioButton().isSelected())
+			{
+				float sizeUnits = Float.parseFloat(getJTextField().getText());				
+				m_FSymbol.setFontSize(sizeUnits); // Para que se pueda crear correctamente al recuperar del proyecto
+				m_FSymbol.setFontSizeInPixels(false);
+			}
+			else
+			{				
+				float sizePoints = Float.parseFloat(getJTextField().getText());
+				m_FSymbol.setFont(labelFont);
+				m_FSymbol.setFont(labelFont.deriveFont(sizePoints));
+				m_FSymbol.setFontSize(sizePoints);
+				m_FSymbol.setFontSizeInPixels(true);
+			}		
+			m_Renderer.setDefaultSymbol(m_FSymbol);
+		}
+		else
+		{
+			// Para que no se dibujen las etiquetas, el campo labelField del Renderer
+			// ha de ser null
+			m_Renderer.setLabelField(null);
+		}
+	}
+
+	
+	
+	
+	private void fillFieldNames() {
+
+		SelectableDataSource rs;
+		try {
+			rs = ((AlphanumericData) m_lyr).getRecordset();
+		String[] nomFields;
+			nomFields = new String[rs.getFieldCount()];
+		for (int i = 0; i < rs.getFieldCount(); i++) {
+			nomFields[i] = rs.getFieldName(i).trim();
+		}
+
+		DefaultComboBoxModel cM_labelField = new DefaultComboBoxModel(nomFields);
+		getJComboBox().setModel(cM_labelField);
+		DefaultComboBoxModel cM_heightField = new DefaultComboBoxModel(nomFields);
+		getJComboBox1().setModel(cM_heightField);
+	} catch (com.iver.cit.gvsig.fmap.DriverException e1) {
+		e1.printStackTrace();
+	} catch (DriverException e) {
+		e.printStackTrace();
+	}
+	
+	}
+		
+	
+	/**
+
+	 * This method initializes jCheckBox	
+
+	 * 	
+
+	 * @return javax.swing.JCheckBox	
+
+	 */    
+	private javax.swing.JCheckBox getJCheckBox() {
+		if (jCheckBox == null) {
+			jCheckBox = new javax.swing.JCheckBox();
+			jCheckBox.setText(PluginServices.getText(this,"Habilitar_etiquetado"));
+			jCheckBox.setBounds(28, 22, 117, 23);
+			jCheckBox.addItemListener(new java.awt.event.ItemListener() { 
+
+				public void itemStateChanged(java.awt.event.ItemEvent e) {    
+					updateControls();					
+
+				}
+			});
+
+		}
+		return jCheckBox;
+	}
+
+	/**
+
+	 * This method initializes jLabel1	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel1() {
+		if (jLabel1 == null) {
+			jLabel1 = new javax.swing.JLabel();
+			jLabel1.setText(PluginServices.getText(this,"Campo_de_etiquetado"));
+			jLabel1.setBounds(29, 53, 116, 21);
+		}
+		return jLabel1;
+	}
+
+	/**
+
+	 * This method initializes jComboBox	
+
+	 * 	
+
+	 * @return javax.swing.JComboBox	
+
+	 */    
+	private javax.swing.JComboBox getJComboBox() {
+		if (jComboBox == null) {
+			jComboBox = new javax.swing.JComboBox();
+			jComboBox.setBounds(175, 52, 110, 19);
+			jComboBox.setEnabled(false);
+		}
+		return jComboBox;
+	}
+
+	/**
+
+	 * This method initializes jLabel2	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel2() {
+		if (jLabel2 == null) {
+			jLabel2 = new javax.swing.JLabel();
+			jLabel2.setBounds(29, 83, 137, 21);
+			jLabel2.setText(PluginServices.getText(this,"campo_altura_texto"));
+			jLabel2.setVisible(false);
+		}
+		return jLabel2;
+	}
+
+	/**
+
+	 * This method initializes jComboBox1	
+
+	 * 	
+
+	 * @return javax.swing.JComboBox	
+
+	 */    
+	private javax.swing.JComboBox getJComboBox1() {
+		if (jComboBox1 == null) {
+			jComboBox1 = new javax.swing.JComboBox();
+			jComboBox1.setBounds(175, 82, 110, 18);
+			jComboBox1.setEnabled(false);
+			jComboBox1.setVisible(false);
+		}
+		return jComboBox1;
+	}
+
+	/**
+
+	 * This method initializes jPanel	
+
+	 * 	
+
+	 * @return javax.swing.JPanel	
+
+	 */    
+	private javax.swing.JPanel getJPanel() {
+		if (jPanel == null) {
+			jPanel = new javax.swing.JPanel();
+			jPanel.setLayout(null);
+			jPanel.setBounds(29, 136, 258, 84);
+			jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"Altura_fija_de_texto"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			ButtonGroup jButtonGroup = new ButtonGroup();
+			jButtonGroup.add(getJRadioButton1());
+			jButtonGroup.add(getJRadioButton());
+			jPanel.add(getJRadioButton1(), null);
+			jPanel.add(getJRadioButton(), null);
+			jPanel.add(getJTextField(), null);
+		}
+		return jPanel;
+	}
+
+	/**
+
+	 * This method initializes jTextField	
+
+	 * 	
+
+	 * @return javax.swing.JTextField	
+
+	 */    
+	private javax.swing.JTextField getJTextField() {
+		if (jTextField == null) {
+			jTextField = new javax.swing.JTextField();
+			jTextField.setBounds(26, 32, 76, 21);
+			jTextField.setEnabled(false);
+			jTextField.setText("10");
+		}
+		return jTextField;
+	}
+
+/**
+
+	 * 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(145, 44, 100, 23);
+			jRadioButton.setEnabled(false);
+			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(145, 16, 100, 23);			
+			jRadioButton1.setEnabled(false);
+		}
+		return jRadioButton1;
+	}
+
+	/**
+
+	 * This method initializes fPreviewSymbol	
+
+	 * 	
+
+	 * @return com.iver.cit.opensig.gui.Panels.FPreviewSymbol	
+
+	 */    
+	private FPreviewSymbol getFPreviewSymbol() {
+		if (fPreviewSymbol == null) {
+			fPreviewSymbol = new FPreviewSymbol();
+			fPreviewSymbol.setBounds(311, 53, 134, 77);
+		}
+		return fPreviewSymbol;
+	}
+
+	/**
+
+	 * This method initializes jLabel3	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel3() {
+		if (jLabel3 == null) {
+			jLabel3 = new javax.swing.JLabel();
+			jLabel3.setBounds(312, 28, 100, 18);
+			jLabel3.setText(PluginServices.getText(this,"Previsualizacion"));
+		}
+		return jLabel3;
+	}
+
+	/**
+
+	 * This method initializes jButton	
+
+	 * 	
+
+	 * @return javax.swing.JButton	
+
+	 */    
+	private javax.swing.JButton getJButton() {
+		if (jButton == null) {
+			jButton = new javax.swing.JButton();
+			jButton.setBounds(315, 139, 111, 29);
+			jButton.setText(PluginServices.getText(this,"fuente")+"...");
+			jButton.addActionListener(new java.awt.event.ActionListener() { 
+
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					JButton origen = (JButton) e.getSource();
+					Font newFont;
+					
+					newFont = FontChooser.showDialog("Choose Font", labelFont);						
+					
+			        if (newFont == null) {
+			            return;
+			        }
+			        
+			        labelFont = newFont;
+			        updateControls();
+
+
+				}
+			});
+
+		}
+		return jButton;
+	}
+
+	/**
+
+	 * This method initializes jLabel4	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel4() {
+		if (jLabel4 == null) {
+			jLabel4 = new javax.swing.JLabel();
+			jLabel4.setBounds(29, 109, 133, 23);
+			jLabel4.setText(PluginServices.getText(this,"color_texto"));
+		}
+		return jLabel4;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.legendmanager.panels.ILegendPanel#getLegend()
+	 */
+	public Legend getLegend() {
+		updateValuesFromControls();
+		return m_Renderer;
+	}
+
+        }  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendLabels.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/ILegendPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/ILegendPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/ILegendPanel.java	(revision 1648)
@@ -0,0 +1,64 @@
+/*
+ * Created on 14-dic-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui.legendmanager.panels;
+
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.rendering.Legend;
+
+/**
+ * @author FJP
+ *
+ * Este interfaz es el que debe cumplir cualquier panel que empleemos
+ * para confeccionar una leyenda. Se le pasa una capa para que 
+ * tome su leyenda, y con el m�todo getLegend tomamos la leyenda
+ * que ha confeccionado el usuario.
+ */
+public interface ILegendPanel {
+	void setLayer(FLayer lyr, Legend legend);
+	Legend getLegend();
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/ILegendPanel.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/FLegendManagerWindow.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/FLegendManagerWindow.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/FLegendManagerWindow.java	(revision 1648)
@@ -0,0 +1,523 @@
+/*
+ * Created on 24-jun-2003
+ *
+ * Copyright (c) 2003
+ * Francisco Jos� Pe�arrubia Mart�nez
+ * IVER Tecnolog�as de la Informaci�n S.A.
+ * Salamanca 50
+ * 46005 Valencia (        SPAIN )
+ * +34 963163400
+ * mailto:fran@iver.es
+ * http://www.iver.es
+ */
+/* 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.gui.legendmanager;
+
+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.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.text.DateFormat;
+import java.util.Date;
+
+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.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.instruction.FieldNotFoundException;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.Messages;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+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.Classifiable;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial;
+import com.iver.cit.gvsig.fmap.rendering.ClassifiedLegend;
+import com.iver.cit.gvsig.fmap.rendering.IntervalLegend;
+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.UniqueValueLegend;
+import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
+import com.iver.cit.gvsig.gui.legendmanager.panels.FPanelLegendBreaks;
+import com.iver.cit.gvsig.gui.legendmanager.panels.FPanelLegendDefault;
+import com.iver.cit.gvsig.gui.legendmanager.panels.FPanelLegendLabels;
+import com.iver.cit.gvsig.gui.legendmanager.panels.FPanelLegendValues;
+import com.iver.cit.gvsig.project.Project;
+import com.iver.utiles.GenericFileFilter;
+import com.iver.utiles.XMLEntity;
+import com.iver.utiles.xmlEntity.generate.XmlTag;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Administrador To change the template for this generated type comment
+ *         go to Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public final class FLegendManagerWindow extends JPanel implements View {
+	
+	public final static int LEGEND_TYPE_BREAK = 3;
+	public final static int LEGEND_TYPE_DEFAULT = 1;
+	public final static int LEGEND_TYPE_VALUE = 2;
+	public final static int SYMBOL_TYPE_DEFAULT = 5;
+	
+	private FMap mapContext;
+	private FLayer m_Lyr;
+    private Legend m_Renderer; // Le asignaremos la leyenda del primer tema activo.
+    private JTabbedPane organizador = new JTabbedPane();
+    private FPanelLegendDefault m_defaultLegendPanel;
+    private FPanelLegendValues m_valuesLegendPanel;
+    private FPanelLegendBreaks m_breaksLegendPanel;
+    private FPanelLegendLabels m_labelsLegendPanel;
+    private JButton btnApply;
+    private JButton btnCancelar;
+
+    // private FRenderer m_Renderer;
+    // private TOC toc;
+    // private FSymbolTable m_panelTable = new FSymbolTable();
+    // Variables declaration - do not modify
+    // private javax.swing.JSplitPane jSplitPane1;
+    private JPanel m_panelBotones = new JPanel();
+    private ComandosListener m_actionListener = new ComandosListener(this);
+    /**
+     * Creates new form JPanel
+     */
+    public FLegendManagerWindow() {
+        initComponents();
+		// this.setLayout(null);
+		this.setSize(500, 360);
+		this.setPreferredSize(new java.awt.Dimension(500,360));
+        
+    }
+
+    /**
+     * This method is called from within the constructor to initialize the
+     * form. WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    private void initComponents() {
+     /*   addWindowListener(new java.awt.event.WindowAdapter() {
+                public void windowClosing(java.awt.event.WindowEvent evt) {
+                    closeDialog(evt);
+                }
+            });
+*/
+        //Createmos los paneles. 
+        m_defaultLegendPanel = new FPanelLegendDefault();
+        m_valuesLegendPanel = new FPanelLegendValues();
+        m_breaksLegendPanel = new FPanelLegendBreaks();
+       
+        m_labelsLegendPanel = new FPanelLegendLabels(this); 
+        // TODO: PONER LOS TABS
+        //Add the scroll panes to a split pane.
+        organizador.addTab(PluginServices.getText(this,"Simbolo_unico"), m_defaultLegendPanel);
+        organizador.addTab(PluginServices.getText(this,"Valores_unicos"), m_valuesLegendPanel);
+        organizador.addTab(PluginServices.getText(this,"Intervalos"), m_breaksLegendPanel);
+        organizador.addTab(PluginServices.getText(this,"Etiquetado"), m_labelsLegendPanel);
+
+        java.awt.Dimension minimumSize = new java.awt.Dimension(100, 50);
+
+        JPanel panelButtons = new JPanel();
+        JButton btnAceptar = new JButton(PluginServices.getText(this,"Aceptar"));
+        btnAceptar.setActionCommand("OK");
+        btnAceptar.addActionListener(m_actionListener);
+
+        btnApply = new JButton(PluginServices.getText(this,"Aplicar"));
+        btnApply.setActionCommand("APPLY");
+        btnApply.addActionListener(m_actionListener);
+
+        // BOTONES PARA GUARDAR Y CARGAR LEYENDAS
+        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);
+
+        ///////////////////////////////////////////////////////
+        btnCancelar = new JButton(PluginServices.getText(this,"Cerrar"));
+        btnCancelar.setActionCommand("CANCEL");
+        btnCancelar.addActionListener(m_actionListener);
+
+        panelButtons.add(btnAceptar);
+        panelButtons.add(btnApply);
+        panelButtons.add(btnSaveLegend);
+        panelButtons.add(btnLoadLegend);
+        panelButtons.add(btnCancelar);
+        setLayout(new BorderLayout());
+        add(organizador, java.awt.BorderLayout.NORTH);
+        add(panelButtons, java.awt.BorderLayout.SOUTH);
+
+        // pack();
+    }
+
+    private FLayer getFirstActiveLayerVect()
+    {
+        // Comprobar en openLegendManager que hay alg�n tema activo!
+        FLayer[] activeLyrs = mapContext.getLayers().getActives();
+        if (activeLyrs.length == 0)
+        {
+        	JOptionPane.showMessageDialog(null, 
+        			Messages.getString("necesita_un_tema_activo"), "", JOptionPane.ERROR_MESSAGE);
+        	return null;
+        }
+        FLayer lyr = null;
+        for (int i=0; i < activeLyrs.length; i++)
+        {
+        	if (activeLyrs[i] instanceof Classifiable)
+        	{
+        		Classifiable auxC = (Classifiable) activeLyrs[i]; 
+        		Legend theLegend = auxC.getLegend();
+        		if (theLegend instanceof VectorialLegend)
+        			lyr = (FLayer) auxC;	
+        	}
+        }        
+
+        if (lyr == null) {
+            System.out.println(PluginServices.getText(this,"Por_favor_active_el_tema")+".");
+        	JOptionPane.showMessageDialog(null, 
+        			Messages.getString("necesita_un_tema_vectorial_activo"), "", JOptionPane.ERROR_MESSAGE);
+
+            return null;
+        }
+        return lyr;
+    	
+    }
+
+    /**
+     * 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(FMap mapContext) throws DriverException {
+        this.mapContext = mapContext;
+        m_Lyr = getFirstActiveLayerVect();
+			try {
+				ClassifiableVectorial aux = (ClassifiableVectorial) m_Lyr;
+				m_Renderer = (Legend) aux.getLegend().cloneLegend();
+			} catch (XMLException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+        actualizar();
+    }
+    
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void actualizar() {
+    	// Avisar si no es Vectorial
+    	FLayer lyrSelected = getFirstActiveLayerVect();
+    	
+        m_defaultLegendPanel.setLayer(lyrSelected, m_Renderer);
+        m_valuesLegendPanel.setLayer(lyrSelected, m_Renderer);
+        m_breaksLegendPanel.setLayer(lyrSelected, m_Renderer);
+        m_labelsLegendPanel.setLayer(lyrSelected, m_Renderer);
+
+        if (m_Renderer instanceof SingleSymbolLegend)
+        	organizador.setSelectedIndex(0);
+        if (m_Renderer instanceof UniqueValueLegend)
+        	organizador.setSelectedIndex(1);
+        if (m_Renderer instanceof IntervalLegend)
+        	organizador.setSelectedIndex(2);
+        
+        /* switch (m_Renderer.getLegendType()) {
+        case FConstant.LEGEND_TYPE_DEFAULT:
+            organizador.setSelectedIndex(0);
+
+            break;
+
+        case FConstant.LEGEND_TYPE_VALUE:
+            organizador.setSelectedIndex(1);
+
+            break;
+
+        case FConstant.LEGEND_TYPE_BREAK:
+            organizador.setSelectedIndex(2);
+
+            break;
+        } */
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param evt DOCUMENT ME!
+     */
+    private void btnApply_actionPerformed(ActionEvent evt) {
+        ClassifiableVectorial aux = (ClassifiableVectorial) m_Lyr;
+        switch (organizador.getSelectedIndex()) {
+        case 0: // default symbol
+            m_Renderer = m_defaultLegendPanel.getLegend();
+            break;
+        case 1: // Unique Values
+            m_Renderer = m_valuesLegendPanel.getLegend();
+            break;
+        case 2:// break values
+           	m_Renderer = m_breaksLegendPanel.getLegend();
+           	break;
+        case 3://text
+        	m_Renderer = m_labelsLegendPanel.getLegend();
+        }
+        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++)
+            {
+                if (activeLyrs[i] instanceof ClassifiableVectorial)
+                {
+                    ClassifiableVectorial aux2 = (ClassifiableVectorial) activeLyrs[i];
+                    if (m_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) m_Renderer;
+                        if (aux2 instanceof AlphanumericData)
+                        {
+                            DataSource rs = ((AlphanumericData) aux2).getRecordset();
+                            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.
+                                aux2.setLegend((VectorialLegend) m_Renderer);
+                            }
+                                
+                        }
+                    }
+                    else if (m_Renderer instanceof SingleSymbolLegend)
+                        aux2.setLegend((VectorialLegend) m_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.DriverException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        // closeDialog(null);
+		
+		// TODO: Aqu� hay que refrescar, si se puede
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.mdiApp.FileListener#readFile(java.io.File)
+     */
+    public Object read(File file) {
+		Legend ret = null;
+        /* try {
+            TransformerFactory transFact = TransformerFactory.newInstance();
+
+            if (transFact.getFeature(SAXTransformerFactory.FEATURE)) {
+                SAXTransformerFactory saxTransFact = (SAXTransformerFactory) transFact;
+
+                XMLReader reader = XMLReaderFactory.createXMLReader();
+
+                // attach the XSLT processor to the CSVXMLReader
+                XMLEntityXMLHandler handler = new XMLEntityXMLHandler();
+                reader.setContentHandler(handler);
+                reader.parse(file.getPath());
+
+                // TODO: Implementar lo del XMLEntity
+                // ret = FRenderer.createFRenderer(handler.getXMLEntity());
+            } else {
+                throw new SAXNotSupportedException("SAX no soportado");
+            }
+        } catch (Exception exc) {
+			App.instance.getNm().addError("Error leyendo la leyenda", exc);
+        }
+        */
+        return ret; 
+        
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @author Fernando Gonz�lez Cort�s
+     */
+    private class ComandosListener implements ActionListener {
+        private FLegendManagerWindow m_lg;
+
+        /**
+         * Creates a new ComandosListener object.
+         *
+         * @param lg DOCUMENT ME!
+         */
+        public ComandosListener(FLegendManagerWindow lg) {
+            m_lg = lg;
+        }
+
+        /* (non-Javadoc)
+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+         */
+        public void actionPerformed(ActionEvent e) {
+            if (e.getActionCommand() == "OK") {
+                m_lg.btnApply_actionPerformed(e);
+            	if (PluginServices.getMainFrame() == null)
+            		((JDialog) (getParent().getParent().getParent().getParent())).dispose();
+            	else                
+            		PluginServices.getMDIManager().closeView(FLegendManagerWindow.this);
+                System.out.println("Ok del FLegendManager");
+            } else if (e.getActionCommand() == "CANCEL") {
+            	if (PluginServices.getMainFrame() == null)
+            		((JDialog) (getParent().getParent().getParent().getParent())).dispose();
+            	else
+            		PluginServices.getMDIManager().closeView(FLegendManagerWindow.this);
+            } else if (e.getActionCommand() == "APPLY") {
+                m_lg.btnApply_actionPerformed(e);
+            } else if (e.getActionCommand() == "SAVE_LEGEND") {
+				m_lg.btnApply_actionPerformed(e);
+				JFileChooser jfc = new JFileChooser();
+				jfc.addChoosableFileFilter(new GenericFileFilter("gvl",
+						PluginServices.getText(this, "tipo_leyenda")));
+
+				if (jfc.showSaveDialog((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");
+					}
+					writeLegend(file);
+				}
+	        } else if (e.getActionCommand() == "LOAD_LEGEND") {
+	        	JFileChooser jfc = new JFileChooser();
+	    		jfc.addChoosableFileFilter(new GenericFileFilter("gvl",
+	    				PluginServices.getText(this, "tipo_leyenda")));
+
+	    		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);
+	    			actualizar();
+	    		}
+	        }
+        }
+    }
+    private void writeLegend(File file) {
+		try {
+			FileWriter writer = new FileWriter(file.getAbsolutePath());
+			Marshaller m = new Marshaller(writer);
+			m.setEncoding("ISO-8859-1");
+			m.marshal(m_Renderer.getXMLEntity().getXmlTag());
+		} catch (Exception e) {
+			NotificationManager.addError("Error guardando la leyenda", e);
+		}
+	}
+
+	public void readLegend(File file) {
+		try {
+			File xmlFile = new File(file.getAbsolutePath());
+			FileReader reader;
+			reader = new FileReader(xmlFile);
+
+			XmlTag tag = (XmlTag) XmlTag.unmarshal(reader);
+			m_Renderer = LegendFactory.createFromXML(new XMLEntity(tag));
+		} catch (FileNotFoundException e) {
+			NotificationManager.addError("Al leer la leyenda", e);
+		} catch (MarshalException e) {
+			NotificationManager.addError("Al leer la leyenda", e);
+		} catch (ValidationException e) {
+			NotificationManager.addError("Al leer la leyenda", e);
+		} catch (XMLException e) {
+			NotificationManager.addError("Al leer la leyenda", e);
+		}
+
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		// Solo se llama una vez
+		ViewInfo viewInfo = new ViewInfo(ViewInfo.MODELESSDIALOG);
+		viewInfo.setWidth(500);
+		viewInfo.setHeight(360);
+		viewInfo.setTitle(PluginServices.getText(this,"Cambio_de_estilo"));
+		return viewInfo;
+		}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/FLegendManagerWindow.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/View.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/View.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/View.java	(revision 1648)
@@ -0,0 +1,392 @@
+/* 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.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+
+import org.cresques.cts.IProjection;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.driverManager.DriverManager;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.andami.ui.mdiManager.ViewListener;
+import com.iver.cit.gvsig.fmap.ColorEvent;
+import com.iver.cit.gvsig.fmap.ExtentEvent;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.ViewPortListener;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
+import com.iver.cit.gvsig.fmap.edition.DefaultEditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.EditionException;
+import com.iver.cit.gvsig.fmap.edition.FileEditableFeatureSource;
+import com.iver.cit.gvsig.fmap.edition.MemoryExpansionFile;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.VectorialFileAdapter;
+import com.iver.cit.gvsig.fmap.tools.CompoundBehavior;
+import com.iver.cit.gvsig.fmap.tools.ZoomOutRightButtonListener;
+import com.iver.cit.gvsig.fmap.tools.Behavior.PolygonBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.Behavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.PolylineBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.MouseMovementBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.MoveBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior;
+import com.iver.cit.gvsig.fmap.tools.Behavior.RectangleBehavior;
+import com.iver.cit.gvsig.gui.cad.CADToolAdapter;
+import com.iver.cit.gvsig.gui.cad.CadMapControl;
+import com.iver.cit.gvsig.gui.cad.tools.PointCadTool;
+import com.iver.cit.gvsig.gui.toc.TOC;
+import com.iver.cit.gvsig.gui.toolListeners.AreaListener;
+import com.iver.cit.gvsig.gui.toolListeners.InfoListener;
+import com.iver.cit.gvsig.gui.toolListeners.LinkListener;
+import com.iver.cit.gvsig.gui.toolListeners.MeasureListener;
+import com.iver.cit.gvsig.gui.toolListeners.PanListener;
+import com.iver.cit.gvsig.gui.toolListeners.PointSelectListener;
+import com.iver.cit.gvsig.gui.toolListeners.RectangleSelectListener;
+import com.iver.cit.gvsig.gui.toolListeners.StatusBarListener;
+import com.iver.cit.gvsig.gui.toolListeners.ZoomInListener;
+import com.iver.cit.gvsig.gui.toolListeners.ZoomOutListener;
+import com.iver.cit.gvsig.project.ProjectView;
+import com.iver.utiles.exceptionHandling.ExceptionListener;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author vcn
+ */
+public class View extends JPanel implements com.iver.andami.ui.mdiManager.View,
+    SingletonView,ViewListener {
+
+    /** DOCUMENT ME! */
+    private CadMapControl m_CadMapControl;
+    private MapOverview m_MapLoc;
+
+    /** DOCUMENT ME! */
+    private FThemePropertiesDialog m_Themeproperties;
+    private JScrollPane jscrollTOC;
+    private TOC m_TOC;
+    private ProjectView modelo;
+    private Table table = null;
+	private ViewExceptionListener CadMapControlExceptionListener = new ViewExceptionListener();
+    	
+    /**
+     * Creates a new View object.
+     */
+    public View() {
+        //this.setName(Utilities.getMessage(this, "Vista")+ " : "+modelo.getName());
+        this.setPreferredSize(new Dimension(500, 300));
+        initComponents();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public ProjectView getModel() {
+        return modelo;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param model DOCUMENT ME!
+     */
+    public void setModel(ProjectView model) {
+        this.modelo = model;
+
+        //Se registra como listener de cambios en FMap
+        FMap fmap = modelo.getMapContext();
+
+        //Se configura el CadMapControl
+        m_CadMapControl.setMapContext(fmap);
+        m_TOC.setMapContext(fmap);
+        m_CadMapControl.setBackground(new Color(255, 255, 255));
+        if (modelo.getMapOverViewContext()!=null){
+        	m_MapLoc.setModel(modelo.getMapOverViewContext());
+        }
+        model.addPropertyChangeListener(new PropertyChangeListener() {
+			public void propertyChange(PropertyChangeEvent evt) {
+				if (evt.getPropertyName().equals("name")){
+					PluginServices.getMDIManager().getViewInfo(View.this).setTitle("Vista: " + (String)evt.getNewValue());
+				}
+			}
+		});
+
+        if (m_CadMapControl.getMapContext().getViewPort() != null){
+        m_CadMapControl.getMapContext().getViewPort().addViewPortListener(new ViewPortListener() {
+			public void extentChanged(ExtentEvent e) {
+				if (PluginServices.getMainFrame() != null){			
+					PluginServices.getMainFrame().getStatusBar().setMessage("6", "1:"+m_CadMapControl.getMapContext().getScaleView());
+					PluginServices.getMainFrame().getStatusBar().setMessage("7",  m_CadMapControl.getMapContext().getViewPort().getProjection().getAbrev());
+				}
+			}
+
+			public void backColorChanged(ColorEvent e) {
+			}
+		}); 
+        } 
+    }
+   /**
+     * DOCUMENT ME!
+     */
+    public void openThemeProperties() {
+    	FMap fmap = modelo.getMapContext();
+    	FLayer[] actives = fmap.getLayers().getActives();
+    	
+    	for (int i = 0; i < actives.length; i++){
+            m_Themeproperties = new FThemePropertiesDialog(actives[i], modelo);
+            PluginServices.getMDIManager().addView(m_Themeproperties);
+    	}
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void initComponents() { //GEN-BEGIN:initComponents
+        m_CadMapControl = new CadMapControl();
+        m_CadMapControl.getMapControl().addExceptionListener(CadMapControlExceptionListener);
+        // modelo.setMapContext(m_CadMapControl.getMapContext());
+
+        // m_CadMapControl.setAcceptEvents(true); Lo comento porque ya se hace en el setModel
+        m_TOC = new TOC();
+
+        JSplitPane tempMainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+        tempMainSplit.setPreferredSize(new Dimension(500, 300));
+
+        // Ponemos el localizador
+        m_MapLoc = new MapOverview(m_CadMapControl.getMapControl());
+        m_MapLoc.setPreferredSize(new Dimension(150, 200));
+        JSplitPane tempSplitToc = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+
+        tempSplitToc.setTopComponent((TOC) m_TOC);
+        tempSplitToc.setBottomComponent(m_MapLoc);
+        tempSplitToc.setResizeWeight(0.7);
+
+        // tempSplitToc.resetToPreferredSizes(); 
+        tempMainSplit.setLeftComponent(tempSplitToc);
+
+        m_TOC.setVisible(true);
+
+        // m_TOC.setPreferredSize(new Dimension(150,50));
+        tempMainSplit.setRightComponent(m_CadMapControl);
+        this.setLayout(new BorderLayout());
+        this.add(tempMainSplit, BorderLayout.CENTER);
+
+        //Listener de eventos de movimiento que pone las coordenadas del rat�n en la barra de estado
+        StatusBarListener sbl = new StatusBarListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.addMapTool("coords", new MouseMovementBehavior(sbl));
+        m_CadMapControl.getMapControl().pushTool("coords");
+        
+        // Zoom out (pinchas y el mapa se centra y te muestra m�s).
+        // No es dibujando un rect�ngulo, es solo pinchando.
+        ZoomOutListener zol = new ZoomOutListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.addMapTool("zoomOut", new PointBehavior(zol));
+        
+        // pan
+
+        PanListener pl = new PanListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.addMapTool("pan", new MoveBehavior(pl));
+        
+        // Medir
+
+        MeasureListener mli = new MeasureListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.addMapTool("medicion", new PolylineBehavior(mli));
+
+        // Area
+
+        AreaListener ali = new AreaListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.addMapTool("area", new PolygonBehavior(ali));
+        
+        //Seleccion por punto
+        PointSelectListener psl = new PointSelectListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.getMapControl().addMapTool("pointSelection", new PointBehavior(psl));
+        
+        //Info por punto
+        InfoListener il = new InfoListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.getMapControl().addMapTool("info", new PointBehavior(il));
+        
+//      Link por punto
+        LinkListener ll = new LinkListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.getMapControl().addMapTool("link", new PointBehavior(ll));
+        
+        //Selecci�n por rect�ngulo
+        RectangleSelectListener rsl = new RectangleSelectListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.getMapControl().addMapTool("rectSelection", new RectangleBehavior(rsl));
+        
+        // Zoom por rect�ngulo
+        ZoomOutRightButtonListener zoil = new ZoomOutRightButtonListener(m_CadMapControl.getMapControl());
+        ZoomInListener zil = new ZoomInListener(m_CadMapControl.getMapControl());
+        m_CadMapControl.getMapControl().addMapTool("zoomIn", new Behavior[]{new PointBehavior(zoil), new RectangleBehavior(zil)});
+        
+        // Por defecto
+        m_CadMapControl.getMapControl().pushTool("zoomIn"); 
+
+     }
+
+    /**
+     * DOCUMENT ME!
+     */
+   /*public void openPropertiesWindow() {
+    }
+*/
+    /**
+     * DOCUMENT ME!
+     */
+  /*  public void openQueryWindow() {
+    }
+*/
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public MapOverview getMapOverview() {
+        return m_MapLoc;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public CadMapControl getMapControl() {
+        return m_CadMapControl;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public TOC getTOC() {
+        return m_TOC;
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public void repaintMap() {
+        m_CadMapControl.getMapControl().drawMap(false);
+    }
+
+    /* (non-Javadoc)
+     * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getModel()
+     */
+    public Object getViewModel() {
+        return modelo;
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+     */
+    public ViewInfo getViewInfo() {
+    	ViewInfo m_viewInfo = new ViewInfo(ViewInfo.ICONIFIABLE | ViewInfo.RESIZABLE |
+	                ViewInfo.MAXIMIZABLE);
+
+			m_viewInfo.setWidth(500);
+			m_viewInfo.setHeight(300);
+		m_viewInfo.setTitle(PluginServices.getText(this, "Vista") + " : " +
+                modelo.getName());
+		
+		return m_viewInfo;
+    	
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+     */
+    public void viewActivated() {
+    	PluginServices.getMainFrame().getStatusBar().setMessage("1",
+    			FConstant.NAMES[getMapControl().getMapControl().getMapContext().getViewPort().getMapUnits()]);
+    	PluginServices.getMainFrame().getStatusBar().setMessage("6", "1:"+m_CadMapControl.getMapContext().getScaleView());
+		PluginServices.getMainFrame().getStatusBar().setMessage("7",  m_CadMapControl.getMapContext().getViewPort().getProjection().getAbrev());
+
+    }
+
+	/**
+	 * @return
+	 */
+	public BufferedImage getImage() {
+		return m_CadMapControl.getMapControl().getImage();
+	}
+	
+	public void setProjection(IProjection proj)
+	{
+		getMapControl().getMapControl().setProjection(proj);
+	}
+	public IProjection getProjection()
+	{
+		return getMapControl().getMapControl().getProjection();
+	}
+	
+	public class ViewExceptionListener implements ExceptionListener {
+
+		/**
+		 * @see com.iver.cit.gvsig.fmap.ExceptionListener#exceptionThrown(java.lang.Throwable)
+		 */
+		public void exceptionThrown(Throwable t) {
+			NotificationManager.addError(t.getMessage(), t);
+		}
+		
+	}
+
+	/**
+	 * @see com.iver.andami.ui.mdiManager.ViewListener#viewClosed()
+	 */
+	public void viewClosed() {
+		///PluginServices.getMainFrame().getStatusBar().setMessage("1","");
+	}
+	
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/View.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorScheme.txt
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorScheme.txt	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorScheme.txt	(revision 1648)
@@ -0,0 +1,53 @@
+BuGn (ColorBrewer),range,f7fcfd,e5f5f9,ccece6,99d8c9,66c2a4,41ae76,238b45,006d2c,00441b
+BuPu (ColorBrewer),range,f7fcfd,e0ecf4,bfd3e6,9ebcda,8c96c6,8c6bb1,88419d,810f7c,4d004b
+GnBu (ColorBrewer),range,f7fcf0,e0f3db,ccebc5,a8ddb5,7bccc4,4eb3d3,2b8cbe,0868ac,084081
+OrRd (ColorBrewer),range,fff7ec,fee8c8,fdd49e,fdbb84,fc8d59,ef6548,d7301f,b30000,7f0000
+PuBu (ColorBrewer),range,fff7fb,ece7f2,d0d1e6,a6bddb,74a9cf,3690c0,0570b0,045a8d,023858
+PuBuGn (ColorBrewer),range,fff7fb,ece2f0,d0d1e6,a6bddb,67a9cf,3690c0,02818a,016c59,014636
+PuRd (ColorBrewer),range,f7f4f9,e7e1ef,d4b9da,c994c7,df65b0,e7298a,ce1256,980043,67001f
+RdPu (ColorBrewer),range,fff7f3,fde0dd,fcc5c0,fa9fb5,f768a1,dd3497,b0017e,7a0177,49006a
+YlGn (ColorBrewer),range,ffffe5,f7fcb9,d9f0a3,addd8e,78c679,41ab5d,238443,006837,004529
+YlGnBu (ColorBrewer),range,ffffd9,edf8b0,c7e9b4,7fcdbb,41b6c3,1d91c0,225ea8,253494,081d58
+YlOrBr (ColorBrewer),range,ffffe5,fff7bc,fee391,fec44f,fe9929,ec7014,cc4c02,993404,662506
+YlOrRd (ColorBrewer),range,ffffcc,ffeda0,fed976,feb24c,fd8d3c,fc4e2a,e31a1a,bd0026,b00026
+Blues (ColorBrewer),range,f7fbff,deebf7,c6dbef,9ecae1,6baed6,4292c6,2171b5,08519c,08306b
+Greens (ColorBrewer),range,f7fcf5,e5f5e0,c7e9c0,a1d99b,74c476,41ab5d,238b45,006d2c,00441b
+Greys (ColorBrewer),range,ffffff,f0f0f0,d9d9d9,bdbdbd,969696,737373,525252,252525,000000
+Oranges (ColorBrewer),range,fff5eb,fee6ce,fdd0a2,fdae6b,fd8d3c,f16913,d94801,a63603,7f2704
+Purples (ColorBrewer),range,fcfbfd,efedf5,dadaeb,bbbddc,9e9ac8,807dba,6a51a3,54278f,3f007d
+Reds (ColorBrewer),range,fff5f0,fee0d2,fcbba1,fc9272,fb6a4a,ef3b2c,cb181d,a50f15,67000d
+BrBG (ColorBrewer),range,543005,8c510a,bf812d,dfc27d,f6e8c3,f5f5f5,c7eae5,80cdc1,35978f,01665e,003c30
+PRGn (ColorBrewer),range,40004b,762a83,9970ab,c2a5cf,e7d4e8,f7f7f7,d9f0d3,a8d8b7,5aae61,1b7837,00441b
+PiYG (ColorBrewer),range,8e0152,c51b7d,de77ae,f1b6da,fde0ef,f7f7f7,e6f5d0,b8e186,7fbc41,4d9221,276419
+PuOr (ColorBrewer),range,7f3b08,b35806,e08214,fdb863,fee0b6,f7f7f7,d8daeb,b2abd2,8073ac,542788,2d004b
+RYB (ColorBrewer),range,a50026,d73027,f46d43,fdae61,fee090,ffffbf,e0f3f8,abd9e9,74add1,4575b4,313695
+RYG (ColorBrewer),range,a50026,d73027,f46d43,fdae61,fee08b,ffffbf,d9ef8b,a6d96a,66bd63,1a9850,006837
+RdBu (ColorBrewer),range,67001f,b2182b,d6604d,f4a582,fddbc7,f7f7f7,d1e5f0,92c5de,4393c3,2166ac,053061
+RdGy (ColorBrewer),range,67001f,b2182b,d6604d,f4a582,fddbc7,ffffff,e0e0e0,bababa,878787,4d4d4d,1a1a1a
+spectral (ColorBrewer),range,9e0142,d53e4f,f46d43,fdae61,fee08b,ffffbf,e6f598,abdda4,66c2a5,3288bd,5e4fa2
+Accents (ColorBrewer),discrete,7fc97f,beaed4,fdc086,ffff99,386cb0,f0027f,bf5b17,666666
+Dark 2 (ColorBrewer),discrete,1b9e77,d95f02,7570b3,e7298a,66a61e,e6ab02,a6761d,666666
+Paired (ColorBrewer),discrete,a6cee3,1f77b4,b2df8a,33a02c,fb9a99,e31a1c,fdbf6f,ff7f00,cab2d6,6a3d9a,ffff99
+Pastel 1 (ColorBrewer),discrete,fbb3ad,b2cce2,ccebc5,decbe4,fed9a5,ffffcc,e4d7bc,fddaec,f2f2f2
+Pastel 2 (ColorBrewer),discrete,b3e2cd,fdcdac,cbd5e8,f4cae4,e6f5c9,fff2ae,f1e2cc,cccccc
+Set 1 (ColorBrewer),discrete,e31a1c,377db8,4daf4a,984ea3,ff7f00,ffff33,a65628,f781bf,999999
+Set 2 (ColorBrewer),discrete,66c2a5,fc8d62,8da0cb,e78ac3,a6d854,ffd92f,e5c494,b3b3b3
+Set 3 (ColorBrewer),discrete,8dd3c7,ffffbc,bebada,fb8072,80b1d3,fdb462,b3de69,fccde5,d9d9d9,bc80bd,ccebc5,ffed6f
+Autumn Evening (Visual Mining Inc.),discrete,993300,6B5E4F,934266,629191,93928F,485EB4,B5A689
+Azalea Garden (Visual Mining Inc.),discrete,755CB7,BABA66,255CC9,375437,007DA3,A10346,758C27
+Cool and Crisp (Visual Mining Inc.),discrete,005699,99CCCC,008B87,C2C4C6,68AEE0,00B09B,9691C7
+Crackling Rosy (Visual Mining Inc.),discrete,99007E,BE99CC,9600A7,C6C2C5,E068CE,6C00B0,C7919A
+Earthy (Visual Mining Inc.),discrete,999966,213321,C3C3E6,333366,DACE98,AA0036,291441
+Expanded Earth Tones (Visual Mining Inc.),discrete,284B53,005699,B8BC9C,271651,AA0036,ECF0B9,999966,333366,C3C3E6,594330,A0BDC4,005699,999966,213321,DACE98
+Festival (Visual Mining Inc.),discrete,CC33CC,FFFF66,62449B,FF9933,999933,FFFFCC,B31646
+Garden Party (Visual Mining Inc.),discrete,FFCC33,33FFCC,9999FF,FF6600,00008B,CC9900,8B0000
+Gold Amber (Visual Mining Inc.),discrete,998300,CCAE99,A76100,C6C6C2,E0CB68,B03400,ABC791
+Lilies and Chrysanthemums (Visual Mining Inc.),discrete,D6B8D9,7D0440,CCD29C,CD672F,8F7DA0,E9E497,A9A67E,D8D7F1,5C776B,5C1F4D
+Moon Lake (Visual Mining Inc.),discrete,E3D782,C7555A,7D1242,51779C,82CBD9,1A2A67,BCCCC1
+Post-Modern (Visual Mining Inc.),discrete,ECEFB8,576728,FFEFCF,386AB3,E2EBF0,C77640,E9ECD9,284B53
+Rose and Jade (Visual Mining Inc.),discrete,D6B8D9,C7D38E,93785F,CBAC9F,EB769A,A74F78
+Soft and Warm (Visual Mining Inc.),discrete,FFF4D6,D7BAD6,A1BBEE,C0C1A1,F0CBAE,958F91,BFA9AC,DBCE99,C8C8C8
+Sophisticated Shades (Visual Mining Inc.),discrete,6C5D94,999966,315394,213321,00566F,690931,515F23
+Summer Smoothie (Visual Mining Inc.),discrete,EBF0F3,5E8109,F7BB83,B55290,1A4C8F,00AB9C,758EC5
+Super-Chill (Visual Mining Inc.),discrete,01559B,68FCFF,008AA7,BAC2CF,49B3FF,00B09B,6A59FF
+Swimming Pool (Visual Mining Inc.),discrete,AC0000,E76C42,99CC99,CC3300,C6FCFB,64BCB7,2F3293,FF6666,339276
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorScheme.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorRenderer.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorRenderer.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorRenderer.java	(revision 1648)
@@ -0,0 +1,123 @@
+/*
+ * Created on 15-mar-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.utils;
+
+import java.awt.Color;
+import java.awt.Component;
+
+import javax.swing.BorderFactory;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.border.Border;
+import javax.swing.table.TableCellRenderer;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author vcn
+ */
+public class ColorRenderer extends JLabel implements TableCellRenderer {
+    Border unselectedBorder = null;
+    Border selectedBorder = null;
+    boolean isBordered = true;
+
+    /**
+     * Creates a new ColorRenderer object.
+     *
+     * @param isBordered DOCUMENT ME!
+     */
+    public ColorRenderer(boolean isBordered) {
+        this.isBordered = isBordered;
+        setOpaque(true); //MUST do this for background to show up.
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param table DOCUMENT ME!
+     * @param color DOCUMENT ME!
+     * @param isSelected DOCUMENT ME!
+     * @param hasFocus DOCUMENT ME!
+     * @param row DOCUMENT ME!
+     * @param column DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public Component getTableCellRendererComponent(JTable table, Object color,
+        boolean isSelected, boolean hasFocus, int row, int column) {
+        Color newColor = (Color) color;
+        setBackground(newColor);
+
+        //JLabel boton=new JLabel("si");
+        //boton.setBackground(new Color(10,10,100));
+        //add(boton);
+        //System.out.println("dentro de Color Renderer");
+        if (isBordered) {
+            if (isSelected) {
+                if (selectedBorder == null) {
+                    selectedBorder = BorderFactory.createMatteBorder(2, 5, 2,
+                            5, table.getSelectionBackground());
+                }
+
+                setBorder(selectedBorder);
+            } else {
+                if (unselectedBorder == null) {
+                    unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2,
+                            5, table.getBackground());
+                }
+
+                setBorder(unselectedBorder);
+            }
+        }
+
+      /*  setToolTipText("RGB value: " + newColor.getRed() + ", " +
+            newColor.getGreen() + ", " + newColor.getBlue());
+*/
+        return this;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/utils/ColorRenderer.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WizardPanel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WizardPanel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WizardPanel.java	(revision 1648)
@@ -0,0 +1,64 @@
+/* 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.gui;
+
+import javax.swing.JPanel;
+
+import com.iver.cit.gvsig.gui.wms.WizardListener;
+import com.iver.cit.gvsig.gui.wms.WizardListenerSupport;
+
+
+public class WizardPanel extends JPanel{
+	private WizardListenerSupport listenerSupport = new WizardListenerSupport();
+
+	public void addWizardListener(WizardListener listener) {
+		listenerSupport.addWizardListener(listener);
+	}
+	public void callError(Exception descripcion) {
+		listenerSupport.callError(descripcion);
+	}
+	public void removeWizardListener(WizardListener listener) {
+		listenerSupport.removeWizardListener(listener);
+	}
+	public void callStateChanged(boolean finishable) {
+		listenerSupport.callStateChanged(finishable);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WizardPanel.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FileOpenDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FileOpenDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FileOpenDialog.java	(revision 1648)
@@ -0,0 +1,369 @@
+/*
+ * Created on 23-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui;
+
+import java.awt.BorderLayout;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Vector;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.DefaultListModel;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.swing.filechooser.FileFilter;
+
+import com.hardcode.driverManager.Driver;
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.data.FileDriver;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.drivers.RasterDriver;
+import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.gui.Panels.ProjChooserPanel;
+
+import javax.swing.JComboBox;
+
+import org.cresques.cts.IProjection;
+import org.cresques.cts.ProjectionPool;
+import com.iver.utiles.listManager.ListManagerListener;
+/**
+ * Di�logo para cargar las dieferentes capas a la vista.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FileOpenDialog extends JPanel{
+	// TODO LWS �los m_Files ... �tendr�an que ser GeoFiles (Projected y dem�s)?
+	private static String lastPath = null;
+    private ArrayList m_Files;
+    private javax.swing.JPanel jPanel2 = null;
+    private DefaultListModel m_lstModel;
+    private JFileChooser fileChooser;
+    private Class[] driverClasses;
+
+	private ProjChooserPanel jPanelProj = null;
+	//private JLabel jLabel = null;
+	//private JComboBox jCboProjections = null;
+	private ListManagerSkin listManagerDemoSkin = null;
+    /**
+     * Creates a new FOpenDialog object.
+     *
+     * @param view Vista que vamos a refrescar
+     * @param mapControl MapControl que recibe la capa (te puede interesar
+     *        a�adirla al principal o al Overview.
+     */
+    public FileOpenDialog(Class[] driverClasses) {
+    	initialize();
+    	
+        m_Files = new ArrayList();
+        
+        this.driverClasses = driverClasses;
+        
+        // Cada vez que se abre, se borran las capas que pudiera haber.
+        m_lstModel = new DefaultListModel(); 
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.setLayout(new BorderLayout());
+        this.setSize(514, 280);
+        this.setLayout(null);
+//        this.setBorder(javax.swing.BorderFactory.createBevelBorder(
+  //              javax.swing.border.BevelBorder.RAISED));
+        this.add(getJPanel2(), null);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public File[] getFiles() {
+        MyFile[] files = (MyFile[]) getListManagerDemoSkin().getListManager().getListModel().getObjects().toArray(new MyFile[0]);
+        File[] ret = new File[files.length];
+        
+        for (int i=0; i < files.length; i++)
+        {
+        	ret[i] = files[i].f;
+        }
+        return ret;
+    }
+
+    /**
+     * This method initializes jPanel2
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel2() {
+        if (jPanel2 == null) {
+            javax.swing.border.TitledBorder titledBorder1 = javax.swing.BorderFactory.createTitledBorder(null,
+            		PluginServices.getText(this,"Seleccionar_fichero"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null);
+            jPanel2 = new javax.swing.JPanel();
+            jPanel2.setLayout(null);
+            jPanel2.setBorder(titledBorder1);
+            jPanel2.setPreferredSize(new java.awt.Dimension(380,200));
+            jPanel2.setBounds(2, 2, 510, 272);
+            titledBorder1.setTitle(PluginServices.getText(this,"Capas"));
+            jPanel2.add(getJPanelProj(), null);
+            jPanel2.add(getListManagerDemoSkin(), null);
+        }
+
+        return jPanel2;
+    }
+
+    public String[] getDriverNames(){
+        MyFile[] files = (MyFile[]) getListManagerDemoSkin().getListManager().getListModel().getObjects().toArray(new MyFile[0]);
+        String[] ret = new String[files.length];
+        
+        for (int i=0; i < files.length; i++)
+        {
+        	ret[i] = files[i].getDriverName();
+        }
+        return ret;
+        
+    	// return ((DriverFileFilter) fileChooser.getFileFilter()).getDescription();    	
+    }
+
+    public class DriverFileFilter extends FileFilter{
+		
+		private Driver driver;
+		
+		public DriverFileFilter(String driverName) throws DriverLoadException{
+			driver = LayerFactory.getDM().getDriver(driverName);
+		}
+
+		/**
+		 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
+		 */
+		public boolean accept(File f) {
+			if (f.isDirectory()) return true;
+			if (driver instanceof VectorialFileDriver){
+				return ((VectorialFileDriver) driver).accept(f);
+			}else if (driver instanceof FileDriver){
+				return ((FileDriver) driver).fileAccepted(f);
+			}else if (driver instanceof RasterDriver){
+				return ((RasterDriver) driver).fileAccepted(f);
+			}else{
+				throw new RuntimeException("Tipo no reconocido");
+			}
+		}
+
+		/**
+		 * @see javax.swing.filechooser.FileFilter#getDescription()
+		 */
+		public String getDescription() {
+			return ((Driver) driver).getName();
+		}
+	}
+	
+	public void setDriverClasses(Class[] driverClasses) {
+		this.driverClasses = driverClasses;
+	}
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private ProjChooserPanel getJPanelProj() {
+		if (jPanelProj == null) {
+			jPanelProj = new ProjChooserPanel(FOpenDialog.getLastProjection());
+			jPanelProj.setBounds(11, 214, 448, 35);
+			jPanelProj.setPreferredSize(new java.awt.Dimension(448,35));
+			jPanelProj.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+			        if (jPanelProj.isOkPressed()) {
+			        	FOpenDialog.setLastProjection(jPanelProj.getCurProj());
+			        }
+				}
+			});
+/*			jPanel = new JLabel();
+			jPanel.setBounds(11, 214, 448, 37);
+			jLabel.setText("Seleccione la proyecci�n:");
+			jPanel.add(jLabel, null);
+			jPanel.add(getJCboProjections(), null);*/
+		}
+		return jPanelProj;
+	}
+	/**
+	 * This method initializes jComboBox	
+	 * 	
+	 * @return javax.swing.JComboBox	
+	 * /    
+	private JComboBox getJCboProjections() {
+		if (jCboProjections == null) {
+			Iterator it = ProjectionPool.iterator();
+			Vector vector = new Vector();
+			int selected = -1;
+			int i=0;
+			while (it.hasNext())
+			{				
+				IProjection auxP =(IProjection) it.next();
+				if (auxP == FOpenDialog.getLastProjection())
+						selected = i;
+				vector.add(auxP.getAbrev());
+				i++;
+			}
+			DefaultComboBoxModel cModel = new DefaultComboBoxModel(vector);
+			cModel.setSelectedItem(vector.get(selected));
+			jCboProjections = new JComboBox(cModel);
+			jCboProjections.setPreferredSize(new java.awt.Dimension(124,19));
+			jCboProjections.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
+					String strProj = (String) jCboProjections.getSelectedItem();
+					FOpenDialog.setLastProjection(ProjectionPool.get(strProj));
+				}
+			});
+		}
+		return jCboProjections;
+	}*/
+	
+	public class MyFile {
+		private File f;
+		private String driverName;
+		
+		public MyFile(File f, String driverName){
+			this.f = f;
+			this.driverName = driverName;
+		}
+		
+		public String toString(){
+			return f.getName();
+		}
+		public String getDriverName(){
+			return driverName;
+		}
+		
+	}
+	
+	/**
+	 * This method initializes listManagerDemoSkin	
+	 * 	
+	 * @return com.iver.utiles.listManager.ListManagerDemoSkin	
+	 */    
+	private ListManagerSkin getListManagerDemoSkin() {
+		if (listManagerDemoSkin == null) {
+			listManagerDemoSkin = new ListManagerSkin();
+			listManagerDemoSkin.setBounds(11, 21, 491, 164);
+			listManagerDemoSkin.getListManager().setListener(new ListManagerListener() {
+				public Object[] addObjects() {
+                    fileChooser = new JFileChooser(lastPath);
+                    fileChooser.setMultiSelectionEnabled(true);
+                    fileChooser.setAcceptAllFileFilterUsed(false);
+
+                    try {
+						String[] driverNames = LayerFactory.getDM().getDriverNames();
+						for (int i = 0; i < driverNames.length; i++) {
+							System.err.println("DRIVER "+i+" : "+driverNames[i]);
+							boolean is = false;
+							for (int j = 0; j < driverClasses.length; j++) {
+								if (i == 0) System.err.println("DRIVER CLASS "+j+" : "+driverClasses[j].toString());
+								if (LayerFactory.getDM().isA(driverNames[i], driverClasses[j]))
+									is = true;
+							}
+							if (is){
+								fileChooser.addChoosableFileFilter(new DriverFileFilter(driverNames[i]));									}
+							}
+					} catch (DriverLoadException e1) {
+						NotificationManager.addError("No se pudo acceder a los drivers", e1);
+					}
+
+					int result = fileChooser.showOpenDialog(FileOpenDialog.this);
+					
+                    File[] newFiles = null;
+                    MyFile[] toAdd;
+                    if (result == JFileChooser.APPROVE_OPTION) {
+                        lastPath = fileChooser.getCurrentDirectory().getAbsolutePath();
+                		newFiles = fileChooser.getSelectedFiles();
+                		toAdd = new MyFile[newFiles.length];
+                		for (int ind=0; ind < newFiles.length; ind++)
+                		{
+                		    String driverName = ((DriverFileFilter) fileChooser.getFileFilter()).getDescription();
+                		    toAdd[ind] = new MyFile(newFiles[ind], driverName);
+                		}
+                			
+                		
+                		return toAdd;
+                    }
+                    else
+                    	return new Object[0];
+
+                    // DefaultListModel lstModel = new DefaultListModel();
+/*
+                    for (int iFile = 0; iFile < newFiles.length;
+                            iFile++) {
+                    	File theFile = newFiles[iFile];
+                    	String absolutePath = theFile.getAbsolutePath();
+                    	lastPath = theFile.getParent();
+                    	// Miramos por si es un ecwp:
+                    	int test = absolutePath.indexOf("ecwp:");
+                    	if (test == -1)
+                    		m_lstModel.addElement(absolutePath);
+                    	else
+                    		m_lstModel.addElement(absolutePath.substring(test));
+                    }
+
+                    getJListLayers().setModel(m_lstModel);*/
+
+                }
+
+				public Object getProperties(Object selected) {
+					return null;
+				}
+			});
+		}
+		return listManagerDemoSkin;
+	}
+   }  //  @jve:decl-index=0:visual-constraint="10,10"
+ //  @jve:visual-info  decl-index=0 visual-constraint="10,10"
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FileOpenDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/GUIUtil.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/GUIUtil.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/GUIUtil.java	(revision 1648)
@@ -0,0 +1,1192 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+/* 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.gui;
+
+import java.awt.CardLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.Transferable;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ContainerAdapter;
+import java.awt.event.ContainerEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.font.TextLayout;
+import java.awt.geom.Point2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.GrayFilter;
+import javax.swing.ImageIcon;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JDesktopPane;
+import javax.swing.JFileChooser;
+import javax.swing.JInternalFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JSlider;
+import javax.swing.JTable;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.Timer;
+import javax.swing.UIManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.InternalFrameEvent;
+import javax.swing.event.InternalFrameListener;
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListDataListener;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.plaf.basic.BasicComboBoxEditor;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableColumn;
+
+import com.vividsolutions.jts.util.Assert;
+import com.vividsolutions.jump.util.StringUtil;
+
+
+//<<TODO:NAMING>> Perhaps rename to WorkbenchUtilities and move to workbench package? [Jon Aquino]
+public class GUIUtil {
+    public final static String dbf = "dbf";
+    public final static String dbfDesc = "DBF";
+    public final static String fme = "fme";
+    public final static String fmeDesc = "FME GML";
+    public final static String gml = "gml";
+    public final static String gmlDesc = "GML";
+
+    //<<TODO:REFACTORING>> If these constants are only used by descendants of
+    //AbstractDriver, they should be moved to AbstractDriver. GUIUtilities is
+    //supposed to be very generic. [Jon Aquino]
+    public final static String jml = "jml";
+    public final static String jmlDesc = "JCS GML";
+    public final static String shp = "shp";
+
+    //<<TODO:NAMING>> "ESRI Shapefile" would be more precise. Is this what they
+    //are? [Jon Aquino]
+    public final static String shpDesc = "ESRI Shapefile";
+    public final static String shx = "shx";
+    public final static String shxDesc = "SHX";
+    public final static String wkt = "wkt";
+    public final static String wktDesc = "Well Known Text";
+    public final static String wktaDesc = "Well Known Text (Show Attribute)";
+    public final static String xml = "xml";
+    public final static String xmlDesc = "XML";
+    public static final FileFilter ALL_FILES_FILTER = new FileFilter() {
+            public boolean accept(File f) {
+                return true;
+            }
+
+            public String getDescription() {
+                return "All Files";
+            }
+        };
+
+    public GUIUtil() {
+    }
+
+    /**
+     * Returns a string suitable for embeddind as HTML.  That is, all 
+     * characters which have a special meaning in HTML are escaped
+     * as character codes.
+     * 
+     * <p>
+     * Based on code from Jason Sherman. See http://www.w3schools.com/html/html_asciiref.asp
+     * </p>
+     */
+    public final static String escapeHTML(String value, boolean escapeSpaces,
+        boolean escapeNewlines) {
+        if (value == null) {
+            return (null);
+        }
+
+        char[] content = new char[value.length()];
+        value.getChars(0, value.length(), content, 0);
+
+        StringBuffer result = new StringBuffer();
+
+        for (int i = 0; i < content.length; i++) {
+            switch (content[i]) {
+            case ' ':
+                result.append(escapeSpaces ? "&#32;" : " ");
+
+                break;
+
+            //Added \n [Jon Aquino]
+            case '\n':
+                result.append(escapeNewlines ? "<BR>" : "\n");
+
+                break;
+
+            case '!':
+                result.append("&#33;");
+
+                break;
+
+            case '"':
+                result.append("&#34;");
+
+                break;
+
+            case '#':
+                result.append("&#35;");
+
+                break;
+
+            case '$':
+                result.append("&#36;");
+
+                break;
+
+            case '%':
+                result.append("&#37;");
+
+                break;
+
+            case '&':
+                result.append("&#38;");
+
+                break;
+
+            case '\'':
+                result.append("&#39;");
+
+                break;
+
+            case '(':
+                result.append("&#40;");
+
+                break;
+
+            case ')':
+                result.append("&#41;");
+
+                break;
+
+            case '*':
+                result.append("&#42;");
+
+                break;
+
+            case '+':
+                result.append("&#43;");
+
+                break;
+
+            case ',':
+                result.append("&#44;");
+
+                break;
+
+            case '-':
+                result.append("&#45;");
+
+                break;
+
+            case '.':
+                result.append("&#46;");
+
+                break;
+
+            case '/':
+                result.append("&#47;");
+
+                break;
+
+            case ':':
+                result.append("&#58;");
+
+                break;
+
+            case ';':
+                result.append("&#59;");
+
+                break;
+
+            case '<':
+                result.append("&#60;");
+
+                break;
+
+            case '=':
+                result.append("&#61;");
+
+                break;
+
+            case '>':
+                result.append("&#62;");
+
+                break;
+
+            case '?':
+                result.append("&#63;");
+
+                break;
+
+            case '@':
+                result.append("&#64;");
+
+                break;
+
+            case '[':
+                result.append("&#91;");
+
+                break;
+
+            case '\\':
+                result.append("&#92;");
+
+                break;
+
+            case ']':
+                result.append("&#93;");
+
+                break;
+
+            case '^':
+                result.append("&#94;");
+
+                break;
+
+            case '_':
+                result.append("&#95;");
+
+                break;
+
+            case '`':
+                result.append("&#96;");
+
+                break;
+
+            case '{':
+                result.append("&#123;");
+
+                break;
+
+            case '|':
+                result.append("&#124;");
+
+                break;
+
+            case '}':
+                result.append("&#125;");
+
+                break;
+
+            case '~':
+                result.append("&#126;");
+
+                break;
+
+            default:
+                result.append(content[i]);
+            }
+        }
+
+        return (result.toString());
+    }
+
+    /*
+     *  Get the extension of a file e.g. txt
+     */
+    public static String getExtension(File f) {
+        String ext = "";
+        String s = f.getName();
+        int i = s.lastIndexOf('.');
+
+        if ((i > 0) && (i < (s.length() - 1))) {
+            ext = s.substring(i + 1).toLowerCase();
+        }
+
+        return ext;
+    }
+
+    public static Color alphaColor(Color color, int alpha) {
+        return new Color(color.getRed(), color.getGreen(), color.getBlue(),
+            alpha);
+    }
+
+    /**
+     *  Centres the first component on the second
+     *
+     *@param  componentToMove      Description of the Parameter
+     *@param  componentToCentreOn  Description of the Parameter
+     */
+    public static void centre(Component componentToMove,
+        Component componentToCentreOn) {
+        Dimension componentToCentreOnSize = componentToCentreOn.getSize();
+        componentToMove.setLocation(componentToCentreOn.getX() +
+            ((componentToCentreOnSize.width - componentToMove.getWidth()) / 2),
+            componentToCentreOn.getY() +
+            ((componentToCentreOnSize.height - componentToMove.getHeight()) / 2));
+    }
+
+    /**
+     *  Centres the component on the screen
+     *
+     *@param  componentToMove  Description of the Parameter
+     */
+    public static void centreOnScreen(Component componentToMove) {
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        componentToMove.setLocation((screenSize.width -
+            componentToMove.getWidth()) / 2,
+            (screenSize.height - componentToMove.getHeight()) / 2);
+    }
+
+    /**
+     *  Centres the component on its window
+     *
+     *@param  componentToMove  Description of the Parameter
+     */
+    public static void centreOnWindow(Component componentToMove) {
+        centre(componentToMove,
+            SwingUtilities.windowForComponent(componentToMove));
+    }
+
+    /**
+     *  Sets the column widths based on the first row.
+     *
+     *@param  table  Description of the Parameter
+     */
+    public static void chooseGoodColumnWidths(JTable table) {
+        //Without padding, columns are slightly narrow, and we get "...". [Jon Aquino]
+        final int PADDING = 5;
+
+        if (table.getModel().getRowCount() == 0) {
+            return;
+        }
+
+        for (int i = 0; i < table.getModel().getColumnCount(); i++) {
+            TableColumn column = table.getColumnModel().getColumn(i);
+            double headerWidth = table.getTableHeader().getDefaultRenderer()
+                                      .getTableCellRendererComponent(table,
+                    table.getModel().getColumnName(i), false, false, 0, i)
+                                      .getPreferredSize().getWidth() + PADDING;
+            double valueWidth = 10; // default in case of error
+
+            try {
+                valueWidth = table.getCellRenderer(0, i)
+                                  .getTableCellRendererComponent(table,
+                        table.getModel().getValueAt(0, i), false, false, 0, i)
+                                  .getPreferredSize().getWidth() + PADDING;
+            } catch (Exception ex) {
+                // ignore the exception, since we can easily choose a default width
+            }
+
+            //Limit column width to 200 pixels.
+            int width = Math.min(200,
+                    Math.max((int) headerWidth, (int) valueWidth));
+            column.setPreferredWidth(width);
+
+            //Need to set the actual width too, otherwise actual width may end
+            //up a bit less than the preferred width. [Jon Aquino]
+            column.setWidth(width);
+        }
+    }
+
+    public static JFileChooser createJFileChooserWithExistenceChecking() {
+        return new JFileChooser() {
+                public void approveSelection() {
+                    File[] files = selectedFiles(this);
+
+                    if (files.length == 0) {
+                        return;
+                    }
+
+                    for (int i = 0; i < files.length; i++) {
+                        if (!files[i].exists() && !files[i].isFile()) {
+                            return;
+                        }
+                    }
+
+                    super.approveSelection();
+                }
+            };
+    }
+
+    public static JFileChooser createJFileChooserWithOverwritePrompting() {
+        return new JFileChooser() {
+                public void approveSelection() {
+                    if (selectedFiles(this).length != 1) {
+                        return;
+                    }
+
+                    File selectedFile = selectedFiles(this)[0];
+
+                    if (selectedFile.exists() && !selectedFile.isFile()) {
+                        return;
+                    }
+
+                    if (selectedFile.exists()) {
+                        int response = JOptionPane.showConfirmDialog(this,
+                                "The file " + selectedFile.getName() +
+                                " already exists. Do you " +
+                                "want to replace the existing file?", "JUMP",
+                                JOptionPane.YES_NO_OPTION);
+
+                        if (response != JOptionPane.YES_OPTION) {
+                            return;
+                        }
+                    }
+
+                    super.approveSelection();
+                }
+            };
+    }
+
+    public static void doNotRoundDoubles(JTable table) {
+        table.setDefaultRenderer(Double.class,
+            new DefaultTableCellRenderer() {
+                public void setValue(Object value) {
+                    setText((value == null) ? "" : ("" + value));
+                }
+
+                {
+                    setHorizontalAlignment(SwingConstants.RIGHT);
+                }
+            });
+    }
+
+    /**
+     *  Workaround for Java Bug 4648654 "REGRESSION: Editable JComboBox focus
+     *  misbehaves under Windows look and feel, proposed by Kleopatra
+     *  (fastegal@addcom.de). Also see Java Bug 4673880 "REGRESSION: Modified
+     *  editable JComboBox in Windows LAF does not release focus." This bug
+     *  started occurring in Java 1.4.0.
+     *
+     *@param  cb  Description of the Parameter
+     */
+    public static void fixEditableComboBox(JComboBox cb) {
+        Assert.isTrue(cb.isEditable());
+
+        if (!UIManager.getLookAndFeel().getName().equals("Windows")) {
+            return;
+        }
+
+        cb.setEditor(new BasicComboBoxEditor() {
+                public void setItem(Object item) {
+                    super.setItem(item);
+                    editor.selectAll();
+                }
+            });
+    }
+
+    public static void handleThrowable(final Throwable t, final Component parent) {
+        try {
+            //<<TODO:UI>> A humane interface does not pop up an error dialog, as that interrupts
+            //the user's work. Rather, error messages are displayed modelessly. See the book
+            //"Humane Interfaces" (Raskin 2000) [Jon Aquino]
+            SwingUtilities.invokeLater(new Runnable() {
+                    public void run() {
+                        t.printStackTrace(System.out);
+                        JOptionPane.showMessageDialog(parent,
+                            StringUtil.split(t.toString(), 80), "Exception",
+                            JOptionPane.ERROR_MESSAGE);
+                    }
+                });
+        } catch (Throwable t2) {
+            t2.printStackTrace(System.out);
+        }
+    }
+
+    /**
+     * GUI operations should be performed only on the AWT event dispatching
+     * thread. Blocks until the Runnable is finished.
+     */
+    public static void invokeOnEventThread(Runnable r)
+        throws InterruptedException, InvocationTargetException {
+        if (SwingUtilities.isEventDispatchThread()) {
+            r.run();
+        } else {
+            SwingUtilities.invokeAndWait(r);
+        }
+    }
+
+    public static String nameWithoutExtension(File file) {
+        String name = file.getName();
+        int dotPosition = name.indexOf('.');
+
+        return (dotPosition < 0) ? name : name.substring(0, dotPosition);
+    }
+
+    public static void removeChoosableFileFilters(JFileChooser fc) {
+        FileFilter[] filters = fc.getChoosableFileFilters();
+
+        for (int i = 0; i < filters.length; i++) {
+            fc.removeChoosableFileFilter(filters[i]);
+        }
+
+        return;
+    }
+
+    /**
+     * @param extensions e.g. txt
+     */
+    public static FileFilter createFileFilter(final String description,
+        final String[] extensions) {
+        return new FileFilter() {
+                public boolean accept(File f) {
+                    if (f.isDirectory()) {
+                        return true;
+                    }
+
+                    for (int i = 0; i < extensions.length; i++) {
+                        if (GUIUtil.getExtension(f).equalsIgnoreCase(extensions[i])) {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                public String getDescription() {
+                    ArrayList extensionStrings = new ArrayList();
+
+                    for (int i = 0; i < extensions.length; i++) {
+                        extensionStrings.add("*." + extensions[i]);
+                    }
+
+                    return description + " (" +
+                    StringUtil.replaceAll(StringUtil.toCommaDelimitedString(
+                            extensionStrings), ",", ";") + ")";
+                }
+            };
+    }
+
+    /**
+     *@param  color  a Color with possibly an alpha less than 255
+     *@return        a Color with alpha equal to 255, but equivalent to the
+     *      original translucent colour on a white background
+     */
+    public static Color toSimulatedTransparency(Color color) {
+        //My guess, but it seems to work! [Jon Aquino]
+        return new Color(color.getRed() +
+            (int) (((255 - color.getRed()) * (255 - color.getAlpha())) / 255d),
+            color.getGreen() +
+            (int) (((255 - color.getGreen()) * (255 - color.getAlpha())) / 255d),
+            color.getBlue() +
+            (int) (((255 - color.getBlue()) * (255 - color.getAlpha())) / 255d));
+    }
+
+    public static String truncateString(String s, int maxLength) {
+        if (s.length() < maxLength) {
+            return s;
+        }
+
+        return s.substring(0, maxLength - 3) + "...";
+    }
+
+    public static Point2D subtract(Point2D a, Point2D b) {
+        return new Point2D.Double(a.getX() - b.getX(), a.getY() - b.getY());
+    }
+
+    public static Point2D add(Point2D a, Point2D b) {
+        return new Point2D.Double(a.getX() + b.getX(), a.getY() + b.getY());
+    }
+
+    public static Point2D multiply(Point2D v, double x) {
+        return new Point2D.Double(v.getX() * x, v.getY() * x);
+    }
+
+    /**
+     * The JVM's clipboard implementation is buggy (see bugs 4644554 and 4522198
+     * in Sun's Java bug database). This method is a workaround that returns null
+     * if an exception is thrown, as suggested in the bug reports.
+     */
+    public static Transferable getContents(Clipboard clipboard) {
+        try {
+            return clipboard.getContents(null);
+        } catch (Throwable t) {
+            return null;
+        }
+    }
+
+    /**
+     * Returns the distance from the baseline to the top of the text's bounding box.
+     * Unlike the usual ascent, which is independent of the actual text.
+     * Note that "True ascent" is not a standard term.
+     */
+    public static double trueAscent(TextLayout layout) {
+        return -layout.getBounds().getY();
+    }
+
+    public static ImageIcon resize(ImageIcon icon, int extent) {
+        return new ImageIcon(icon.getImage().getScaledInstance(extent, extent,
+                Image.SCALE_SMOOTH));
+    }
+
+    /**
+     * Resizes icon to 16 x 16.
+     */
+    public static ImageIcon toSmallIcon(ImageIcon icon) {
+        return resize(icon, 16);
+    }
+
+    public static int swingThreadPriority() {
+        final Int i = new Int();
+
+        try {
+            invokeOnEventThread(new Runnable() {
+                    public void run() {
+                        i.i = Thread.currentThread().getPriority();
+                    }
+                });
+        } catch (InvocationTargetException e) {
+            Assert.shouldNeverReachHere();
+        } catch (InterruptedException e) {
+            Assert.shouldNeverReachHere();
+        }
+
+        return i.i;
+    }
+
+    /**
+     * Fix for Sun Java Bug 4398733: if you click in an inactive JInternalFrame,
+     * the mousePressed and mouseReleased events will be fired, but not the
+     * mouseClicked event.
+     */
+    public static void fixClicks(final Component c) {
+        //This is a time bomb because when (if?) Sun fixes the bug, this method will
+        //add an extra click. We should put an if statement here that immediately
+        //returns if the Java version is greater than or equal to that in which the bug
+        //is fixed. Problem is, we don't know what that version will be. [Jon Aquino]
+        c.addMouseListener(new MouseListener() {
+                public void mousePressed(MouseEvent e) {
+                    add(e);
+                }
+
+                public void mouseExited(MouseEvent e) {
+                    add(e);
+                }
+
+                public void mouseClicked(MouseEvent e) {
+                    add(e);
+                }
+
+                public void mouseEntered(MouseEvent e) {
+                    add(e);
+                }
+
+                private MouseEvent event(int i) {
+                    return (MouseEvent) events.get(i);
+                }
+
+                public void mouseReleased(MouseEvent e) {
+                    add(e);
+
+                    if ((events.size() == 4) &&
+                            (event(0).getID() == MouseEvent.MOUSE_PRESSED) &&
+                            (event(1).getID() == MouseEvent.MOUSE_EXITED) &&
+                            (event(2).getID() == MouseEvent.MOUSE_ENTERED)) {
+                        c.dispatchEvent(new MouseEvent(c,
+                                MouseEvent.MOUSE_CLICKED,
+                                System.currentTimeMillis(), e.getModifiers(),
+                                e.getX(), e.getY(), e.getClickCount(),
+                                e.isPopupTrigger()));
+                    }
+                }
+
+                private void add(MouseEvent e) {
+                    if (events.size() == 4) {
+                        events.remove(0);
+                    }
+
+                    events.add(e);
+                }
+
+                private ArrayList events = new ArrayList();
+            });
+    }
+
+    /**
+     * Listens to all internal frames (current and future) in a JDesktopPane.
+     */
+    public static void addInternalFrameListener(JDesktopPane pane,
+        final InternalFrameListener listener) {
+        JInternalFrame[] frames = pane.getAllFrames();
+
+        for (int i = 0; i < frames.length; i++) {
+            frames[i].addInternalFrameListener(listener);
+        }
+
+        pane.addContainerListener(new ContainerAdapter() {
+                public void componentAdded(ContainerEvent e) {
+                    if (e.getChild() instanceof JInternalFrame) {
+                        ((JInternalFrame) e.getChild()).removeInternalFrameListener(listener);
+                        ((JInternalFrame) e.getChild()).addInternalFrameListener(listener);
+                    }
+                }
+            });
+    }
+
+    public static DocumentListener toDocumentListener(
+        final ActionListener listener) {
+        return new DocumentListener() {
+                public void insertUpdate(DocumentEvent e) {
+                    listener.actionPerformed(new ActionEvent(e, 0, e.toString()));
+                }
+
+                public void removeUpdate(DocumentEvent e) {
+                    listener.actionPerformed(new ActionEvent(e, 0, e.toString()));
+                }
+
+                public void changedUpdate(DocumentEvent e) {
+                    listener.actionPerformed(new ActionEvent(e, 0, e.toString()));
+                }
+            };
+    }
+
+    public static ListDataListener toListDataListener(
+        final ActionListener listener) {
+        return new ListDataListener() {
+                public void intervalAdded(ListDataEvent e) {
+                    listener.actionPerformed(new ActionEvent(e.getSource(), 0,
+                            e.toString()));
+                }
+
+                public void intervalRemoved(ListDataEvent e) {
+                    listener.actionPerformed(new ActionEvent(e.getSource(), 0,
+                            e.toString()));
+                }
+
+                public void contentsChanged(ListDataEvent e) {
+                    listener.actionPerformed(null);
+                }
+            };
+    }
+
+    public static InternalFrameListener toInternalFrameListener(
+        final ActionListener listener) {
+        return new InternalFrameListener() {
+                private void fireActionPerformed(InternalFrameEvent e) {
+                    listener.actionPerformed(new ActionEvent(e.getSource(),
+                            e.getID(), e.toString()));
+                }
+
+                public void internalFrameActivated(InternalFrameEvent e) {
+                    fireActionPerformed(e);
+                }
+
+                public void internalFrameClosed(InternalFrameEvent e) {
+                    fireActionPerformed(e);
+                }
+
+                public void internalFrameClosing(InternalFrameEvent e) {
+                    fireActionPerformed(e);
+                }
+
+                public void internalFrameDeactivated(InternalFrameEvent e) {
+                    fireActionPerformed(e);
+                }
+
+                public void internalFrameDeiconified(InternalFrameEvent e) {
+                    fireActionPerformed(e);
+                }
+
+                public void internalFrameIconified(InternalFrameEvent e) {
+                    fireActionPerformed(e);
+                }
+
+                public void internalFrameOpened(InternalFrameEvent e) {
+                    fireActionPerformed(e);
+                }
+            };
+    }
+
+    /**
+     * Returns a Timer that fires once, after the delay. The delay can be restarted
+     * by restarting the Timer.
+     */
+    public static Timer createRestartableSingleEventTimer(int delay,
+        ActionListener listener) {
+        Timer timer = new Timer(delay, listener);
+        timer.setCoalesce(true);
+        timer.setInitialDelay(delay);
+        timer.setRepeats(false);
+
+        return timer;
+    }
+
+    public static ValidatingTextField createSyncdTextField(JSlider s) {
+        int columns = (int) Math.ceil(Math.log(s.getMaximum()) / Math.log(10));
+
+        return createSyncdTextField(s, columns);
+    }
+
+    public static ValidatingTextField createSyncdTextField(JSlider s,
+        int columns) {
+        ValidatingTextField t = new ValidatingTextField(s.getValue() + "",
+                columns, SwingConstants.RIGHT,
+                ValidatingTextField.INTEGER_VALIDATOR,
+                new ValidatingTextField.CompositeCleaner(new ValidatingTextField.Cleaner[] {
+                        new ValidatingTextField.BlankCleaner("" +
+                            s.getMinimum()),
+                        new ValidatingTextField.MinIntCleaner(s.getMinimum()),
+                        new ValidatingTextField.MaxIntCleaner(s.getMaximum())
+                    }));
+        sync(s, t);
+        syncEnabledStates(s, t);
+
+        return t;
+    }
+    
+    /**
+     * @see #createSyncdTextField(JSlider s, int columns)
+     */
+     public static void sync(final JSlider s, final ValidatingTextField t) {
+        t.setText("" + s.getValue());
+
+        final Boolean[] changing = new Boolean[] { Boolean.FALSE };
+        s.addChangeListener(new ChangeListener() {
+                public void stateChanged(ChangeEvent e) {
+                    if (changing[0] == Boolean.TRUE) {
+                        return;
+                    }
+
+                    changing[0] = Boolean.TRUE;
+
+                    try {
+                        t.setText("" + s.getValue());
+                    } finally {
+                        changing[0] = Boolean.FALSE;
+                    }
+                }
+            });
+        t.getDocument().addDocumentListener(new DocumentListener() {
+                private void changed() {
+                    if (changing[0] == Boolean.TRUE) {
+                        return;
+                    }
+
+                    changing[0] = Boolean.TRUE;
+
+                    try {
+                        s.setValue(t.getInteger());
+                    } finally {
+                        changing[0] = Boolean.FALSE;
+                    }
+                }
+
+                public void changedUpdate(DocumentEvent e) {
+                    changed();
+                }
+
+                public void insertUpdate(DocumentEvent e) {
+                    changed();
+                }
+
+                public void removeUpdate(DocumentEvent e) {
+                    changed();
+                }
+            });
+    }
+
+    public static void syncEnabledStates(final JComponent c1,
+        final JComponent c2) {
+        c2.setEnabled(c1.isEnabled());
+        c1.addPropertyChangeListener("enabled",
+            new PropertyChangeListener() {
+                public void propertyChange(PropertyChangeEvent evt) {
+                    if (c1.isEnabled() == c2.isEnabled()) {
+                        return;
+                    }
+
+                    c2.setEnabled(c1.isEnabled());
+                }
+            });
+        c2.addPropertyChangeListener("enabled",
+            new PropertyChangeListener() {
+                public void propertyChange(PropertyChangeEvent evt) {
+                    if (c1.isEnabled() == c2.isEnabled()) {
+                        return;
+                    }
+
+                    c1.setEnabled(c2.isEnabled());
+                }
+            });
+    }
+
+    public static void sync(final JSlider s1, final JSlider s2) {
+        s2.setValue(s1.getValue());
+        Assert.isTrue(s1.getMinimum() == s2.getMinimum());
+        Assert.isTrue(s1.getMaximum() == s2.getMaximum());
+
+        final Boolean[] changing = new Boolean[] { Boolean.FALSE };
+        s1.addChangeListener(new ChangeListener() {
+                public void stateChanged(ChangeEvent e) {
+                    if (changing[0] == Boolean.TRUE) {
+                        return;
+                    }
+
+                    changing[0] = Boolean.TRUE;
+
+                    try {
+                        s2.setValue(s1.getValue());
+                    } finally {
+                        changing[0] = Boolean.FALSE;
+                    }
+                }
+            });
+        s2.addChangeListener(new ChangeListener() {
+                public void stateChanged(ChangeEvent e) {
+                    if (changing[0] == Boolean.TRUE) {
+                        return;
+                    }
+
+                    changing[0] = Boolean.TRUE;
+
+                    try {
+                        s1.setValue(s2.getValue());
+                    } finally {
+                        changing[0] = Boolean.FALSE;
+                    }
+                }
+            });
+    }
+
+    public static void sync(final JCheckBox c1, final JCheckBox c2) {
+        c2.setSelected(c1.isSelected());
+
+        final Boolean[] changing = new Boolean[] { Boolean.FALSE };
+        c1.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    if (changing[0] == Boolean.TRUE) {
+                        return;
+                    }
+
+                    changing[0] = Boolean.TRUE;
+
+                    try {
+                        c2.setSelected(c1.isSelected());
+                    } finally {
+                        changing[0] = Boolean.FALSE;
+                    }
+                }
+            });
+        c2.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    if (changing[0] == Boolean.TRUE) {
+                        return;
+                    }
+
+                    changing[0] = Boolean.TRUE;
+
+                    try {
+                        c1.setSelected(c2.isSelected());
+                    } finally {
+                        changing[0] = Boolean.FALSE;
+                    }
+                }
+            });
+    }
+
+    public static List items(JComboBox comboBox) {
+        ArrayList items = new ArrayList();
+
+        for (int i = 0; i < comboBox.getItemCount(); i++) {
+            items.add(comboBox.getItemAt(i));
+        }
+
+        return items;
+    }
+
+    /**
+     * Calls #doClick so that events are fired.
+     */
+    public static void setSelectedWithClick(JCheckBox checkBox, boolean selected) {
+        checkBox.setSelected(!selected);
+        checkBox.doClick();
+    }
+
+    public static void setLocation(Component componentToMove,
+        Location location, Component other) {
+        Point p = new Point((int) other.getLocationOnScreen().getX() +
+                (location.fromRight
+                ? (other.getWidth() - componentToMove.getWidth() - location.x)
+                : location.x),
+                (int) other.getLocationOnScreen().getY() +
+                (location.fromBottom
+                ? (other.getHeight() - componentToMove.getHeight() -
+                location.y) : location.y));
+        SwingUtilities.convertPointFromScreen(p, componentToMove.getParent());
+        componentToMove.setLocation(p);
+    }
+
+
+    /** Highlights a given component with a given color. 
+     * Great for GridBagLayout debugging. 
+     *
+     * @author Jon Aquino
+     */
+    public static void highlightForDebugging(JComponent component, Color color) {
+        component.setBackground(color);
+        component.setBorder(BorderFactory.createMatteBorder(10, 10, 10, 10,
+                color));
+    }
+
+    public static Component topCard(Container c) {
+        Assert.isTrue(c.getLayout() instanceof CardLayout);
+
+        Component[] components = c.getComponents();
+
+        for (int i = 0; i < components.length; i++) {
+            if (components[i].isVisible()) {
+                return components[i];
+            }
+        }
+
+        Assert.shouldNeverReachHere();
+
+        return null;
+    }
+
+    /**
+     * Work around Java Bug 4437688 "JFileChooser.getSelectedFile() returns
+     * nothing when a file is selected" [Jon Aquino]
+     */
+    public static File[] selectedFiles(JFileChooser chooser) {
+        return ((chooser.getSelectedFiles().length == 0) &&
+        (chooser.getSelectedFile() != null))
+        ? new File[] { chooser.getSelectedFile() } : chooser.getSelectedFiles();
+    }
+
+    public static ImageIcon toDisabledIcon(ImageIcon icon) {
+        return new ImageIcon(GrayFilter.createDisabledImage((icon).getImage()));
+    }
+
+    public static Component getDescendantOfClass(Class c, Container container) {
+        for (int i = 0; i < container.getComponentCount(); i++) {
+            if (c.isInstance(container.getComponent(i))) {
+                return container.getComponent(i);
+            }
+
+            if (container.getComponent(i) instanceof Container) {
+                Component descendant = getDescendantOfClass(c,
+                        (Container) container.getComponent(i));
+
+                if (descendant != null) {
+                    return descendant;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Ensures that the next frame is activated when #dispose is called
+     * explicitly, in JDK 1.4. JDK 1.3 didn't have this problem.
+     */
+    public static void dispose(final JInternalFrame internalFrame,
+        JDesktopPane desktopPane) {
+        desktopPane.getDesktopManager().closeFrame(internalFrame);
+        internalFrame.dispose();
+    }
+
+    private static class Int {
+        public volatile int i;
+    }
+
+    public static class Location {
+        private int x;
+        private int y;
+        private boolean fromRight;
+        private boolean fromBottom;
+
+        /**
+	 * Constructor taking an initial location, offset hint.
+	 *
+         * @param fromBottom whether y is the number of pixels between the bottom
+         * edges of the toolbox and desktop pane, or between the top edges.
+         */
+        public Location(int x, boolean fromRight, int y, boolean fromBottom) {
+            this.x = x;
+            this.y = y;
+            this.fromRight = fromRight;
+            this.fromBottom = fromBottom;
+        }
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/GUIUtil.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListSelectorListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListSelectorListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListSelectorListener.java	(revision 1648)
@@ -0,0 +1,71 @@
+/* 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.gui;
+
+/**
+ * Interfaz invocada por el FPanelExtentSelector cuando el usuario ha seleccionado al
+ * menos un elemento y pulsa el bot�n aceptar
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public interface ListSelectorListener {
+    /**
+     * M�todo invocado cuando el usuario pulsa aceptar y hay algo seleccionado
+     *
+     * @param indices Array con los �ndices de los elementos seleccionados
+     */
+    public void indexesSelected(int[] indices);
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param indices DOCUMENT ME!
+     */
+    public void indexesRemoved(int[] indices);
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param name DOCUMENT ME!
+     */
+    public void newElement(String name);
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListSelectorListener.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WMSDataSourceAdapter.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WMSDataSourceAdapter.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WMSDataSourceAdapter.java	(revision 1648)
@@ -0,0 +1,482 @@
+/*
+ * Created on 09-sep-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui;
+
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import org.exolab.castor.xml.ValidationException;
+
+import com.iver.cit.gvsig.gui.wms.LayerInfo;
+import com.iver.cit.gvsig.gui.wms.WizardData;
+import com.iver.cit.gvsig.gui.wms.WizardDataSource;
+import com.iver.wmsclient.UnsupportedVersionException;
+import com.iver.wmsclient.WMSClient;
+import com.iver.wmsclient.WMSClientFactory;
+import com.iver.wmsclient.wms_1_0_0.capabilities.Format;
+import com.iver.wmsclient.wms_1_0_0.capabilities.Layer;
+import com.iver.wmsclient.wms_1_0_0.capabilities.Name;
+import com.iver.wmsclient.wms_1_0_0.capabilities.SRS;
+import com.iver.wmsclient.wms_1_0_0.capabilities.WMT_MS_Capabilities;
+
+
+/**
+ * Adapta las capa wms de Fmap a los datasource del WMSWizard
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class WMSDataSourceAdapter implements WizardDataSource {
+    private WMSClient cliente;
+
+    /**
+     * M�todo detalles para la versi�n 1.0.0
+     *
+     * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#detalles()
+     */
+    private WizardData detalles_1_0_0(WMT_MS_Capabilities cap) {
+        WizardData data = new WizardData();
+
+        data.setTitle(cap.getService().getTitle().getContent());
+        data.setAbstract(cap.getService().getAbstract().getContent());
+
+        Format f = cap.getCapability().getRequest().getMap().getFormat();
+        ArrayList formatos = new ArrayList();
+
+        if (f.getGIF() != null) {
+            formatos.add("image/gif");
+        }
+
+        if (f.getPNG() != null) {
+            formatos.add("image/png");
+        }
+
+        if (f.getJPEG() != null) {
+            formatos.add("image/jpeg");
+        }
+
+        if (f.getTIFF() != null) {
+            formatos.add("image/tiff");
+        }
+
+        data.setFormats((String[]) formatos.toArray(new String[0]));
+
+        Layer l = cap.getCapability().getLayer();
+
+        LayerInfo root = new LayerInfo();
+        root.text = l.getTitle().getContent();
+
+        Name name = l.getName();
+
+        if (name != null) {
+            root.name = name.getContent();
+        }
+
+        SRS srs = l.getSRS();
+
+        if (srs != null) {
+            root.addSRS(l.getSRS().getContent());
+        }
+
+        rellena_1_0_0((LayerInfo) root, l);
+
+        data.setLayer(root);
+
+        return data;
+    }
+
+    /**
+     * M�todo detalles para la versi�n 1.1.0
+     *
+     * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#detalles()
+     */
+    private WizardData detalles_1_1_0(
+        com.iver.wmsclient.wms_1_1_0.capabilities.WMT_MS_Capabilities cap) {
+        WizardData data = new WizardData();
+
+        data.setTitle(cap.getService().getTitle().getContent());
+        data.setAbstract(cap.getService().getAbstract().getContent());
+
+        com.iver.wmsclient.wms_1_1_0.capabilities.Format[] f = cap.getCapability()
+                                                                           .getRequest()
+                                                                           .getGetMap()
+                                                                           .getFormat();
+        ArrayList formatos = new ArrayList();
+
+        for (int i = 0; i < f.length; i++) {
+            if (isValidFormat(f[i].getContent())) {
+                formatos.add(f[i].getContent());
+            }
+        }
+
+        data.setFormats((String[]) formatos.toArray(new String[0]));
+
+        com.iver.wmsclient.wms_1_1_0.capabilities.Layer l = cap.getCapability()
+                                                                        .getLayer();
+
+        LayerInfo root = new LayerInfo();
+        root.text = l.getTitle().getContent();
+
+        com.iver.wmsclient.wms_1_1_0.capabilities.Name name = l.getName();
+
+        if (name != null) {
+            root.name = name.getContent();
+        }
+
+        com.iver.wmsclient.wms_1_1_0.capabilities.SRS srs = l.getSRS();
+
+        if (srs != null) {
+            root.addSRS(l.getSRS().getContent());
+        }
+
+        rellena_1_1_0((LayerInfo) root, l);
+
+        data.setLayer(root);
+
+        return data;
+    }
+
+    /**
+     * M�todo detalles para la versi�n 1.3.0
+     *
+     * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#detalles()
+     */
+    private WizardData detalles_1_3_0(
+        com.iver.wmsclient.wms_1_3_0.capabilities.WMS_Capabilities cap) {
+        WizardData data = new WizardData();
+
+        data.setTitle(cap.getService().getTitle().getContent());
+        data.setAbstract(cap.getService().getAbstract().getContent());
+
+        com.iver.wmsclient.wms_1_3_0.capabilities.Format[] f = cap.getCapability()
+                                                                           .getRequest()
+                                                                           .getGetMap()
+                                                                           .getFormat();
+        ArrayList formatos = new ArrayList();
+
+        for (int i = 0; i < f.length; i++) {
+            if (isValidFormat(f[i].getContent())) {
+                formatos.add(f[i].getContent());
+            }
+        }
+
+        data.setFormats((String[]) formatos.toArray(new String[0]));
+
+        com.iver.wmsclient.wms_1_3_0.capabilities.Layer l = cap.getCapability()
+                                                                        .getLayer();
+
+        LayerInfo root = new LayerInfo();
+        root.text = l.getTitle().getContent();
+
+        com.iver.wmsclient.wms_1_3_0.capabilities.Name name = l.getName();
+
+        if (name != null) {
+            root.name = name.getContent();
+        }
+
+        String[] srs = l.getCRS();
+
+        if (srs != null) {
+            for (int i = 0; i < srs.length; i++) {
+                root.addSRS(srs[i]);
+            }
+        }
+
+        rellena_1_3_0((LayerInfo) root, l);
+
+        data.setLayer(root);
+
+        return data;
+    }
+
+    /**
+     * M�todo detalles para la versi�n 1.1.1
+     *
+     * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#detalles()
+     */
+    private WizardData detalles_1_1_1(
+        com.iver.wmsclient.wms_1_1_1.capabilities.WMT_MS_Capabilities cap) {
+        WizardData data = new WizardData();
+
+        data.setTitle(cap.getService().getTitle().getContent());
+        data.setAbstract(cap.getService().getAbstract().getContent());
+
+        com.iver.wmsclient.wms_1_1_1.capabilities.Format[] f = cap.getCapability()
+                                                                           .getRequest()
+                                                                           .getGetMap()
+                                                                           .getFormat();
+        ArrayList formatos = new ArrayList();
+
+        for (int i = 0; i < f.length; i++) {
+            if (isValidFormat(f[i].getContent())) {
+                formatos.add(f[i].getContent());
+            }
+        }
+
+        data.setFormats((String[]) formatos.toArray(new String[0]));
+
+        com.iver.wmsclient.wms_1_1_1.capabilities.Layer l = cap.getCapability()
+                                                                        .getLayer();
+
+        LayerInfo root = new LayerInfo();
+        root.text = l.getTitle().getContent();
+
+        com.iver.wmsclient.wms_1_1_1.capabilities.Name name = l.getName();
+
+        if (name != null) {
+            root.name = name.getContent();
+        }
+
+        com.iver.wmsclient.wms_1_1_1.capabilities.SRS[] srs = l.getSRS();
+
+        if (srs != null) {
+            for (int i = 0; i < srs.length; i++) {
+                root.addSRS(srs[i].getContent());
+            }
+        }
+
+        rellena_1_1_1((LayerInfo) root, l);
+
+        data.setLayer(root);
+
+        return data;
+    }
+
+    /**
+     * M�todo para saber los formatos que admite la aplicaci�n
+     *
+     * @param format cadena con el formato a validar
+     *
+     * @return true si soportamos dicho formato y false en
+     * caso contrario
+     */
+    private boolean isValidFormat(String format) {
+        if (format.equalsIgnoreCase("image/png") ||
+                format.equalsIgnoreCase("image/jpg") ||
+                format.equalsIgnoreCase("image/tiff") ||
+                format.equalsIgnoreCase("image/jpeg") ||
+                format.equalsIgnoreCase("image/tif") ||
+                format.equalsIgnoreCase("image/gif")) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Genera la jerarquia de capas para la versi�n 1.0.0
+     *
+     * @param nodo nodo raiz de la jerarqu�a que hay que generar
+     * @param layer objeto layer de la respuesta del servidor
+     */
+    private void rellena_1_0_0(LayerInfo nodo, Layer layer) {
+        for (int i = 0; i < layer.getLayerCount(); i++) {
+            LayerInfo nuevo = new LayerInfo();
+            nuevo.text = layer.getLayer(i).getTitle().getContent();
+
+            Name name = layer.getLayer(i).getName();
+
+            if (name != null) {
+                nuevo.name = name.getContent();
+            }
+
+            SRS srs = layer.getLayer(i).getSRS();
+
+            if (srs != null) {
+                nuevo.addSRS(srs.getContent());
+            }
+
+            nuevo.queryable = layer.getLayer(i).getQueryable().toString()
+                                   .equals("1");
+
+            nodo.hijos.add(nuevo);
+            nuevo.padre = nodo;
+            rellena_1_0_0((LayerInfo) nodo.hijos.get(i), layer.getLayer(i));
+        }
+    }
+
+    /**
+     * Genera la jerarquia de capas para la versi�n 1.1.0
+     *
+     * @param nodo nodo raiz de la jerarqu�a que hay que generar
+     * @param layer objeto layer de la respuesta del servidor
+     */
+    private void rellena_1_1_0(LayerInfo nodo,
+        com.iver.wmsclient.wms_1_1_0.capabilities.Layer layer) {
+        for (int i = 0; i < layer.getLayerCount(); i++) {
+            LayerInfo nuevo = new LayerInfo();
+            nuevo.text = layer.getLayer(i).getTitle().getContent();
+
+            com.iver.wmsclient.wms_1_1_0.capabilities.Name name = layer.getLayer(i)
+                                                                                .getName();
+
+            if (name != null) {
+                nuevo.name = name.getContent();
+            }
+
+            com.iver.wmsclient.wms_1_1_0.capabilities.SRS srs = layer.getLayer(i)
+                                                                              .getSRS();
+
+            if (srs != null) {
+                nuevo.addSRS(srs.getContent());
+            }
+
+            nuevo.queryable = layer.getLayer(i).getQueryable().toString()
+                                   .equals("1");
+
+            nodo.hijos.add(nuevo);
+            nuevo.padre = nodo;
+            rellena_1_1_0((LayerInfo) nodo.hijos.get(i), layer.getLayer(i));
+        }
+    }
+
+    /**
+     * Genera la jerarquia de capas para la versi�n 1.1.1
+     *
+     * @param nodo nodo raiz de la jerarqu�a que hay que generar
+     * @param layer objeto layer de la respuesta del servidor
+     */
+    private void rellena_1_1_1(LayerInfo nodo,
+        com.iver.wmsclient.wms_1_1_1.capabilities.Layer layer) {
+        for (int i = 0; i < layer.getLayerCount(); i++) {
+            LayerInfo nuevo = new LayerInfo();
+            nuevo.text = layer.getLayer(i).getTitle().getContent();
+
+            com.iver.wmsclient.wms_1_1_1.capabilities.Name name = layer.getLayer(i)
+                                                                                .getName();
+                                                                                
+            if (name != null){
+				nuevo.name = name.getContent();
+            }
+
+            com.iver.wmsclient.wms_1_1_1.capabilities.SRS[] srs = layer.getLayer(i)
+                                                                                .getSRS();
+
+            if (srs != null) {
+                for (int j = 0; j < srs.length; j++) {
+                    nuevo.addSRS(srs[j].getContent());
+                }
+            }
+
+            nuevo.queryable = layer.getLayer(i).getQueryable().toString()
+                                   .equals("1");
+
+            nodo.hijos.add(nuevo);
+            nuevo.padre = nodo;
+            rellena_1_1_1((LayerInfo) nodo.hijos.get(i), layer.getLayer(i));
+        }
+    }
+
+    /**
+     * Genera la jerarquia de capas para la versi�n 1.3.0
+     *
+     * @param nodo nodo raiz de la jerarqu�a que hay que generar
+     * @param layer objeto layer de la respuesta del servidor
+     */
+    private void rellena_1_3_0(LayerInfo nodo,
+        com.iver.wmsclient.wms_1_3_0.capabilities.Layer layer) {
+        for (int i = 0; i < layer.getLayerCount(); i++) {
+            LayerInfo nuevo = new LayerInfo();
+            nuevo.text = layer.getLayer(i).getTitle().getContent();
+
+            com.iver.wmsclient.wms_1_3_0.capabilities.Name name = layer.getLayer(i)
+                                                                                .getName();
+
+            if (name != null) {
+                nuevo.name = name.getContent();
+            }
+
+            String[] srs = layer.getLayer(i).getCRS();
+
+            if (srs != null) {
+                for (int j = 0; j < srs.length; j++) {
+                    nuevo.addSRS(srs[j]);
+                }
+            }
+
+            nuevo.queryable = layer.getLayer(i).getQueryable();
+
+            nodo.hijos.add(nuevo);
+            nuevo.padre = nodo;
+            rellena_1_3_0((LayerInfo) nodo.hijos.get(i), layer.getLayer(i));
+        }
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#detalles()
+     */
+    public WizardData detalles(URL host)
+        throws IllegalStateException, ValidationException, 
+            UnsupportedVersionException, IOException {
+        cliente = WMSClientFactory.getClient(host);
+
+        com.iver.wmsclient.Capabilities c = cliente.getCapabilities(host);
+
+        String version = c.getVersion();
+
+        if (version.equals("1.0.0")) {
+            return detalles_1_0_0((WMT_MS_Capabilities) c.getRoot());
+        } else if (version.equals("1.1.0")) {
+            return detalles_1_1_0((com.iver.wmsclient.wms_1_1_0.capabilities.WMT_MS_Capabilities) c.getRoot());
+        } else if (version.equals("1.1.1")) {
+            return detalles_1_1_1((com.iver.wmsclient.wms_1_1_1.capabilities.WMT_MS_Capabilities) c.getRoot());
+        } else if (version.equals("1.3.0")) {
+            return detalles_1_3_0((com.iver.wmsclient.wms_1_3_0.capabilities.WMS_Capabilities) c.getRoot());
+        } else {
+            throw new UnsupportedVersionException(version);
+        }
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#getBoundingBox(java.lang.String,
+     *      java.lang.String)
+     */
+    public Rectangle2D getBoundingBox(String[] layerName, String srs) {
+        return cliente.getBoundingBox(layerName, srs);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/WMSDataSourceAdapter.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/IView.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/IView.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/IView.java	(revision 1648)
@@ -0,0 +1,76 @@
+/*
+ * Created on 09-dic-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.gui.toc.TOC;
+
+/**
+ * @author FJP
+ * 
+ * El motivo de tener un Interfaz IView es para poder tener aplicaciones
+ * como SingleView, que permiten tener un interfaz del tipo SDI en lugar
+ * de MDI.
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public interface IView {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public abstract MapControl getMapControl();
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public abstract TOC getTOC();
+}
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/IView.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/DefaultSelectionByThemeModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/DefaultSelectionByThemeModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/DefaultSelectionByThemeModel.java	(revision 1648)
@@ -0,0 +1,68 @@
+/* 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.gui.selectionByTheme;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+
+
+
+public class DefaultSelectionByThemeModel
+	implements SelectionByThemeModel {
+
+	private FLayers layers;
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.selectionByTheme.SelectionByThemeModel#getViews()
+	 */
+	public FLayers getLayers() {
+		View v = PluginServices.getMDIManager().getActiveView();
+		if (v instanceof com.iver.cit.gvsig.gui.View){
+			com.iver.cit.gvsig.gui.View vista = (com.iver.cit.gvsig.gui.View) v;
+			
+			return vista.getModel().getMapContext().getLayers();
+		}
+		
+		return null;
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/DefaultSelectionByThemeModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeListener.java	(revision 1648)
@@ -0,0 +1,49 @@
+/* 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.gui.selectionByTheme;
+
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+
+public interface SelectionByThemeListener {
+	public void newSet(FLayer[] toSelect, FLayer selectionLayer, int action);
+	public void addToSet(FLayer[] toSelect, FLayer selectionLayer, int action);
+	public void fromSet(FLayer[] toSelect, FLayer selectionLayer, int action);
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeListener.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/MySelectionByThemeListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/MySelectionByThemeListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/MySelectionByThemeListener.java	(revision 1648)
@@ -0,0 +1,132 @@
+/* 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.gui.selectionByTheme;
+
+import java.util.BitSet;
+
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.core.FGeometry;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.v02.FConverter;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FBitSet;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+import com.iver.cit.gvsig.fmap.layers.VectorialAdapter;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.Selectable;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.SingleLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.VectorialData;
+import com.iver.cit.gvsig.fmap.operations.strategies.QueryByThemeVisitor;
+import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
+import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.geom.IntersectionMatrix;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class MySelectionByThemeListener implements SelectionByThemeListener {
+    /**
+     * @see com.iver.cit.gvsig.gui.selectionByTheme.SelectionByThemeListener#newSet(int, int,
+     *      int)
+     */
+    public void newSet(FLayer[] toSelect, FLayer selectionLayer, int action) {
+        for (int i = 0; i < toSelect.length; i++) {
+        	Selectable capa = (Selectable) toSelect[i];
+            QueryByThemeVisitor visitor = new QueryByThemeVisitor(toSelect[i], selectionLayer, action);
+            capa.clearSelection();
+            try {
+				((VectorialData) selectionLayer).process(visitor, ((Selectable)selectionLayer).getSelection());
+				((Selectable) toSelect[i]).setSelection(visitor.getBitset());
+			} catch (DriverException e) {
+				NotificationManager.addError("Error leyendo las capas", e);
+			} catch (VisitException e) {
+				NotificationManager.addError("Error leyendo las capas", e);
+			}
+        }
+//        doSelection(toSelect, selectionLayer, action, false);
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.gui.selectionByTheme.SelectionByThemeListener#addToSet(int,
+     *      int, int)
+     */
+    public void addToSet(FLayer[] toSelect, FLayer selectionLayer, int action) {
+        for (int i = 0; i < toSelect.length; i++) {
+        	Selectable capa = (Selectable) toSelect[i];
+            QueryByThemeVisitor visitor = new QueryByThemeVisitor(toSelect[i], selectionLayer, action);
+            FBitSet selection = capa.getSelection();
+            try {
+				((VectorialData) selectionLayer).process(visitor, ((Selectable)selectionLayer).getSelection());
+				selection.or(visitor.getBitset());
+				((Selectable) toSelect[i]).setSelection(selection);
+			} catch (DriverException e) {
+				NotificationManager.addError("Error leyendo las capas", e);
+			} catch (VisitException e) {
+				NotificationManager.addError("Error leyendo las capas", e);
+			}
+        }
+    }
+
+    /**
+     * @see com.iver.cit.gvsig.gui.selectionByTheme.SelectionByThemeListener#fromSet(int, int,
+     *      int)
+     */
+    public void fromSet(FLayer[] toSelect, FLayer selectionLayer, int action) {
+        for (int i = 0; i < toSelect.length; i++) {
+        	Selectable capa = (Selectable) toSelect[i];
+            QueryByThemeVisitor visitor = new QueryByThemeVisitor(toSelect[i], selectionLayer, action);
+            FBitSet selection = capa.getSelection();
+            try {
+				((VectorialData) selectionLayer).process(visitor, ((Selectable)selectionLayer).getSelection());
+				selection.and(visitor.getBitset());
+				((Selectable) toSelect[i]).setSelection(selection);
+			} catch (DriverException e) {
+				NotificationManager.addError("Error leyendo las capas", e);
+			} catch (VisitException e) {
+				NotificationManager.addError("Error leyendo las capas", e);
+			}
+        }
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/MySelectionByThemeListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByTheme.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByTheme.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByTheme.java	(revision 1648)
@@ -0,0 +1,359 @@
+/* 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.gui.selectionByTheme;
+
+import java.util.ArrayList;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+
+
+public class SelectionByTheme extends JPanel implements View {
+	public static final int EQUALS = 0;
+	public static final int DISJOINT = 1;
+	public static final int INTERSECTS = 2;
+	public static final int TOUCHES = 3;
+	public static final int CROSSES = 4;
+	public static final int WITHIN = 5;
+	public static final int CONTAINS = 6;
+	public static final int OVERLAPS = 7;
+	public static final String[] textosAcciones = new String[] {
+	"sean iguales a",
+	"sean disjuntos a",
+	"intersecten con",
+	"toquen",
+	"crucen con",
+	"est�n contenidos en",
+	"contengan",
+	"se superponen a"
+	};
+
+	private SelectionByThemeModel dataSource = null;
+
+	private ArrayList listeners = new ArrayList();
+
+	private javax.swing.JPanel jPanel = null;
+	private javax.swing.JPanel jPanel1 = null;
+	private javax.swing.JLabel jLabel = null;
+	private javax.swing.JComboBox cmbAction = null;
+	private javax.swing.JLabel jLabel1 = null;
+	private javax.swing.JComboBox cmbCapas = null;
+	private javax.swing.JButton btnNew = null;
+	private javax.swing.JButton btnAdd = null;
+	private javax.swing.JButton btnFrom = null;
+	private javax.swing.JButton btnCancel = null;
+	/**
+	 * This is the default constructor
+	 */
+	public SelectionByTheme() {
+		super();
+		initialize();
+	}
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+		java.awt.FlowLayout layFlowLayout2 = new java.awt.FlowLayout();
+		layFlowLayout2.setHgap(0);
+		layFlowLayout2.setVgap(0);
+		this.setLayout(layFlowLayout2);
+		this.add(getJPanel(), null);
+		this.add(getJPanel1(), null);
+		this.setSize(440, 220);
+	}
+	/**
+	 * This method initializes jPanel
+	 * 
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel() {
+		if(jPanel == null) {
+			jPanel = new javax.swing.JPanel();
+			java.awt.FlowLayout layFlowLayout1 = new java.awt.FlowLayout();
+			layFlowLayout1.setVgap(30);
+			jPanel.setLayout(layFlowLayout1);
+			jPanel.add(getJLabel(), null);
+			jPanel.add(getCmbAction(), null);
+			jPanel.add(getJLabel1(), null);
+			jPanel.add(getCmbCapas(), null);
+			jPanel.setPreferredSize(new java.awt.Dimension(290,220));
+		}
+		return jPanel;
+	}
+	/**
+	 * This method initializes jPanel1
+	 * 
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel1() {
+		if(jPanel1 == null) {
+			jPanel1 = new javax.swing.JPanel();
+			java.awt.FlowLayout layFlowLayout3 = new java.awt.FlowLayout();
+			layFlowLayout3.setVgap(25);
+			jPanel1.setLayout(layFlowLayout3);
+			jPanel1.add(getBtnNew(), null);
+			jPanel1.add(getBtnAdd(), null);
+			jPanel1.add(getBtnFrom(), null);
+			jPanel1.add(getBtnCancel(), null);
+			jPanel1.setPreferredSize(new java.awt.Dimension(140,220));
+		}
+		return jPanel1;
+	}
+	/**
+	 * This method initializes jLabel
+	 * 
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel() {
+		if(jLabel == null) {
+			jLabel = new javax.swing.JLabel();
+			jLabel.setText("Seleccionar de las capas activas los elementos que... ");
+			jLabel.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+		}
+		return jLabel;
+	}
+	/**
+	 * This method initializes cmbAction
+	 * 
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCmbAction() {
+		if(cmbAction == null) {
+			cmbAction = new javax.swing.JComboBox();
+			cmbAction.setPreferredSize(new java.awt.Dimension(200,20));
+			DefaultComboBoxModel model = new DefaultComboBoxModel(textosAcciones);
+			cmbAction.setModel(model);
+			cmbAction.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+		}
+		return cmbAction;
+	}
+	/**
+	 * This method initializes jLabel1
+	 * 
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel1() {
+		if(jLabel1 == null) {
+			jLabel1 = new javax.swing.JLabel();
+			jLabel1.setText("elementos seleccionados de la capa");
+			jLabel1.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+		}
+		return jLabel1;
+	}
+	/**
+	 * This method initializes cmbCapas
+	 * 
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCmbCapas() {
+		if(cmbCapas == null) {
+			cmbCapas = new javax.swing.JComboBox();
+			cmbCapas.setPreferredSize(new java.awt.Dimension(200,20));
+			cmbCapas.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+		}
+		return cmbCapas;
+	}
+	/**
+	 * This method initializes btnNew
+	 * 
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnNew() {
+		if(btnNew == null) {
+			btnNew = new javax.swing.JButton();
+			btnNew.setText("Nuevo Conjunto");
+			btnNew.setMargin(new java.awt.Insets(2,2,2,2));
+			btnNew.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+			btnNew.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+					callNewListeners(cmbCapas.getSelectedIndex(), cmbAction.getSelectedIndex());
+				}
+			});
+		}
+		return btnNew;
+	}
+	/**
+	 * This method initializes btnAdd
+	 * 
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnAdd() {
+		if(btnAdd == null) {
+			btnAdd = new javax.swing.JButton();
+			btnAdd.setText("A�adir al conjunto");
+			btnAdd.setMargin(new java.awt.Insets(2,2,2,2));
+			btnAdd.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+			btnAdd.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					callAddToListeners(cmbCapas.getSelectedIndex(), cmbAction.getSelectedIndex());
+				}
+			});
+		}
+		return btnAdd;
+	}
+	/**
+	 * This method initializes btnFrom
+	 * 
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnFrom() {
+		if(btnFrom == null) {
+			btnFrom = new javax.swing.JButton();
+			btnFrom.setText("Seleccionar del conjunto");
+			btnFrom.setMargin(new java.awt.Insets(2,2,2,2));
+			btnFrom.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+			btnFrom.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					callFromListeners(cmbCapas.getSelectedIndex(), cmbAction.getSelectedIndex());
+				}
+			});
+		}
+		return btnFrom;
+	}
+	/**
+	 * This method initializes btnCancel
+	 * 
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnCancel() {
+		if(btnCancel == null) {
+			btnCancel = new javax.swing.JButton();
+			btnCancel.setText("Cancel");
+			btnCancel.setMargin(new java.awt.Insets(2,2,2,2));
+			btnCancel.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
+			btnCancel.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					PluginServices.getMDIManager().closeView(SelectionByTheme.this);
+				}
+			});
+		}
+		return btnCancel;
+	}
+	
+	/**
+	 * @return
+	 */
+	public SelectionByThemeModel getModel() {
+		return dataSource;
+	}
+
+	/**
+	 * @param source
+	 */
+	public void setModel(SelectionByThemeModel source) {
+		dataSource = source;
+		String[] nameLayers = new String[dataSource.getLayers().getLayersCount()];
+		for (int i=0; i < nameLayers.length; i++)
+			nameLayers[i] = dataSource.getLayers().getLayer(i).getName();
+		DefaultComboBoxModel model = 
+			new DefaultComboBoxModel(nameLayers);
+		cmbCapas.setModel(model);
+	}
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo vi = new ViewInfo(ViewInfo.MODALDIALOG);
+		return vi;
+	}
+	
+	private void callNewListeners(int selection, int actionCode){
+		for (int i = 0; i < listeners.size();
+				i++) {
+			SelectionByThemeListener l = (SelectionByThemeListener) listeners.get(i);
+			l.newSet(dataSource.getLayers().getActives(), dataSource.getLayers().getLayer(selection), actionCode);
+		}
+		
+	}
+	
+	private void callAddToListeners(int selection, int actionCode){
+		for (int i = 0; i < listeners.size();
+				i++) {
+			SelectionByThemeListener l = (SelectionByThemeListener) listeners.get(i);
+			l.addToSet(dataSource.getLayers().getActives(), dataSource.getLayers().getLayer(selection), actionCode);
+		}
+		
+	}
+	
+	private void callFromListeners(int selection, int actionCode){
+		for (int i = 0; i < listeners.size();
+				i++) {
+			SelectionByThemeListener l = (SelectionByThemeListener) listeners.get(i);
+			l.fromSet(dataSource.getLayers().getActives(), dataSource.getLayers().getLayer(selection), actionCode);
+		}
+		
+	}
+	
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param arg0
+	 *
+	 * @return
+	 */
+	public boolean addSelectionListener(SelectionByThemeListener arg0) {
+		return listeners.add(arg0);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param arg0
+	 *
+	 * @return
+	 */
+	public boolean removeSelectionListener(SelectionByThemeListener arg0) {
+		return listeners.remove(arg0);
+	}
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+	
+}  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByTheme.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeModel.java	(revision 1648)
@@ -0,0 +1,48 @@
+/* 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.gui.selectionByTheme;
+
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+
+
+public interface SelectionByThemeModel {
+	public FLayers getLayers();
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/selectionByTheme/SelectionByThemeModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ExtentListSelectorModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ExtentListSelectorModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ExtentListSelectorModel.java	(revision 1648)
@@ -0,0 +1,109 @@
+/* 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.gui;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+
+import javax.swing.ListModel;
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListDataListener;
+
+import com.iver.cit.gvsig.project.Project;
+
+
+
+public class ExtentListSelectorModel implements ListModel, PropertyChangeListener {
+
+	private Project project;
+	private ArrayList listeners = new ArrayList();
+
+	public ExtentListSelectorModel(Project p){
+		project = p;
+	}
+
+	/**
+	 * @see javax.swing.ListModel#getSize()
+	 */
+	public int getSize() {
+		return project.getExtents().length;
+	}
+
+	/**
+	 * @see javax.swing.ListModel#getElementAt(int)
+	 */
+	public Object getElementAt(int arg0) {
+		return project.getExtents()[arg0];
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)
+	 */
+	public void addListDataListener(ListDataListener arg0) {
+		listeners.add(arg0);
+	}
+
+	/**
+	 * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)
+	 */
+	public void removeListDataListener(ListDataListener arg0) {
+		listeners.remove(arg0);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent change) {
+		if (change.getPropertyName().equals("addExtent")){
+			ListDataEvent event = new ListDataEvent(this, ListDataEvent.INTERVAL_ADDED, 0, getSize());
+			for (int i = 0; i < listeners.size(); i++){
+				((ListDataListener) listeners.get(i)).intervalAdded(event);
+			}
+		}else{
+			ListDataEvent event = new ListDataEvent(this, ListDataEvent.INTERVAL_ADDED, 0, getSize());
+			for (int i = 0; i < listeners.size(); i++){
+				((ListDataListener) listeners.get(i)).intervalRemoved(event);
+			}
+		}
+	}
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ExtentListSelectorModel.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/TableSorter.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/TableSorter.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/TableSorter.java	(revision 1648)
@@ -0,0 +1,538 @@
+/* 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.gui;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.Icon;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumnModel;
+import javax.swing.table.TableModel;
+
+/**
+ * TableSorter is a decorator for TableModels; adding sorting
+ * functionality to a supplied TableModel. TableSorter does
+ * not store or copy the data in its TableModel; instead it maintains
+ * a map from the row indexes of the view to the row indexes of the
+ * model. As requests are made of the sorter (like getValueAt(row, col))
+ * they are passed to the underlying model after the row numbers
+ * have been translated via the internal mapping array. This way,
+ * the TableSorter appears to hold another copy of the table
+ * with the rows in a different order.
+ * <p/>
+ * TableSorter registers itself as a listener to the underlying model,
+ * just as the JTable itself would. Events recieved from the model
+ * are examined, sometimes manipulated (typically widened), and then
+ * passed on to the TableSorter's listeners (typically the JTable).
+ * If a change to the model has invalidated the order of TableSorter's
+ * rows, a note of this is made and the sorter will resort the
+ * rows the next time a value is requested.
+ * <p/>
+ * When the tableHeader property is set, either by using the
+ * setTableHeader() method or the two argument constructor, the
+ * table header may be used as a complete UI for TableSorter.
+ * The default renderer of the tableHeader is decorated with a renderer
+ * that indicates the sorting status of each column. In addition,
+ * a mouse listener is installed with the following behavior:
+ * <ul>
+ * <li>
+ * Mouse-click: Clears the sorting status of all other columns
+ * and advances the sorting status of that column through three
+ * values: {NOT_SORTED, ASCENDING, DESCENDING} (then back to
+ * NOT_SORTED again).
+ * <li>
+ * SHIFT-mouse-click: Clears the sorting status of all other columns
+ * and cycles the sorting status of the column through the same
+ * three values, in the opposite order: {NOT_SORTED, DESCENDING, ASCENDING}.
+ * <li>
+ * CONTROL-mouse-click and CONTROL-SHIFT-mouse-click: as above except
+ * that the changes to the column do not cancel the statuses of columns
+ * that are already sorting - giving a way to initiate a compound
+ * sort.
+ * </ul>
+ * <p/>
+ * This is a long overdue rewrite of a class of the same name that
+ * first appeared in the swing table demos in 1997.
+ * 
+ * @author Philip Milne
+ * @author Brendon McLean 
+ * @author Dan van Enckevort
+ * @author Parwinder Sekhon
+ * @version 2.0 02/27/04
+ */
+
+public class TableSorter extends AbstractTableModel {
+    protected TableModel tableModel;
+
+    public static final int DESCENDING = -1;
+    public static final int NOT_SORTED = 0;
+    public static final int ASCENDING = 1;
+
+    private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
+
+    public static final Comparator COMPARABLE_COMAPRATOR = new Comparator() {
+        public int compare(Object o1, Object o2) {
+            return ((Comparable) o1).compareTo(o2);
+        }
+    };
+    public static final Comparator LEXICAL_COMPARATOR = new Comparator() {
+        public int compare(Object o1, Object o2) {
+            return o1.toString().compareTo(o2.toString());
+        }
+    };
+
+    private Row[] viewToModel;
+    private int[] modelToView;
+
+    private JTableHeader tableHeader;
+    private MouseListener mouseListener;
+    private TableModelListener tableModelListener;
+    private Map columnComparators = new HashMap();
+    private List sortingColumns = new ArrayList();
+
+    public TableSorter() {
+        this.mouseListener = new MouseHandler();
+        this.tableModelListener = new TableModelHandler();
+    }
+
+    public TableSorter(TableModel tableModel) {
+        this();
+        setTableModel(tableModel);
+    }
+
+    public TableSorter(TableModel tableModel, JTableHeader tableHeader) {
+        this();
+        setTableHeader(tableHeader);
+        setTableModel(tableModel);
+    }
+
+    private void clearSortingState() {
+        viewToModel = null;
+        modelToView = null;
+    }
+
+    public TableModel getTableModel() {
+        return tableModel;
+    }
+
+    public void setTableModel(TableModel tableModel) {
+        if (this.tableModel != null) {
+            this.tableModel.removeTableModelListener(tableModelListener);
+        }
+
+        this.tableModel = tableModel;
+        if (this.tableModel != null) {
+            this.tableModel.addTableModelListener(tableModelListener);
+        }
+
+        clearSortingState();
+        fireTableStructureChanged();
+    }
+
+    public JTableHeader getTableHeader() {
+        return tableHeader;
+    }
+
+    public void setTableHeader(JTableHeader tableHeader) {
+        if (this.tableHeader != null) {
+            this.tableHeader.removeMouseListener(mouseListener);
+            TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
+            if (defaultRenderer instanceof SortableHeaderRenderer) {
+                this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
+            }
+        }
+        this.tableHeader = tableHeader;
+        if (this.tableHeader != null) {
+            this.tableHeader.addMouseListener(mouseListener);
+            this.tableHeader.setDefaultRenderer(
+                    new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer()));
+        }
+    }
+
+    public boolean isSorting() {
+        return sortingColumns.size() != 0;
+    }
+
+    private Directive getDirective(int column) {
+        for (int i = 0; i < sortingColumns.size(); i++) {
+            Directive directive = (Directive)sortingColumns.get(i);
+            if (directive.column == column) {
+                return directive;
+            }
+        }
+        return EMPTY_DIRECTIVE;
+    }
+
+    public int getSortingStatus(int column) {
+        return getDirective(column).direction;
+    }
+
+    private void sortingStatusChanged() {
+        clearSortingState();
+        fireTableDataChanged();
+        if (tableHeader != null) {
+            tableHeader.repaint();
+        }
+    }
+
+    public void setSortingStatus(int column, int status) {
+        Directive directive = getDirective(column);
+        if (directive != EMPTY_DIRECTIVE) {
+            sortingColumns.remove(directive);
+        }
+        if (status != NOT_SORTED) {
+            sortingColumns.add(new Directive(column, status));
+        }
+        sortingStatusChanged();
+    }
+
+    protected Icon getHeaderRendererIcon(int column, int size) {
+        Directive directive = getDirective(column);
+        if (directive == EMPTY_DIRECTIVE) {
+            return null;
+        }
+        return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
+    }
+
+    private void cancelSorting() {
+        sortingColumns.clear();
+        sortingStatusChanged();
+    }
+
+    public void setColumnComparator(Class type, Comparator comparator) {
+        if (comparator == null) {
+            columnComparators.remove(type);
+        } else {
+            columnComparators.put(type, comparator);
+        }
+    }
+
+    protected Comparator getComparator(int column) {
+        Class columnType = tableModel.getColumnClass(column);
+        Comparator comparator = (Comparator) columnComparators.get(columnType);
+        if (comparator != null) {
+            return comparator;
+        }
+        if (Comparable.class.isAssignableFrom(columnType)) {
+            return COMPARABLE_COMAPRATOR;
+        }
+        return LEXICAL_COMPARATOR;
+    }
+
+    private Row[] getViewToModel() {
+        if (viewToModel == null) {
+            int tableModelRowCount = tableModel.getRowCount();
+            viewToModel = new Row[tableModelRowCount];
+            for (int row = 0; row < tableModelRowCount; row++) {
+                viewToModel[row] = new Row(row);
+            }
+
+            if (isSorting()) {
+                Arrays.sort(viewToModel);
+            }
+        }
+        return viewToModel;
+    }
+
+    public int modelIndex(int viewIndex) {
+        return getViewToModel()[viewIndex].modelIndex;
+    }
+
+    private int[] getModelToView() {
+        if (modelToView == null) {
+            int n = getViewToModel().length;
+            modelToView = new int[n];
+            for (int i = 0; i < n; i++) {
+                modelToView[modelIndex(i)] = i;
+            }
+        }
+        return modelToView;
+    }
+
+    // TableModel interface methods 
+
+    public int getRowCount() {
+        return (tableModel == null) ? 0 : tableModel.getRowCount();
+    }
+
+    public int getColumnCount() {
+        return (tableModel == null) ? 0 : tableModel.getColumnCount();
+    }
+
+    public String getColumnName(int column) {
+        return tableModel.getColumnName(column);
+    }
+
+    public Class getColumnClass(int column) {
+        return tableModel.getColumnClass(column);
+    }
+
+    public boolean isCellEditable(int row, int column) {
+        return tableModel.isCellEditable(modelIndex(row), column);
+    }
+
+    public Object getValueAt(int row, int column) {
+        return tableModel.getValueAt(modelIndex(row), column);
+    }
+
+    public void setValueAt(Object aValue, int row, int column) {
+        tableModel.setValueAt(aValue, modelIndex(row), column);
+    }
+
+    // Helper classes
+    
+    private class Row implements Comparable {
+        private int modelIndex;
+
+        public Row(int index) {
+            this.modelIndex = index;
+        }
+
+        public int compareTo(Object o) {
+            int row1 = modelIndex;
+            int row2 = ((Row) o).modelIndex;
+
+            for (Iterator it = sortingColumns.iterator(); it.hasNext();) {
+                Directive directive = (Directive) it.next();
+                int column = directive.column;
+                Object o1 = tableModel.getValueAt(row1, column);
+                Object o2 = tableModel.getValueAt(row2, column);
+
+                int comparison = 0;
+                // Define null less than everything, except null.
+                if (o1 == null && o2 == null) {
+                    comparison = 0;
+                } else if (o1 == null) {
+                    comparison = -1;
+                } else if (o2 == null) {
+                    comparison = 1;
+                } else {
+                    comparison = getComparator(column).compare(o1, o2);
+                }
+                if (comparison != 0) {
+                    return directive.direction == DESCENDING ? -comparison : comparison;
+                }
+            }
+            return 0;
+        }
+    }
+
+    private class TableModelHandler implements TableModelListener {
+        public void tableChanged(TableModelEvent e) {
+            // If we're not sorting by anything, just pass the event along.             
+            if (!isSorting()) {
+                clearSortingState();
+                fireTableChanged(e);
+                return;
+            }
+                
+            // If the table structure has changed, cancel the sorting; the             
+            // sorting columns may have been either moved or deleted from             
+            // the model. 
+            if (e.getFirstRow() == TableModelEvent.HEADER_ROW) {
+                cancelSorting();
+                fireTableChanged(e);
+                return;
+            }
+
+            // We can map a cell event through to the view without widening             
+            // when the following conditions apply: 
+            // 
+            // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and, 
+            // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
+            // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and, 
+            // d) a reverse lookup will not trigger a sort (modelToView != null)
+            //
+            // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
+            // 
+            // The last check, for (modelToView != null) is to see if modelToView 
+            // is already allocated. If we don't do this check; sorting can become 
+            // a performance bottleneck for applications where cells  
+            // change rapidly in different parts of the table. If cells 
+            // change alternately in the sorting column and then outside of             
+            // it this class can end up re-sorting on alternate cell updates - 
+            // which can be a performance problem for large tables. The last 
+            // clause avoids this problem. 
+            int column = e.getColumn();
+            if (e.getFirstRow() == e.getLastRow()
+                    && column != TableModelEvent.ALL_COLUMNS
+                    && getSortingStatus(column) == NOT_SORTED
+                    && modelToView != null) {
+                int viewIndex = getModelToView()[e.getFirstRow()];
+                fireTableChanged(new TableModelEvent(TableSorter.this, 
+                                                     viewIndex, viewIndex, 
+                                                     column, e.getType()));
+                return;
+            }
+
+            // Something has happened to the data that may have invalidated the row order. 
+            clearSortingState();
+            fireTableDataChanged();
+            return;
+        }
+    }
+
+    private class MouseHandler extends MouseAdapter {
+        public void mouseClicked(MouseEvent e) {
+            JTableHeader h = (JTableHeader) e.getSource();
+            TableColumnModel columnModel = h.getColumnModel();
+            int viewColumn = columnModel.getColumnIndexAtX(e.getX());
+            int column = columnModel.getColumn(viewColumn).getModelIndex();
+            if (column != -1) {
+                int status = getSortingStatus(column);
+                if (!e.isControlDown()) {
+                    cancelSorting();
+                }
+                // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or 
+                // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed. 
+                status = status + (e.isShiftDown() ? -1 : 1);
+                status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
+                setSortingStatus(column, status);
+            }
+        }
+    }
+
+    private static class Arrow implements Icon {
+        private boolean descending;
+        private int size;
+        private int priority;
+
+        public Arrow(boolean descending, int size, int priority) {
+            this.descending = descending;
+            this.size = size;
+            this.priority = priority;
+        }
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            Color color = c == null ? Color.GRAY : c.getBackground();             
+            // In a compound sort, make each succesive triangle 20% 
+            // smaller than the previous one. 
+            int dx = (int)(size/2*Math.pow(0.8, priority));
+            int dy = descending ? dx : -dx;
+            // Align icon (roughly) with font baseline. 
+            y = y + 5*size/6 + (descending ? -dy : 0);
+            int shift = descending ? 1 : -1;
+            g.translate(x, y);
+
+            // Right diagonal. 
+            g.setColor(color.darker());
+            g.drawLine(dx / 2, dy, 0, 0);
+            g.drawLine(dx / 2, dy + shift, 0, shift);
+            
+            // Left diagonal. 
+            g.setColor(color.brighter());
+            g.drawLine(dx / 2, dy, dx, 0);
+            g.drawLine(dx / 2, dy + shift, dx, shift);
+            
+            // Horizontal line. 
+            if (descending) {
+                g.setColor(color.darker().darker());
+            } else {
+                g.setColor(color.brighter().brighter());
+            }
+            g.drawLine(dx, 0, 0, 0);
+
+            g.setColor(color);
+            g.translate(-x, -y);
+        }
+
+        public int getIconWidth() {
+            return size;
+        }
+
+        public int getIconHeight() {
+            return size;
+        }
+    }
+
+    private class SortableHeaderRenderer implements TableCellRenderer {
+        private TableCellRenderer tableCellRenderer;
+
+        public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
+            this.tableCellRenderer = tableCellRenderer;
+        }
+
+        public Component getTableCellRendererComponent(JTable table, 
+                                                       Object value,
+                                                       boolean isSelected, 
+                                                       boolean hasFocus,
+                                                       int row, 
+                                                       int column) {
+            Component c = tableCellRenderer.getTableCellRendererComponent(table, 
+                    value, isSelected, hasFocus, row, column);
+            if (c instanceof JLabel) {
+                JLabel l = (JLabel) c;
+                l.setHorizontalTextPosition(JLabel.LEFT);
+                int modelColumn = table.convertColumnIndexToModel(column);
+                l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
+            }
+            return c;
+        }
+    }
+
+    private static class Directive {
+        private int column;
+        private int direction;
+
+        public Directive(int column, int direction) {
+            this.column = column;
+            this.direction = direction;
+        }
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/TableSorter.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectProperties.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectProperties.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectProperties.java	(revision 1648)
@@ -0,0 +1,476 @@
+/* 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.gui.project;
+
+
+import java.awt.Color;
+import java.io.File;
+
+import javax.swing.JColorChooser;
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.project.Project;
+
+
+/**
+ * Propiedades del proyecto
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectProperties extends JPanel implements View {
+    private Project project = null;
+    private javax.swing.JPanel pane = null;
+    private javax.swing.JPanel jPanel = null;
+    private javax.swing.JLabel jLabel = null;
+    private javax.swing.JLabel jLabel1 = null;
+    private javax.swing.JLabel jLabel2 = null;
+    private javax.swing.JLabel jLabel3 = null;
+    private javax.swing.JLabel jLabel4 = null;
+    private javax.swing.JTextField txtName = null;
+    private javax.swing.JTextField txtPath = null;
+    private javax.swing.JTextField txtCreationDate = null;
+    private javax.swing.JTextField txtModificationDate = null;
+    private javax.swing.JTextField txtOwner = null;
+    private javax.swing.JLabel jLabel5 = null;
+    private javax.swing.JTextArea txtComments = null;
+    private javax.swing.JButton btnOk = null;
+    private javax.swing.JButton btnCancel = null;
+    private javax.swing.JLabel jLabel6 = null;
+    private javax.swing.JLabel lblColor = null;
+    private javax.swing.JButton btnColor = null;
+    private javax.swing.JScrollPane jScrollPane = null;
+    private ViewInfo m_viewinfo = null;
+    /**
+     * This is the default constructor
+     *
+     * @param owner Frame padre del di�logo
+     * @param p Proyecto cuyos datos se muestran en el di�logo
+     */
+    public ProjectProperties(Project p) {
+        project = p;
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+		setLayout(new java.awt.BorderLayout());
+		add(getJPanel(), java.awt.BorderLayout.CENTER);
+
+        getTxtName().setText(project.getName());
+
+        String path = project.getPath();
+
+        if (path != null) {
+            File f = new File(path);
+            getTxtPath().setText(f.toString());
+        } else {
+            getTxtPath().setText("");
+        }
+
+        getTxtOwner().setText(project.getOwner());
+        getTxtComments().setText(project.getComments());
+        getTxtCreationDate().setText(project.getCreationDate());
+        getTxtModificationDate().setText(project.getModificationDate());
+
+        getLblColor().setBackground(project.getSelectionColor());
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel() {
+        if (jPanel == null) {
+            jPanel = new javax.swing.JPanel();
+            jPanel.add(getJLabel(), null);
+            jPanel.add(getTxtName(), null);
+            jPanel.add(getJLabel1(), null);
+            jPanel.add(getTxtPath(), null);
+            jPanel.add(getJLabel2(), null);
+            jPanel.add(getTxtCreationDate(), null);
+            jPanel.add(getJLabel3(), null);
+            jPanel.add(getTxtModificationDate(), null);
+            jPanel.add(getJLabel4(), null);
+            jPanel.add(getTxtOwner(), null);
+            jPanel.add(getJLabel5(), null);
+            jPanel.add(getJScrollPane(), null);
+            jPanel.add(getJLabel6(), null);
+            jPanel.add(getLblColor(), null);
+            jPanel.add(getBtnColor(), null);
+            jPanel.add(getBtnOk(), null);
+            jPanel.add(getBtnCancel(), null);
+            jPanel.setPreferredSize(new java.awt.Dimension(150, 10));
+        }
+
+        return jPanel;
+    }
+
+    /**
+     * This method initializes jLabel
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel() {
+        if (jLabel == null) {
+            jLabel = new javax.swing.JLabel();
+            jLabel.setText(PluginServices.getText(this, "nombre_sesion") + ":");
+            jLabel.setPreferredSize(new java.awt.Dimension(149, 16));
+        }
+
+        return jLabel;
+    }
+
+    /**
+     * This method initializes jLabel1
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel1() {
+        if (jLabel1 == null) {
+            jLabel1 = new javax.swing.JLabel();
+            jLabel1.setText(PluginServices.getText(this, "path") + ":");
+            jLabel1.setPreferredSize(new java.awt.Dimension(149, 16));
+        }
+
+        return jLabel1;
+    }
+
+    /**
+     * This method initializes jLabel2
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel2() {
+        if (jLabel2 == null) {
+            jLabel2 = new javax.swing.JLabel();
+            jLabel2.setText(PluginServices.getText(this, "creation_date") + ":");
+            jLabel2.setPreferredSize(new java.awt.Dimension(149, 16));
+        }
+
+        return jLabel2;
+    }
+
+    /**
+     * This method initializes jLabel3
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel3() {
+        if (jLabel3 == null) {
+            jLabel3 = new javax.swing.JLabel();
+            jLabel3.setText(PluginServices.getText(this, "modification_date") +
+                ":");
+            jLabel3.setPreferredSize(new java.awt.Dimension(149, 16));
+        }
+
+        return jLabel3;
+    }
+
+    /**
+     * This method initializes jLabel4
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel4() {
+        if (jLabel4 == null) {
+            jLabel4 = new javax.swing.JLabel();
+            jLabel4.setText(PluginServices.getText(this, "owner") + ":");
+            jLabel4.setPreferredSize(new java.awt.Dimension(149, 16));
+        }
+
+        return jLabel4;
+    }
+
+    /**
+     * This method initializes txtName
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtName() {
+        if (txtName == null) {
+            txtName = new javax.swing.JTextField();
+            txtName.setPreferredSize(new java.awt.Dimension(160, 20));
+        }
+
+        return txtName;
+    }
+
+    /**
+     * This method initializes txtPath
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtPath() {
+        if (txtPath == null) {
+            txtPath = new javax.swing.JTextField();
+            txtPath.setPreferredSize(new java.awt.Dimension(160, 20));
+            txtPath.setEditable(false);
+            txtPath.setBackground(java.awt.Color.white);
+        }
+
+        return txtPath;
+    }
+
+    /**
+     * This method initializes txtCreationDate
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtCreationDate() {
+        if (txtCreationDate == null) {
+            txtCreationDate = new javax.swing.JTextField();
+            txtCreationDate.setPreferredSize(new java.awt.Dimension(160, 20));
+            txtCreationDate.setEditable(false);
+            txtCreationDate.setBackground(java.awt.Color.white);
+        }
+
+        return txtCreationDate;
+    }
+
+    /**
+     * This method initializes txtModificationDate
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtModificationDate() {
+        if (txtModificationDate == null) {
+            txtModificationDate = new javax.swing.JTextField();
+            txtModificationDate.setPreferredSize(new java.awt.Dimension(160, 20));
+            txtModificationDate.setEditable(false);
+            txtModificationDate.setBackground(java.awt.Color.white);
+        }
+
+        return txtModificationDate;
+    }
+
+    /**
+     * This method initializes txtOwner
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtOwner() {
+        if (txtOwner == null) {
+            txtOwner = new javax.swing.JTextField();
+            txtOwner.setPreferredSize(new java.awt.Dimension(160, 20));
+        }
+
+        return txtOwner;
+    }
+
+    /**
+     * This method initializes jLabel5
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel5() {
+        if (jLabel5 == null) {
+            jLabel5 = new javax.swing.JLabel();
+            jLabel5.setText(PluginServices.getText(this, "comentarios") + ":");
+            jLabel5.setPreferredSize(new java.awt.Dimension(119, 16));
+            jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+        }
+
+        return jLabel5;
+    }
+
+    /**
+     * This method initializes txtComments
+     *
+     * @return javax.swing.JTextArea
+     */
+    private javax.swing.JTextArea getTxtComments() {
+        if (txtComments == null) {
+            txtComments = new javax.swing.JTextArea();
+            txtComments.setRows(1);
+            txtComments.setColumns(20);
+        }
+
+        return txtComments;
+    }
+
+    /**
+     * This method initializes btnOk
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnOk() {
+        if (btnOk == null) {
+            btnOk = new javax.swing.JButton();
+            btnOk.setPreferredSize(new java.awt.Dimension(100, 30));
+            btnOk.setText(PluginServices.getText(this, "ok") + ":");
+
+            btnOk.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        project.setName(txtName.getText());
+                        project.setOwner(txtOwner.getText());
+                        project.setComments(txtComments.getText());
+                        project.setSelectionColor(lblColor.getBackground());
+                        PluginServices.getMDIManager().closeView(ProjectProperties.this);
+                    }
+                });
+        }
+
+        return btnOk;
+    }
+
+    /**
+     * This method initializes btnCancel
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnCancel() {
+        if (btnCancel == null) {
+            btnCancel = new javax.swing.JButton();
+            btnCancel.setPreferredSize(new java.awt.Dimension(100, 30));
+            btnCancel.setText(PluginServices.getText(this, "cancel") + ":");
+
+            btnCancel.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(ProjectProperties.this);
+                    }
+                });
+        }
+
+        return btnCancel;
+    }
+
+    /**
+     * This method initializes jLabel6
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel6() {
+        if (jLabel6 == null) {
+            jLabel6 = new javax.swing.JLabel();
+            jLabel6.setText(PluginServices.getText(this, "selection_color") +
+                ":");
+            jLabel6.setPreferredSize(new java.awt.Dimension(190, 16));
+        }
+
+        return jLabel6;
+    }
+
+    /**
+     * This method initializes lblColor
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getLblColor() {
+        if (lblColor == null) {
+            lblColor = new javax.swing.JLabel();
+
+            //			lblColor.setText("");
+            lblColor.setPreferredSize(new java.awt.Dimension(30, 16));
+            lblColor.setOpaque(true);
+        }
+
+        return lblColor;
+    }
+
+    /**
+     * This method initializes btnColor
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnColor() {
+        if (btnColor == null) {
+            btnColor = new javax.swing.JButton();
+            btnColor.setPreferredSize(new java.awt.Dimension(34, 16));
+            btnColor.setText("...");
+
+            btnColor.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        Color ret = JColorChooser.showDialog(ProjectProperties.this,
+                        		PluginServices.getText(this, "selection_color"),
+                                lblColor.getBackground());
+
+                        if (ret != null) {
+                            lblColor.setBackground(ret);
+                        }
+                    }
+                });
+        }
+
+        return btnColor;
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getTxtComments());
+            jScrollPane.setPreferredSize(new java.awt.Dimension(310, 70));
+        }
+
+        return jScrollPane;
+    }
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+   		m_viewinfo.setWidth(341);
+   		m_viewinfo.setHeight(311);
+   		m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_sesion"));
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}
+
+
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectProperties.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/TableProperties.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/TableProperties.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/TableProperties.java	(revision 1648)
@@ -0,0 +1,396 @@
+/* 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.gui.project;
+
+
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.project.ProjectTable;
+
+
+/**
+ * Dialogo de propiedades de la tabla
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class TableProperties extends JPanel implements View {
+    private javax.swing.JPanel jContentPane = null;
+    private javax.swing.JLabel jLabel = null;
+    private javax.swing.JTextField txtName = null;
+    private javax.swing.JLabel jLabel1 = null;
+    private javax.swing.JTextField txtDate = null;
+    private javax.swing.JTextField txtOwner = null;
+    private javax.swing.JLabel jLabel2 = null;
+    private javax.swing.JLabel jLabel3 = null;
+    private javax.swing.JScrollPane jScrollPane = null;
+    private javax.swing.JTextArea txtComments = null;
+    private javax.swing.JScrollPane jScrollPane1 = null;
+    private javax.swing.JTable tabla = null;
+    private ProjectTable table;
+    private javax.swing.JButton btnOk = null;
+    private javax.swing.JButton btnCancel = null;
+    private javax.swing.JPanel jPanel = null;
+    private javax.swing.JPanel jPanel1 = null;
+    private javax.swing.JLabel jLabel4 = null;
+    private ViewInfo m_viewinfo = null;
+    /**
+     * This is the default constructor
+     *
+     * @param f Frame padre del di�logo
+     * @param t Tabla que se representa en el di�logo
+     */
+    public TableProperties(ProjectTable t) {
+        table = t;
+
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+
+		java.awt.FlowLayout layFlowLayout7 = new java.awt.FlowLayout();
+		layFlowLayout7.setHgap(0);
+        setLayout(layFlowLayout7);
+		add(getJPanel(), null);
+		add(getJPanel1(), null);
+		add(getJLabel3(), null);
+		add(getJScrollPane(), null);
+		add(getJScrollPane1(), null);
+		add(getBtnOk(), null);
+		add(getJLabel4(), null);
+		add(getBtnCancel(), null);
+
+        txtName.setText(table.getName());
+        txtDate.setText(table.getCreationDate());
+        txtOwner.setText(table.getOwner());
+        txtComments.setText(table.getComment());
+
+        tabla.setModel(new MyTableModel(table));
+    }
+
+    /**
+     * This method initializes jLabel
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel() {
+        if (jLabel == null) {
+            jLabel = new javax.swing.JLabel();
+            jLabel.setText(PluginServices.getText(this, "nombre") + ":");
+        }
+
+        return jLabel;
+    }
+
+    /**
+     * This method initializes txtName
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtName() {
+        if (txtName == null) {
+            txtName = new javax.swing.JTextField();
+            txtName.setPreferredSize(new java.awt.Dimension(220, 20));
+        }
+
+        return txtName;
+    }
+
+    /**
+     * This method initializes jLabel1
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel1() {
+        if (jLabel1 == null) {
+            jLabel1 = new javax.swing.JLabel();
+            jLabel1.setText(PluginServices.getText(this, "creation_date") + ":");
+        }
+
+        return jLabel1;
+    }
+
+    /**
+     * This method initializes txtDate
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtDate() {
+        if (txtDate == null) {
+            txtDate = new javax.swing.JTextField();
+            txtDate.setPreferredSize(new java.awt.Dimension(220, 20));
+            txtDate.setEditable(false);
+            txtDate.setBackground(java.awt.Color.white);
+        }
+
+        return txtDate;
+    }
+
+    /**
+     * This method initializes txtOwner
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtOwner() {
+        if (txtOwner == null) {
+            txtOwner = new javax.swing.JTextField();
+            txtOwner.setPreferredSize(new java.awt.Dimension(220, 20));
+        }
+
+        return txtOwner;
+    }
+
+    /**
+     * This method initializes jLabel2
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel2() {
+        if (jLabel2 == null) {
+            jLabel2 = new javax.swing.JLabel();
+            jLabel2.setText(PluginServices.getText(this, "owner") + ":");
+        }
+
+        return jLabel2;
+    }
+
+    /**
+     * This method initializes jLabel3
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel3() {
+        if (jLabel3 == null) {
+            jLabel3 = new javax.swing.JLabel();
+            jLabel3.setText(PluginServices.getText(this, "comentarios") + ":");
+        }
+
+        return jLabel3;
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getTxtComments());
+            jScrollPane.setPreferredSize(new java.awt.Dimension(320, 70));
+        }
+
+        return jScrollPane;
+    }
+
+    /**
+     * This method initializes txtComments
+     *
+     * @return javax.swing.JTextArea
+     */
+    private javax.swing.JTextArea getTxtComments() {
+        if (txtComments == null) {
+            txtComments = new javax.swing.JTextArea();
+        }
+
+        return txtComments;
+    }
+
+    /**
+     * This method initializes jTable
+     *
+     * @return javax.swing.JTable
+     */
+    private javax.swing.JTable getJTable() {
+        if (tabla == null) {
+            tabla = new javax.swing.JTable();
+        }
+
+        return tabla;
+    }
+
+    /**
+     * This method initializes jScrollPane1
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane1() {
+        if (jScrollPane1 == null) {
+            jScrollPane1 = new javax.swing.JScrollPane();
+            jScrollPane1.setViewportView(getJTable());
+            jScrollPane1.setPreferredSize(new java.awt.Dimension(320, 160));
+        }
+
+        return jScrollPane1;
+    }
+
+    /**
+     * This method initializes btnOk
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnOk() {
+        if (btnOk == null) {
+            btnOk = new javax.swing.JButton();
+            btnOk.setPreferredSize(new java.awt.Dimension(90, 30));
+            btnOk.setText(PluginServices.getText(this, "ok"));
+
+            btnOk.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        table.setName(txtName.getText());
+                        table.setCreationDate(txtDate.getText());
+                        table.setOwner(txtOwner.getText());
+                        table.setComment(txtComments.getText());
+
+						PluginServices.getMDIManager().closeView(TableProperties.this);
+                    }
+                });
+        }
+
+        return btnOk;
+    }
+
+    /**
+     * This method initializes btnCancel
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnCancel() {
+        if (btnCancel == null) {
+            btnCancel = new javax.swing.JButton();
+            btnCancel.setPreferredSize(new java.awt.Dimension(90, 30));
+            btnCancel.setText(PluginServices.getText(this, "cancel"));
+
+            btnCancel.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                    	PluginServices.getMDIManager().closeView(TableProperties.this);
+                    }
+                });
+        }
+
+        return btnCancel;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel() {
+        if (jPanel == null) {
+            jPanel = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout9 = new java.awt.FlowLayout();
+            layFlowLayout9.setAlignment(java.awt.FlowLayout.RIGHT);
+            layFlowLayout9.setVgap(9);
+            jPanel.setLayout(layFlowLayout9);
+            jPanel.add(getJLabel(), null);
+            jPanel.add(getJLabel1(), null);
+            jPanel.add(getJLabel2(), null);
+            jPanel.setPreferredSize(new java.awt.Dimension(100, 80));
+        }
+
+        return jPanel;
+    }
+
+    /**
+     * This method initializes jPanel1
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel1() {
+        if (jPanel1 == null) {
+            jPanel1 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout8 = new java.awt.FlowLayout();
+            layFlowLayout8.setAlignment(java.awt.FlowLayout.LEFT);
+            jPanel1.setLayout(layFlowLayout8);
+            jPanel1.add(getTxtName(), null);
+            jPanel1.add(getTxtDate(), null);
+            jPanel1.add(getTxtOwner(), null);
+            jPanel1.setPreferredSize(new java.awt.Dimension(230, 80));
+        }
+
+        return jPanel1;
+    }
+
+    /**
+     * This method initializes jLabel4
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel4() {
+        if (jLabel4 == null) {
+            jLabel4 = new javax.swing.JLabel();
+            jLabel4.setText("");
+            jLabel4.setPreferredSize(new java.awt.Dimension(30, 0));
+        }
+
+        return jLabel4;
+    }
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+   		m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_tabla"));
+		m_viewinfo.setWidth(349);
+		m_viewinfo.setHeight(400);
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}
+
+
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/TableProperties.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ViewProperties.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ViewProperties.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ViewProperties.java	(revision 1648)
@@ -0,0 +1,628 @@
+/* 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.gui.project;
+
+
+import java.awt.Color;
+
+import javax.swing.JButton;
+import javax.swing.JColorChooser;
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.gui.Dialogs.CSSelectionDialog;
+import com.iver.cit.gvsig.gui.Panels.ProjChooserPanel;
+import com.iver.cit.gvsig.gui.layout.Attributes;
+import com.iver.cit.gvsig.project.ProjectView;
+/**
+ * Dialogo donde se muestran las propiedades de una vista
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ViewProperties extends JPanel implements View{
+    /*private String[] units = new String[] {
+            PluginServices.getText(this, "metros"),
+            PluginServices.getText(this, "kilometros"),
+        };
+    */
+    private javax.swing.JPanel jContentPane = null;
+    private javax.swing.JLabel jLabel = null;
+    private javax.swing.JTextField txtName = null;
+    private javax.swing.JLabel jLabel1 = null;
+    private javax.swing.JTextField txtDate = null;
+    private javax.swing.JLabel jLabel2 = null;
+    private javax.swing.JTextField txtOwner = null;
+    private javax.swing.JLabel jLabel4 = null;
+    private javax.swing.JComboBox cmbMapUnits = null;
+    private javax.swing.JLabel jLabel5 = null;
+    private javax.swing.JComboBox cmbDistanceUnits = null;
+    private javax.swing.JLabel jLabel6 = null;
+    private javax.swing.JTextArea txtComments = null;
+    private javax.swing.JLabel jLabel7 = null;
+    private javax.swing.JLabel lblColor = null;
+    private javax.swing.JButton btnColor = null;
+    private javax.swing.JButton btnOk = null;
+    private javax.swing.JButton btnCancel = null;
+    private ProjectView view=null;
+    private javax.swing.JScrollPane jScrollPane = null;
+    private javax.swing.JPanel jPanel = null;
+    private javax.swing.JPanel jPanel1 = null;
+    private javax.swing.JPanel jPanel2 = null;
+    private javax.swing.JPanel jPanel3 = null;
+    private javax.swing.JLabel jLabel3 = null;
+    private ViewInfo m_viewinfo = null;
+	//private JLabel jLblProj = null;
+	//private JLabel jLblProjName = null;
+	//private JButton jBtnChangeProj = null;
+	private ProjChooserPanel jPanelProj = null;
+    /**
+     * This is the default constructor
+     *
+     * @param f Frame padre del dialogo
+     * @param v Vista que se representa
+     */
+    public ViewProperties(ProjectView v) {
+        view = v;
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.setSize(378, 358);
+		java.awt.FlowLayout layFlowLayout3 = new java.awt.FlowLayout();
+		layFlowLayout3.setHgap(0);
+		setLayout(layFlowLayout3);
+/*      jLblProjName = new JLabel();
+        jLblProj = new JLabel();
+		jLblProj.setText(view.getProjection().getAbrev());
+		jLblProj.setPreferredSize(new java.awt.Dimension(180,20));
+		jLblProjName.setText("Proyecci�n actual:");
+		jLblProjName.setPreferredSize(new java.awt.Dimension(95,15));*/
+		this.setPreferredSize(new java.awt.Dimension(365,343));
+		add(getJPanel(), null);
+		add(getJPanel1(), null);
+		add(getJPanel2(), null);
+		add(getJPanel3(), null);
+		this.add(getJPanelProj(), null);
+		this.add(getJLabel6(), null);
+		add(getJScrollPane(), null);
+		this.add(getJLabel7(), null);
+		this.add(getLblColor(), null);
+		this.add(getBtnColor(), null);
+		add(getJLabel3(), null);
+		this.add(getBtnOk(), null);
+		this.add(getBtnCancel(), null);
+        txtName.setText(view.getName());
+        txtDate.setText(view.getCreationDate());
+        txtOwner.setText(view.getOwner());
+
+        cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits());
+        cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort().getDistanceUnits());
+
+        txtComments.setText(view.getComment());
+
+        lblColor.setBackground(view.getMapContext().getViewPort().getBackColor());
+    }
+
+    /**
+     * This method initializes jLabel
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel() {
+        if (jLabel == null) {
+            jLabel = new javax.swing.JLabel();
+            jLabel.setText(PluginServices.getText(this, "nombre") + ":");
+        }
+
+        return jLabel;
+    }
+
+    /**
+     * This method initializes txtName
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtName() {
+        if (txtName == null) {
+            txtName = new javax.swing.JTextField();
+            txtName.setPreferredSize(new java.awt.Dimension(220, 20));
+        }
+
+        return txtName;
+    }
+
+    /**
+     * This method initializes jLabel1
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel1() {
+        if (jLabel1 == null) {
+            jLabel1 = new javax.swing.JLabel();
+            jLabel1.setText(PluginServices.getText(this, "creation_date") + ":");
+        }
+
+        return jLabel1;
+    }
+
+    /**
+     * This method initializes txtDate
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtDate() {
+        if (txtDate == null) {
+            txtDate = new javax.swing.JTextField();
+            txtDate.setPreferredSize(new java.awt.Dimension(220, 20));
+            txtDate.setEditable(false);
+            txtDate.setBackground(java.awt.Color.white);
+        }
+
+        return txtDate;
+    }
+
+    /**
+     * This method initializes jLabel2
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel2() {
+        if (jLabel2 == null) {
+            jLabel2 = new javax.swing.JLabel();
+            jLabel2.setText(PluginServices.getText(this, "owner") + ":");
+        }
+
+        return jLabel2;
+    }
+
+    /**
+     * This method initializes txtOwner
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtOwner() {
+        if (txtOwner == null) {
+            txtOwner = new javax.swing.JTextField();
+            txtOwner.setPreferredSize(new java.awt.Dimension(220, 20));
+        }
+
+        return txtOwner;
+    }
+
+    /**
+     * This method initializes jLabel4
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel4() {
+        if (jLabel4 == null) {
+            jLabel4 = new javax.swing.JLabel();
+            jLabel4.setText(PluginServices.getText(this, "map_units") + ":");
+        }
+
+        return jLabel4;
+    }
+
+    /**
+     * This method initializes cmbMapUnits
+     *
+     * @return javax.swing.JComboBox
+     */
+    private javax.swing.JComboBox getCmbMapUnits() {
+        if (cmbMapUnits == null) {
+            cmbMapUnits = new javax.swing.JComboBox(Attributes.NAMES);
+            cmbMapUnits.setPreferredSize(new java.awt.Dimension(160, 20));
+       		cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits());
+            cmbMapUnits.addActionListener(new java.awt.event.ActionListener() { 
+            	public void actionPerformed(java.awt.event.ActionEvent e) {    
+            		view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex());
+            	}
+            });
+        }
+
+        return cmbMapUnits;
+    }
+
+    /**
+     * This method initializes jLabel5
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel5() {
+        if (jLabel5 == null) {
+            jLabel5 = new javax.swing.JLabel();
+            jLabel5.setText(PluginServices.getText(this, "distance_units") + ":");
+        }
+
+        return jLabel5;
+    }
+
+    /**
+     * This method initializes cmbDistanceUnits
+     *
+     * @return javax.swing.JComboBox
+     */
+    private javax.swing.JComboBox getCmbDistanceUnits() {
+        if (cmbDistanceUnits == null) {
+            cmbDistanceUnits = new javax.swing.JComboBox(Attributes.NAMES);
+            cmbDistanceUnits.setPreferredSize(new java.awt.Dimension(160, 20));
+            cmbDistanceUnits.setEditable(false);
+            cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort().getDistanceUnits());
+            cmbDistanceUnits.addActionListener(new java.awt.event.ActionListener() { 
+            	public void actionPerformed(java.awt.event.ActionEvent e) {    
+            		view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex());
+            	}
+            });
+        }
+
+        return cmbDistanceUnits;
+    }
+
+    /**
+     * This method initializes jLabel6
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel6() {
+        if (jLabel6 == null) {
+            jLabel6 = new javax.swing.JLabel();
+            jLabel6.setText(PluginServices.getText(this, "comentarios") + ":");
+            jLabel6.setPreferredSize(new java.awt.Dimension(330,35));
+            jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+            jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
+        }
+
+        return jLabel6;
+    }
+
+    /**
+     * This method initializes txtComments
+     *
+     * @return javax.swing.JTextArea
+     */
+    private javax.swing.JTextArea getTxtComments() {
+        if (txtComments == null) {
+            txtComments = new javax.swing.JTextArea();
+            txtComments.setRows(1);
+            txtComments.setColumns(28);
+        }
+
+        return txtComments;
+    }
+
+    /**
+     * This method initializes jLabel7
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel7() {
+        if (jLabel7 == null) {
+            jLabel7 = new javax.swing.JLabel();
+            jLabel7.setText(PluginServices.getText(this, "background_color") +
+                ":");
+            jLabel7.setPreferredSize(new java.awt.Dimension(240,16));
+        }
+
+        return jLabel7;
+    }
+
+    /**
+     * This method initializes lblColor
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getLblColor() {
+        if (lblColor == null) {
+            lblColor = new javax.swing.JLabel();
+            lblColor.setText("");
+            lblColor.setPreferredSize(new java.awt.Dimension(30, 16));
+            lblColor.setBackground(view.getMapContext().getViewPort().getBackColor());
+            lblColor.setOpaque(true);
+        }
+
+        return lblColor;
+    }
+
+    /**
+     * This method initializes btnColor
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnColor() {
+        if (btnColor == null) {
+            btnColor = new javax.swing.JButton();
+            btnColor.setPreferredSize(new java.awt.Dimension(34, 16));
+            btnColor.setText("...");
+
+            btnColor.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        Color ret = JColorChooser.showDialog(ViewProperties.this,
+                                PluginServices.getText(this, "background_color"),
+                                lblColor.getBackground());
+
+                        if (ret != null) {
+                            lblColor.setBackground(ret);
+                        }
+                    }
+                });
+        }
+
+        return btnColor;
+    }
+
+    /**
+     * This method initializes btnOk
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnOk() {
+        if (btnOk == null) {
+            btnOk = new javax.swing.JButton();
+            btnOk.setPreferredSize(new java.awt.Dimension(100, 30));
+            btnOk.setText(PluginServices.getText(this, "ok"));
+
+            btnOk.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        view.setName(txtName.getText());
+                        view.setCreationDate(txtDate.getText());
+                        view.setOwner(txtOwner.getText());
+                        view.setComment(txtComments.getText());
+                        view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex());
+                        view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex());
+                        view.setBackColor(lblColor.getBackground());
+                        
+                        PluginServices.getMDIManager().closeView(ViewProperties.this);
+                    }
+                });
+        }
+
+        return btnOk;
+    }
+
+    /**
+     * This method initializes btnCancel
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnCancel() {
+        if (btnCancel == null) {
+            btnCancel = new javax.swing.JButton();
+            btnCancel.setPreferredSize(new java.awt.Dimension(100, 30));
+            btnCancel.setText(PluginServices.getText(this, "cancel"));
+
+            btnCancel.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                    	PluginServices.getMDIManager().closeView(ViewProperties.this);
+                    }
+                });
+        }
+
+        return btnCancel;
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getTxtComments());
+            jScrollPane.setPreferredSize(new java.awt.Dimension(320, 70));
+        }
+
+        return jScrollPane;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel() {
+        if (jPanel == null) {
+            jPanel = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout4 = new java.awt.FlowLayout();
+            layFlowLayout4.setAlignment(java.awt.FlowLayout.RIGHT);
+            layFlowLayout4.setVgap(9);
+            jPanel.setLayout(layFlowLayout4);
+            jPanel.add(getJLabel(), null);
+            jPanel.add(getJLabel1(), null);
+            jPanel.add(getJLabel2(), null);
+            jPanel.setPreferredSize(new java.awt.Dimension(100, 80));
+        }
+
+        return jPanel;
+    }
+
+    /**
+     * This method initializes jPanel1
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel1() {
+        if (jPanel1 == null) {
+            jPanel1 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout2 = new java.awt.FlowLayout();
+            layFlowLayout2.setHgap(5);
+            layFlowLayout2.setAlignment(java.awt.FlowLayout.LEFT);
+            jPanel1.setLayout(layFlowLayout2);
+            jPanel1.add(getTxtName(), null);
+            jPanel1.add(getTxtDate(), null);
+            jPanel1.add(getTxtOwner(), null);
+            jPanel1.setPreferredSize(new java.awt.Dimension(230, 80));
+        }
+
+        return jPanel1;
+    }
+
+    /**
+     * This method initializes jPanel2
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel2() {
+        if (jPanel2 == null) {
+            jPanel2 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout5 = new java.awt.FlowLayout();
+            layFlowLayout5.setAlignment(java.awt.FlowLayout.RIGHT);
+            layFlowLayout5.setVgap(9);
+            jPanel2.setLayout(layFlowLayout5);
+            jPanel2.add(getJLabel4(), null);
+            jPanel2.add(getJLabel5(), null);
+            jPanel2.setPreferredSize(new java.awt.Dimension(100, 50));
+        }
+
+        return jPanel2;
+    }
+
+    /**
+     * This method initializes jPanel3
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel3() {
+        if (jPanel3 == null) {
+            jPanel3 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout6 = new java.awt.FlowLayout();
+            layFlowLayout6.setAlignment(java.awt.FlowLayout.LEFT);
+            jPanel3.setLayout(layFlowLayout6);
+            jPanel3.add(getCmbMapUnits(), null);
+            jPanel3.add(getCmbDistanceUnits(), null);
+            jPanel3.setPreferredSize(new java.awt.Dimension(230, 50));
+        }
+
+        return jPanel3;
+    }
+
+    /**
+     * This method initializes jLabel3
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel3() {
+        if (jLabel3 == null) {
+            jLabel3 = new javax.swing.JLabel();
+            jLabel3.setText("");
+            jLabel3.setPreferredSize(new java.awt.Dimension(30, 0));
+        }
+
+        return jLabel3;
+    }
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+    		m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_vista"));
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 * /    
+	private JButton getJBtnChangeProj() {
+		if (jBtnChangeProj == null) {
+			jBtnChangeProj = new JButton();
+			jBtnChangeProj.setText("...");
+			jBtnChangeProj.setPreferredSize(new java.awt.Dimension(34,16));
+			jBtnChangeProj.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					CSSelectionDialog csSelect = new CSSelectionDialog();
+					csSelect.setProjection(view.getProjection());
+					
+			        PluginServices.getMDIManager().addView(csSelect);
+			        
+			        if (csSelect.isOkPressed()) {
+			        	view.getMapContext().setProjection(csSelect.getProjection());
+			        	jLblProj.setText(view.getProjection().getAbrev());
+			        }
+				}
+			});
+		}
+		return jBtnChangeProj;
+	} */
+	/**
+	 * This method initializes jPanel4	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private ProjChooserPanel getJPanelProj() {
+		if (jPanelProj == null) {
+			jPanelProj = new ProjChooserPanel(view.getProjection());
+			jPanelProj.setPreferredSize(new java.awt.Dimension(330,35));
+			jPanelProj.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+			        if (jPanelProj.isOkPressed()) {
+			        	view.getMapContext().setProjection(jPanelProj.getCurProj());
+			        }
+				}
+			});
+
+//			jPanelProj.add(jLblProjName, null);
+//			jPanelProj.add(jLblProj, null);
+//			jPanelProj.add(getJBtnChangeProj(), null);
+		}
+		return jPanelProj;
+	}
+  }  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"
+
+
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ViewProperties.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MapProperties.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MapProperties.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MapProperties.java	(revision 1648)
@@ -0,0 +1,652 @@
+/* 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.gui.project;
+
+
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.project.ProjectMap;
+/**
+ * Dialogo con la informaci�n de los mapas
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class MapProperties extends JPanel implements View {
+    private javax.swing.JPanel jContentPane = null;
+    private javax.swing.JLabel jLabel = null;
+    private javax.swing.JTextField txtName = null;
+    private javax.swing.JLabel jLabel1 = null;
+    private javax.swing.JTextField txtDate = null;
+    private javax.swing.JLabel jLabel2 = null;
+    private javax.swing.JTextField txtOwner = null;
+    private javax.swing.JLabel jLabel3 = null;
+    private javax.swing.JScrollPane jScrollPane = null;
+    private javax.swing.JTextArea txtComments = null;
+    private javax.swing.JLabel jLabel4 = null;
+    private javax.swing.JTextField txtHorizontal = null;
+    private javax.swing.JLabel jLabel5 = null;
+    private javax.swing.JTextField txtVertical = null;
+    private javax.swing.JCheckBox chkMalla = null;
+    private javax.swing.JButton btnOk = null;
+    private javax.swing.JButton btnCancel = null;
+    private ProjectMap map;
+    private javax.swing.JPanel jPanel = null;
+    private javax.swing.JPanel jPanel1 = null;
+    private javax.swing.JPanel jPanel2 = null;
+    private javax.swing.JPanel jPanel3 = null;
+    private javax.swing.JLabel jLabel6 = null;
+
+	private javax.swing.JPanel jPanel4 = null;
+	private javax.swing.JLabel jLabel7 = null;
+	private javax.swing.JLabel jLabel8 = null;
+	private javax.swing.JCheckBox jCheckBox = null;
+	private javax.swing.JPanel jPanel5 = null;
+	private ViewInfo m_viewinfo = null;
+	private JPanel jPanel6 = null;
+	private JCheckBox jCheckBox1 = null;
+	/**
+	 * This method initializes 
+	 * 
+	 */
+	public MapProperties() {
+		super();
+		initialize();
+	}
+    /**
+     * This is the default constructor
+     *
+     * @param f frame padre del dialogo
+     * @param m mapa cuya informaci�n se presenta
+     */
+    public MapProperties(ProjectMap m) {
+        map = m;
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.setSize(320, 355);
+        this.add(getJContentPane(), null);
+		getTxtName().setText(map.getName());
+        getTxtDate().setText(map.getCreationDate());
+        getTxtOwner().setText(map.getOwner());
+        getTxtComments().setText(map.getComment());
+
+        getTxtHorizontal().setText(Double.toString(map.getModel().getAtributes().getNumUnitsX()));
+        getTxtVertical().setText(Double.toString(map.getModel().getAtributes().getNumUnitsY()));
+
+        getChkMalla().setSelected(map.getModel().isCuadricula());
+   		//map.getModel().setProjectMap(map);
+	}
+
+    /**
+     * This method initializes jContentPane
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJContentPane() {
+        if (jContentPane == null) {
+            jContentPane = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout10 = new java.awt.FlowLayout();
+            layFlowLayout10.setHgap(0);
+            jContentPane.setLayout(layFlowLayout10);
+            jContentPane.add(getJPanel(), null);
+            jContentPane.add(getJPanel1(), null);
+            jContentPane.add(getJLabel3(), null);
+            jContentPane.add(getJScrollPane(), null);
+            jContentPane.add(getJPanel4(), null);
+            jContentPane.add(getJPanel2(), null);
+            jContentPane.add(getJPanel3(), null);
+            jContentPane.add(getJPanel5(), null);
+            jContentPane.setPreferredSize(new java.awt.Dimension(310,345));
+            jContentPane.add(getJPanel6(), null);
+            jContentPane.add(getBtnOk(), null);
+            jContentPane.add(getBtnCancel(), null);
+        }
+
+        return jContentPane;
+    }
+
+    /**
+     * This method initializes jLabel
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel() {
+        if (jLabel == null) {
+            jLabel = new javax.swing.JLabel();
+            jLabel.setText(PluginServices.getText(this, "nombre") + ":");
+            jLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+        }
+
+        return jLabel;
+    }
+
+    /**
+     * This method initializes txtName
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtName() {
+        if (txtName == null) {
+            txtName = new javax.swing.JTextField();
+            txtName.setPreferredSize(new java.awt.Dimension(190, 20));
+        }
+
+        return txtName;
+    }
+
+    /**
+     * This method initializes jLabel1
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel1() {
+        if (jLabel1 == null) {
+            jLabel1 = new javax.swing.JLabel();
+            jLabel1.setText(PluginServices.getText(this, "creation_date") + ":");
+            jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+        }
+
+        return jLabel1;
+    }
+
+    /**
+     * This method initializes txtDate
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtDate() {
+        if (txtDate == null) {
+            txtDate = new javax.swing.JTextField();
+            txtDate.setPreferredSize(new java.awt.Dimension(190, 20));
+            txtDate.setEditable(false);
+            txtDate.setBackground(java.awt.Color.white);
+        }
+
+        return txtDate;
+    }
+
+    /**
+     * This method initializes jLabel2
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel2() {
+        if (jLabel2 == null) {
+            jLabel2 = new javax.swing.JLabel();
+            jLabel2.setText(PluginServices.getText(this, "owner") + ":");
+            jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
+        }
+
+        return jLabel2;
+    }
+
+    /**
+     * This method initializes txtOwner
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtOwner() {
+        if (txtOwner == null) {
+            txtOwner = new javax.swing.JTextField();
+            txtOwner.setPreferredSize(new java.awt.Dimension(190, 20));
+        }
+
+        return txtOwner;
+    }
+
+    /**
+     * This method initializes jLabel3
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel3() {
+        if (jLabel3 == null) {
+            jLabel3 = new javax.swing.JLabel();
+            jLabel3.setText(PluginServices.getText(this, "comentarios") + ":");
+        }
+
+        return jLabel3;
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getTxtComments());
+            jScrollPane.setPreferredSize(new java.awt.Dimension(290,50));
+        }
+
+        return jScrollPane;
+    }
+
+    /**
+     * This method initializes txtComments
+     *
+     * @return javax.swing.JTextArea
+     */
+    private javax.swing.JTextArea getTxtComments() {
+        if (txtComments == null) {
+            txtComments = new javax.swing.JTextArea();
+        }
+
+        return txtComments;
+    }
+
+    /**
+     * This method initializes jLabel4
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel4() {
+        if (jLabel4 == null) {
+            jLabel4 = new javax.swing.JLabel();
+            jLabel4.setText(PluginServices.getText(this, "espaciado_horizontal") +
+                ":");
+        }
+
+        return jLabel4;
+    }
+
+    /**
+     * This method initializes txtHorizontal
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtHorizontal() {
+        if (txtHorizontal == null) {
+            txtHorizontal = new javax.swing.JTextField();
+            txtHorizontal.setPreferredSize(new java.awt.Dimension(40, 20));
+        }
+
+        return txtHorizontal;
+    }
+
+    /**
+     * This method initializes jLabel5
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel5() {
+        if (jLabel5 == null) {
+            jLabel5 = new javax.swing.JLabel();
+            jLabel5.setText(PluginServices.getText(this, "espaciado_vertical") +
+                ":");
+        }
+
+        return jLabel5;
+    }
+
+    /**
+     * This method initializes txtVertical
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JTextField getTxtVertical() {
+        if (txtVertical == null) {
+            txtVertical = new javax.swing.JTextField();
+            txtVertical.setPreferredSize(new java.awt.Dimension(40, 20));
+        }
+
+        return txtVertical;
+    }
+
+    /**
+     * This method initializes chkMalla
+     *
+     * @return javax.swing.JCheckBox
+     */
+    private javax.swing.JCheckBox getChkMalla() {
+        if (chkMalla == null) {
+            chkMalla = new javax.swing.JCheckBox();
+            chkMalla.setText(PluginServices.getText(this, "malla_activada"));
+            chkMalla.setSelected(true);
+            chkMalla.setPreferredSize(new java.awt.Dimension(100,24));
+            chkMalla.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING);
+            chkMalla.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+            chkMalla.addActionListener(new java.awt.event.ActionListener() { 
+            	public void actionPerformed(java.awt.event.ActionEvent e) {    
+            		map.getModel().setIsCuadricula(chkMalla.isSelected());
+            	}
+            });
+        }
+
+        return chkMalla;
+    }
+
+    /**
+     * This method initializes btnOk
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnOk() {
+        if (btnOk == null) {
+            btnOk = new javax.swing.JButton();
+            btnOk.setPreferredSize(new java.awt.Dimension(80,23));
+            btnOk.setText(PluginServices.getText(this, "ok"));
+
+            btnOk.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        map.setName(txtName.getText());
+                        map.setOwner(txtOwner.getText());
+                        map.setComment(txtComments.getText());
+							
+                        try {
+                        	String sh=txtHorizontal.getText();
+                        	sh=sh.replace(',','.');
+                        	if (sh.length()!=0){
+                            	double f = new Double(sh).doubleValue();
+								map.getModel().getAtributes().setNumUnitsX(f);
+                        	}
+                        	
+							String sv=txtVertical.getText();
+							sv=sv.replace(',','.');
+							if (sv.length()!=0){
+								double f = new Double(sv).doubleValue();
+								map.getModel().getAtributes().setNumUnitsY(f);
+							}
+							
+ 							PluginServices.getMDIManager().closeView(MapProperties.this);
+ 							map.getModel().setIsDrawGrid(getJCheckBox1().isSelected());
+ 							map.getModel().refresh();
+                        } catch (NumberFormatException ex) {
+                            NotificationManager.addInfo("no es un double", ex);
+                        }
+                    }
+                });
+        }
+
+        return btnOk;
+    }
+
+    /**
+     * This method initializes btnCancel
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnCancel() {
+        if (btnCancel == null) {
+            btnCancel = new javax.swing.JButton();
+            btnCancel.setPreferredSize(new java.awt.Dimension(80,23));
+            btnCancel.setText(PluginServices.getText(this, "cancel"));
+
+            btnCancel.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                    	PluginServices.getMDIManager().closeView(MapProperties.this);
+                   }
+                });
+        }
+
+        return btnCancel;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel() {
+        if (jPanel == null) {
+            jPanel = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout11 = new java.awt.FlowLayout();
+            layFlowLayout11.setAlignment(java.awt.FlowLayout.RIGHT);
+            layFlowLayout11.setVgap(9);
+            jPanel.setLayout(layFlowLayout11);
+            jPanel.add(getJLabel(), null);
+            jPanel.add(getJLabel1(), null);
+            jPanel.add(getJLabel2(), null);
+            jPanel.setPreferredSize(new java.awt.Dimension(100, 80));
+        }
+
+        return jPanel;
+    }
+
+    /**
+     * This method initializes jPanel1
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel1() {
+        if (jPanel1 == null) {
+            jPanel1 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout12 = new java.awt.FlowLayout();
+            layFlowLayout12.setAlignment(java.awt.FlowLayout.LEFT);
+            jPanel1.setLayout(layFlowLayout12);
+            jPanel1.add(getTxtName(), null);
+            jPanel1.add(getTxtDate(), null);
+            jPanel1.add(getTxtOwner(), null);
+            jPanel1.setPreferredSize(new java.awt.Dimension(200, 80));
+        }
+
+        return jPanel1;
+    }
+
+    /**
+     * This method initializes jPanel2
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel2() {
+        if (jPanel2 == null) {
+            jPanel2 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout13 = new java.awt.FlowLayout();
+            layFlowLayout13.setAlignment(java.awt.FlowLayout.RIGHT);
+            layFlowLayout13.setVgap(9);
+            jPanel2.setLayout(layFlowLayout13);
+            jPanel2.add(getJLabel4(), null);
+            jPanel2.add(getJLabel5(), null);
+            jPanel2.setPreferredSize(new java.awt.Dimension(200, 50));
+        }
+
+        return jPanel2;
+    }
+
+    /**
+     * This method initializes jPanel3
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel3() {
+        if (jPanel3 == null) {
+            jPanel3 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout14 = new java.awt.FlowLayout();
+            layFlowLayout14.setAlignment(java.awt.FlowLayout.LEFT);
+            jPanel3.setLayout(layFlowLayout14);
+            jPanel3.add(getTxtHorizontal(), null);
+            jPanel3.add(getJLabel6(), null);
+            jPanel3.add(getTxtVertical(), null);
+            jPanel3.setPreferredSize(new java.awt.Dimension(100, 50));
+        }
+
+        return jPanel3;
+    }
+
+    /**
+     * This method initializes jLabel6
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel6() {
+        if (jLabel6 == null) {
+            jLabel6 = new javax.swing.JLabel();
+            jLabel6.setPreferredSize(new java.awt.Dimension(38, 0));
+        }
+
+        return jLabel6;
+    }
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+   		m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_mapa"));
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+	/**
+	 * This method initializes jPanel4
+	 * 
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel4() {
+		if(jPanel4 == null) {
+			jPanel4 = new javax.swing.JPanel();
+			jPanel4.add(getJLabel7(), null);
+			jPanel4.add(getJLabel8(), null);
+			jPanel4.setPreferredSize(new java.awt.Dimension(300,24));
+		}
+		return jPanel4;
+	}
+	/**
+	 * This method initializes jLabel7
+	 * 
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel7() {
+		if(jLabel7 == null) {
+			jLabel7 = new javax.swing.JLabel();
+			jLabel7.setText("Unidades: ");
+		}
+		return jLabel7;
+	}
+	/**
+	 * This method initializes jLabel8
+	 * 
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel8() {
+		if(jLabel8 == null) {
+			jLabel8 = new javax.swing.JLabel();
+			jLabel8.setText(map.getModel().getAtributes().getNameUnit());
+		}
+		return jLabel8;
+	}
+	/**
+	 * This method initializes jCheckBox
+	 * 
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getJCheckBox() {
+		if(jCheckBox == null) {
+			jCheckBox = new javax.swing.JCheckBox();
+			jCheckBox.setText(PluginServices.getText(this,"activar_regla"));
+			jCheckBox.setSelected(map.getModel().getRuler());
+			jCheckBox.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					map.getModel().setRuler(jCheckBox.isSelected());
+				}
+			});
+		}
+		return jCheckBox;
+	}
+	/**
+	 * This method initializes jPanel5
+	 * 
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel5() {
+		if(jPanel5 == null) {
+			jPanel5 = new javax.swing.JPanel();
+			jPanel5.add(getChkMalla(), null);
+			jPanel5.add(getJCheckBox(), null);
+			jPanel5.setPreferredSize(new java.awt.Dimension(290,30));
+		}
+		return jPanel5;
+	}
+	/**
+	 * This method initializes jPanel6	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private JPanel getJPanel6() {
+		if (jPanel6 == null) {
+			jPanel6 = new JPanel();
+			jPanel6.setPreferredSize(new java.awt.Dimension(300,34));
+			jPanel6.add(getJCheckBox1(), null);
+		}
+		return jPanel6;
+	}
+	/**
+	 * This method initializes jCheckBox1	
+	 * 	
+	 * @return javax.swing.JCheckBox	
+	 */    
+	private JCheckBox getJCheckBox1() {
+		if (jCheckBox1 == null) {
+			jCheckBox1 = new JCheckBox();
+			jCheckBox1.setSelected(map.getModel().getIsDrawGrid());
+			jCheckBox1.setText(PluginServices.getText(this,"visualizar_cuadricula"));
+			jCheckBox1.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					
+				}
+			});
+		}
+		return jCheckBox1;
+	}
+  }  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"
+
+
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MapProperties.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectElementListModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectElementListModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectElementListModel.java	(revision 1648)
@@ -0,0 +1,89 @@
+/* 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.gui.project;
+
+import java.util.ArrayList;
+
+import javax.swing.AbstractListModel;
+
+
+/**
+ * Modelo para presentar los ProjectElement's (vistas, mapas, tablas) en un
+ * JList
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectElementListModel extends AbstractListModel {
+    private ArrayList els;
+
+    /**
+     * Creates a new MyListModel object.
+     *
+     * @param els Elementos del modelo
+     */
+    public ProjectElementListModel(ArrayList els) {
+        this.els = els;
+    }
+
+    /**
+     * Obtiene el tama�o de la lista
+     *
+     * @return tama�o de la lista
+     */
+    public int getSize() {
+        if (els == null) {
+            return 0;
+        }
+
+        return els.size();
+    }
+
+    /**
+     * @see javax.swing.ListModel#getElementAt(int)
+     */
+    public Object getElementAt(int index) {
+        if (els == null) {
+            return "";
+        }
+
+        return els.get(index);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectElementListModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MyTableModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MyTableModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MyTableModel.java	(revision 1648)
@@ -0,0 +1,152 @@
+/* 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.gui.project;
+
+
+import javax.swing.table.AbstractTableModel;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.project.ProjectTable;
+
+
+/**
+ * Modelo para la JTable de MapProperties
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class MyTableModel extends AbstractTableModel {
+    private ProjectTable table;
+
+    /**
+     * Creates a new MyTableModel object.
+     *
+     * @param t Tabla del proyecto que se quiere mostrar
+     */
+    public MyTableModel(ProjectTable t) {
+        table = t;
+    }
+
+    /**
+     * @see javax.swing.table.TableModel#getColumnCount()
+     */
+    public int getColumnCount() {
+        return 3;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.table.TableModel#getRowCount()
+     */
+    public int getRowCount() {
+    	//TODO implementar bien
+    	return 0;
+        //return table.getModelo().getFieldsCount();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.table.TableModel#getValueAt(int, int)
+     */
+    public Object getValueAt(int rowIndex, int columnIndex) {
+        if (columnIndex == 0) {
+            return new Boolean(table.get(rowIndex));
+        } else if (columnIndex == 1) {
+        	//TODO implementar bien
+        	return null;
+            //return table.getModelo().getFieldName(rowIndex);
+        } else {
+            return "alias"; //table.getModelo().getColumnAlias(rowIndex);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.table.TableModel#getColumnClass(int)
+     */
+    public Class getColumnClass(int columnIndex) {
+        if (columnIndex == 0) {
+            return Boolean.class;
+        }
+
+        return String.class;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.table.TableModel#isCellEditable(int, int)
+     */
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+        return (columnIndex != 1);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
+     */
+    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+        if (columnIndex == 0) {
+            table.set(rowIndex, ((Boolean) aValue).booleanValue());
+        } else {
+            //table.getModelo().setColumnAlias(rowIndex, (String) aValue);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see javax.swing.table.TableModel#getColumnName(int)
+     */
+    public String getColumnName(int column) {
+        String ret = null;
+
+        switch (column) {
+        case 0:
+            ret = PluginServices.getText(this, "visible");
+
+            break;
+
+        case 1:
+            ret = PluginServices.getText(this, "campo");
+
+            break;
+
+        case 2:
+            ret = PluginServices.getText(this, "alias");
+
+            break;
+        }
+
+        return ret;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/MyTableModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectWindow.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectWindow.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectWindow.java	(revision 1648)
@@ -0,0 +1,1021 @@
+/* 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.gui.project;
+
+import java.awt.Component;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.text.DateFormat;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.gdbms.engine.data.DBDriver;
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.hardcode.gdbms.engine.data.DataSourceFactory;
+import com.hardcode.gdbms.engine.data.FileDriver;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.ProjectExtension;
+import com.iver.cit.gvsig.fmap.drivers.GeorreferencedRasterDriver;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.gui.DataBaseOpenDialog;
+import com.iver.cit.gvsig.gui.FOpenDialog;
+import com.iver.cit.gvsig.gui.FileOpenDialog;
+import com.iver.cit.gvsig.gui.Table;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.project.Project;
+import com.iver.cit.gvsig.project.ProjectElement;
+import com.iver.cit.gvsig.project.ProjectFactory;
+import com.iver.cit.gvsig.project.ProjectMap;
+import com.iver.cit.gvsig.project.ProjectTable;
+import com.iver.cit.gvsig.project.ProjectView;
+import com.iver.utiles.DefaultListModel;
+
+
+/**
+ * Clase principal del proyecto donde se puede operar para crear vistas,
+ * tablas, mapas, ...
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class ProjectWindow extends JPanel implements PropertyChangeListener,
+    View, SingletonView {
+    private javax.swing.JPanel jPanel = null;
+    private javax.swing.JRadioButton btnVistas = null;
+    private javax.swing.JRadioButton btnTablas = null;
+    private javax.swing.JRadioButton btnMapas = null;
+    private ButtonGroup grupo = new ButtonGroup();
+    private javax.swing.JPanel jPanel1 = null;
+    private javax.swing.JList lstDocs = null;
+    private javax.swing.JPanel jPanel2 = null;
+    private javax.swing.JButton btnNuevo = null;
+    private javax.swing.JButton btnPropiedades = null;
+    private javax.swing.JButton btnAbrir = null;
+    private javax.swing.JButton btnBorrar = null;
+    private javax.swing.JButton btnRenombrar = null;
+    private javax.swing.JPanel jPanel3 = null;
+    private javax.swing.JLabel jLabel = null;
+    private javax.swing.JLabel lblNombreSesion = null;
+    private javax.swing.JLabel jLabel1 = null;
+    private javax.swing.JLabel lblGuardado = null;
+    private javax.swing.JLabel jLabel2 = null;
+    private javax.swing.JLabel lblFecha = null;
+    private javax.swing.JButton btnImportar = null;
+    private javax.swing.JButton btnExportar = null;
+    private javax.swing.JButton btnEditar = null;
+
+    /** Proyecto representado en la vista */
+    private Project p;
+
+    /**
+     * Extension con la informaci�n, entre otras, sobre las extensiones para
+     * las tablas
+     */
+    private ProjectExtension projectExtension;
+    private javax.swing.JScrollPane jScrollPane = null;
+    private javax.swing.JPanel jPanel4 = null;
+
+    /**
+     * This is the default constructor
+     *
+     * @param project Extension
+     */
+    public ProjectWindow(ProjectExtension project) {
+        super();
+
+        initialize();
+
+        projectExtension = project;
+
+        refreshControls();
+    }
+
+    /**
+     * Asigna el proyecto a la ventana
+     *
+     * @param p Proyecto con el que se operar� a trav�s de este di�logo
+     */
+    public void setProject(Project p) {
+        this.p = p;
+        p.addPropertyChangeListener(this);
+        refreshControls();
+    }
+
+    /**
+     * Activa los botones de la botonera del medio o los desactiva en funci�n
+     * de que est� seleccionado o no un elemento de proyecto en la lista del
+     * medio
+     */
+    private void activarBotones() {
+        if (lstDocs.getSelectedIndex() != -1) {
+            btnAbrir.setEnabled(true);
+            btnBorrar.setEnabled(true);
+            btnRenombrar.setEnabled(true);
+            btnPropiedades.setEnabled(true);
+        } else {
+            btnAbrir.setEnabled(false);
+            btnBorrar.setEnabled(false);
+            btnRenombrar.setEnabled(false);
+            btnPropiedades.setEnabled(false);
+        }
+    }
+
+    /**
+     * Refresca la lista de elementos de proyecto con vistas, mapas o tablas,
+     * seg�n la opci�n activada
+     */
+    private void refreshList() {
+        if (p != null) {
+            DefaultListModel model;
+
+            if (btnMapas.isSelected()) {
+                model = new DefaultListModel(p.getMaps());
+
+                //				getBtnNuevo().setEnabled(true);
+            } else if (btnTablas.isSelected()) {
+                model = new DefaultListModel(p.getTables());
+
+                //                getBtnNuevo().setEnabled(false);
+            } else {
+                model = new DefaultListModel(p.getViews());
+
+                //				getBtnNuevo().setEnabled(true);
+            }
+
+            lstDocs.setModel(model);
+
+            activarBotones();
+        }
+    }
+
+    /**
+     * Refresca las etiquetas con la informaci�n del proyecto
+     */
+    private void refreshProperties() {
+        if (p != null) {
+            String aux;
+
+            lblNombreSesion.setText(p.getName());
+
+            String path = p.getPath();
+
+            if (path != null) {
+                File f = new File(path);
+                lblGuardado.setText(f.toString());
+            } else {
+                lblGuardado.setText("");
+            }
+
+            lblFecha.setText(p.getCreationDate());
+        }
+    }
+
+    /**
+     * Refresca todo el di�logo
+     */
+    public void refreshControls() {
+        refreshList();
+        refreshProperties();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        setLayout(new java.awt.FlowLayout());
+        add(getJPanel(), null);
+        add(getJPanel1(), null);
+        add(getJPanel3(), null);
+
+        this.setSize(400, 450);
+        this.setPreferredSize(new java.awt.Dimension(400, 430));
+        grupo.add(btnVistas);
+        grupo.add(btnTablas);
+        grupo.add(btnMapas);
+
+        btnVistas.setSelected(true);
+    }
+
+    /**
+     * Crea un nuevo project element
+     *
+     * @throws Exception DOCUMENT ME!
+     */
+    private void nuevo() throws Exception {
+        DateFormat df = DateFormat.getDateInstance();
+
+        if (btnMapas.isSelected()) {
+            ProjectMap map = ProjectFactory.createMap(PluginServices.getText(
+                        this, "untitled"));
+            map.setModel(new Layout());
+            map.getModel().setProjectMap(map);
+            p.addMap(map);
+        } else if (btnTablas.isSelected()) {
+            try {
+                FOpenDialog fopen = new FOpenDialog();
+                FileOpenDialog fod = new FileOpenDialog(new Class[]{FileDriver.class, GeorreferencedRasterDriver.class});
+                DataBaseOpenDialog dbod = new DataBaseOpenDialog();
+                dbod.setClasses(new Class[] { DBDriver.class });
+                fopen.addTab("Fichero", fod);
+                fopen.addTab("Base de datos", dbod);
+                PluginServices.getMDIManager().addView(fopen);
+
+                if (fopen.isAccepted()) {
+                    JPanel panel = fopen.getSelectedTab();
+
+                    if (panel instanceof FileOpenDialog) {
+                    	File[] files = fod.getFiles();
+                    	String[] driverNames = fod.getDriverNames();
+                    	for (int i = 0; i < files.length; i++) {
+                        	String name = files[i].getName();
+                            DataSourceFactory.addFileDataSource(driverNames[i], name, files[i].getAbsolutePath(), files[i].getAbsolutePath());
+
+                            DataSource dataSource = DataSourceFactory.createRandomDataSource(name);
+                            SelectableDataSource sds = new SelectableDataSource(dataSource);
+                            ProjectExtension ext = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
+                            ProjectTable projectTable = ProjectFactory.createTable(null, sds);
+                            ext.getProject().addTable(projectTable);
+
+                            Table t = new Table();
+                            t.setModel(projectTable);
+                            PluginServices.getMDIManager().addView(t);
+						}
+                    } else if (panel instanceof DataBaseOpenDialog) {
+                        String driverName = dbod.getDriverName();
+                        int port = -1;
+
+                        try {
+                            port = Integer.parseInt(dbod.getPort());
+                        } catch (NumberFormatException e) {
+                        }
+
+                        String name = dbod.getHost() + "/" +
+                            dbod.getDataBase();
+
+                        if (port != -1) {
+                            name = dbod.getHost() + ":" + port + "/" +
+                                dbod.getDataBase();
+                        }
+
+                        String user = dbod.getUser().trim();
+                        String password = dbod.getPassword();
+
+                        if (user.equals("")) {
+                            user = null;
+                            password = null;
+                        }
+
+                        DataSourceFactory.addDBDataSource(name, dbod.getHost(),
+                            port, user, password, dbod.getDataBase(),
+                            dbod.getTable(), driverName);
+
+                        DataSource dataSource = DataSourceFactory.createRandomDataSource(name);
+                        SelectableDataSource sds = new SelectableDataSource(dataSource);
+
+                        ProjectExtension ext = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
+                        ProjectTable projectTable = ProjectFactory.createTable(null, sds);
+                        ext.getProject().addTable(projectTable);
+
+                        Table t = new Table();
+                        t.setModel(projectTable);
+                        PluginServices.getMDIManager().addView(t);
+                    }
+                }
+            } catch (DriverLoadException e) {
+            	NotificationManager.addError("Error al cargar los drivers", e);
+            }
+        } else {
+            ProjectView vista = ProjectFactory.createView(PluginServices.getText(
+                        this, "untitled"));
+            p.addView(vista);
+        }
+    }
+
+    /**
+     * Abre la ventana de un nuevo project element
+     */
+    private void abrir() {
+        if (btnMapas.isSelected()) {
+            int index = lstDocs.getSelectedIndex();
+
+            if (index == -1) {
+                return;
+            }
+
+            Layout l = (Layout)((ProjectMap) p.getMaps().get(index)).getModel();
+            l.fullRect();
+            PluginServices.getMDIManager().addView(l);
+        } else if (btnTablas.isSelected()) {
+            com.iver.cit.gvsig.gui.Table vista = new com.iver.cit.gvsig.gui.Table();
+            int index = lstDocs.getSelectedIndex();
+
+            if (index == -1) {
+                return;
+            }
+
+            vista.setModel((ProjectTable) p.getTables().get(index));
+            PluginServices.getMDIManager().addView(vista);
+        } else {
+            com.iver.cit.gvsig.gui.View vista = new com.iver.cit.gvsig.gui.View();
+            int index = lstDocs.getSelectedIndex();
+
+            if (index == -1) {
+                return;
+            }
+
+            vista.setModel((ProjectView) p.getViews().get(index));
+            PluginServices.getMDIManager().addView(vista);
+            
+        }
+    }
+
+    /**
+     * Cambia el nombre de un project element
+     */
+    private void renombrar() {
+        ProjectElement elem = null;
+        int index = lstDocs.getSelectedIndex();
+
+        if (index == -1) {
+            return;
+        }
+
+        if (btnMapas.isSelected()) {
+            elem = (ProjectElement) p.getMaps().get(index);
+        } else if (btnTablas.isSelected()) {
+            elem = (ProjectElement) p.getTables().get(index);
+        } else {
+            elem = (ProjectElement) p.getViews().get(index);
+        }
+
+        JOptionPane pane = new JOptionPane();
+        pane.setMessage(PluginServices.getText(this, "introduce_nombre"));
+        pane.setMessageType(JOptionPane.QUESTION_MESSAGE);
+        pane.setWantsInput(true);
+        pane.setInitialSelectionValue(elem.getName());
+
+        JDialog dlg = pane.createDialog((Component) PluginServices.getMainFrame(),
+        		PluginServices.getText(this, "renombrar"));
+        dlg.setModal(true);
+        dlg.show();
+
+        String nuevoNombre = pane.getInputValue().toString().trim();
+
+        if (nuevoNombre.length() == 0) {
+            return;
+        }
+
+        if (nuevoNombre == null) {
+            return;
+        }
+
+        elem.setName(nuevoNombre);
+
+        refreshList();
+    }
+
+    /**
+     * Borra un project element
+     */
+    private void borrar() {
+        int res = JOptionPane.showConfirmDialog((Component) PluginServices.getMainFrame(),
+        		PluginServices.getText(this, "confirmar_borrar"),
+        		PluginServices.getText(this, "borrar"),
+                JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
+
+        if (res == JOptionPane.YES_OPTION) {
+            int index = lstDocs.getSelectedIndex();
+
+            if (btnMapas.isSelected()) {
+            	PluginServices.getMDIManager().closeSingletonView(p.getMaps().get(index));
+                p.delMap(index);
+            } else if (btnTablas.isSelected()) {
+            	PluginServices.getMDIManager().closeSingletonView(p.getTables().get(index));
+                p.delTable(index);
+            } else {
+            	PluginServices.getMDIManager().closeSingletonView(p.getViews().get(index));
+                p.delView(index);
+            }
+
+            refreshList();
+        }
+    }
+
+    /**
+     * Muestra el di�logo de propiedades de un project element
+     */
+    private void propiedades() {
+        int index = lstDocs.getSelectedIndex();
+
+        if (index == -1) {
+            return;
+        }
+
+        View dlg;
+
+        if (btnMapas.isSelected()) {
+            dlg = new MapProperties((ProjectMap) p.getMaps().get(index));
+        } else if (btnTablas.isSelected()) {
+            dlg = new TableProperties((ProjectTable) p.getTables().get(index));
+        } else {
+            dlg = new ViewProperties((ProjectView) p.getViews().get(index));
+        }
+
+        PluginServices.getMDIManager().addView(dlg);
+
+        refreshControls();
+        lstDocs.setSelectedIndex(index);
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel() {
+        if (jPanel == null) {
+            jPanel = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout1 = new java.awt.FlowLayout();
+            layFlowLayout1.setHgap(15);
+            jPanel.setLayout(layFlowLayout1);
+            jPanel.add(getBtnVistas(), null);
+            jPanel.add(getBtnTablas(), null);
+            jPanel.add(getBtnMapas(), null);
+            jPanel.setName("tipoDocPanel");
+            jPanel.setPreferredSize(new java.awt.Dimension(390, 125));
+            jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this, "tipos_de_documentos"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+        }
+
+        return jPanel;
+    }
+
+    /**
+     * This method initializes btnVistas
+     *
+     * @return javax.swing.JRadioButton
+     */
+    private javax.swing.JRadioButton getBtnVistas() {
+        if (btnVistas == null) {
+            btnVistas = new javax.swing.JRadioButton();
+            btnVistas.setIcon(new javax.swing.ImageIcon(
+                    this.getClass().getClassLoader().getResource("images/Vista.png")));
+            btnVistas.setSelectedIcon(new javax.swing.ImageIcon(
+                    this.getClass().getClassLoader().getResource("images/Vista_sel.png")));
+            btnVistas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+            btnVistas.setText(PluginServices.getText(this, "vistas"));
+            btnVistas.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+            btnVistas.setName("vistasBtn");
+            btnVistas.addChangeListener(new javax.swing.event.ChangeListener() {
+                    public void stateChanged(javax.swing.event.ChangeEvent e) {
+                        refreshList();
+                    }
+                });
+        }
+
+        return btnVistas;
+    }
+
+    /**
+     * This method initializes btnTablas
+     *
+     * @return javax.swing.JRadioButton
+     */
+    private javax.swing.JRadioButton getBtnTablas() {
+        if (btnTablas == null) {
+            btnTablas = new javax.swing.JRadioButton();
+            btnTablas.setIcon(new javax.swing.ImageIcon(
+                    this.getClass().getClassLoader().getResource("images/tablas.png")));
+            btnTablas.setSelectedIcon(new javax.swing.ImageIcon(
+                    this.getClass().getClassLoader().getResource("images/tablas_sel.png")));
+            btnTablas.setText(PluginServices.getText(this, "tablas"));
+            btnTablas.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+            btnTablas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+            btnTablas.setName("tablasBtn");
+            btnTablas.addChangeListener(new javax.swing.event.ChangeListener() {
+                    public void stateChanged(javax.swing.event.ChangeEvent e) {
+                        refreshList();
+                    }
+                });
+        }
+
+        return btnTablas;
+    }
+
+    /**
+     * This method initializes btnMapas
+     *
+     * @return javax.swing.JRadioButton
+     */
+    private javax.swing.JRadioButton getBtnMapas() {
+        if (btnMapas == null) {
+            btnMapas = new javax.swing.JRadioButton();
+            btnMapas.setIcon(new javax.swing.ImageIcon(
+                    this.getClass().getClassLoader().getResource("images/mapas.png")));
+            btnMapas.setSelectedIcon(new javax.swing.ImageIcon(
+                    this.getClass().getClassLoader().getResource("images/mapas_sel.png")));
+            btnMapas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+            btnMapas.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+            btnMapas.setText(PluginServices.getText(this, "mapas"));
+            btnMapas.addChangeListener(new javax.swing.event.ChangeListener() {
+                    public void stateChanged(javax.swing.event.ChangeEvent e) {
+                        refreshList();
+                    }
+                });
+        }
+
+        return btnMapas;
+    }
+
+    /**
+     * This method initializes jPanel1
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel1() {
+        if (jPanel1 == null) {
+            jPanel1 = new javax.swing.JPanel();
+
+            java.awt.BorderLayout layBorderLayout2 = new java.awt.BorderLayout();
+            layBorderLayout2.setVgap(30);
+            jPanel1.setLayout(layBorderLayout2);
+            jPanel1.add(getJPanel2(), java.awt.BorderLayout.EAST);
+            jPanel1.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
+            jPanel1.setPreferredSize(new java.awt.Dimension(390, 170));
+            jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this, "documentos_existentes"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+        }
+
+        return jPanel1;
+    }
+
+    /**
+     * This method initializes lstDocs
+     *
+     * @return javax.swing.JList
+     */
+    private javax.swing.JList getLstDocs() {
+        if (lstDocs == null) {
+            lstDocs = new javax.swing.JList();
+            lstDocs.addMouseListener(new java.awt.event.MouseAdapter() {
+                    public void mouseClicked(java.awt.event.MouseEvent e) {
+                        if (e.getClickCount() == 2) {
+                            abrir();
+                        }
+                    }
+                });
+            lstDocs.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+                    public void valueChanged(
+                        javax.swing.event.ListSelectionEvent e) {
+                        activarBotones();
+                    }
+                });
+        }
+
+        return lstDocs;
+    }
+
+    /**
+     * This method initializes jPanel2
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel2() {
+        if (jPanel2 == null) {
+            jPanel2 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout11 = new java.awt.FlowLayout();
+            layFlowLayout11.setVgap(5);
+            jPanel2.setLayout(layFlowLayout11);
+            jPanel2.add(getBtnNuevo(), null);
+            jPanel2.add(getBtnAbrir(), null);
+            jPanel2.add(getBtnRenombrar(), null);
+            jPanel2.add(getBtnBorrar(), null);
+            jPanel2.add(getBtnPropiedades(), null);
+            jPanel2.setPreferredSize(new java.awt.Dimension(100, 50));
+        }
+
+        return jPanel2;
+    }
+
+    /**
+     * This method initializes btnNuevo
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnNuevo() {
+        if (btnNuevo == null) {
+            btnNuevo = new javax.swing.JButton();
+            btnNuevo.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnNuevo.setName("btnNuevo");
+            btnNuevo.setText(PluginServices.getText(this, "nuevo"));
+            btnNuevo.setMargin(new java.awt.Insets(2, 2, 2, 2));
+            btnNuevo.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        try {
+                            nuevo();
+                        } catch (Exception e1) {
+                            NotificationManager.addError(e1.getLocalizedMessage(),
+                                e1);
+                        }
+                    }
+                });
+        }
+
+        return btnNuevo;
+    }
+
+    /**
+     * This method initializes btnPropiedades
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnPropiedades() {
+        if (btnPropiedades == null) {
+            btnPropiedades = new javax.swing.JButton();
+            btnPropiedades.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnPropiedades.setText(PluginServices.getText(this, "propiedades"));
+            btnPropiedades.setName("btnPropiedades");
+            btnPropiedades.setEnabled(false);
+            btnPropiedades.setMargin(new java.awt.Insets(2, 2, 2, 2));
+            btnPropiedades.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        propiedades();
+                    }
+                });
+        }
+
+        return btnPropiedades;
+    }
+
+    /**
+     * This method initializes btnAbrir
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnAbrir() {
+        if (btnAbrir == null) {
+            btnAbrir = new javax.swing.JButton();
+            btnAbrir.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnAbrir.setName("btnAbrir");
+            btnAbrir.setText(PluginServices.getText(this, "abrir"));
+            btnAbrir.setEnabled(false);
+            btnAbrir.setMargin(new java.awt.Insets(2, 2, 2, 2));
+            btnAbrir.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        abrir();
+                    }
+                });
+        }
+
+        return btnAbrir;
+    }
+
+    /**
+     * This method initializes btnBorrar
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnBorrar() {
+        if (btnBorrar == null) {
+            btnBorrar = new javax.swing.JButton();
+            btnBorrar.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnBorrar.setText(PluginServices.getText(this, "borrar"));
+            btnBorrar.setName("btnBorrar");
+            btnBorrar.setEnabled(false);
+            btnBorrar.setMargin(new java.awt.Insets(2, 2, 2, 2));
+            btnBorrar.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        borrar();
+                    }
+                });
+        }
+
+        return btnBorrar;
+    }
+
+    /**
+     * This method initializes btnRenombrar
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnRenombrar() {
+        if (btnRenombrar == null) {
+            btnRenombrar = new javax.swing.JButton();
+            btnRenombrar.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnRenombrar.setName("btnRenombrar");
+            btnRenombrar.setText(PluginServices.getText(this, "renombrar"));
+            btnRenombrar.setEnabled(false);
+            btnRenombrar.setMargin(new java.awt.Insets(2, 2, 2, 2));
+            btnRenombrar.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        renombrar();
+                    }
+                });
+        }
+
+        return btnRenombrar;
+    }
+
+    /**
+     * This method initializes jPanel3
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel3() {
+        if (jPanel3 == null) {
+            jPanel3 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout3 = new java.awt.FlowLayout();
+            layFlowLayout3.setHgap(5);
+            layFlowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
+            jPanel3.setLayout(layFlowLayout3);
+            jPanel3.add(getJLabel(), null);
+            jPanel3.add(getLblNombreSesion(), null);
+            jPanel3.add(getJLabel1(), null);
+            jPanel3.add(getLblGuardado(), null);
+            jPanel3.add(getJLabel2(), null);
+            jPanel3.add(getLblFecha(), null);
+            jPanel3.add(getJPanel4(), null);
+            jPanel3.setPreferredSize(new java.awt.Dimension(390, 125));
+            jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this, "propiedades_sesion"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+        }
+
+        return jPanel3;
+    }
+
+    /**
+     * This method initializes jLabel
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel() {
+        if (jLabel == null) {
+            jLabel = new javax.swing.JLabel();
+            jLabel.setText(PluginServices.getText(this, "nombre_sesion") + ":");
+            jLabel.setPreferredSize(new java.awt.Dimension(150, 16));
+        }
+
+        return jLabel;
+    }
+
+    /**
+     * This method initializes lblNombreSesion
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getLblNombreSesion() {
+        if (lblNombreSesion == null) {
+            lblNombreSesion = new javax.swing.JLabel();
+            lblNombreSesion.setText("");
+            lblNombreSesion.setName("lblNombreSesion");
+            lblNombreSesion.setPreferredSize(new java.awt.Dimension(200, 16));
+            lblNombreSesion.setAutoscrolls(true);
+        }
+
+        return lblNombreSesion;
+    }
+
+    /**
+     * This method initializes jLabel1
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel1() {
+        if (jLabel1 == null) {
+            jLabel1 = new javax.swing.JLabel();
+            jLabel1.setText(PluginServices.getText(this, "guardado") + ":");
+            jLabel1.setPreferredSize(new java.awt.Dimension(150, 16));
+        }
+
+        return jLabel1;
+    }
+
+    /**
+     * This method initializes lblGuardado
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getLblGuardado() {
+        if (lblGuardado == null) {
+            lblGuardado = new javax.swing.JLabel();
+            lblGuardado.setText("");
+            lblGuardado.setPreferredSize(new java.awt.Dimension(200, 16));
+            lblGuardado.setAutoscrolls(true);
+        }
+
+        return lblGuardado;
+    }
+
+    /**
+     * This method initializes jLabel2
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel2() {
+        if (jLabel2 == null) {
+            jLabel2 = new javax.swing.JLabel();
+            jLabel2.setText(PluginServices.getText(this, "creation_date") + ":");
+            jLabel2.setPreferredSize(new java.awt.Dimension(150, 16));
+        }
+
+        return jLabel2;
+    }
+
+    /**
+     * This method initializes lblFecha
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getLblFecha() {
+        if (lblFecha == null) {
+            lblFecha = new javax.swing.JLabel();
+            lblFecha.setText("");
+            lblFecha.setPreferredSize(new java.awt.Dimension(200, 16));
+            lblFecha.setAutoscrolls(true);
+        }
+
+        return lblFecha;
+    }
+
+    /**
+     * This method initializes btnImportar
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnImportar() {
+        if (btnImportar == null) {
+            btnImportar = new javax.swing.JButton();
+            btnImportar.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnImportar.setText(PluginServices.getText(this, "importar"));
+            btnImportar.setMargin(new java.awt.Insets(2, 2, 2, 2));
+        }
+
+        return btnImportar;
+    }
+
+    /**
+     * This method initializes btnExportar
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnExportar() {
+        if (btnExportar == null) {
+            btnExportar = new javax.swing.JButton();
+            btnExportar.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnExportar.setText(PluginServices.getText(this, "exportar"));
+            btnExportar.setMargin(new java.awt.Insets(2, 2, 2, 2));
+        }
+
+        return btnExportar;
+    }
+
+    /**
+     * This method initializes btnEditar
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnEditar() {
+        if (btnEditar == null) {
+            btnEditar = new javax.swing.JButton();
+            btnEditar.setPreferredSize(new java.awt.Dimension(80, 23));
+            btnEditar.setText(PluginServices.getText(this, "propiedades"));
+
+            btnEditar.setMargin(new java.awt.Insets(2, 2, 2, 2));
+
+            final JPanel f = this;
+            btnEditar.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        ProjectProperties dlg = new ProjectProperties(p);
+                        PluginServices.getMDIManager().addView(dlg);
+                        refreshProperties();
+                    }
+                });
+        }
+
+        return btnEditar;
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getLstDocs());
+            jScrollPane.setPreferredSize(new java.awt.Dimension(200, 100));
+            jScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+        }
+
+        return jScrollPane;
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
+     */
+    public Object getViewModel() {
+        return p;
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+     */
+    public ViewInfo getViewInfo() {
+        ViewInfo m_viewinfo = new ViewInfo();
+        m_viewinfo.setWidth(400);
+        m_viewinfo.setHeight(430);
+        m_viewinfo.setTitle(PluginServices.getText(this, "titulo"));
+        
+        return m_viewinfo;
+    }
+
+    /**
+     * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+     */
+    public void propertyChange(PropertyChangeEvent evt) {
+        refreshControls();
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+     */
+    public void viewActivated() {
+    }
+
+    /**
+     * This method initializes jPanel4
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel4() {
+        if (jPanel4 == null) {
+            jPanel4 = new javax.swing.JPanel();
+
+            java.awt.FlowLayout layFlowLayout2 = new java.awt.FlowLayout();
+            layFlowLayout2.setHgap(30);
+            jPanel4.setLayout(layFlowLayout2);
+            jPanel4.add(getBtnImportar(), null);
+            jPanel4.add(getBtnExportar(), null);
+            jPanel4.add(getBtnEditar(), null);
+            jPanel4.setPreferredSize(new java.awt.Dimension(360, 30));
+        }
+
+        return jPanel4;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/project/ProjectWindow.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PointSelectListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PointSelectListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PointSelectListener.java	(revision 1648)
@@ -0,0 +1,76 @@
+/* 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.gui.toolListeners;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.tools.BehaviorException;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+import com.iver.cit.gvsig.fmap.tools.PointSelectionListener;
+
+
+/**
+ * Extensi�n de la clase PointSelectionListener de FMap para poder llamar a
+ * m�todos de andami o de gvSIG.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class PointSelectListener extends PointSelectionListener {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param mapCtrl
+	 */
+	public PointSelectListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 *
+	 * @throws BehaviorException
+	 */
+	public void point(PointEvent event) throws BehaviorException {
+		super.point(event);
+		// PluginServices.getMainFrame().enableControls();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PointSelectListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/InfoListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/InfoListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/InfoListener.java	(revision 1648)
@@ -0,0 +1,390 @@
+/* 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.gui.toolListeners;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.geom.Point2D;
+import java.util.BitSet;
+
+import javax.swing.ImageIcon;
+import javax.swing.JDialog;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+
+import org.apache.log4j.Logger;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.VectorialData;
+import com.iver.cit.gvsig.fmap.operations.strategies.QueryByPointVisitor;
+import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
+import com.iver.cit.gvsig.fmap.tools.BehaviorException;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener;
+import com.iver.cit.gvsig.gui.Dialogs.FInfoDialogXML;
+import com.iver.utiles.xmlViewer.TextXMLContent;
+import com.iver.utiles.xmlViewer.XMLContent;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class InfoListener implements PointListener {
+	// private final Image img = new ImageIcon(NewMapControl.class.getResource(
+	//"images/InfoCursor.png")).getImage();
+	private static Logger logger = Logger.getLogger(InfoListener.class.getName());
+	private final Image img = new ImageIcon(MapControl.class.getResource(
+    	"images/InfoCursor.gif")).getImage();
+	private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(img,
+			new Point(16, 16), "");
+	private MapControl mapCtrl;
+	/**
+	 * Crea un nuevo AreaListenerImpl.
+	 *
+	 * @param mc DOCUMENT ME!
+	 */
+	public InfoListener(MapControl mc) {
+		this.mapCtrl = mc;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 *
+	 * @throws DriverIOException
+	 *
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+	 */
+	public void point(PointEvent event) throws BehaviorException {
+		Point2D pReal = mapCtrl.getMapContext().getViewPort().toMapPoint(event.getPoint());
+		Point imagePoint = new Point((int) event.getPoint().getX(), (int) event.getPoint().getY());
+
+		// Dentro de queryByPoint tenemos que separar los registros que vienen asociados a una 
+		// capa o a otra. Supongo que lo correcto ser�a que montaramos un XML y usar el visor
+		// de XML que ha empezado Fernando.
+		// String strResul = m_MapControl.queryByPoint(pScreen,m_MapControl.toMapDistance(3),"");
+		//FInfoDialog dlg = new FInfoDialog();
+		//     dlg.clearAll();
+		//   dlg.setViewModel((ProjectView) proj);
+		FInfoDialogXML dlgXML = new FInfoDialogXML();
+
+		//MultipleXMLContent xmlModel = new MultipleXMLContent();		
+
+		FLayer[] sel = mapCtrl.getMapContext().getLayers().getActives();
+
+		final XMLItem[] items = new XMLItem[sel.length];
+
+		for (int i = 0; i < sel.length; i++) {
+			FLayer laCapa = (FLayer) sel[i];
+
+			if ((laCapa instanceof VectorialData) &&
+					(laCapa instanceof AlphanumericData)){
+				QueryByPointVisitor visitor = new QueryByPointVisitor();
+				visitor.setLayer(laCapa);
+				visitor.setQueriedPoint(pReal);
+				visitor.setTolerance(mapCtrl.getMapContext().getViewPort().toMapDistance(3));
+				try {
+					((VectorialData) laCapa).process(visitor);
+				} catch (DriverException e) {
+					throw new BehaviorException("No se pudo procesar la capa", e);
+				} catch (VisitException e) {
+					throw new RuntimeException(e);
+				}
+
+				items[i] = new VectorialXMLItem(visitor.getBitSet(), laCapa);
+			}
+			
+			if (laCapa instanceof InfoByPoint){
+				InfoByPoint layer = (InfoByPoint) laCapa;
+				
+				String text;
+				try {
+					text = layer.queryByPoint(imagePoint);
+				} catch (DriverException e) {
+					throw new BehaviorException("No se pudo procesar la capa", e);
+				}
+				items[i] = new StringXMLItem(text);
+			}
+		}
+
+		if (items.length > 0) {
+			try {
+				if (PluginServices.getMainFrame() == null)
+				{
+					JDialog dialog = new JDialog();
+					dlgXML.setPreferredSize(dlgXML.getSize());
+					dialog.getContentPane().add(dlgXML);
+					dialog.setModal(false);			
+					dialog.pack();
+					dialog.show();
+					
+				}
+				else
+				{
+					dlgXML = (FInfoDialogXML) PluginServices.getMDIManager().addView(dlgXML);
+				}
+				
+				dlgXML.setModel(new XMLContent() {
+					private ContentHandler handler;
+
+					public void setContentHandler(ContentHandler arg0) {
+						handler = arg0;
+					}
+
+					public void parse() throws SAXException {
+						handler.startDocument();
+
+						for (int i = 0; i < items.length; i++) {
+							items[i].parse(handler);
+						}
+
+						handler.endDocument();
+					}
+				});
+				dlgXML.getXmlTree().setRootVisible(false);
+				DefaultTreeModel treeModel = (DefaultTreeModel) dlgXML.getXmlTree().getModel();
+		        DefaultMutableTreeNode n;
+		        DefaultMutableTreeNode root = (DefaultMutableTreeNode) dlgXML.getXmlTree().getModel().getRoot();
+				n = root.getFirstLeaf();
+				TreePath path = new TreePath(treeModel.getPathToRoot(n));
+				dlgXML.getXmlTree().expandPath(path);
+			
+				dlgXML.getXmlTree().setSelectionPath(path);
+
+			} catch (SAXException e) {
+				NotificationManager.addError("Error formateando los resultados", e);
+			}
+		}
+
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+	 */
+	public Cursor getCursor() {
+		return cur;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+	 */
+	public boolean cancelDrawing() {
+		return false;
+	}
+	
+	private interface XMLItem{
+		public void parse(ContentHandler handler) throws SAXException;
+	}
+	
+	private class VectorialXMLItem implements XMLItem{
+		private BitSet bitset;
+		private FLayer layer;
+		
+		public VectorialXMLItem (BitSet bitset, FLayer layer){
+			this.bitset = bitset;
+			this.layer = layer;
+		}
+
+		/**
+		 * @see com.iver.cit.gvsig.gui.toolListeners.InfoListener.XMLItem#parse(org.xml.sax.ContentHandler)
+		 */
+		public void parse(ContentHandler handler) throws SAXException {
+			AttributesImpl aii = new AttributesImpl();
+			handler.startElement("", "",
+					((FLayer) layer).getName(), aii);
+			try{
+			DataSource ds = ((AlphanumericData) layer).getRecordset();
+			ds.start();
+
+			for (int j = bitset.nextSetBit(0);
+					j >= 0;
+					j = bitset.nextSetBit(j + 1)) {
+				// for (int j = 0; j < bitset[i].length();
+				//        j++) {
+				//if (bitset[i].get(j)) {
+				AttributesImpl ai = new AttributesImpl();
+
+				for (int k = 0; k < ds.getFieldCount();
+						k++) {
+					ai.addAttribute("",
+						ds.getFieldName(k), "",
+						"xs:string",
+						ds.getFieldValue(j, k).toString());
+				}
+
+				handler.startElement("", "",
+					String.valueOf(j), ai);
+
+				handler.endElement("", "",
+					String.valueOf(j));
+
+			}
+
+			logger.debug("ds.stop()");
+			ds.stop();
+			
+			} catch (com.hardcode.gdbms.engine.data.DriverException e) {
+				throw new SAXException(e);
+			} catch (DriverException e) {
+				throw new SAXException(e);
+			}
+			handler.endElement("", "",
+					((FLayer) layer).getName());
+		}
+	}
+	
+	private class StringXMLItem extends TextXMLContent implements XMLItem{
+
+		/**
+		 * @param text
+		 */
+		public StringXMLItem(String text) {
+			super(text);
+			
+		}
+
+		/**
+		 * @see com.iver.cit.gvsig.gui.toolListeners.InfoListener.XMLItem#parse(org.xml.sax.ContentHandler)
+		 */
+		public void parse(ContentHandler handler) throws SAXException {
+			setContentHandler(new FilterContentHandler(handler));
+			parse();
+		}
+		
+		private class FilterContentHandler implements ContentHandler{
+
+			private ContentHandler handler;
+			
+			public FilterContentHandler(ContentHandler handler){
+				this.handler = handler;
+			}
+			
+			/**
+			 * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
+			 */
+			public void setDocumentLocator(Locator arg0) {
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#startDocument()
+			 */
+			public void startDocument() throws SAXException {
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#endDocument()
+			 */
+			public void endDocument() throws SAXException {
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String)
+			 */
+			public void startPrefixMapping(String arg0, String arg1) throws SAXException {
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
+			 */
+			public void endPrefixMapping(String arg0) throws SAXException {
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+			 */
+			public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException {
+				handler.startElement(arg0, arg1, arg2, arg3);
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
+			 */
+			public void endElement(String arg0, String arg1, String arg2) throws SAXException {
+				handler.endElement(arg0, arg1, arg2);
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#characters(char[], int, int)
+			 */
+			public void characters(char[] arg0, int arg1, int arg2) throws SAXException {
+				handler.characters(arg0, arg1, arg2);
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
+			 */
+			public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException {
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
+			 */
+			public void processingInstruction(String arg0, String arg1) throws SAXException {
+			}
+
+			/**
+			 * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
+			 */
+			public void skippedEntity(String arg0) throws SAXException {
+			}
+			
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/InfoListener.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomInListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomInListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomInListener.java	(revision 1648)
@@ -0,0 +1,76 @@
+/* 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.gui.toolListeners;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.tools.Events.RectangleEvent;
+import com.iver.cit.gvsig.fmap.tools.ZoomInListenerImpl;
+
+
+/**
+ * Extensi�n de la clase ZoomInListenerImpl de FMap para poder llamar a m�todos
+ * de andami o de gvSIG.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ZoomInListener extends ZoomInListenerImpl {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param mapCtrl
+	 */
+	public ZoomInListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 */
+	public void rectangle(RectangleEvent event) {
+		super.rectangle(event);
+		if (PluginServices.getMainFrame() != null)
+		    PluginServices.getMainFrame().enableControls();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomInListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomOutListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomOutListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomOutListener.java	(revision 1648)
@@ -0,0 +1,75 @@
+/* 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.gui.toolListeners;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+import com.iver.cit.gvsig.fmap.tools.ZoomOutListenerImpl;
+
+
+/**
+ * Extensi�n de la clase ZoomOutListenerImpl de FMap para poder llamar a
+ * m�todos de andami o de gvSIG.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ZoomOutListener extends ZoomOutListenerImpl {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param mapCtrl
+	 */
+	public ZoomOutListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 */
+	public void point(PointEvent event) {
+		super.point(event);
+		PluginServices.getMainFrame().enableControls();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/ZoomOutListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/LinkListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/LinkListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/LinkListener.java	(revision 1648)
@@ -0,0 +1,198 @@
+/* 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.gui.toolListeners;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.geom.Point2D;
+import java.util.BitSet;
+
+import javax.swing.ImageIcon;
+
+import org.apache.log4j.Logger;
+import org.xml.sax.SAXException;
+
+import com.hardcode.gdbms.engine.data.DataSource;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.VectorialData;
+import com.iver.cit.gvsig.fmap.operations.strategies.QueryByPointVisitor;
+import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
+import com.iver.cit.gvsig.fmap.tools.BehaviorException;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener;
+import com.iver.cit.gvsig.gui.View;
+import com.iver.cit.gvsig.gui.Panels.LinkPanel;
+import com.iver.cit.gvsig.project.ProjectView;
+
+
+/**
+ * Listener que implementa PointListener para hacer el hiperlink.
+ *
+ * @author Vicente Caballero Navarro
+ * 
+ */
+public class LinkListener implements PointListener {
+	private static Logger logger = Logger.getLogger(InfoListener.class.getName());
+	private final Image img = new ImageIcon(MapControl.class.getResource(
+				"images/LinkCursor.gif")).getImage();
+	private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(img,
+			new Point(16, 16), "");
+	private MapControl mapCtrl;
+	private BitSet[] bitset;
+	private FLayer[] layers;
+	private String field;
+	private String ext="";
+	private int type;
+
+	/**
+	 * Crea un nuevo AreaListenerImpl.
+	 *
+	 * @param mc DOCUMENT ME!
+	 */
+	public LinkListener(MapControl mc) {
+		this.mapCtrl = mc;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 * @throws BehaviorException
+	 *
+	 * @throws DriverException
+	 * @throws SAXException
+	 *
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+	 */
+	public void point(PointEvent event) throws BehaviorException {
+		Point2D pReal = mapCtrl.getMapContext().getViewPort().toMapPoint(event.getPoint());
+		View view=(View)PluginServices.getMDIManager().getActiveView();
+		FLayer[] sel = mapCtrl.getMapContext().getLayers().getActives();
+
+		bitset = new BitSet[sel.length];
+		layers = new FLayer[sel.length];
+
+		for (int i = 0; i < sel.length; i++) {
+			FLayer laCapa = (FLayer) sel[i];
+
+			if ((laCapa instanceof VectorialData) &&
+					(laCapa instanceof AlphanumericData)) {
+				QueryByPointVisitor visitor = new QueryByPointVisitor();
+				visitor.setLayer(laCapa);
+				visitor.setQueriedPoint(pReal);
+				visitor.setTolerance(mapCtrl.getMapContext().getViewPort()
+											.toMapDistance(3));
+				try {
+					((VectorialData) laCapa).process(visitor);
+				} catch (DriverException e) {
+					throw new BehaviorException("No se pudo procesar la capa",e);
+				} catch (VisitException e) {
+					throw new RuntimeException(e);
+				}
+				bitset[i] = visitor.getBitSet();
+				layers[i] = laCapa;
+			}
+		}
+
+		if (bitset != null) {
+			for (int i = 0; i < bitset.length; i++) {
+				try {
+					ProjectView model=view.getModel();
+					type=model.getTypeLink();
+					field=model.getSelectedField();
+					//field = "NOM_PROVIN";
+					//ext=".png";
+					ext=model.getExtLink();
+					DataSource ds;
+					try {
+						ds = ((AlphanumericData) layers[i]).getRecordset();
+					} catch (DriverException e1) {
+						throw new BehaviorException("",e1);
+					}
+					ds.start();
+					boolean exist=false;
+					for (int j = bitset[i].nextSetBit(0); j >= 0;
+							j = bitset[i].nextSetBit(j + 1)) {
+						for (int k = 0; k < ds.getFieldCount(); k++) {
+							if (ds.getFieldName(k).equals(field)) {
+								exist=true;
+								LinkPanel linkpanel = new LinkPanel(field,
+									ds.getFieldValue(j, k).toString(),ext,type);
+								PluginServices.getMDIManager().addView(linkpanel);
+							}
+						}
+						if (!exist){
+							logger.debug("Campo sin seleccionar");
+						}
+					}
+
+					logger.debug("ds.stop()");
+					ds.stop();
+					
+				} catch (com.hardcode.gdbms.engine.data.DriverException e) {
+					NotificationManager.addError("Error formateando los resultados", e);
+				} 
+			}
+			
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+	 */
+	public Cursor getCursor() {
+		return cur;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+	 */
+	public boolean cancelDrawing() {
+		return false;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/LinkListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PanListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PanListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PanListener.java	(revision 1648)
@@ -0,0 +1,75 @@
+/* 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.gui.toolListeners;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.tools.Events.MoveEvent;
+import com.iver.cit.gvsig.fmap.tools.PanListenerImpl;
+
+
+/**
+ * Extensi�n de la clase PanListenerImpl de FMap para poder llamar a m�todos de
+ * andami o de gvSIG.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class PanListener extends PanListenerImpl {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param mapCtrl
+	 */
+	public PanListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 */
+	public void move(MoveEvent event) {
+		super.move(event);
+		PluginServices.getMainFrame().enableControls();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/PanListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MeasureListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MeasureListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MeasureListener.java	(revision 1648)
@@ -0,0 +1,100 @@
+/* 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.gui.toolListeners;
+
+import java.awt.Point;
+import java.awt.geom.Point2D;
+import java.text.NumberFormat;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.tools.MeasureListenerImpl;
+import com.iver.cit.gvsig.fmap.tools.Events.MeasureEvent;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class MeasureListener extends MeasureListenerImpl {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param mc
+	 */
+	public MeasureListener(MapControl mc) {
+		super(mc);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 */
+	public void points(MeasureEvent event) {
+		double dist = 0;
+		double distAll = 0;
+
+		ViewPort vp = mapCtrl.getMapContext().getViewPort();
+
+		Point2D p = vp.toMapPoint(new Point(event.getXs()[0].intValue(),
+				event.getYs()[0].intValue()));
+		for (int i = 1; i < (event.getXs().length); i++) {
+			Point2D p2 = vp.toMapPoint(new Point(event.getXs()[i].intValue(),
+					event.getYs()[i].intValue()));
+			dist = vp.distanceWorld(p, p2);
+			distAll += dist;
+			p = p2;
+		}
+
+		//System.out.println("Distancia = " + dist + " Distancia Total = " +
+		//	(distAll));
+		NumberFormat nf = NumberFormat.getInstance();
+        nf.setMaximumFractionDigits(2);
+
+        PluginServices.getMainFrame().getStatusBar().setMessage("4",
+			"Dist:" + nf.format(dist) + "");
+		PluginServices.getMainFrame().getStatusBar().setMessage("5",
+			"Total:" + nf.format(distAll) + "");
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MeasureListener.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MapOverviewListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MapOverviewListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MapOverviewListener.java	(revision 1648)
@@ -0,0 +1,115 @@
+/* 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.gui.toolListeners;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener;
+import com.iver.cit.gvsig.gui.MapOverview;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import javax.swing.ImageIcon;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class MapOverviewListener implements PointListener {
+	private final Image izoomout = new ImageIcon(MapControl.class.getResource(
+				"images/CruxCursor.png")).getImage();
+	private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(izoomout,
+			new Point(16, 16), "");
+	protected MapControl mapControl;
+
+	/**
+	 * Crea un nuevo ZoomOutListenerImpl.
+	 *
+	 * @param mapControl DOCUMENT ME!
+	 */
+	public MapOverviewListener(MapControl mapControl) {
+		this.mapControl = mapControl;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.PointEvent)
+	 */
+	public void point(PointEvent event) {
+		ViewPort vp = mapControl.getMapContext().getViewPort();
+
+		if (vp.getExtent() != null) {
+			Point2D p = vp.toMapPoint(event.getPoint());
+			Rectangle2D r = (Rectangle2D) ((MapOverview) this.mapControl).getAssociatedMapContext()
+										   .getViewPort().getExtent().clone();
+
+			r.setRect(p.getX() - (r.getWidth() / 2),
+				p.getY() - (r.getHeight() / 2), r.getWidth(), r.getHeight());
+
+			((MapOverview) this.mapControl).getAssociatedMapContext()
+			 .getViewPort().setExtent(r);
+			PluginServices.getMainFrame().enableControls();
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+	 */
+	public Cursor getCursor() {
+		return cur;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+	 */
+	public boolean cancelDrawing() {
+		return true;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/MapOverviewListener.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/RectangleSelectListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/RectangleSelectListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/RectangleSelectListener.java	(revision 1648)
@@ -0,0 +1,77 @@
+/* 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.gui.toolListeners;
+
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.tools.BehaviorException;
+import com.iver.cit.gvsig.fmap.tools.Events.RectangleEvent;
+import com.iver.cit.gvsig.fmap.tools.RectangleSelectionListener;
+
+
+/**
+ * Extensi�n de la clase RectangleSelectionListener de FMap para poder llamar a
+ * m�todos de andami o de gvSIG.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class RectangleSelectListener extends RectangleSelectionListener {
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param mapCtrl
+	 */
+	public RectangleSelectListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param event DOCUMENT ME!
+	 *
+	 * @throws BehaviorException
+	 */
+	public void rectangle(RectangleEvent event) throws BehaviorException {
+		super.rectangle(event);
+
+		// PluginServices.getMainFrame().enableControls();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/RectangleSelectListener.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/AreaListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/AreaListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/AreaListener.java	(revision 1648)
@@ -0,0 +1,111 @@
+/* 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.gui.toolListeners;
+
+import java.awt.Point;
+import java.awt.geom.Point2D;
+import java.text.NumberFormat;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.tools.AreaListenerImpl;
+import com.iver.cit.gvsig.fmap.tools.Events.MeasureEvent;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class AreaListener extends AreaListenerImpl {
+	/**
+     * Crea un nuevo AreaListener.
+     *
+     * @param vp DOCUMENT ME!
+     */
+    public AreaListener(MapControl mc) {
+    	super(mc);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param event DOCUMENT ME!
+     */
+    public void points(MeasureEvent event) {
+        this.event = event;
+
+        double dist = 0;
+        double distAll = 0;
+
+        ViewPort vp = mapCtrl.getMapContext().getViewPort();
+        for (int i = 0; i < (event.getXs().length - 1); i++) {
+            dist = 0;
+
+            Point2D p = vp.toMapPoint(new Point(event.getXs()[i].intValue(),
+                    event.getYs()[i].intValue()));
+            Point2D p2 = vp.toMapPoint(new Point(event.getXs()[i + 1].intValue(),
+                    event.getYs()[i + 1].intValue()));
+            ///dist = vp.toMapDistance((int) p.distance(p2));
+            dist = vp.distanceWorld(p,p2);   
+            System.out.println(dist);
+            distAll += dist;
+        }
+
+       // System.out.println("Per�metro = " + distAll + " �rea = " +
+       //     (returnArea(vp.toMapPoint(
+       //             new Point2D.Double(
+       //                 event.getXs()[event.getXs().length - 2].doubleValue(),
+       //                 event.getYs()[event.getYs().length - 2].doubleValue())))));
+        NumberFormat nf = NumberFormat.getInstance();
+        nf.setMaximumFractionDigits(2);
+        PluginServices.getMainFrame().getStatusBar().setMessage("4",
+    			"P:" + nf.format(distAll) + "");
+    		PluginServices.getMainFrame().getStatusBar().setMessage("5",
+    			"A:" + nf.format(returnArea(vp.toMapPoint(
+                        new Point2D.Double(
+                                event.getXs()[event.getXs().length - 2].doubleValue(),
+                                event.getYs()[event.getYs().length - 2].doubleValue())))) + "");
+    }
+
+    
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/AreaListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/StatusBarListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/StatusBarListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/StatusBarListener.java	(revision 1648)
@@ -0,0 +1,104 @@
+/* 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.gui.toolListeners;
+
+import java.awt.Cursor;
+import java.awt.geom.Point2D;
+import java.text.NumberFormat;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiFrame.MainFrame;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.tools.BehaviorException;
+import com.iver.cit.gvsig.fmap.tools.Events.PointEvent;
+import com.iver.cit.gvsig.fmap.tools.Listeners.PointListener;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class StatusBarListener implements PointListener {
+	private MapControl mapControl = null;
+	private NumberFormat nf = null;
+
+	/**
+	 * Crea un nuevo StatusBarListener.
+	 *
+	 * @param mc DOCUMENT ME!
+	 */
+	public StatusBarListener(MapControl mc) {
+		mapControl = mc;
+		nf = NumberFormat.getInstance();
+		nf.setMaximumFractionDigits(2);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+	 */
+	public Cursor getCursor() {
+		return null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+	 */
+	public boolean cancelDrawing() {
+		return false;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+	 */
+	public void point(PointEvent event) throws BehaviorException {
+		Point2D p = mapControl.getMapContext().getViewPort().toMapPoint(event.getPoint());
+		MainFrame mF = PluginServices.getMainFrame();
+		if (mF != null)
+		{
+			mF.getStatusBar().setMessage("2",
+					"X =" + String.valueOf(nf.format(p.getX())));
+			mF.getStatusBar().setMessage("3",
+					"Y =" + String.valueOf(nf.format(p.getY())));
+		}
+	}
+		
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/StatusBarListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerListModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerListModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerListModel.java	(revision 1648)
@@ -0,0 +1,144 @@
+/* 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.gui.wms;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.swing.AbstractListModel;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class LayerListModel extends AbstractListModel {
+    private ArrayList nodos = new ArrayList();
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param elemento DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public boolean addElement(LayerInfo elemento) {
+        if (elemento == null) {
+            return false;
+        }
+
+        for (int i = 0; i < nodos.size(); i++) {
+            if (((LayerInfo) nodos.get(i)).equals(elemento)) {
+                return false;
+            }
+        }
+
+        nodos.add(elemento);
+
+        fireContentsChanged(this, nodos.size() - 1, nodos.size() - 1);
+
+        return true;
+    }
+
+	public void clear(){
+		nodos.clear();
+		fireContentsChanged(this, 0, 0);
+	}
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param index DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public LayerInfo delElement(int index) {
+        LayerInfo ret = (LayerInfo) nodos.remove(index);
+        this.fireContentsChanged(this, index, index);
+
+        return ret;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param c DOCUMENT ME!
+     */
+    public void delElements(Collection c) {
+        nodos.removeAll(c);
+        this.fireContentsChanged(this, 0, nodos.size());
+    }
+
+    /**
+     * @see javax.swing.ListModel#getSize()
+     */
+    public int getSize() {
+        return nodos.size();
+    }
+
+    /**
+     * @see javax.swing.ListModel#getElementAt(int)
+     */
+    public Object getElementAt(int index) {
+        return ((LayerInfo) nodos.get(index)).text;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public LayerInfo[] getElements() {
+        return (LayerInfo[]) nodos.toArray(new LayerInfo[0]);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param index DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public LayerInfo getLayerInfo(int index) {
+        return (LayerInfo) nodos.get(index);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerListModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardData.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardData.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardData.java	(revision 1648)
@@ -0,0 +1,125 @@
+/* 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.gui.wms;
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class WizardData {
+    private String title;
+    private String Abstract;
+    private LayerInfo layer;
+    private String[] formats;
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public String getAbstract() {
+        return Abstract;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public String[] getFormats() {
+        return formats;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public LayerInfo getLayer() {
+        return layer;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param string
+     */
+    public void setAbstract(String string) {
+        Abstract = string;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param strings
+     */
+    public void setFormats(String[] strings) {
+        formats = strings;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param info
+     */
+    public void setLayer(LayerInfo info) {
+        layer = info;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param string
+     */
+    public void setTitle(String string) {
+        title = string;
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardData.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardDataSource.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardDataSource.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardDataSource.java	(revision 1648)
@@ -0,0 +1,69 @@
+/*
+ * Created on 09-sep-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.wms;
+
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.net.URL;
+
+import org.exolab.castor.xml.ValidationException;
+
+import com.iver.wmsclient.UnsupportedVersionException;
+
+/**
+ * @author fernando
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+public interface WizardDataSource {
+	public WizardData detalles(URL host)throws IllegalStateException, ValidationException, 
+	UnsupportedVersionException, IOException ;
+	
+	public Rectangle2D getBoundingBox(String[] layerName, String srs);
+
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardDataSource.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerTreeModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerTreeModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerTreeModel.java	(revision 1648)
@@ -0,0 +1,113 @@
+/* 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.gui.wms;
+
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+
+
+
+public class LayerTreeModel implements TreeModel {
+
+	LayerInfo root;
+
+	public LayerTreeModel(LayerInfo root){
+		this.root = root;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#getRoot()
+	 */
+	public Object getRoot() {
+		return root;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
+	 */
+	public int getChildCount(Object parent) {
+		return ((LayerInfo)parent).hijos.size();
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
+	 */
+	public boolean isLeaf(Object node) {
+		return ((LayerInfo)node).hijos.size() == 0;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
+	 */
+	public void addTreeModelListener(TreeModelListener l) {
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
+	 */
+	public void removeTreeModelListener(TreeModelListener l) {
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
+	 */
+	public Object getChild(Object parent, int index) {
+		return ((LayerInfo)parent).hijos.get(index);
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object)
+	 */
+	public int getIndexOfChild(Object parent, Object child) {
+		LayerInfo pare = (LayerInfo) parent;
+		for (int i = 0; i < pare.hijos.size(); i++)
+			if (child == pare.hijos.get(i)) return i;
+		return -1;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
+	 */
+	public void valueForPathChanged(TreePath path, Object newValue) {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerTreeModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListenerSupport.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListenerSupport.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListenerSupport.java	(revision 1648)
@@ -0,0 +1,95 @@
+/* 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.gui.wms;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class WizardListenerSupport {
+    private ArrayList listeners = new ArrayList();
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param listener DOCUMENT ME!
+     */
+    public void addWizardListener(WizardListener listener) {
+        listeners.add(listener);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param listener DOCUMENT ME!
+     */
+    public void removeWizardListener(WizardListener listener) {
+        listeners.remove(listener);
+    }
+
+	/**
+	 * DOCUMENT ME!
+	 * @param finishable TODO
+	 */
+	public void callStateChanged(boolean finishable) {
+		Iterator i = listeners.iterator();
+
+		while (i.hasNext()) {
+			((WizardListener) i.next()).wizardStateChanged(finishable);
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 */
+	public void callError(Exception descripcion) {
+		Iterator i = listeners.iterator();
+
+		while (i.hasNext()) {
+			((WizardListener) i.next()).error(descripcion);
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListenerSupport.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/SRSListModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/SRSListModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/SRSListModel.java	(revision 1648)
@@ -0,0 +1,140 @@
+/* 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.gui.wms;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import javax.swing.AbstractListModel;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class SRSListModel extends AbstractListModel {
+	ArrayList comunes = new ArrayList();
+	
+    private HashSet srsSet = new HashSet();
+	private HashMap cuenta = new HashMap();
+	private ArrayList nombresSRS = new ArrayList();
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param srs DOCUMENT ME!
+     */
+    public void add(String srs) {
+    	System.out.println("A�adiendo " + srs);
+        if (!srsSet.add(srs)) {
+            Integer i = (Integer) cuenta.get(srs);
+            cuenta.put(srs, new Integer(i.intValue() + 1));
+            System.out.println("Ya hab�a, llevamos " + i.intValue() + 1);
+        } else {
+			nombresSRS.add(srs);
+            cuenta.put(srs, new Integer(1));
+			fireContentsChanged(this, nombresSRS.size()-1,nombresSRS.size()-1);
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param srs DOCUMENT ME!
+     */
+    public void del(String srs) {
+    	System.out.println("Eliminando SRS: "+ srs);
+        Integer i = (Integer) cuenta.get(srs);
+
+        if (i == null) {
+        	System.out.println("Eliminando un elemento que no estaba");
+            return;
+        }
+
+        int nuevo = i.intValue() - 1;
+
+		System.out.println("quedan " + nuevo);
+		
+        if (nuevo == 0) {
+            cuenta.remove(srs);
+            srsSet.remove(srs);
+            nombresSRS.remove(srs);
+			fireContentsChanged(this, 0,nombresSRS.size()-1);
+        } else {
+            cuenta.put(srs, new Integer(nuevo));
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public Iterator iterator() {
+        return srsSet.iterator();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public int size() {
+        return srsSet.size();
+    }
+
+	/**
+	 * @see javax.swing.ListModel#getSize()
+	 */
+	public int getSize() {
+		return nombresSRS.size();
+	}
+
+	/**
+	 * @see javax.swing.ListModel#getElementAt(int)
+	 */
+	public Object getElementAt(int index) {
+		return nombresSRS.get(index);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/SRSListModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/FormatListModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/FormatListModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/FormatListModel.java	(revision 1648)
@@ -0,0 +1,76 @@
+/* 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.gui.wms;
+
+import javax.swing.AbstractListModel;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class FormatListModel extends AbstractListModel {
+    String[] formatos;
+
+    /**
+     * Creates a new FormatListModel object.
+     *
+     * @param f DOCUMENT ME!
+     */
+    public FormatListModel(String[] f) {
+        formatos = f;
+    }
+
+    /**
+     * @see javax.swing.ListModel#getSize()
+     */
+    public int getSize() {
+        return formatos.length;
+    }
+
+    /**
+     * @see javax.swing.ListModel#getElementAt(int)
+     */
+    public Object getElementAt(int index) {
+        return formatos[index];
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/FormatListModel.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListener.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListener.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListener.java	(revision 1648)
@@ -0,0 +1,62 @@
+/* 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.gui.wms;
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ */
+public interface WizardListener {
+
+	/**
+	 * Invocado cuando el wizard puede ser finalizado porque se
+	 * ha rellenado toda la informaci�n necesaria
+	 */
+	public void wizardStateChanged(boolean finishable);
+	
+	/**
+	 * Si se produce alg�n error
+	 *
+	 * @param e Excepci�n que se ha producido
+	 */
+	public void error(Exception e);
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WizardListener.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WMSWizard.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WMSWizard.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WMSWizard.java	(revision 1648)
@@ -0,0 +1,1062 @@
+/*
+ * Created on 23-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui.wms;
+
+import java.awt.geom.Rectangle2D;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.TreeSet;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.DefaultListModel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.tree.TreePath;
+
+import org.apache.log4j.Logger;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.cit.gvsig.gui.WizardPanel;
+import com.iver.utiles.swing.JComboBox;
+
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class WMSWizard extends WizardPanel {
+    private static Logger logger = Logger.getLogger(WMSWizard.class.getName());
+    private int page = 0;
+    private boolean conectado = false;
+    private javax.swing.JPanel jContentPane = null;
+    private JComboBox cmbHost = null;
+    private javax.swing.JButton btnDetalles = null;
+    private javax.swing.JPanel jPanel = null;
+    private javax.swing.JLabel jLabel1 = null;
+    private javax.swing.JLabel lblTitle = null;
+    private javax.swing.JScrollPane jScrollPane = null;
+    private javax.swing.JTextArea txtAbstract = null;
+    private javax.swing.JScrollPane jScrollPane1 = null;
+    private javax.swing.JTree treeLayers1 = null;
+    private javax.swing.JScrollPane jScrollPane2 = null;
+    private javax.swing.JList lstFormats1 = null;
+    private javax.swing.JPanel panelPage1 = null;
+    private javax.swing.JPanel panelPage2 = null;
+    private javax.swing.JScrollPane jScrollPane5 = null;
+    private javax.swing.JList lstSelectedLayers = null;
+    private javax.swing.JButton btnAdd = null;
+    private javax.swing.JButton btnDel = null;
+    private javax.swing.JScrollPane jScrollPane6 = null;
+    private javax.swing.JList lstSRSs = null;
+    private LayerListModel selectedLayersModel = new LayerListModel();
+    private javax.swing.JButton btnSiguiente = null;
+    private javax.swing.JButton btnAnterior = null;
+    private javax.swing.JPanel jPanel1 = null;
+    private javax.swing.JPanel jPanel2 = null;
+    private javax.swing.JPanel jPanel3 = null;
+    private WizardListenerSupport listenerSupport = new WizardListenerSupport();
+    private WizardDataSource dataSource;
+    private JPanel jPanel4 = null;
+    private JTextField jTxtNomCapa = null;
+
+    /**
+     * This is the default constructor
+     *
+     * @param v DOCUMENT ME!
+     */
+    public WMSWizard() {
+        super();
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.setSize(510, 311);
+        this.setLayout(null);
+        this.setPreferredSize(new java.awt.Dimension(750, 320));
+        this.setVisible(true);
+        this.add(getPanelPage1(), null);
+        this.add(getPanelPage2(), null);
+        this.add(getBtnAnterior(), null);
+        this.add(getBtnSiguiente(), null);
+        activarVisualizarBotones();
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void actualizarSRS() {
+        LayerInfo[] layers = ((LayerListModel) lstSelectedLayers.getModel()).getElements();
+
+        if (layers.length == 0) {
+            lstSRSs.setModel(new DefaultListModel());
+        } else {
+            TreeSet srsSet = new TreeSet();
+            srsSet.addAll(layers[0].getSRSs());
+
+            for (int i = 1; i < layers.length; i++) {
+                HashSet nuevo = new HashSet(layers[i].getSRSs());
+                Iterator it = srsSet.iterator();
+
+                while (it.hasNext()) {
+                    String srs = (String) it.next();
+
+                    if (!nuevo.contains(srs)) {
+                        srsSet.remove(srs);
+                    }
+                }
+            }
+
+            DefaultListModel model = new DefaultListModel();
+            String[] array = (String[]) srsSet.toArray(new String[0]);
+
+            for (int i = 0; i < array.length; i++) {
+                model.addElement(array[i]);
+            }
+
+            lstSRSs.setModel(model);
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void addLayer() {
+        boolean alguno = false;
+
+        TreePath[] selecciones = getTreeLayers1().getSelectionPaths();
+
+        for (int i = 0; i < selecciones.length; i++) {
+            LayerInfo nodo = (LayerInfo) selecciones[i].getLastPathComponent();
+
+            String name = nodo.name;
+            String text = nodo.text;
+            ArrayList srs = nodo.getSRSs();
+
+            //Se a�ade a la lista de layers seleccionados
+            LayerListModel modelo = (LayerListModel) lstSelectedLayers.getModel();
+
+            if (modelo.addElement(nodo)) {
+                alguno = true;
+            }
+        }
+
+        if (alguno) {
+            activarVisualizarBotones();
+            actualizarSRS();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void delLayer() {
+        int[] index = lstSelectedLayers.getSelectedIndices();
+
+        ArrayList removeList = new ArrayList();
+        LayerListModel modelo = (LayerListModel) lstSelectedLayers.getModel();
+        LayerInfo[] infos = modelo.getElements();
+
+        for (int i = 0; i < index.length; i++) {
+            removeList.add(infos[index[i]]);
+        }
+
+        modelo.delElements(removeList);
+        lstSelectedLayers.clearSelection();
+
+        activarVisualizarBotones();
+
+        actualizarSRS();
+    }
+
+	private void addHost(String host){
+		host = host.trim();
+		DefaultComboBoxModel model = (DefaultComboBoxModel) getTxtHost().getModel();
+		if (model.getIndexOf(host) < 0){
+			model.addElement(host);
+		}
+	}
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void rellenarControles() {
+        try {
+            String host = cmbHost.getModel().getSelectedItem().toString();
+
+            if (!host.endsWith("?")) {
+                host += "?";
+            }
+            
+            WizardData data = dataSource.detalles(new URL(host));
+
+			addHost(host);            
+
+            ((LayerListModel) lstSelectedLayers.getModel()).clear();
+            lstSelectedLayers.repaint();
+            lblTitle.setText(data.getTitle());
+            txtAbstract.setText(data.getAbstract());
+            lstFormats1.setModel(new FormatListModel(data.getFormats()));
+            treeLayers1.setModel(new LayerTreeModel(data.getLayer()));
+            conectado = true;
+            activarVisualizarBotones();
+        } catch (Exception e) {
+            listenerSupport.callError(e);
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    private void activarVisualizarBotones() {
+        if (page == 0) {
+            getBtnAnterior().setEnabled(false);
+            getBtnSiguiente().setVisible(true);
+
+            if (conectado) {
+                getBtnSiguiente().setEnabled(true);
+            } else {
+                getBtnSiguiente().setEnabled(false);
+            }
+
+        } else if (page == 1) {
+            getBtnAnterior().setEnabled(true);
+            getBtnSiguiente().setVisible(false);
+            listenerSupport.callStateChanged(true);
+
+            if ((getLstSRSs().getSelectedIndex() != -1) &&
+                    (getLstFormats1().getSelectedIndex() != -1) &&
+                    (getLstSelectedLayers().getModel().getSize() > 0)) {
+                listenerSupport.callStateChanged(true);
+            } else {
+                listenerSupport.callStateChanged(false);
+            }
+
+            if (getTreeLayers1().getSelectionCount() > 0) {
+                LayerInfo nodo = (LayerInfo) getTreeLayers1().getSelectionPath()
+                                                 .getLastPathComponent();
+                String name = nodo.name;
+
+                if (name != null) {
+                    getBtnAdd().setEnabled(true);
+                } else {
+                    getBtnAdd().setEnabled(false);
+                }
+            } else {
+                getBtnAdd().setEnabled(false);
+            }
+
+            if (getLstSelectedLayers().getSelectedIndex() != -1) {
+                getBtnDel().setEnabled(true);
+            } else {
+                getBtnDel().setEnabled(false);
+            }
+        }
+    }
+
+    /*
+     * DOCUMENT ME!
+     *
+               private void finalizar() {
+                   LayerInfo[] layers = ((LayerListModel) lstSelectedLayers.getModel()).getElements();
+                   String srs = (String) lstSRSs.getSelectedValue();
+                   //Nombre separado por comas de las capas
+                   String layersQuery = layers[0].name;
+                   for (int i = 1; i < layers.length; i++) {
+                       layersQuery += ("," + layers[i].name);
+                   }
+                   Rectangle2D rect;
+                   rect = v.getMapControl().getExtent();
+                   if (rect == null) {
+                       //Boundingbox de todas las capas
+                       ArrayList rectangulos = new ArrayList();
+                       for (int i = 0; i < layers.length; i++) {
+                           rect = wms.getBoundingBox(layers[i].name, srs);
+                           if (rect != null) {
+                               rectangulos.add(rect);
+                           }
+                       }
+                       rect = Utilities.getRectangle((Rectangle2D.Double[]) rectangulos.toArray(
+                                   new Rectangle2D.Double[0]));
+                       if (rect == null) {
+                           App.instance.getNm().addInfo("Si no hay un bounding box en la especificaci�n, y tampoco en el FMap.",
+                               null);
+                           return; //Si no hay un bounding box en la especificaci�n, y tampoco en el FMap.
+                       }
+                       logger.debug("(" + rect.getMinX() + ", " + rect.getMinY() + ")-(" +
+                           rect.getMaxX() + ", " + rect.getMaxY() + ")");
+                   }
+                   if (rect != null) {
+                       IFLayer lyr = new FLyrWMS(rect,
+                               (String) lstFormats1.getSelectedValue(), layersQuery, srs,
+                               wms);
+                       v.getMapControl().getLayers().addLayer(lyr);
+                       v.getTOC().refresh();
+                       v.getMapControl().drawMap();
+                   } else {
+                   }
+                   /*MapQuery query = new MapQuery();
+                      query.setBBOX(rect);
+                      query.setFormat((String) lstFormats1.getSelectedValue());
+                      query.setHeight(300);
+                      query.setLayers(layersQuery);
+                      query.setSRS(srs);
+                      query.setStyles("");
+                      query.setVersion("1.0.0");
+                      query.setWidth(300);
+                      byte[] bytes;
+                      try {
+                              bytes = wms.doMapQuery(query);
+                              FileOutputStream out;
+                              out = new FileOutputStream("res.png");
+                              out.write(bytes);
+                              out.close();
+                      } catch (WMSException e1) {
+                              e1.printStackTrace();
+                      } catch (Exception e1) {
+                              e1.printStackTrace();
+                      }
+               }*/
+
+    /**
+     * This method initializes txtHost
+     *
+     * @return javax.swing.JTextField
+     */
+    private javax.swing.JComboBox getTxtHost() {
+        if (cmbHost == null) {
+            cmbHost = new JComboBox();
+            cmbHost.setModel(new DefaultComboBoxModel());
+            cmbHost.setPreferredSize(new java.awt.Dimension(350, 20));
+            cmbHost.setEditable(true);
+            ((DefaultComboBoxModel) cmbHost.getModel()).addElement(
+                "http://demo.deegree.org:8080/deegree/wms");
+            ((DefaultComboBoxModel) cmbHost.getModel()).addElement(
+                "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?");
+        }
+
+        return cmbHost;
+    }
+
+    /**
+     * This method initializes btnDetalles
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnDetalles() {
+        if (btnDetalles == null) {
+            btnDetalles = new javax.swing.JButton();
+            btnDetalles.setPreferredSize(new java.awt.Dimension(100, 20));
+            btnDetalles.setText(PluginServices.getText(this,"detalles"));
+            btnDetalles.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        rellenarControles();
+                    }
+                });
+        }
+
+        return btnDetalles;
+    }
+
+    /**
+     * This method initializes jPanel
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel() {
+        if (jPanel == null) {
+            jPanel = new javax.swing.JPanel();
+            jPanel.setLayout(null);
+            jPanel.setPreferredSize(new java.awt.Dimension(470, 130));
+            jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this,"descripcion"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            jPanel.setBounds(2, 67, 477, 197);
+            jPanel.add(getJLabel1(), null);
+            jPanel.add(getLblTitle(), null);
+            jPanel.add(getJScrollPane(), null);
+        }
+
+        return jPanel;
+    }
+
+    /**
+     * This method initializes jLabel1
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getJLabel1() {
+        if (jLabel1 == null) {
+            jLabel1 = new javax.swing.JLabel();
+            jLabel1.setText(PluginServices.getText(this,"nombre")+":");
+            jLabel1.setBounds(37, 26, 40, 15);
+        }
+
+        return jLabel1;
+    }
+
+    /**
+     * This method initializes lblTitle
+     *
+     * @return javax.swing.JLabel
+     */
+    private javax.swing.JLabel getLblTitle() {
+        if (lblTitle == null) {
+            lblTitle = new javax.swing.JLabel();
+            lblTitle.setText("-");
+            lblTitle.setPreferredSize(new java.awt.Dimension(350, 16));
+            lblTitle.setBounds(82, 26, 350, 16);
+        }
+
+        return lblTitle;
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getTxtAbstract());
+            jScrollPane.setPreferredSize(new java.awt.Dimension(450, 60));
+            jScrollPane.setBounds(10, 47, 450, 137);
+        }
+
+        return jScrollPane;
+    }
+
+    /**
+     * This method initializes txtAbstract
+     *
+     * @return javax.swing.JTextArea
+     */
+    private javax.swing.JTextArea getTxtAbstract() {
+        if (txtAbstract == null) {
+            txtAbstract = new javax.swing.JTextArea();
+            txtAbstract.setWrapStyleWord(true);
+            txtAbstract.setColumns(30);
+            txtAbstract.setLineWrap(true);
+        }
+
+        return txtAbstract;
+    }
+
+    /**
+     * This method initializes jScrollPane1
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane1() {
+        if (jScrollPane1 == null) {
+            jScrollPane1 = new javax.swing.JScrollPane();
+            jScrollPane1.setViewportView(getTreeLayers1());
+            jScrollPane1.setPreferredSize(new java.awt.Dimension(205, 75));
+        }
+
+        return jScrollPane1;
+    }
+
+    /**
+     * This method initializes treeLayers1
+     *
+     * @return javax.swing.JTree
+     */
+    private javax.swing.JTree getTreeLayers1() {
+        if (treeLayers1 == null) {
+            treeLayers1 = new javax.swing.JTree();
+            treeLayers1.setRootVisible(true);
+            treeLayers1.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
+                    public void valueChanged(
+                        javax.swing.event.TreeSelectionEvent e) {
+                        activarVisualizarBotones();
+                    }
+                });
+        }
+
+        return treeLayers1;
+    }
+
+    /**
+     * This method initializes jScrollPane2
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane2() {
+        if (jScrollPane2 == null) {
+            jScrollPane2 = new javax.swing.JScrollPane();
+            jScrollPane2.setViewportView(getLstFormats1());
+            jScrollPane2.setPreferredSize(new java.awt.Dimension(100, 200));
+            jScrollPane2.setBounds(297, 26, 183, 66);
+        }
+
+        return jScrollPane2;
+    }
+
+    /**
+     * This method initializes lstFormats1
+     *
+     * @return javax.swing.JList
+     */
+    private javax.swing.JList getLstFormats1() {
+        if (lstFormats1 == null) {
+            lstFormats1 = new javax.swing.JList();
+            lstFormats1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+            lstFormats1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+                    public void valueChanged(
+                        javax.swing.event.ListSelectionEvent e) {
+                        activarVisualizarBotones();
+                    }
+                });
+        }
+
+        return lstFormats1;
+    }
+
+    /**
+     * This method initializes panelPage1
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getPanelPage1() {
+        if (panelPage1 == null) {
+            panelPage1 = new javax.swing.JPanel();
+            panelPage1.setLayout(null);
+            panelPage1.setPreferredSize(new java.awt.Dimension(480, 220));
+            panelPage1.setVisible(true);
+            panelPage1.setBounds(15, 5, 480, 262);
+            panelPage1.add(getJPanel1(), null);
+            panelPage1.add(getJPanel(), null);
+        }
+
+        return panelPage1;
+    }
+
+    /**
+     * This method initializes panelPage2
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getPanelPage2() {
+        if (panelPage2 == null) {
+            panelPage2 = new javax.swing.JPanel();
+            panelPage2.setLayout(null);
+            panelPage2.setPreferredSize(new java.awt.Dimension(490, 300));
+            panelPage2.setVisible(false);
+            panelPage2.setBounds(10, 5, 490, 276);
+            panelPage2.add(getJPanel2(), null);
+            panelPage2.add(getJPanel3(), null);
+            panelPage2.add(getJPanel4(), null);
+        }
+
+        return panelPage2;
+    }
+
+    /**
+     * This method initializes jScrollPane5
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane5() {
+        if (jScrollPane5 == null) {
+            jScrollPane5 = new javax.swing.JScrollPane();
+            jScrollPane5.setViewportView(getLstSelectedLayers());
+            jScrollPane5.setPreferredSize(new java.awt.Dimension(205, 75));
+        }
+
+        return jScrollPane5;
+    }
+
+    /**
+     * This method initializes lstSelectedLayers
+     *
+     * @return javax.swing.JList
+     */
+    private javax.swing.JList getLstSelectedLayers() {
+        if (lstSelectedLayers == null) {
+            lstSelectedLayers = new javax.swing.JList();
+            lstSelectedLayers.setModel(selectedLayersModel);
+            lstSelectedLayers.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+            lstSelectedLayers.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+                    public void valueChanged(
+                        javax.swing.event.ListSelectionEvent e) {
+                        activarVisualizarBotones();
+                    }
+                });
+        }
+
+        return lstSelectedLayers;
+    }
+
+    /**
+     * This method initializes btnAdd
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnAdd() {
+        if (btnAdd == null) {
+            btnAdd = new javax.swing.JButton();
+            btnAdd.setPreferredSize(new java.awt.Dimension(23, 23));
+            btnAdd.setText(">");
+            btnAdd.setMargin(new java.awt.Insets(2, 0, 2, 0));
+            btnAdd.setEnabled(false);
+            btnAdd.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        addLayer();
+                    }
+                });
+        }
+
+        return btnAdd;
+    }
+
+    /**
+     * This method initializes btnDel
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnDel() {
+        if (btnDel == null) {
+            btnDel = new javax.swing.JButton();
+            btnDel.setPreferredSize(new java.awt.Dimension(23, 23));
+            btnDel.setText("<");
+            btnDel.setMargin(new java.awt.Insets(2, 0, 2, 0));
+            btnDel.setEnabled(false);
+            btnDel.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        delLayer();
+                    }
+                });
+        }
+
+        return btnDel;
+    }
+
+    /**
+     * This method initializes jScrollPane6
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane6() {
+        if (jScrollPane6 == null) {
+            jScrollPane6 = new javax.swing.JScrollPane();
+            jScrollPane6.setViewportView(getLstSRSs());
+            jScrollPane6.setPreferredSize(new java.awt.Dimension(250, 200));
+            jScrollPane6.setBounds(10, 26, 272, 68);
+        }
+
+        return jScrollPane6;
+    }
+
+    /**
+     * This method initializes lstSRSs
+     *
+     * @return javax.swing.JList
+     */
+    private javax.swing.JList getLstSRSs() {
+        if (lstSRSs == null) {
+            lstSRSs = new javax.swing.JList();
+            lstSRSs.setModel(new SRSListModel());
+            lstSRSs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+            lstSRSs.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+                    public void valueChanged(
+                        javax.swing.event.ListSelectionEvent e) {
+                        activarVisualizarBotones();
+                    }
+                });
+        }
+
+        return lstSRSs;
+    }
+
+    /**
+     * This method initializes btnSiguiente
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnSiguiente() {
+        if (btnSiguiente == null) {
+            btnSiguiente = new javax.swing.JButton();
+            btnSiguiente.setPreferredSize(new java.awt.Dimension(100, 30));
+            btnSiguiente.setText(PluginServices.getText(this,"siguiente"));
+            btnSiguiente.setBounds(205, 282, 100, 21);
+            btnSiguiente.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        page++;
+                        getPanelPage1().setVisible(false);
+                        getPanelPage2().setVisible(true);
+                        activarVisualizarBotones();
+                    }
+                });
+        }
+
+        return btnSiguiente;
+    }
+
+    /**
+     * This method initializes btnAnterior
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnAnterior() {
+        if (btnAnterior == null) {
+            btnAnterior = new javax.swing.JButton();
+            btnAnterior.setText(PluginServices.getText(this,"anterior"));
+            btnAnterior.setPreferredSize(new java.awt.Dimension(100, 30));
+            btnAnterior.setBounds(100, 282, 100, 21);
+            btnAnterior.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        page--;
+                        getPanelPage1().setVisible(true);
+                        getPanelPage2().setVisible(false);
+                        activarVisualizarBotones();
+                    }
+                });
+        }
+
+        return btnAnterior;
+    }
+
+    /**
+     * This method initializes jPanel1
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel1() {
+        if (jPanel1 == null) {
+            jPanel1 = new javax.swing.JPanel();
+            jPanel1.add(getTxtHost(), null);
+            jPanel1.add(getBtnDetalles(), null);
+            jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this,"servidor"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            jPanel1.setBounds(2, 5, 477, 57);
+        }
+
+        return jPanel1;
+    }
+
+    /**
+     * This method initializes jPanel2
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel2() {
+        if (jPanel2 == null) {
+            jPanel2 = new javax.swing.JPanel();
+            jPanel2.add(getJScrollPane1(), null);
+            jPanel2.add(getBtnDel(), null);
+            jPanel2.add(getBtnAdd(), null);
+            jPanel2.add(getJScrollPane5(), null);
+            jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this,"seleccionar_capas"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            jPanel2.setBounds(-1, 5, 493, 112);
+        }
+
+        return jPanel2;
+    }
+
+    /**
+     * This method initializes jPanel3
+     *
+     * @return javax.swing.JPanel
+     */
+    private javax.swing.JPanel getJPanel3() {
+        if (jPanel3 == null) {
+            jPanel3 = new javax.swing.JPanel();
+            jPanel3.setLayout(null);
+            jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this,"seleccionar_formato"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            jPanel3.setPreferredSize(new java.awt.Dimension(493, 300));
+            jPanel3.setLocation(-1, 122);
+            jPanel3.setSize(493, 101);
+            jPanel3.add(getJScrollPane6(), null);
+            jPanel3.add(getJScrollPane2(), null);
+        }
+
+        return jPanel3;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param listener
+     */
+    public void addWizardListener(WizardListener listener) {
+        listenerSupport.addWizardListener(listener);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param listener
+     */
+    public void removeWizardListener(WizardListener listener) {
+        listenerSupport.removeWizardListener(listener);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return
+     */
+    public WizardDataSource getDataSource() {
+        return dataSource;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param source
+     */
+    public void setDataSource(WizardDataSource source) {
+        dataSource = source;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getLayersQuery() {
+        LayerInfo[] layers = ((LayerListModel) lstSelectedLayers.getModel()).getElements();
+
+        //Nombre separado por comas de las capas
+        String layersQuery = layers[0].name;
+
+        for (int i = 1; i < layers.length; i++) {
+            layersQuery += ("," + layers[i].name);
+        }
+
+        return layersQuery;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getQueryableLayerQuery() {
+        LayerInfo[] layers = ((LayerListModel) lstSelectedLayers.getModel()).getElements();
+
+        //Nombre separado por comas de las capas
+        String layersQuery = "";
+        int i;
+
+        for (i = 0; i < layers.length; i++) {
+            if (layers[i].queryable) {
+                layersQuery = layers[i].name;
+
+                break;
+            }
+        }
+
+        for (int j = i + 1; j < layers.length; j++) {
+            if (layers[j].queryable) {
+                layersQuery += ("," + layers[j].name);
+            }
+        }
+
+        return layersQuery;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getSRS() {
+        return (String) lstSRSs.getSelectedValue();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String getFormat() {
+        return (String) lstFormats1.getSelectedValue();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public TreePath[] getSelectedLayers() {
+        return getTreeLayers1().getSelectionPaths();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public Rectangle2D getLayersRectangle() {
+        TreePath[] layers = getSelectedLayers();
+
+        //Boundingbox de todas las capas
+        ArrayList rectangulos = new ArrayList();
+
+        Rectangle2D rect;
+
+        for (int i = 0; i < layers.length; i++) {
+            String[] rutaCapa = new String[layers[i].getPathCount()];
+
+            for (int j = 0; j < layers[i].getPathCount(); j++) {
+                rutaCapa[j] = ((LayerInfo) layers[i].getPathComponent(j)).text;
+            }
+
+            rect = dataSource.getBoundingBox(rutaCapa, getSRS());
+
+            if (rect != null) {
+                rectangulos.add(rect);
+            }
+        }
+
+        rect = getRectangle((Rectangle2D.Double[]) rectangulos.toArray(
+                    new Rectangle2D.Double[0]));
+
+        return rect;
+    }
+
+    /**
+     * Obtiene el rect�ngulo que contiene a todos los
+     * otros
+     *
+     * @param rects rectangulos
+     *
+     * @return Rectangulo que contiene a todos los demas
+     */
+    public static Rectangle2D getRectangle(Rectangle2D[] rects) {
+        Rectangle2D ret = rects[0];
+
+        for (int i = 1; i < rects.length; i++) {
+            ret.add(rects[i]);
+        }
+
+        return ret;
+    }
+
+    /**
+     * Devuelve el host que est� escrito en el cuadro de texto del host o null
+     * en caso de que no haya nada escrito o est� mal escrito
+     *
+     * @return URL del host
+     */
+    public URL getHost() {
+        try {
+            return new URL(cmbHost.getModel().getSelectedItem().toString());
+        } catch (MalformedURLException e) {
+            return null;
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return Nombre de la capa que aparece en el TOC.
+     */
+    public String getLayerName() {
+        return jTxtNomCapa.getText();
+    }
+
+    /**
+     * This method initializes jPanel4
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getJPanel4() {
+        if (jPanel4 == null) {
+            jPanel4 = new JPanel();
+            jPanel4.setLayout(null);
+            jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this,"nombre_capa"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            jPanel4.setBounds(-1, 223, 493, 48);
+            jPanel4.add(getJTxtNomCapa(), null);
+        }
+
+        return jPanel4;
+    }
+
+    /**
+     * This method initializes jTextField
+     *
+     * @return javax.swing.JTextField
+     */
+    private JTextField getJTxtNomCapa() {
+        if (jTxtNomCapa == null) {
+            jTxtNomCapa = new JTextField();
+            jTxtNomCapa.setBounds(10, 19, 474, 20);
+            jTxtNomCapa.setText(PluginServices.getText(this,"capaWMS"));
+        }
+
+        return jTxtNomCapa;
+    }
+}
+ //  @jve:decl-index=0:visual-constraint="10,10"
+//  @jve:visual-info  decl-index=0 visual-constraint="16,10"
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"
+//	@jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/WMSWizard.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerInfo.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerInfo.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerInfo.java	(revision 1648)
@@ -0,0 +1,107 @@
+/* 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.gui.wms;
+
+import java.util.ArrayList;
+
+
+//	Nodo[] nodos;
+public class LayerInfo {
+    public String text;
+    public String name;
+    public boolean queryable;
+    private ArrayList srs = new ArrayList();
+    
+    public ArrayList hijos = new ArrayList();
+    public LayerInfo padre;
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param srs DOCUMENT ME!
+     */
+    public void addSRS(String srs) {
+    	String[] srsArray = srs.split(" ");
+    	for (int i = 0; i < srsArray.length; i++){
+			this.srs.add(srsArray[i]);
+    	}
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public ArrayList getSRSs() {
+		ArrayList ret = new ArrayList();
+		ret.addAll(srs);
+
+        if (padre != null) {
+            ret.addAll(padre.getSRSs());
+        }
+
+        return ret;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public String toString() {
+        return text;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object obj) {
+    	try{
+	        LayerInfo objeto = (LayerInfo) obj;
+			return this.name.equals(objeto.name);
+		}catch(ClassCastException e){
+			e.printStackTrace();
+			return false;
+		}catch (NullPointerException e) {
+			return false;
+		}
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/wms/LayerInfo.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Table.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Table.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Table.java	(revision 1648)
@@ -0,0 +1,368 @@
+/* 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.gui;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.text.DateFormat;
+import java.text.NumberFormat;
+import java.util.BitSet;
+
+import javax.swing.DefaultListSelectionModel;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.AbstractTableModel;
+
+import org.apache.log4j.Logger;
+
+import com.hardcode.gdbms.engine.data.DriverException;
+import com.hardcode.gdbms.engine.values.ValueFactory;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
+import com.iver.cit.gvsig.fmap.layers.SelectionEvent;
+import com.iver.cit.gvsig.fmap.layers.SelectionListener;
+import com.iver.cit.gvsig.project.ProjectTable;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class Table extends JPanel implements SingletonView {
+    private static Logger logger = Logger.getLogger(Table.class.getName());
+    private javax.swing.JScrollPane jScrollPane = null;
+    private javax.swing.JTable table = null;
+    private ProjectTable model = null;
+    private DateFormat df = DateFormat.getDateInstance();
+    private NumberFormat nf = NumberFormat.getInstance();
+    private JLabel jLabelStatus = null;
+    private ViewInfo m_viewInfo = null;
+    private FMap fmap;
+    
+    private boolean updating = false;
+    
+    private TableSelectionListener selectionListener = new TableSelectionListener();
+    
+    /**
+     * This is the default constructor
+     */
+    public Table() {
+        super();
+        initialize();
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public ProjectTable getModel() {
+        return model;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param table DOCUMENT ME!
+     */
+    public void setModel(ProjectTable table) {
+        try {
+            SelectableDataSource dataSource;
+
+            if (model != null) {
+                dataSource = model.getModelo();
+
+                if (dataSource != null) {
+                	logger.debug("dataSource.stop()");
+                    dataSource.stop();
+                }
+            }
+            model = table;
+
+            //Gesti�n del nombre de la ventana
+            model.addPropertyChangeListener(new PropertyChangeListener() {
+    			public void propertyChange(PropertyChangeEvent evt) {
+    				if (evt.getPropertyName().equals("name")){
+    					PluginServices.getMDIManager().getViewInfo(Table.this).setTitle(PluginServices.getText(this, "Tabla")+": " + (String)evt.getNewValue());
+    				}
+    			}
+    		});           
+			PluginServices.getMDIManager().getViewInfo(Table.this).setTitle(PluginServices.getText(this, "Tabla")+": " + model.getName());
+            
+            
+            
+            if (table.getAssociatedTable() != null){
+            	this.fmap = ((FLayer)table.getAssociatedTable()).getFMap();
+            }else{
+            	this.fmap = null;
+            }
+            
+            dataSource = table.getModelo();
+            logger.debug("dataSource.start()");
+            dataSource.start();
+
+            AbstractTableModel dataModel = new DataSourceDataModel(dataSource);
+
+//            getTable().setModel(dataModel);
+    		TableSorter sorter = new TableSorter(dataModel); //ADDED THIS
+    		getTable().setModel(sorter);
+    		sorter.setTableHeader(getTable().getTableHeader()); //ADDED THIS
+
+            table.getModelo().addSelectionListener(selectionListener);
+            
+            updateSelection();
+
+            jLabelStatus.setText(" " + dataSource.getRowCount() + " " +
+                PluginServices.getText(this, "registros") + ".");
+        } catch (DriverException e) {
+            NotificationManager.addError("Error accediendo a los datos", e);
+        }
+    }
+
+    /**
+     *
+     */
+    private void updateSelection() {
+    	updating = true;
+    	
+        DefaultListSelectionModel sm = (DefaultListSelectionModel) getTable()
+                                                                       .getSelectionModel();
+        sm.clearSelection();
+        BitSet bs = model.getModelo().getSelection();
+        sm.setValueIsAdjusting(true);
+
+        for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
+            sm.addSelectionInterval(i, i);
+        }
+
+        sm.setValueIsAdjusting(false);
+        
+        updating = false;
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        jLabelStatus = new JLabel();
+        setLayout(new java.awt.BorderLayout());
+        jLabelStatus.setText("");
+        jLabelStatus.setName("");
+        jLabelStatus.setPreferredSize(new java.awt.Dimension(100, 18));
+        add(getJScrollPane(), java.awt.BorderLayout.CENTER);
+        this.add(jLabelStatus, java.awt.BorderLayout.SOUTH);
+    }
+
+    /**
+     * This method initializes table
+     *
+     * @return javax.swing.JTable
+     */
+    private javax.swing.JTable getTable() {
+        if (table == null) {
+            table = new javax.swing.JTable();
+            table.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
+            table.setSelectionModel(new DefaultListSelectionModel());
+            table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+                    public void valueChanged(ListSelectionEvent e) {
+                    	if (updating) return;
+
+                    	SelectableDataSource dataModel = Table.this.model.getModelo();
+                    	
+                    	DefaultListSelectionModel model = (DefaultListSelectionModel) table.getSelectionModel();
+                        BitSet selection = dataModel.getSelection();
+
+                        for (int i = e.getFirstIndex();
+                                i <= e.getLastIndex(); i++) {
+                            selection.set(i, model.isSelectedIndex(i));
+                        }
+
+                        if (e.getValueIsAdjusting() == false) {
+                        	if (fmap != null){
+                        		fmap.endAtomicEvent();
+                        	}
+                            dataModel.fireSelectionEvents();
+                        }else{
+                        	if (fmap != null)
+                        	fmap.beginAtomicEvent();
+                        }
+                    }
+                });
+        }
+
+        return table;
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getTable());
+        }
+
+        return jScrollPane;
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
+     */
+    public Object getViewModel() {
+        return model;
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+     */
+    public ViewInfo getViewInfo() {
+    	ViewInfo m_viewInfo = new ViewInfo(ViewInfo.ICONIFIABLE | ViewInfo.MAXIMIZABLE |
+                ViewInfo.RESIZABLE);
+            m_viewInfo.setTitle(PluginServices.getText(this, "Tabla"));
+            m_viewInfo.setWidth(300);
+            m_viewInfo.setHeight(200);
+
+        return m_viewInfo;
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+     */
+    public void viewActivated() {
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @author Fernando Gonz�lez Cort�s
+     */
+    public class DataSourceDataModel extends AbstractTableModel {
+        private SelectableDataSource dataSource;
+
+        /**
+         * Crea un nuevo DataSourceDataModel.
+         *
+         * @param ds DOCUMENT ME!
+         */
+        public DataSourceDataModel(SelectableDataSource ds) {
+            dataSource = ds;
+        }
+
+        /**
+         * DOCUMENT ME!
+         *
+         * @param col DOCUMENT ME!
+         *
+         * @return DOCUMENT ME!
+         */
+        public String getColumnName(int col) {
+            try {
+                return dataSource.getFieldName(col).trim();
+            } catch (DriverException e) {
+                return e.getMessage();
+            }
+        }
+
+        /**
+         * DOCUMENT ME!
+         *
+         * @return DOCUMENT ME!
+         */
+        public int getColumnCount() {
+            try {
+                return dataSource.getFieldCount();
+            } catch (DriverException e) {
+                return 0;
+            }
+        }
+
+        /**
+         * DOCUMENT ME!
+         *
+         * @return DOCUMENT ME!
+         */
+        public int getRowCount() {
+            try {
+                return (int) dataSource.getRowCount();
+            } catch (DriverException e) {
+                return 0;
+            }
+        }
+
+        /**
+         * DOCUMENT ME!
+         *
+         * @param row DOCUMENT ME!
+         * @param col DOCUMENT ME!
+         *
+         * @return DOCUMENT ME!
+         */
+        public Object getValueAt(int row, int col) {
+            try {
+                return dataSource.getFieldValue(row, col);
+            } catch (DriverException e) {
+                return ValueFactory.createValue("").toString();
+            }
+        }
+    }
+
+    public class TableSelectionListener implements SelectionListener{
+
+		/**
+		 * @see com.iver.cit.gvsig.fmap.layers.LegendListener#selectionChanged(com.iver.cit.gvsig.fmap.layers.LayerEvent)
+		 */
+		public void selectionChanged(SelectionEvent e) {
+			updateSelection();
+			Table.this.repaint();
+		}
+    	
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Table.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FOpenDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FOpenDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FOpenDialog.java	(revision 1648)
@@ -0,0 +1,245 @@
+/*
+ * Created on 23-abr-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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.gui;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.cresques.cts.IProjection;
+import org.cresques.cts.ProjectionPool;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.gui.wms.WizardListener;
+import com.iver.cit.gvsig.project.Project;
+/**
+ * Di�logo para cargar las dieferentes capas a la vista.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FOpenDialog extends JPanel implements com.iver.andami.ui.mdiManager.View {
+	//private javax.swing.JDialog jDialog = null;  //  @jve:visual-info  decl-index=0 visual-constraint="19,27"
+    
+	static private IProjection proj = Project.getProjection();
+	
+	private javax.swing.JTabbedPane jTabbedPane = null;
+    private javax.swing.JPanel psegundo = null;
+    private DefaultListModel m_lstModel;
+    private JFileChooser fileChooser;
+
+	private JPanel jPanel = null;
+	private JButton btnAceptar = null;
+	private JButton jButton = null;
+	
+	private boolean accepted = false;
+	
+	private WizardListener wizardListener = new DialogWizardListener();
+    /**
+     * Creates a new FOpenDialog object.
+     *
+     * @param view Vista que vamos a refrescar
+     * @param mapControl MapControl que recibe la capa (te puede interesar
+     *        a�adirla al principal o al Overview.
+     */
+    public FOpenDialog() {
+    	initialize();
+    	
+        // Cada vez que se abre, se borran las capas que pudiera haber.
+        m_lstModel = new DefaultListModel(); 
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.setLayout(new BorderLayout());
+        this.setSize(523, 369);
+        this.setPreferredSize(new java.awt.Dimension(523, 369));
+        this.add(getJTabbedPane(), BorderLayout.CENTER);
+        this.add(getJPanel(), java.awt.BorderLayout.SOUTH);
+    }
+
+    /**
+     * This method initializes jTabbedPane
+     *
+     * @return javax.swing.JTabbedPane
+     */
+    private javax.swing.JTabbedPane getJTabbedPane() {
+        if (jTabbedPane == null) {
+            jTabbedPane = new javax.swing.JTabbedPane();
+            jTabbedPane.setBounds(0, 0, 519, 352);
+            jTabbedPane.addChangeListener(new ChangeListener() {
+				public void stateChanged(ChangeEvent e) {
+					JTabbedPane tabs = (JTabbedPane) e.getSource();
+					getBtnAceptar().setEnabled(!(tabs.getSelectedComponent() instanceof WizardPanel));
+				}
+			});
+        }
+
+        return jTabbedPane;
+    }
+
+    public void addTab(String title, JPanel panel){
+    	getJTabbedPane().addTab(title, panel);
+    }
+    
+    public void addWizardTab(String title, WizardPanel panel){
+    	panel.addWizardListener(wizardListener);
+    	getJTabbedPane().addTab(title, panel);
+    }
+    
+    public JPanel getSelectedTab(){
+    	return (JPanel) getJTabbedPane().getSelectedComponent();
+    }
+    
+    public ViewInfo getViewInfo() {
+    	ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+   		m_viewinfo.setTitle(PluginServices.getText(this,"Abrir_una_capa"));
+        return m_viewinfo;
+    }
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private JPanel getJPanel() {
+		if (jPanel == null) {
+			FlowLayout flowLayout1 = new FlowLayout();
+			jPanel = new JPanel();
+			jPanel.setLayout(flowLayout1);
+			flowLayout1.setHgap(30);
+			jPanel.add(getBtnAceptar(), null);
+			jPanel.add(getJButton(), null);
+		}
+		return jPanel;
+	}
+	/**
+	 * This method initializes btnAceptar	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getBtnAceptar() {
+		if (btnAceptar == null) {
+			btnAceptar = new JButton();
+			btnAceptar.setText("Aceptar");
+			btnAceptar.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+					accepted = true;
+                    if (PluginServices.getMainFrame() == null) {
+                        ((JDialog) (getParent().getParent().getParent()
+                                .getParent())).dispose();
+                    } else {
+                        PluginServices.getMDIManager().closeView((View) FOpenDialog.this);
+                    }
+				}
+			});
+		}
+		return btnAceptar;
+	}
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJButton() {
+		if (jButton == null) {
+			jButton = new JButton();
+			jButton.setText("Cancelar");
+			jButton.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+                    if (PluginServices.getMainFrame() != null) {
+                        PluginServices.getMDIManager().closeView((View) FOpenDialog.this);
+                    } else {
+                        ((JDialog) (getParent().getParent().getParent()
+                                        .getParent())).dispose();
+                    }
+				}
+			});
+		}
+		return jButton;
+	}
+	public boolean isAccepted() {
+		return accepted;
+	}
+	
+	public class DialogWizardListener implements WizardListener {
+
+		/**
+		 * @see com.iver.cit.gvsig.gui.wms.WizardListener#error(java.lang.Exception)
+		 */
+		public void error(Exception e) {
+		}
+
+		/**
+		 * @see com.iver.cit.gvsig.gui.wms.WizardListener#wizardStateChanged(boolean)
+		 */
+		public void wizardStateChanged(boolean finishable) {
+			getBtnAceptar().setEnabled(finishable);
+		}
+		
+	}
+	public static IProjection getLastProjection() {
+		return proj;
+	}
+	public static void setLastProjection(IProjection proj) {
+		FOpenDialog.proj = proj;
+	}
+   }  //  @jve:decl-index=0:visual-constraint="10,10"
+ //  @jve:visual-info  decl-index=0 visual-constraint="10,10"
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FOpenDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelLocConfig.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelLocConfig.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelLocConfig.java	(revision 1648)
@@ -0,0 +1,568 @@
+/*
+ * Created on 18-jun-2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/* 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.gui;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListModel;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.cresques.cts.IProjection;
+import org.cresques.cts.ProjectionPool;
+
+import com.hardcode.gdbms.engine.data.DBDriver;
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.MapControl;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.fmap.drivers.GeorreferencedRasterDriver;
+import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
+import com.iver.cit.gvsig.fmap.layers.CancelationException;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+import com.iver.cit.gvsig.fmap.layers.LayerFactory;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.Classifiable;
+import com.iver.cit.gvsig.gui.legendmanager.FLegendManagerWindow;
+
+/**
+ * @author FJP
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class FPanelLocConfig extends JPanel implements ActionListener,View {
+	private javax.swing.JLabel jLabel = null;
+	private javax.swing.JList jList = null;
+	private javax.swing.JButton jBtnUp = null;
+	private javax.swing.JButton jBtnDown = null;
+	private javax.swing.JButton jBtnAddLayer = null;  //
+	private javax.swing.JButton jBtnRemoveLayer = null;
+	private javax.swing.JButton jBtnEditLegend = null;
+	private javax.swing.JButton jBtnCancel = null;
+	
+	//private JDialog m_Owner;
+	private MapControl mapCtrl;
+	private FLegendManagerWindow m_LegendEditor = new FLegendManagerWindow();
+	private ViewInfo m_viewinfo = null;
+	/**
+	 * This is the default constructor
+	 */
+	public FPanelLocConfig( MapControl mc) {
+		super();
+		mapCtrl = mc;
+		initialize();
+		refreshList();
+		updateControls(null);
+	}
+	
+	private void refreshList()
+	{
+		DefaultListModel lstModel = (DefaultListModel) getJList().getModel();
+		lstModel.clear();
+		for (int i=mapCtrl.getMapContext().getLayers().getLayersCount()-1; i >=0; i--)
+		{
+			FLayer lyr = mapCtrl.getMapContext().getLayers().getLayer(i);
+			lstModel.addElement(lyr.getName());
+		}	
+	}
+	
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private  void initialize() {
+		this.setLayout(null);
+		this.setSize(370, 200);
+		this.setPreferredSize(new java.awt.Dimension(370,200));
+		this.add(getJLabel(), null);
+		this.add(getJList(), null);
+		this.add(getJBtnUp(), null);
+		this.add(getJBtnDown(), null);
+		this.add(getJBtnAddLayer(), null);
+		this.add(getJBtnRemoveLayer(), null);
+		this.add(getJBtnEditLegend(), null);
+		this.add(getJBtnCancel(), null);
+	}
+	/**
+
+	 * This method initializes jLabel	
+
+	 * 	
+
+	 * @return javax.swing.JLabel	
+
+	 */    
+	private javax.swing.JLabel getJLabel() {
+		if (jLabel == null) {
+			jLabel = new javax.swing.JLabel();
+			jLabel.setText(PluginServices.getText(this,"Capas_del_localizador")+":");
+			jLabel.setBounds(22, 15, 132, 25);
+		}
+		return jLabel;
+	}
+
+	/**
+
+	 * This method initializes jList	
+
+	 * 	
+
+	 * @return javax.swing.JList	
+
+	 */    
+	private javax.swing.JList getJList() {
+		if (jList == null) {
+			jList = new javax.swing.JList(new DefaultListModel());
+			jList.setBounds(22, 49, 179, 139);
+			jList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+			jList.setBorder(BorderFactory.createLineBorder(Color.BLACK));
+			jList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { 
+
+				public void valueChanged(javax.swing.event.ListSelectionEvent e) {    
+					updateControls(e);
+				}
+			});
+
+		}
+		return jList;
+	}
+	
+	private void updateControls(javax.swing.event.ListSelectionEvent e)
+	{
+		System.out.println("valueChanged()"); // TODO Auto-generated Event stub valueChanged()
+		DefaultListModel lstModel = (DefaultListModel) getJList().getModel();
+		int selIndex = jList.getSelectedIndex();
+		jBtnDown.setEnabled(false);
+		jBtnUp.setEnabled(false);
+		
+		if (selIndex != -1)
+		{
+			if (lstModel.getSize() > 1)
+			{
+				if (selIndex < (lstModel.getSize()-1))
+					jBtnDown.setEnabled(true);
+				
+				if (selIndex > 0)
+					jBtnUp.setEnabled(true);
+			}
+			
+		}
+
+		
+	}
+
+	/**
+
+	 * This method initializes jBtnUp	
+
+	 * 	
+
+	 * @return javax.swing.JButton	
+
+	 */    
+	private javax.swing.JButton getJBtnUp() {
+		if (jBtnUp == null) {
+			jBtnUp = new javax.swing.plaf.basic.BasicArrowButton(
+					javax.swing.SwingConstants.NORTH);
+			jBtnUp.setBounds(206, 49, 25, 23);
+			jBtnUp.setToolTipText(PluginServices.getText(this,"Subir_capa"));
+			jBtnUp.addActionListener(this);
+			jBtnUp.setActionCommand("UP");
+
+		}
+		return jBtnUp;
+	}
+
+	/**
+
+	 * This method initializes jBtnDown	
+
+	 * 	
+
+	 * @return javax.swing.JButton	
+
+	 */    
+	private javax.swing.JButton getJBtnDown() {
+		if (jBtnDown == null) {
+			jBtnDown = new javax.swing.plaf.basic.BasicArrowButton(
+					javax.swing.SwingConstants.SOUTH);
+			jBtnDown.setBounds(206, 164, 25, 23);
+			jBtnDown.setToolTipText(PluginServices.getText(this,"Bajar_capa"));
+			jBtnDown.setActionCommand("DOWN");
+			jBtnDown.addActionListener(this);
+		}
+		return jBtnDown;
+	}
+
+	/**
+
+	 * This method initializes jButton2	
+
+	 * 	
+
+	 * @return javax.swing.JButton	
+
+	 */    
+	private javax.swing.JButton getJBtnAddLayer() {
+		if (jBtnAddLayer == null) {
+			jBtnAddLayer = new javax.swing.JButton();
+			jBtnAddLayer.setBounds(251, 49, 109, 23);
+			jBtnAddLayer.setText(PluginServices.getText(this,"Anadir_capa")+"...");
+			jBtnAddLayer.addActionListener(this);
+			jBtnAddLayer.setActionCommand("ADD_LAYER");
+		}
+		return jBtnAddLayer;
+	}
+
+	/**
+
+	 * This method initializes jBtnRemoveLayer	
+
+	 * 	
+
+	 * @return javax.swing.JButton	
+
+	 */    
+	private javax.swing.JButton getJBtnRemoveLayer() {
+		if (jBtnRemoveLayer == null) {
+			jBtnRemoveLayer = new javax.swing.JButton();
+			jBtnRemoveLayer.setBounds(251, 78, 109, 23);
+			jBtnRemoveLayer.setText(PluginServices.getText(this,"Quitar_capa")+"...");
+			jBtnRemoveLayer.addActionListener(this);
+			jBtnRemoveLayer.setActionCommand("REMOVE_LAYER");
+			
+		}
+		return jBtnRemoveLayer;
+	}
+
+	/**
+
+	 * This method initializes jBtnEditLegend	
+
+	 * 	
+
+	 * @return javax.swing.JButton	
+
+	 */    
+	private javax.swing.JButton getJBtnEditLegend() {
+		if (jBtnEditLegend == null) {
+			jBtnEditLegend = new javax.swing.JButton();
+			jBtnEditLegend.setBounds(251, 113, 109, 23);
+			jBtnEditLegend.setText(PluginServices.getText(this,"Editar_leyenda")+"...");
+			jBtnEditLegend.addActionListener(this);
+			jBtnEditLegend.setActionCommand("EDIT_LEGEND");
+		}
+		return jBtnEditLegend;
+	}
+
+	/**
+
+	 * This method initializes jBtnCancel	
+
+	 * 	
+
+	 * @return javax.swing.JButton	
+
+	 */    
+	private javax.swing.JButton getJBtnCancel() {
+		if (jBtnCancel == null) {
+			jBtnCancel = new javax.swing.JButton();
+			jBtnCancel.setBounds(251, 162, 109, 23);
+			jBtnCancel.setText(PluginServices.getText(this,"Cerrar"));
+			jBtnCancel.setActionCommand("CANCEL");
+			jBtnCancel.addActionListener(this); 
+
+		}
+		return jBtnCancel;
+	}
+	/* (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e)
+	{
+		DefaultListModel lstModel = (DefaultListModel) getJList().getModel();
+		FLayers theLayers = mapCtrl.getMapContext().getLayers();
+		// TODO LWS Esto debe venir de fuera (proyeccion del fichero, o de la vista)
+		IProjection proj = ProjectionPool.get("EPSG:23030");
+		
+		int numLayers = theLayers.getLayersCount()-1;
+
+		if (e.getActionCommand() == "CANCEL")
+		{
+			if (PluginServices.getMainFrame() != null)
+			{
+				PluginServices.getMDIManager().closeView(FPanelLocConfig.this);
+			}
+			else
+			{
+				((JDialog) (getParent().getParent().getParent().getParent())).dispose();
+			}
+		}
+		if (e.getActionCommand() == "ADD_LAYER")
+		{
+            FOpenDialog fopen = new FOpenDialog();            
+            if (PluginServices.getMainFrame() != null)
+            {
+                FileOpenDialog fileDlg = new FileOpenDialog(new Class[]{VectorialFileDriver.class, GeorreferencedRasterDriver.class});
+                DataBaseOpenDialog dbop = new DataBaseOpenDialog();
+                dbop.setClasses(new Class[] { DBDriver.class });
+                fopen.addTab("Fichero", fileDlg);
+                fopen.addTab("Base de datos", dbop);
+                PluginServices.getMDIManager().addView(fopen);
+
+                if (fopen.isAccepted()) {
+                    // TODO: Hacer lo de la capa WMS tambi�n.
+                    if (fileDlg.getFiles() == null) {
+                        return;
+                    }
+
+                    FLayer lyr = null;
+                    File[] files = fileDlg.getFiles();
+                    String[] driverNames = fileDlg.getDriverNames();
+                    for (int iFile = 0; iFile < files.length; iFile++) {
+                        File fich = files[iFile];
+                        String layerName = fich.getName();
+                        String layerPath = fich.getAbsolutePath();
+
+                        try {
+                            lyr = LayerFactory.createLayer(layerName, driverNames[iFile],
+                                    fich, proj);
+
+                            if (lyr != null) {
+                                try {
+
+                                    lyr.setVisible(true);
+                                    mapCtrl.getMapContext().getLayers()
+                                           .addLayer(lyr);
+                                    if (mapCtrl instanceof MapOverview){
+                                    	((MapOverview)mapCtrl).refreshExtent();
+                                    }
+                                } catch (CancelationException ex) {
+                                    // TODO Auto-generated catch block
+                                    ex.printStackTrace();
+                                }
+
+                            }
+                        } catch (DriverException ex) {
+                        	NotificationManager.addError("A�adiendo capa",ex);
+                        }
+                    } // for
+                }
+            	
+            }
+            else
+            {
+            	JDialog dlg = new JDialog();
+                dlg.setModal(true);
+                FileOpenDialog fileDlg = new FileOpenDialog(new Class[]{VectorialFileDriver.class});
+                DataBaseOpenDialog dbop = new DataBaseOpenDialog();
+                dbop.setClasses(new Class[]{DBDriver.class});
+                
+                fopen = new FOpenDialog();
+                fopen.addTab("Fichero", fileDlg);
+                fopen.addTab("Base de datos", dbop);
+                // fileDlg.setPreferredSize(fopen.getSize());
+                dlg.setSize(fopen.getSize());
+                dlg.getContentPane().add(fopen);
+                dlg.pack();
+                dlg.show();
+                
+      
+                // TODO: Hacer lo de la capa WMS tambi�n.
+        		if (fileDlg.getFiles() == null) return;
+        		FLayer lyr = null;
+        		File[] files = fileDlg.getFiles();
+        		String[] driverNames = fileDlg.getDriverNames();
+        		for  (int iFile=0; iFile < files.length; iFile++)
+        		{
+        			File fich = files[iFile];
+        			String layerName = fich.getName();
+        			String layerPath = fich.getAbsolutePath();
+        			
+        			try {
+        				lyr = LayerFactory.createLayer(layerName, driverNames[iFile], fich, proj);
+
+        				lyr.setVisible(true);
+        				lyr.setName(layerName);
+        				if (lyr != null )
+        				{
+        					try {
+        						mapCtrl.getMapContext().getLayers().addLayer(lyr);
+        					} catch (CancelationException ex) {
+        						// TODO Auto-generated catch block
+        						ex.printStackTrace();
+        					}
+        				}    		
+        				
+        			} catch (DriverException ex) {
+        				NotificationManager.addError("A�adiendo capa",ex);
+    				}
+        		} // for
+           //  lstModel.addElement(lyr.getName());
+            }
+            refreshList();
+            updateControls(null);
+	            
+ 		}
+		if (e.getActionCommand() == "REMOVE_LAYER")
+		{
+			if (jList.getSelectedIndex() != -1)
+			{
+				theLayers.removeLayer((String) lstModel.get(jList.getSelectedIndex()));
+				lstModel.remove(jList.getSelectedIndex());
+				///mapCtrl.drawMap();
+				updateControls(null);
+				  if (mapCtrl instanceof MapOverview){
+                	((MapOverview)mapCtrl).refreshExtent();
+                }
+			}
+		}
+		if (e.getActionCommand() == "EDIT_LEGEND")
+		{
+			int idSelec = jList.getSelectedIndex(); 
+			if (idSelec != -1)
+			{
+				FLayer lyr = theLayers.getLayer((String) lstModel.get(idSelec));
+				if (lyr instanceof Classifiable)
+				{
+					try {
+						theLayers.setActive(false);
+						lyr.setActive(true);
+						m_LegendEditor.setMapContext(mapCtrl.getMapContext());
+					} catch (DriverException e1) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
+					if (PluginServices.getMainFrame() == null) {
+						JDialog dlg = new JDialog();
+						    							
+						m_LegendEditor.setPreferredSize(m_LegendEditor.getSize());
+						dlg.getContentPane().add(m_LegendEditor);
+						dlg.setModal(true);			
+						dlg.pack();
+						dlg.show();
+						
+					} else
+						PluginServices.getMDIManager().addView(m_LegendEditor);					
+				}
+				else
+				{
+					JOptionPane.showMessageDialog(null, PluginServices.getText(this,"Solo para capas vectoriales")+".");
+				}
+
+			}
+
+		}
+		if (e.getActionCommand() == "UP")
+		{
+			int idSelec = jList.getSelectedIndex();
+		    int fromIndex = idSelec;
+		    int toIndex = idSelec-1;
+		        FLayer aux = theLayers.getLayer((String) lstModel.get(fromIndex));
+		        try {
+					theLayers.moveTo(numLayers-fromIndex, numLayers-toIndex);
+				} catch (CancelationException e1) {
+					e1.printStackTrace();
+				}
+		        
+		        lstModel.remove(fromIndex);
+		        lstModel.add(toIndex,aux.getName());
+		        
+		        jList.setSelectedIndex(toIndex);
+		        
+		        ///mapCtrl.drawMap();
+		}
+		if (e.getActionCommand() == "DOWN")
+		{
+			int idSelec = jList.getSelectedIndex();
+		    int fromIndex = idSelec;
+		    int toIndex = idSelec+1;
+		        FLayer aux = theLayers.getLayer((String) lstModel.get(fromIndex));
+		        try {
+		        	theLayers.moveTo(numLayers-fromIndex, numLayers-toIndex);
+				} catch (CancelationException e1) {
+					e1.printStackTrace();
+				}
+		        
+		        lstModel.remove(fromIndex);
+		        lstModel.add(toIndex,aux.getName());
+		        
+		        jList.setSelectedIndex(toIndex);
+		        
+		        ///mapCtrl.drawMap();
+		}
+		
+		
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		if (m_viewinfo==null){
+    		m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG);
+			m_viewinfo.setTitle(PluginServices.getText(this,"Configurar_localizador"));
+		}
+			return m_viewinfo;
+		}
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+        }  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelLocConfig.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListManagerSkin.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListManagerSkin.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListManagerSkin.java	(revision 1648)
@@ -0,0 +1,204 @@
+/* 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.gui;
+
+import javax.swing.JPanel;
+
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+
+import javax.swing.JScrollPane;
+import javax.swing.JList;
+import javax.swing.JButton;
+
+import com.iver.andami.PluginServices;
+import com.iver.utiles.listManager.ListManager;
+
+import java.awt.FlowLayout;
+public class ListManagerSkin extends JPanel {
+
+	private JScrollPane jScrollPane = null;
+	private JPanel jPanel = null;
+	private JButton jButton = null;
+	private JButton jButton1 = null;
+	private JButton jButton2 = null;
+	private JButton jButton3 = null;
+	
+	private ListManager listManager = new ListManager();
+	
+	private JList jList = null;
+	private JPanel jPanel1 = null;
+	/**
+	 * This method initializes jScrollPane	
+	 * 	
+	 * @return javax.swing.JScrollPane	
+	 */    
+	private JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new JScrollPane();
+			jScrollPane.setViewportView(getJList());
+			jScrollPane.setViewportView(getJList());
+		}
+		return jScrollPane;
+	}
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private JPanel getJPanel() {
+		if (jPanel == null) {
+			FlowLayout flowLayout2 = new FlowLayout();
+			jPanel = new JPanel();
+			jPanel.setLayout(flowLayout2);
+			flowLayout2.setAlignment(java.awt.FlowLayout.RIGHT);
+			jPanel.add(getJPanel1(), null);
+		}
+		return jPanel;
+	}
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJButton() {
+		if (jButton == null) {
+			jButton = new JButton();
+			jButton.setText(PluginServices.getText(this, "Abajo"));
+		}
+		return jButton;
+	}
+	/**
+	 * This method initializes jButton1	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJButton1() {
+		if (jButton1 == null) {
+			jButton1 = new JButton();
+			jButton1.setText(PluginServices.getText(this, "Arriba"));
+		}
+		return jButton1;
+	}
+	/**
+	 * This method initializes jButton2	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJButton2() {
+		if (jButton2 == null) {
+			jButton2 = new JButton();
+			jButton2.setText(PluginServices.getText(this, "Anadir"));
+		}
+		return jButton2;
+	}
+	/**
+	 * This method initializes jButton3	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */    
+	private JButton getJButton3() {
+		if (jButton3 == null) {
+			jButton3 = new JButton();
+			jButton3.setText(PluginServices.getText(this, "Eliminar"));
+		}
+		return jButton3;
+	}
+	/**
+	 * This method initializes jList	
+	 * 	
+	 * @return javax.swing.JList	
+	 */    
+	private JList getJList() {
+		if (jList == null) {
+			jList = new JList();
+		}
+		return jList;
+	}
+         	/**
+	 * This is the default constructor
+	 */
+	public ListManagerSkin() {
+		super();
+		initialize();
+	}
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private  void initialize() {
+		this.setLayout(new BorderLayout());
+		this.setSize(300, 248);
+		this.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
+		this.add(getJPanel(), java.awt.BorderLayout.EAST);
+		listManager.setBtnDown(getJButton());
+		listManager.setBtnUp(getJButton1());
+		listManager.setBtnAdd(getJButton2());
+		listManager.setBtnDel(getJButton3());
+		listManager.setList(getJList());
+		listManager.initialize();
+
+	}
+	/**
+	 * @return Returns the listManager.
+	 */
+	public ListManager getListManager() {
+		return listManager;
+	}
+	/**
+	 * This method initializes jPanel1	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private JPanel getJPanel1() {
+		if (jPanel1 == null) {
+			jPanel1 = new JPanel();
+			jPanel1.setPreferredSize(new java.awt.Dimension(100,180));
+			jPanel1.add(getJButton2(), null);
+			jPanel1.add(getJButton3(), null);
+			jPanel1.add(getJButton1(), null);
+			jPanel1.add(getJButton(), null);
+		}
+		return jPanel1;
+	}
+}  //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ListManagerSkin.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ValidatingTextField.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ValidatingTextField.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ValidatingTextField.java	(revision 1648)
@@ -0,0 +1,445 @@
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
+ * for visualizing and manipulating spatial features with geometry and attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ *
+ * 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:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+/* 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.gui;
+
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+
+import javax.swing.JTextField;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.PlainDocument;
+
+import com.vividsolutions.jts.util.Assert;
+
+
+/**
+ * Prevents the user from entering invalid data.
+ */
+public class ValidatingTextField extends JTextField {
+    public static final Validator LONG_VALIDATOR = new ValidatingTextField.Validator() {
+            public boolean isValid(String text) {
+                try {
+                    Long.parseLong(text.trim());
+
+                    return true;
+                } catch (NumberFormatException e) {
+                    return false;
+                }
+            }
+        };
+
+    /**
+     * Prevents the user from entering invalid integer.
+     */
+    public static final Validator INTEGER_VALIDATOR = new ValidatingTextField.Validator() {
+            public boolean isValid(String text) {
+                try {
+                    Integer.parseInt(text.trim());
+
+                    return true;
+                } catch (NumberFormatException e) {
+                    return false;
+                }
+            }
+        };
+
+    /**
+     * Prevents the user from entering invalid double.
+     */
+    public static final Validator DOUBLE_VALIDATOR = new ValidatingTextField.Validator() {
+            public boolean isValid(String text) {
+                try {
+                    //Add "0" so user can type "-" [Jon Aquino]
+                    Double.parseDouble(text.trim() + "0");
+
+                    return true;
+                } catch (NumberFormatException e) {
+                    return false;
+                }
+            }
+        };
+
+    /**
+     * Cleaner that does nothing.
+     */
+    public static Cleaner DUMMY_CLEANER = new Cleaner() {
+            public String clean(String text) {
+                return text;
+            }
+        };
+
+    /**
+     * The validators allow the user to simply enter "+", "-", or ".". If the user
+     * doesn't go any farther, this cleaner will set the text to 0, which is reasonable.
+     */
+    public static Cleaner NUMBER_CLEANER = new Cleaner() {
+            public String clean(String text) {
+                try {
+                    Double.parseDouble(text.trim());
+
+                    return text;
+                } catch (NumberFormatException e) {
+                    return "0";
+                }
+            }
+        };
+
+    /**
+     * Validator that does nothing.
+     */
+    public static Validator DUMMY_VALIDATOR = new Validator() {
+            public boolean isValid(String text) {
+                return true;
+            }
+        };
+
+    private Cleaner cleaner;
+
+    /**
+     * Validator that uses dummy cleaner.
+     */
+    public ValidatingTextField(String text, int columns,
+        final Validator validator) {
+        this(text, columns, LEFT, validator, DUMMY_CLEANER);
+    }
+
+    /**
+     * Validator for text fields.
+     */
+    public ValidatingTextField(String text, int columns,
+        int horizontalAlignment, final Validator validator,
+        final Cleaner cleaner) {
+        super(text, columns);
+        this.cleaner = cleaner;
+        setHorizontalAlignment(horizontalAlignment);
+        installValidationBehavior(this, validator, cleaner);
+
+        //Clean the text, mainly so that parties wishing to install a BlankCleaner
+        //need only pass "" for the text. [Jon Aquino]
+        setText(cleaner.clean(getText()));
+
+        //Bonus: workaround for how GridBagLayout shrinks components to
+        //minimum sizes if it can't accomodate their preferred sizes. [Jon Aquino]
+        setMinimumSize(getPreferredSize());
+    }
+
+    //Hopefully this will let us add validation behaviour to combo boxes. [Jon Aquino]
+    public static void installValidationBehavior(final JTextField textField,
+        final Validator validator, final Cleaner cleaner) {
+        textField.setDocument(new PlainDocument() {
+                public void insertString(int offs, String str, AttributeSet a)
+                    throws BadLocationException {
+                    String currentText = this.getText(0, getLength());
+                    String beforeOffset = currentText.substring(0, offs);
+                    String afterOffset = currentText.substring(offs,
+                            currentText.length());
+                    String proposedResult = beforeOffset + str + afterOffset;
+                    if (validator.isValid(cleaner.clean(proposedResult))) {
+                        super.insertString(offs, str, a);
+                    }
+                }
+
+                public void remove(int offs, int len)
+                    throws BadLocationException {
+                    String currentText = this.getText(0, getLength());
+                    String beforeOffset = currentText.substring(0, offs);
+                    String afterOffset = currentText.substring(len + offs,
+                            currentText.length());
+                    String proposedResult = beforeOffset + afterOffset;
+                    if (validator.isValid(cleaner.clean(proposedResult))) {
+                        super.remove(offs, len);
+                    }
+                }
+            });
+        textField.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    textField.setText(cleaner.clean(textField.getText()));
+                }
+            });
+    }
+
+    public String getText() {
+        //Focus may not be lost yet (e.g. when syncing with scrollbar) [Jon Aquino]
+        return cleaner.clean(super.getText());
+    }
+
+    public double getDouble() {
+        return Double.parseDouble(getText().trim());
+    }
+
+    public int getInteger() {
+        return Integer.parseInt(getText().trim());
+    }
+
+    public static interface Validator {
+        public boolean isValid(String text);
+    }
+
+    public static interface Cleaner {
+        public String clean(String text);
+    }
+
+/**
+ * Implements validator with a greater than threshold.
+ */
+
+    public static class GreaterThanValidator implements Validator {
+        private double threshold;
+
+        public GreaterThanValidator(double threshold) {
+            this.threshold = threshold;
+        }
+
+        public boolean isValid(String text) {
+            return Double.parseDouble(text.trim()) > threshold;
+        }
+    }
+/**
+ * Implements validator with a less than threshold.
+ */
+
+    public static class LessThanValidator implements Validator {
+        private double threshold;
+
+        public LessThanValidator(double threshold) {
+            this.threshold = threshold;
+        }
+
+        public boolean isValid(String text) {
+            return Double.parseDouble(text.trim()) < threshold;
+        }
+    }
+/**
+ * Implements validator with a greater than or equal to threshold.
+ */
+
+    public static class GreaterThanOrEqualValidator implements Validator {
+        private double threshold;
+
+        public GreaterThanOrEqualValidator(double threshold) {
+            this.threshold = threshold;
+        }
+
+        public boolean isValid(String text) {
+            return Double.parseDouble(text.trim()) >= threshold;
+        }
+    }
+/**
+ * Implements validator with a less than or equal to threshold.
+ */
+
+    public static class LessThanOrEqualValidator implements Validator {
+        private double threshold;
+
+        public LessThanOrEqualValidator(double threshold) {
+            this.threshold = threshold;
+        }
+
+        public boolean isValid(String text) {
+            return Double.parseDouble(text.trim()) <= threshold;
+        }
+    }
+    
+    /**
+ * Implements cleaner which cleans up blank strings.
+ */
+
+
+    public static class BlankCleaner implements Cleaner {
+        private String replacement;
+
+        public BlankCleaner(String replacement) {
+            this.replacement = replacement;
+        }
+
+        public String clean(String text) {
+            return (text.trim().length() == 0) ? replacement : text;
+        }
+    }
+    
+    /**
+     * Allow the user to start typing a number with "-" or "."
+     * @author jaquino
+     *
+     * To change the template for this generated type comment go to
+     * Window>Preferences>Java>Code Generation>Code and Comments
+     */
+    public static class NumberCleaner implements Cleaner {
+        private String textToAppend;
+
+        public NumberCleaner(String textToAppend) {
+            this.textToAppend = textToAppend;
+        }
+
+        public String clean(String text) {
+            if (text.trim().length() == 0) { return text; }
+            try {
+                Double.parseDouble(text);
+                return text;
+            }
+            catch (NumberFormatException e) {
+                return text + textToAppend;
+            }
+        }
+    }    
+
+    public static class MinIntCleaner implements Cleaner {
+        private int minimum;
+
+        public MinIntCleaner(int minimum) {
+            this.minimum = minimum;
+        }
+
+        public String clean(String text) {
+            return "" + Math.max(minimum, Integer.parseInt(text));
+        }
+    }
+
+/**
+ * Extends CompositeValidator to validat that integers is within a set of boundary values.
+ */
+    public static class BoundedIntValidator extends CompositeValidator {
+        public BoundedIntValidator(int min, int max) {
+            super(new Validator[] {
+                    INTEGER_VALIDATOR, new GreaterThanOrEqualValidator(min),
+                    new LessThanOrEqualValidator(max)
+                });
+            Assert.isTrue(min < max);
+        }
+    }
+
+    public static class BoundedDoubleValidator extends CompositeValidator {
+        public BoundedDoubleValidator(double min, boolean includeMin,
+            double max, boolean includeMax) {
+            super(new Validator[] {
+                    DOUBLE_VALIDATOR,
+                    includeMin
+                    ? (Validator) new GreaterThanOrEqualValidator(min)
+                    : new GreaterThanValidator(min),
+                    includeMax ? (Validator) new LessThanOrEqualValidator(max)
+                               : new LessThanValidator(max)
+                });
+            Assert.isTrue(min < max);
+        }
+    }
+
+    public static class MaxIntCleaner implements Cleaner {
+        private int maximum;
+
+        public MaxIntCleaner(int maximum) {
+            this.maximum = maximum;
+        }
+
+        public String clean(String text) {
+            return "" + Math.min(maximum, Integer.parseInt(text));
+        }
+    }
+/**
+ * Implements validator to check for more than one condition.
+ */
+
+    public static class CompositeValidator implements Validator {
+        private Validator[] validators;
+
+        public CompositeValidator(Validator[] validators) {
+            this.validators = validators;
+        }
+
+        public boolean isValid(String text) {
+            for (int i = 0; i < validators.length; i++) {
+                if (!validators[i].isValid(text)) {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+    }
+
+    public static class CompositeCleaner implements Cleaner {
+        private Cleaner[] cleaners;
+
+        public CompositeCleaner(Cleaner[] cleaners) {
+            this.cleaners = cleaners;
+        }
+
+        public String clean(String text) {
+            String result = text;
+            for (int i = 0; i < cleaners.length; i++) {
+                result = cleaners[i].clean(result);
+            }
+
+            return result;
+        }
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/ValidatingTextField.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutDraw.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutDraw.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutDraw.java	(revision 1648)
@@ -0,0 +1,482 @@
+/*
+ * Created on 27-sep-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.gui.layout;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+
+/**
+ * Clase que implementa los m�todos del Layout que dibujan sobre el Graphics.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FLayoutDraw {
+	private Layout layout;
+
+	/**
+	 * Crea un nuevo FLayoutDraw.
+	 *
+	 * @param l Referencia al Layout.
+	 */
+	public FLayoutDraw(Layout l) {
+		layout = l;
+	}
+
+	/**
+	 * M�todo para dibujar el Layout y modificar la matriz de transformaci�n  a
+	 * partir del tama�o en pixels que tenga rect y el formato de papel
+	 * seleccionado.
+	 *
+	 * @param g2
+	 * @param imgBase Si es null, est�s imprimiendo. Si no, la usas para el
+	 * 		  c�digo de  optimizaci�n.
+	 *
+	 * @throws DriverException
+	 */
+	public void drawLayout(Graphics2D g2, BufferedImage imgBase)
+		throws DriverException {
+		/* PluginServices.getMainFrame().getStatusBar().setMessage("1",
+		   layout.getAtributes().getNameUnit());
+		 */
+		layout.setCancelDrawing(false);
+
+		double scale = 0;
+
+		scale = layout.getRect().height / layout.getAtributes().m_sizePaper.getAlto() * 1;
+
+		AffineTransform escalado = new AffineTransform();
+		AffineTransform translacion = new AffineTransform();
+		translacion.setToTranslation(layout.getRect().getMinX(),
+			layout.getRect().getMinY());
+		escalado.setToScale(scale, scale);
+		layout.getAT().setToIdentity();
+		layout.getAT().concatenate(translacion);
+		layout.getAT().concatenate(escalado);
+		layout.getAtributes().setDistanceUnitX(layout.getRect());
+		layout.getAtributes().setDistanceUnitY(layout.getRect());
+
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			if (layout.getFFrames().get(i) instanceof FFrameView) {
+				FFrameView fframe = (FFrameView) layout.getFFrames().get(i);
+				Rectangle2D rec = fframe.getBoundingBox(layout.getAT());
+				rec = rec.createIntersection(layout.getVisibleRect());
+
+				BufferedImage img = new BufferedImage((int) layout.getWidth(),
+						(int) layout.getHeight(), BufferedImage.TYPE_INT_ARGB);
+				((Graphics2D) img.getGraphics()).clipRect((int) rec.getMinX(),
+					(int) rec.getMinY(), (int) rec.getWidth(),
+					(int) rec.getHeight());
+				fframe.draw((Graphics2D) img.getGraphics(), layout.getAT(),
+					layout.getVisibleRect(), imgBase);
+
+				if (fframe.getFMap() != null) {
+					fframe.setAt((AffineTransform) fframe.getFMap().getViewPort()
+														 .getAffineTransform()
+														 .clone());
+				}
+
+				fframe.setBufferedImage(img);
+			}
+		}
+
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			if (layout.getFFrames().get(i) instanceof FFrameView) {
+				g2.drawImage(((FFrameView) layout.getFFrames().get(i)).getBufferedImage(),
+					0, 0, layout);
+			} else {
+				((IFFrame) layout.getFFrames().get(i)).draw(g2, layout.getAT(),
+					layout.getVisibleRect(), imgBase);
+			}
+
+			//          Dibuja el s�mbolo de que contiene un tag.
+			if (((IFFrame) layout.getFFrames().get(i)).getTag() != null) {
+				((IFFrame) layout.getFFrames().get(i)).drawSymbolTag(g2);
+			}
+		}
+
+		if (!layout.getFFrames().isEmpty()) {
+			layout.setStatus(Layout.ACTUALIZADO);
+		} else {
+			layout.setStatus(Layout.DESACTUALIZADO);
+		}
+	}
+
+	/**
+	 * Dibuja sobre un Graphics2D el rect�ngulo que representa al folio.
+	 *
+	 * @param g Graphics2D
+	 */
+	public void drawRectangle(Graphics2D g) {
+		double unidadesX = layout.getAtributes().getUnitInPixelsX();
+		double unidadesY = layout.getAtributes().getUnitInPixelsY();
+
+		if ((unidadesX == 0) && (unidadesY == 0)) {
+			return;
+		}
+
+		g.setColor(Color.red);
+
+		Rectangle2D.Double rectBig = new Rectangle2D.Double(layout.getRect().x,
+				layout.getRect().y, layout.getRect().width,
+				layout.getRect().height);
+
+		g.fill3DRect((int) rectBig.x + 10, (int) rectBig.y + 10,
+			(int) rectBig.width, (int) rectBig.height, true);
+
+		Rectangle2D.Double r = new Rectangle2D.Double();
+
+		if (layout.getAtributes().isMargin()) {
+			r = new Rectangle2D.Double((layout.getRect().x +
+					FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[2], layout.getAT())),
+					(layout.getRect().y +
+					FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[0], layout.getAT())),
+					(layout.getRect().width -
+					FLayoutUtilities.fromSheetDistance(layout.getAtributes().m_area[2] +
+						layout.getAtributes().m_area[3], layout.getAT())),
+					(layout.getRect().height -
+					FLayoutUtilities.fromSheetDistance(layout.getAtributes().m_area[0] +
+						layout.getAtributes().m_area[1], layout.getAT())));
+		} else {
+			r.setRect(layout.getRect());
+		}
+
+		g.setColor(Color.white);
+		g.fill(layout.getRect());
+
+		g.setColor(Color.blue);
+		g.drawRect((int) layout.getRect().getMinX(),
+			(int) layout.getRect().getMinY(),
+			(int) layout.getRect().getWidth(),
+			(int) layout.getRect().getHeight());
+
+		if (layout.getAtributes().isMargin()) {
+			g.setColor(Color.black);
+
+			g.drawRect((int) r.x, (int) r.y, (int) r.width, (int) r.height);
+		}
+	}
+
+	public void drawGrid(Graphics2D g)
+	{
+		int unidadesMin = 6;
+		double unidadesX = layout.getAtributes().getUnitInPixelsX();
+		double unidadesY = layout.getAtributes().getUnitInPixelsY();
+
+		if ((unidadesX == 0) && (unidadesY == 0)) {
+			return;
+		}
+		Rectangle2D.Double rectBig = new Rectangle2D.Double(layout.getRect().x,
+				layout.getRect().y, layout.getRect().width,
+				layout.getRect().height);
+		Rectangle2D.Double r = new Rectangle2D.Double();
+
+		if (layout.getAtributes().isMargin()) {
+			r = new Rectangle2D.Double((layout.getRect().x +
+					FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[2], layout.getAT())),
+					(layout.getRect().y +
+					FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[0], layout.getAT())),
+					(layout.getRect().width -
+					FLayoutUtilities.fromSheetDistance(layout.getAtributes().m_area[2] +
+						layout.getAtributes().m_area[3], layout.getAT())),
+					(layout.getRect().height -
+					FLayoutUtilities.fromSheetDistance(layout.getAtributes().m_area[0] +
+						layout.getAtributes().m_area[1], layout.getAT())));
+		} else {
+			r.setRect(layout.getRect());
+		}
+
+		g.setColor(Color.BLUE);
+		if (((unidadesX > unidadesMin) || (unidadesY > unidadesMin)) &&
+				layout.getIsDrawGrid()) {
+			double ax = r.getMinX();
+			double ay;
+
+			while (ax < (r.getMaxX())) {
+				ay = (r.getMinY());
+
+				while (ay < (r.getMaxY())) {
+					g.drawLine((int) ax, (int) ay, (int) ax, (int) ay);
+					ay = ay + unidadesY;
+				}
+
+				ax = ax + unidadesX;
+			}
+		}
+
+	}
+	/**
+	 * Dibuja sobre el graphics2d las reglas.
+	 *
+	 * @param g graphics2d sobre el que se dibuja.
+	 * @param color Color de la regla.
+	 */
+	public void drawRuler(Graphics2D g, Color color) {
+		if (layout.getRuler()) {
+			int ini = 10;
+			int w = 30;
+			int wi = 16;
+
+			g.setColor(new Color(250, 255, 250, 180));
+			g.fillRect(ini, w, wi, layout.getHeight() - w);
+			g.fillRect(w, ini, layout.getWidth() - w, wi);
+
+			g.setColor(new Color(100, 155, 150, 180));
+			g.fillRect(w, ini, (int) layout.getRect().x - w, wi);
+			g.fillRect((int) layout.getRect().getMaxX(), ini,
+				(int) layout.getWidth() - (int) layout.getRect().getMaxX(), wi);
+
+			g.fillRect(ini, w, wi, (int) layout.getRect().y - w);
+			g.fillRect(ini, (int) layout.getRect().getMaxY(), wi,
+				(int) layout.getHeight() - (int) layout.getRect().getMaxY());
+
+			if (layout.getAtributes().isMargin()) {
+				g.setColor(new Color(50, 55, 50, 180));
+				g.fillRect((int) layout.getRect().x, ini,
+					(int) FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[2], layout.getAT()), wi);
+				g.fillRect((int) layout.getRect().getMaxX() -
+					(int) FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[3], layout.getAT()), ini,
+					(int) FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[3], layout.getAT()), wi);
+
+				g.fillRect(ini, (int) layout.getRect().y, wi,
+					(int) FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[0], layout.getAT()));
+				g.fillRect(ini,
+					(int) layout.getRect().getMaxY() -
+					(int) FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[1], layout.getAT()), wi,
+					(int) FLayoutUtilities.fromSheetDistance(
+						layout.getAtributes().m_area[1], layout.getAT()));
+			}
+
+			g.setColor(color);
+			g.drawLine(w, wi + ini, layout.getWidth(), wi + ini);
+			g.drawLine(w, ini, layout.getWidth(), ini);
+			g.drawLine(ini, w, ini, layout.getHeight());
+			g.drawLine(wi + ini, w, wi + ini, layout.getHeight());
+
+			drawLineY(g, 5, 12, 22, layout.getRect().y, 0);
+			drawLineX(g, 5, 12, 22, layout.getRect().x, 0);
+
+			if (FLayoutUtilities.fromSheetDistance(1, layout.getAT()) > 15) {
+				drawLineY(g, 1, 12, 22, layout.getRect().y, 0);
+				drawLineX(g, 1, 12, 22, layout.getRect().x, 0);
+
+				if (FLayoutUtilities.fromSheetDistance(1, layout.getAT()) > 25) {
+					drawLineY(g, 1, 18, 22, layout.getRect().y, 0.5);
+					drawLineY(g, 0.1, 21, 22, layout.getRect().y, 0);
+					drawLineX(g, 1, 18, 22, layout.getRect().x, 0.5);
+					drawLineX(g, 0.1, 21, 22, layout.getRect().x, 0);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Dibuja sobre el graphics2d las l�neas verticales que representan a las
+	 * unidades de medida.
+	 *
+	 * @param g Graphics2d sobre el que se dibuja.
+	 * @param dist distancia en cent�metros de una l�nea a otra.
+	 * @param init inicio de la l�nea.
+	 * @param end fin de la l�nea.
+	 * @param y rect�ngulo, dentro del cual se dibujan las l�neas.
+	 * @param desp Desplazamiento.
+	 */
+	private void drawLineY(Graphics2D g, double dist, int init, int end,
+		double y, double desp) {
+		double distY = FLayoutUtilities.fromSheetDistance(dist, layout.getAT());
+		double rota = Math.toRadians(90);
+
+		if (distY > 4) {
+			double despY = FLayoutUtilities.fromSheetDistance(desp,
+					layout.getAT());
+
+			double posUnitY = y + despY;
+			double posUnitYNeg = posUnitY;
+			int num = 0;
+			double iniY = 40;
+			Point2D.Double pfin = FLayoutUtilities.fromSheetPoint(new Point2D.Double(
+						layout.getWidth(), layout.getHeight()), layout.getAT());
+
+			while (posUnitY < (pfin.y - 5)) {
+				posUnitYNeg -= distY;
+
+				if (distY > 16) {
+					if (init == 12) {
+						if (posUnitY > iniY) {
+							g.rotate(-rota, 20, posUnitY - 12);
+							g.drawString(String.valueOf(num), (int) 10,
+								(int) posUnitY - 12);
+							g.rotate(rota, 20, posUnitY - 12);
+						}
+
+						if (dist == 5) {
+							num = num + 5;
+						} else {
+							num++;
+						}
+
+						if (posUnitYNeg > iniY) {
+							g.rotate(-rota, 20, posUnitYNeg - 12);
+							g.drawString(String.valueOf(-num), (int) 10,
+								(int) posUnitYNeg - 12);
+							g.rotate(rota, 20, posUnitYNeg - 12);
+						}
+					}
+				}
+
+				if (posUnitY > iniY) {
+					g.drawLine((int) 2 + init, (int) posUnitY, (int) 2 + end,
+						(int) posUnitY);
+				}
+
+				if (posUnitYNeg > iniY) {
+					g.drawLine((int) 2 + init, (int) posUnitYNeg,
+						(int) 2 + end, (int) posUnitYNeg);
+				}
+
+				posUnitY += distY;
+			}
+		}
+	}
+
+	/**
+	 * Dibuja sobre el graphics2d las l�neas horizontales que representan a las
+	 * unidades de medida.
+	 *
+	 * @param g Graphics2d sobre el que se dibuja.
+	 * @param dist distancia en cent�metros de una l�nea a otra.
+	 * @param init inicio de la l�nea.
+	 * @param end fin de la l�nea.
+	 * @param x rect�ngulo, dentro del cual se dibujan las l�neas.
+	 * @param desp Desplazamiento.
+	 */
+	private void drawLineX(Graphics2D g, double dist, int init, int end,
+		double x, double desp) {
+		double distX = FLayoutUtilities.fromSheetDistance(dist, layout.getAT());
+
+		if (distX > 4) {
+			double despX = FLayoutUtilities.fromSheetDistance(desp,
+					layout.getAT());
+			double posUnitX = x + despX;
+			double posUnitXNeg = posUnitX;
+			int num = 0;
+			double iniX = 40;
+			Point2D.Double pfin = FLayoutUtilities.fromSheetPoint(new Point2D.Double(
+						layout.getWidth(), layout.getHeight()), layout.getAT());
+
+			while (posUnitX < (pfin.x - 5)) {
+				posUnitXNeg -= distX;
+
+				if (init == 12) {
+					if (distX > 16) {
+						if (posUnitX > iniX) {
+							g.drawString(String.valueOf(num),
+								(int) posUnitX + 3, (int) 20);
+						}
+
+						if (dist == 5) {
+							num = num + 5;
+						} else {
+							num++;
+						}
+
+						if (posUnitXNeg > iniX) {
+							g.drawString(String.valueOf(-num),
+								(int) posUnitXNeg + 3, (int) 20);
+						}
+					}
+				}
+
+				if (posUnitX > iniX) {
+					g.drawLine((int) posUnitX, (int) 2 + init, (int) posUnitX,
+						(int) 2 + end);
+				}
+
+				if (posUnitXNeg > iniX) {
+					g.drawLine((int) posUnitXNeg, (int) 2 + init,
+						(int) posUnitXNeg, (int) 2 + end);
+				}
+
+				posUnitX += distX;
+			}
+		}
+	}
+
+	/**
+	 * Dibuja los handlers sobre los fframes que esten seleccionados.
+	 *
+	 * @param g Graphics sobre el que se dibuja.
+	 * @param color Color de los Handlers.
+	 */
+	public void drawHandlers(Graphics2D g, Color color) {
+		g.setColor(color);
+
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != FFrame.NOSELECT) {
+				fframe.drawHandlers((Graphics2D) g);
+			}
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutDraw.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/EventsHandler.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/EventsHandler.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/EventsHandler.java	(revision 1648)
@@ -0,0 +1,395 @@
+/*
+ * Created on 27-jul-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.gui.layout;
+
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import java.awt.Cursor;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import java.util.ArrayList;
+
+
+/**
+ * Eventos que se realizan sobre el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class EventsHandler implements ActionListener, ComponentListener,
+	MouseMotionListener, MouseListener {
+	private Layout layout = null;
+	private Point2D.Double m_pointSelected = null;
+	private int index = 0;
+	private ArrayList lastSelect = new ArrayList();
+	private FLayoutFunctions events = null;
+	private FLayoutZooms zooms = null;
+
+	/**
+	 * Crea un nuevo EventsHandler.
+	 *
+	 * @param l Referencia al Layout.
+	 */
+	public EventsHandler(Layout l) {
+		layout = l;
+		events = new FLayoutFunctions(layout);
+		zooms = new FLayoutZooms(layout);
+	}
+
+	/**
+	 * @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent)
+	 */
+	public void componentHidden(ComponentEvent arg0) {
+	}
+
+	/**
+	 * @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent)
+	 */
+	public void componentMoved(ComponentEvent arg0) {
+	}
+
+	/**
+	 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
+	 */
+	public void componentResized(ComponentEvent arg0) {
+		layout.fullRect();
+	}
+
+	/**
+	 * @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent)
+	 */
+	public void componentShown(ComponentEvent arg0) {
+	}
+
+	/**
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent arg0) {
+		layout.repaint();
+	}
+
+	/**
+	 * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
+	 */
+	public void mouseDragged(MouseEvent e) {
+		if (e.getButton() != MouseEvent.BUTTON3) {
+			layout.setLastPoint(e.getPoint());
+			layout.repaint();
+		}
+	}
+
+	/**
+	 * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent)
+	 */
+	public void mouseMoved(MouseEvent E) {
+		if (layout.getTool() == Layout.SELECT) {
+			Cursor cursor = null;
+			Point2D.Double p = new Point2D.Double(E.getX(), E.getY());
+
+			for (int i = 0; i < layout.getFFrames().size(); i++) {
+				IFFrame auxfframe = (IFFrame) layout.getFFrames().get(i);
+
+				if ((auxfframe.getSelected() != FFrame.NOSELECT)) {
+					cursor = auxfframe.getMapCursor(p);
+				}
+
+				if (cursor != null) {
+					layout.setMapCursor(cursor);
+				} else {
+					layout.setMapCursor(Layout.icrux);
+				}
+			}
+		}
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+	 */
+	public void mouseClicked(MouseEvent E) {
+		if (E.getButton() == MouseEvent.BUTTON1) {
+			if (layout.getTool() == Layout.SELECT) {
+				m_pointSelected = new Point2D.Double(E.getX(), E.getY());
+
+				int i = layout.getFFrames().size() - 1;
+				boolean isSelect = false;
+
+				if (layout.getFFrames().size() > 0) {
+					ArrayList listSelect = new ArrayList();
+
+					for (int j = 0; j < layout.getFFrames().size(); j++) {
+						if (((IFFrame) layout.getFFrames().get(j)).getContains(
+									m_pointSelected) != FFrame.NOSELECT) {
+							listSelect.add((IFFrame) layout.getFFrames().get(j));
+						}
+					}
+
+					if (listSelect.size() > 0) {
+						for (int k = 0; k < listSelect.size(); k++) {
+							if (((IFFrame) listSelect.get(k)).getSelected() != FFrame.NOSELECT) {
+								index = listSelect.size() - k;
+
+								break;
+							}
+						}
+
+						if (!FLayoutUtilities.isEqualList(listSelect, lastSelect) ||
+								(index > (listSelect.size() - 1))) {
+							index = 0;
+						}
+
+						for (int j = 0; j < layout.getFFrames().size(); j++) {
+							IFFrame fframe = (IFFrame) layout.getFFrames().get(j);
+
+							if (!E.isShiftDown()) {
+								fframe.setSelected(false);
+							} else {
+								if (fframe.getSelected() != FFrame.NOSELECT) {
+									if (fframe.getContains(m_pointSelected) != FFrame.NOSELECT) {
+										fframe.setSelected(false);
+									}
+								}
+							}
+						}
+
+						((IFFrame) listSelect.get((listSelect.size() - 1 -
+							index))).setSelected(true);
+						index++;
+						lastSelect = listSelect;
+					}
+
+					layout.setStatus(Layout.SELECT);
+					layout.repaint();
+
+					if (E.getClickCount() > 1) {
+						FLayoutGraphics flg = new FLayoutGraphics(layout);
+						flg.openFFrameDialog();
+						layout.setStatus(Layout.DESACTUALIZADO);
+						layout.repaint();
+
+						//layout.setStatus(Layout.SELECT);
+					}
+				}
+			}
+		} else if (E.getButton() == MouseEvent.BUTTON2) {
+		}
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
+	 */
+	public void mouseEntered(MouseEvent arg0) {
+		/* TODO        PluginServices.getMainFrame().getStatusBar().setMessage("0",
+		   layout.getAtributes().getNameUnit());
+		 */
+		if (layout.getTool() == Layout.PAN) {
+			layout.setMapCursor(Layout.iLayoutpan);
+		} else if (layout.getTool() == Layout.ZOOM_MAS) {
+			layout.setMapCursor(Layout.iLayoutzoomin);
+		} else if (layout.getTool() == Layout.ZOOM_MENOS) {
+			layout.setMapCursor(Layout.iLayoutzoomout);
+		} else if (layout.getTool() == Layout.VIEW_PAN) {
+			layout.setMapCursor(Layout.ipan);
+		} else if (layout.getTool() == Layout.VIEW_ZOOMIN) {
+			layout.setMapCursor(Layout.izoomin);
+		} else if (layout.getTool() == Layout.VIEW_ZOOMOUT) {
+			layout.setMapCursor(Layout.izoomout);
+		}
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
+	 */
+	public void mouseExited(MouseEvent arg0) {
+		///TODO	PluginServices.getMainFrame().getStatusBar().setMessage("0", "");
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public void mousePressed(MouseEvent E) {
+		if (E.getButton() == MouseEvent.BUTTON1) {
+			Point pScreen = new Point(E.getX(), E.getY());
+			layout.setPointAnt(pScreen);
+			layout.setFirstPoint(layout.getPointAnt());
+
+			if ((layout.getTool() == Layout.ZOOM_MAS) ||
+					(layout.getTool() == Layout.VIEW_ZOOMIN)) {
+				layout.setStatus(Layout.ZOOM_MAS);
+			} else if ((layout.getTool() == Layout.RECTANGLEVIEW) ||
+					(layout.getTool() == Layout.RECTANGLEPICTURE) ||
+					(layout.getTool() == Layout.RECTANGLESCALEBAR) ||
+					(layout.getTool() == Layout.RECTANGLELEGEND) ||
+					(layout.getTool() == Layout.RECTANGLETEXT)) {
+				layout.setStatus(Layout.RECTANGLE);
+			} else if ((layout.getTool() == Layout.POINT) ||
+					(layout.getTool() == Layout.LINE) ||
+					(layout.getTool() == Layout.POLYLINE) ||
+					(layout.getTool() == Layout.RECTANGLESIMPLE) ||
+					(layout.getTool() == Layout.CIRCLE) ||
+					(layout.getTool() == Layout.POLYGON)) {
+				layout.setStatus(Layout.RECTANGLE);
+			} else if (layout.getTool() == Layout.PAN) {
+				layout.getRectOrigin().setLocation(layout.getRect().x,
+					layout.getRect().y);
+				layout.setStatus(Layout.PAN);
+			} else if (layout.getTool() == Layout.VIEW_PAN) {
+				/*        layout.getRectOrigin().setLocation(layout.getRect().x,
+				   layout.getRect().y);
+				 */
+				layout.setStatus(Layout.VIEW_PAN);
+			} else if (layout.getTool() == Layout.ZOOM_MENOS) {
+				layout.setCancelDrawing(true);
+			} else if ((layout.getTool() == Layout.ZOOM_MAS) ||
+					(layout.getTool() == Layout.PAN)) {
+				layout.setCancelDrawing(true);
+			} else if (layout.getTool() == Layout.SELECT) {
+				m_pointSelected = new Point2D.Double(E.getX(), E.getY());
+
+				for (int i = 0; i < layout.getFFrames().size(); i++) {
+					IFFrame fframe = ((IFFrame) layout.getFFrames().get(i));
+
+					if (m_pointSelected != null) {
+						if (!E.isShiftDown()) {
+							if ((fframe.getSelected() != FFrame.NOSELECT)) {
+								fframe.setSelected(m_pointSelected);
+							}
+						}
+					}
+
+					if (fframe.getSelected() != FFrame.NOSELECT) {
+						layout.setIsReSel(false);
+					}
+				}
+
+				if ((layout.getLastPoint() != null) &&
+						(layout.getFirstPoint() != null)) {
+					layout.getLastPoint().setLocation(layout.getFirstPoint());
+				}
+
+				if (E.getClickCount() < 2) {
+					layout.setStatus(Layout.SELECT);
+					layout.repaint();
+				}
+			} else if (layout.getTool() == Layout.POINT) {
+				FFrameGraphics fframepoint = new FFrameGraphics();
+				fframepoint.setBoundBox(FLayoutUtilities.toSheetRect(
+						new Rectangle2D.Double(E.getX(), E.getY(), 20, 20),
+						layout.getAT()));
+				fframepoint.update(Layout.POINT, layout.getAT());
+				layout.addFFrame(fframepoint, true);
+			} else if (layout.getTool() == Layout.SET_TAG) {
+				m_pointSelected = new Point2D.Double(E.getX(), E.getY());
+
+				for (int i = 0; i < layout.getFFrames().size(); i++) {
+					IFFrame fframe = ((IFFrame) layout.getFFrames().get(i));
+
+					if (m_pointSelected != null) {
+						if (fframe.contains(m_pointSelected)) {
+							fframe.openTag();
+						}
+					}
+				}
+			}
+		} else if (E.getButton() == MouseEvent.BUTTON3) {
+			Popupmenu popupmenu = new Popupmenu(layout, E.getPoint());
+		}
+	}
+
+	/**
+	 * @see java.awt.event.MouseListener#mouseReleassed(java.awt.event.MouseEvent)
+	 */
+	public void mouseReleased(MouseEvent E) {
+		if (E.getButton() == MouseEvent.BUTTON1) {
+			Point p1 = layout.getFirstPoint();
+			Point p2 = new Point(E.getX(), E.getY());
+			IFFrame fframe = null;
+			boolean isadd = false;
+
+			layout.setStatus(Layout.DESACTUALIZADO);
+
+			if (layout.getTool() == Layout.ZOOM_MAS) {
+				zooms.setZoomIn(p1, p2);
+			} else if ((layout.getTool() == Layout.ZOOM_MENOS) ||
+					(E.getButton() == MouseEvent.BUTTON3)) {
+				zooms.setZoomOut(p2);
+			} else if (layout.getTool() == Layout.SELECT) {
+				events.setSelect();
+			} else if ((layout.getTool() == Layout.RECTANGLEVIEW) ||
+					(layout.getTool() == Layout.RECTANGLEPICTURE) ||
+					(layout.getTool() == Layout.RECTANGLESCALEBAR) ||
+					(layout.getTool() == Layout.RECTANGLELEGEND) ||
+					(layout.getTool() == Layout.RECTANGLETEXT) ||
+					(layout.getTool() == Layout.RECTANGLESIMPLE) ||
+					(layout.getTool() == Layout.LINE) ||
+					(layout.getTool() == Layout.POLYLINE) ||
+					(layout.getTool() == Layout.POLYGON) ||
+					(layout.getTool() == Layout.CIRCLE) ||
+					(layout.getTool() == Layout.POINT)) {
+				events.setFFrame();
+			} else if (layout.getTool() == Layout.VIEW_ZOOMIN) {
+				zooms.setViewZoomIn(p1, p2);
+			} else if (layout.getTool() == Layout.VIEW_ZOOMOUT) {
+				zooms.setViewZoomOut(p2);
+			} else if (layout.getTool() == Layout.VIEW_PAN) {
+				events.setViewPan(p1, p2);
+			}
+
+			layout.setCancelDrawing(false);
+		} else if (E.getButton() == MouseEvent.BUTTON3) {
+		}
+
+		layout.repaint();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/EventsHandler.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FAlignDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FAlignDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FAlignDialog.java	(revision 1648)
@@ -0,0 +1,588 @@
+/*
+ * Created on 19-jul-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.gui.layout.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.Abrir;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JToggleButton;
+
+
+/**
+ * Contenedor de los botones necesarios para alinear, desplazar y cambiar el
+ * tama�o de los fframes.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FAlignDialog extends JPanel implements SingletonView {
+	private static final ImageIcon ileft = new ImageIcon(Abrir.class.getClassLoader()
+																	.getResource("images/left.PNG"));
+	private static final ImageIcon icenterV = new ImageIcon(Abrir.class.getClassLoader()
+																	   .getResource("images/centerV.PNG"));
+	private static final ImageIcon iright = new ImageIcon(Abrir.class.getClassLoader()
+																	 .getResource("images/right.PNG"));
+	private static final ImageIcon iup = new ImageIcon(Abrir.class.getClassLoader()
+																  .getResource("images/up.PNG"));
+	private static final ImageIcon icenterH = new ImageIcon(Abrir.class.getClassLoader()
+																	   .getResource("images/centerH.PNG"));
+	private static final ImageIcon idown = new ImageIcon(Abrir.class.getClassLoader()
+																	.getResource("images/down.PNG"));
+	private static final ImageIcon idistUp = new ImageIcon(Abrir.class.getClassLoader()
+																	  .getResource("images/distUp.PNG"));
+	private static final ImageIcon idistCenterH = new ImageIcon(Abrir.class.getClassLoader()
+																		   .getResource("images/distCenterH.PNG"));
+	private static final ImageIcon idistDown = new ImageIcon(Abrir.class.getClassLoader()
+																		.getResource("images/distDown.PNG"));
+	private static final ImageIcon idistLeft = new ImageIcon(Abrir.class.getClassLoader()
+																		.getResource("images/distLeft.PNG"));
+	private static final ImageIcon idistCenterV = new ImageIcon(Abrir.class.getClassLoader()
+																		   .getResource("images/distCenterV.PNG"));
+	private static final ImageIcon idistRight = new ImageIcon(Abrir.class.getClassLoader()
+																		 .getResource("images/distRight.PNG"));
+	private static final ImageIcon isizeWidth = new ImageIcon(Abrir.class.getClassLoader()
+																		 .getResource("images/sizeWidth.PNG"));
+	private static final ImageIcon isizeHeight = new ImageIcon(Abrir.class.getClassLoader()
+																		  .getResource("images/sizeHeight.PNG"));
+	private static final ImageIcon isizeOther = new ImageIcon(Abrir.class.getClassLoader()
+																		 .getResource("images/sizeOther.PNG"));
+	private static final ImageIcon ispaceRight = new ImageIcon(Abrir.class.getClassLoader()
+																		  .getResource("images/spaceRight.PNG"));
+	private static final ImageIcon ispaceDown = new ImageIcon(Abrir.class.getClassLoader()
+																		 .getResource("images/spaceDown.PNG"));
+	private static final ImageIcon iinLayout = new ImageIcon(Abrir.class.getClassLoader()
+																		.getResource("images/inLayout.PNG"));
+	private javax.swing.JButton bleft = null;
+	private javax.swing.JButton bcenterV = null;
+	private javax.swing.JButton bright = null;
+	private javax.swing.JButton bup = null;
+	private javax.swing.JButton bcenterH = null;
+	private javax.swing.JButton bdown = null;
+	private javax.swing.JButton bdistUp = null;
+	private Layout m_layout = null;
+	private javax.swing.JLabel lAlineamiento = null;
+	private javax.swing.JLabel lDistribuir = null;
+	private javax.swing.JButton bdistcenterV = null;
+	private javax.swing.JButton bdistDown = null;
+	private javax.swing.JButton bdistLeft = null;
+	private javax.swing.JButton bdistcenterH = null;
+	private javax.swing.JButton bdistRight = null;
+	private javax.swing.JLabel lSize = null;
+	private javax.swing.JButton bsizecenterV = null;
+	private javax.swing.JButton bsizecenterH = null;
+	private javax.swing.JButton bsizeother = null;
+	private javax.swing.JButton bspaceRight = null;
+	private javax.swing.JButton bspaceDown = null;
+	private javax.swing.JLabel lEspacio = null;
+	private javax.swing.JLabel lEnElMapa = null;
+	private JToggleButton binLayout = null;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layout Referencia al Layout.
+	 */
+	public FAlignDialog(Layout layout) {
+		super();
+		m_layout = layout;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(null);
+
+		EventsFAlign listener = new EventsFAlign(m_layout);
+		this.add(getBleft(), null);
+		this.add(getBcenterV(), null);
+		this.add(getBright(), null);
+		this.add(getBup(), null);
+		this.add(getBcenterH(), null);
+		this.add(getBdown(), null);
+		this.add(getBdistUp(), null);
+		this.add(getLAlineamiento(), null);
+		this.add(getLDistribuir(), null);
+		this.add(getBdistcenterV(), null);
+		this.add(getBdistDown(), null);
+		this.add(getBdistLeft(), null);
+		this.add(getBdistcenterH(), null);
+		this.add(getBdistRight(), null);
+		this.add(getLSize(), null);
+		this.add(getBsizecenterV(), null);
+		this.add(getBsizecenterH(), null);
+		this.add(getBsizeother(), null);
+		this.add(getBspaceRight(), null);
+		this.add(getBspaceDown(), null);
+		this.add(getLEspacio(), null);
+		this.add(getLEnElMapa(), null);
+		this.add(getBinLayout(), null);
+		this.setSize(310, 190);
+		getBleft().addActionListener(listener);
+		getBleft().setActionCommand("LEFT");
+		getBcenterV().addActionListener(listener);
+		getBcenterV().setActionCommand("CENTERV");
+		getBright().addActionListener(listener);
+		getBright().setActionCommand("RIGHT");
+		getBup().addActionListener(listener);
+		getBup().setActionCommand("UP");
+		getBcenterH().addActionListener(listener);
+		getBcenterH().setActionCommand("CENTERH");
+		getBdown().addActionListener(listener);
+		getBdown().setActionCommand("DOWN");
+		getBdistUp().addActionListener(listener);
+		getBdistUp().setActionCommand("DISTUP");
+		getBdistcenterV().addActionListener(listener);
+		getBdistcenterV().setActionCommand("DISTCENTERV");
+		getBdistDown().addActionListener(listener);
+		getBdistDown().setActionCommand("DISTDOWN");
+		getBdistLeft().addActionListener(listener);
+		getBdistLeft().setActionCommand("DISTLEFT");
+		getBdistcenterH().addActionListener(listener);
+		getBdistcenterH().setActionCommand("DISTCENTERH");
+		getBdistRight().addActionListener(listener);
+		getBdistRight().setActionCommand("DISTRIGHT");
+		getBsizecenterV().addActionListener(listener);
+		getBsizecenterV().setActionCommand("SIZECENTERV");
+		getBsizecenterH().addActionListener(listener);
+		getBsizecenterH().setActionCommand("SIZECENTERH");
+		getBsizeother().addActionListener(listener);
+		getBsizeother().setActionCommand("SIZEOTHER");
+		getBspaceRight().addActionListener(listener);
+		getBspaceRight().setActionCommand("SPACERIGHT");
+		getBspaceDown().addActionListener(listener);
+		getBspaceDown().setActionCommand("SPACEDOWN");
+		getBinLayout().addActionListener(listener);
+		getBinLayout().setActionCommand("INLAYOUT");
+	}
+
+	/**
+	 * This method initializes bleft
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBleft() {
+		if (bleft == null) {
+			bleft = new javax.swing.JButton();
+			bleft.setSize(24, 24);
+			bleft.setIcon(ileft);
+			bleft.setLocation(10, 30);
+			bleft.setPreferredSize(new java.awt.Dimension(30, 30));
+		}
+
+		return bleft;
+	}
+
+	/**
+	 * This method initializes bcenterV
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBcenterV() {
+		if (bcenterV == null) {
+			bcenterV = new javax.swing.JButton();
+			bcenterV.setSize(24, 24);
+			bcenterV.setIcon(icenterV);
+			bcenterV.setLocation(35, 30);
+			bcenterV.setPreferredSize(new java.awt.Dimension(39, 20));
+		}
+
+		return bcenterV;
+	}
+
+	/**
+	 * This method initializes bright
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBright() {
+		if (bright == null) {
+			bright = new javax.swing.JButton();
+			bright.setSize(24, 24);
+			bright.setIcon(iright);
+			bright.setLocation(60, 30);
+		}
+
+		return bright;
+	}
+
+	/**
+	 * This method initializes bup
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBup() {
+		if (bup == null) {
+			bup = new javax.swing.JButton();
+			bup.setSize(24, 24);
+			bup.setIcon(iup);
+			bup.setLocation(100, 30);
+		}
+
+		return bup;
+	}
+
+	/**
+	 * This method initializes bcenterH
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBcenterH() {
+		if (bcenterH == null) {
+			bcenterH = new javax.swing.JButton();
+			bcenterH.setSize(24, 24);
+			bcenterH.setIcon(icenterH);
+			bcenterH.setLocation(125, 30);
+		}
+
+		return bcenterH;
+	}
+
+	/**
+	 * This method initializes bdown
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBdown() {
+		if (bdown == null) {
+			bdown = new javax.swing.JButton();
+			bdown.setSize(24, 24);
+			bdown.setIcon(idown);
+			bdown.setLocation(150, 30);
+		}
+
+		return bdown;
+	}
+
+	/**
+	 * This method initializes bdistUp
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBdistUp() {
+		if (bdistUp == null) {
+			bdistUp = new javax.swing.JButton();
+			bdistUp.setSize(24, 24);
+			bdistUp.setIcon(idistUp);
+			bdistUp.setLocation(100, 73);
+		}
+
+		return bdistUp;
+	}
+
+	/**
+	 * This method initializes lAlineamiento
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAlineamiento() {
+		if (lAlineamiento == null) {
+			lAlineamiento = new javax.swing.JLabel();
+			lAlineamiento.setSize(107, 13);
+			lAlineamiento.setText(PluginServices.getText(this, "alineamiento"));
+			lAlineamiento.setLocation(10, 10);
+		}
+
+		return lAlineamiento;
+	}
+
+	/**
+	 * This method initializes lDistribuir
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLDistribuir() {
+		if (lDistribuir == null) {
+			lDistribuir = new javax.swing.JLabel();
+			lDistribuir.setBounds(10, 57, 107, 13);
+			lDistribuir.setText(PluginServices.getText(this, "distribuir"));
+		}
+
+		return lDistribuir;
+	}
+
+	/**
+	 * This method initializes bdistcenterV
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBdistcenterV() {
+		if (bdistcenterV == null) {
+			bdistcenterV = new javax.swing.JButton();
+			bdistcenterV.setSize(24, 24);
+			bdistcenterV.setIcon(idistCenterH);
+			bdistcenterV.setLocation(125, 73);
+		}
+
+		return bdistcenterV;
+	}
+
+	/**
+	 * This method initializes bdistDown
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBdistDown() {
+		if (bdistDown == null) {
+			bdistDown = new javax.swing.JButton();
+			bdistDown.setSize(24, 24);
+			bdistDown.setIcon(idistDown);
+			bdistDown.setLocation(150, 73);
+		}
+
+		return bdistDown;
+	}
+
+	/**
+	 * This method initializes bdistLeft
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBdistLeft() {
+		if (bdistLeft == null) {
+			bdistLeft = new javax.swing.JButton();
+			bdistLeft.setSize(24, 24);
+			bdistLeft.setIcon(idistLeft);
+			bdistLeft.setLocation(10, 73);
+		}
+
+		return bdistLeft;
+	}
+
+	/**
+	 * This method initializes bdistcenterH
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBdistcenterH() {
+		if (bdistcenterH == null) {
+			bdistcenterH = new javax.swing.JButton();
+			bdistcenterH.setSize(24, 24);
+			bdistcenterH.setIcon(idistCenterV);
+			bdistcenterH.setLocation(35, 73);
+		}
+
+		return bdistcenterH;
+	}
+
+	/**
+	 * This method initializes bdistRight
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBdistRight() {
+		if (bdistRight == null) {
+			bdistRight = new javax.swing.JButton();
+			bdistRight.setIcon(idistRight);
+			bdistRight.setBounds(60, 73, 24, 24);
+		}
+
+		return bdistRight;
+	}
+
+	/**
+	 * This method initializes lSize
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLSize() {
+		if (lSize == null) {
+			lSize = new javax.swing.JLabel();
+			lSize.setBounds(10, 101, 107, 13);
+			lSize.setText(PluginServices.getText(this, "coincidir_tama�o"));
+		}
+
+		return lSize;
+	}
+
+	/**
+	 * This method initializes bsizecenterV
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBsizecenterV() {
+		if (bsizecenterV == null) {
+			bsizecenterV = new javax.swing.JButton();
+			bsizecenterV.setIcon(isizeWidth);
+			bsizecenterV.setBounds(10, 115, 24, 24);
+		}
+
+		return bsizecenterV;
+	}
+
+	/**
+	 * This method initializes bsizecenterH
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBsizecenterH() {
+		if (bsizecenterH == null) {
+			bsizecenterH = new javax.swing.JButton();
+			bsizecenterH.setIcon(isizeHeight);
+			bsizecenterH.setBounds(35, 115, 24, 24);
+		}
+
+		return bsizecenterH;
+	}
+
+	/**
+	 * This method initializes bsizeother
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBsizeother() {
+		if (bsizeother == null) {
+			bsizeother = new javax.swing.JButton();
+			bsizeother.setIcon(isizeOther);
+			bsizeother.setBounds(60, 115, 24, 24);
+		}
+
+		return bsizeother;
+	}
+
+	/**
+	 * This method initializes bspaceRight
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBspaceRight() {
+		if (bspaceRight == null) {
+			bspaceRight = new javax.swing.JButton();
+			bspaceRight.setIcon(ispaceRight);
+			bspaceRight.setBounds(125, 115, 24, 24);
+		}
+
+		return bspaceRight;
+	}
+
+	/**
+	 * This method initializes bspaceDown
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBspaceDown() {
+		if (bspaceDown == null) {
+			bspaceDown = new javax.swing.JButton();
+			bspaceDown.setIcon(ispaceDown);
+			bspaceDown.setBounds(150, 115, 24, 24);
+		}
+
+		return bspaceDown;
+	}
+
+	/**
+	 * This method initializes lEspacio
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLEspacio() {
+		if (lEspacio == null) {
+			lEspacio = new javax.swing.JLabel();
+			lEspacio.setBounds(125, 100, 57, 15);
+			lEspacio.setText(PluginServices.getText(this, "espacio"));
+		}
+
+		return lEspacio;
+	}
+
+	/**
+	 * This method initializes lEnElMapa
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLEnElMapa() {
+		if (lEnElMapa == null) {
+			lEnElMapa = new javax.swing.JLabel();
+			lEnElMapa.setBounds(187, 33, 77, 17);
+			lEnElMapa.setText(PluginServices.getText(this, "en_el_mapa"));
+		}
+
+		return lEnElMapa;
+	}
+
+	/**
+	 * This method initializes binLayout
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JToggleButton getBinLayout() {
+		if (binLayout == null) {
+			binLayout = new JToggleButton();
+			binLayout.setIcon(iinLayout);
+			binLayout.setBounds(199, 58, 51, 41);
+		}
+
+		return binLayout;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
+	 */
+	public Object getViewModel() {
+		return "AlignDialog";
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODELESSDIALOG);
+		m_viewinfo.setTitle(PluginServices.getText(this, "alinear"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}  //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FAlignDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FBorderDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FBorderDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FBorderDialog.java	(revision 1648)
@@ -0,0 +1,652 @@
+/*
+ * Created on 28-jul-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.gui.layout.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.gui.layout.FLayoutGraphics;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGroup;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameGraphicsDialog;
+
+import java.awt.Color;
+import java.awt.geom.Rectangle2D;
+
+import java.util.ArrayList;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+
+
+/**
+ * Di�logo con todas las opciones para crear un borde a los fframes.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FBorderDialog extends JPanel implements View {
+	private javax.swing.JRadioButton rbSeleccionados = null;
+	private javax.swing.JRadioButton rbTodos = null;
+	private javax.swing.JRadioButton rbMargen = null;
+	private javax.swing.JCheckBox chbAgrupar = null;
+	private javax.swing.JPanel pPosicion = null;
+	private javax.swing.JCheckBox chbIgualLados = null;
+	private javax.swing.JLabel lunidades = null;
+	private javax.swing.JTextField tTodosLados = null;
+	private javax.swing.JLabel lSuperior = null;
+	private javax.swing.JLabel lInferior = null;
+	private javax.swing.JTextField tSuperior = null;
+	private javax.swing.JTextField tInferior = null;
+	private javax.swing.JLabel lIzquierda = null;
+	private javax.swing.JLabel lDerecha = null;
+	private javax.swing.JTextField tIzquierda = null;
+	private javax.swing.JTextField tDerecha = null;
+	private javax.swing.JLabel lUnidades = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+	private Layout layout = null;
+	private ArrayList selecList = new ArrayList();
+	private FFrameGraphics fframegraphics = null;
+	private FLayoutGraphics flg = null;
+	private String m_NameUnit = null;
+	private javax.swing.JButton bConfigurar = null;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param l Referencia al Layout.
+	 */
+	public FBorderDialog(Layout l) {
+		super();
+		layout = l;
+		flg = new FLayoutGraphics(layout);
+		fframegraphics = new FFrameGraphics();
+		fframegraphics.setColor(Color.red);
+		fframegraphics.update(Layout.RECTANGLESIMPLE, layout.getAT());
+
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			if (((IFFrame) layout.getFFrames().get(i)).getSelected() != FFrame.NOSELECT) {
+				selecList.add(layout.getFFrames().get(i));
+			}
+		}
+
+		this.setLayout(null);
+		m_NameUnit = layout.getAtributes().getNameUnit();
+		this.add(getRbSeleccionados(), null);
+		this.add(getRbTodos(), null);
+		this.add(getRbMargen(), null);
+		this.add(getChbAgrupar(), null);
+		this.add(getPPosicion(), null);
+		this.add(getBAceptar(), null);
+		this.add(getBCancelar(), null);
+		this.add(getBConfigurar(), null);
+		this.setSize(371, 223);
+
+		ButtonGroup group = new ButtonGroup();
+		group.add(getRbSeleccionados());
+		group.add(getRbTodos());
+		group.add(getRbMargen());
+	}
+
+	/**
+	 * This method initializes rbSeleccionados
+	 *
+	 * @return javax.swing.JRadioButton
+	 */
+	private javax.swing.JRadioButton getRbSeleccionados() {
+		if (rbSeleccionados == null) {
+			rbSeleccionados = new javax.swing.JRadioButton();
+			rbSeleccionados.setBounds(10, 8, 416, 20);
+			rbSeleccionados.setText(PluginServices.getText(this,
+					"colocar_alrededor_seleccionados"));
+
+			if (selecList.size() == 0) {
+				rbSeleccionados.setEnabled(false);
+				getRbTodos().setSelected(true);
+			} else {
+				rbSeleccionados.setSelected(true);
+			}
+		}
+
+		return rbSeleccionados;
+	}
+
+	/**
+	 * This method initializes rbTodos
+	 *
+	 * @return javax.swing.JRadioButton
+	 */
+	private javax.swing.JRadioButton getRbTodos() {
+		if (rbTodos == null) {
+			rbTodos = new javax.swing.JRadioButton();
+			rbTodos.setBounds(10, 29, 332, 20);
+			rbTodos.setText(PluginServices.getText(this,
+					"colocar_alrededor_todos"));
+		}
+
+		return rbTodos;
+	}
+
+	/**
+	 * This method initializes rbMargen
+	 *
+	 * @return javax.swing.JRadioButton
+	 */
+	private javax.swing.JRadioButton getRbMargen() {
+		if (rbMargen == null) {
+			rbMargen = new javax.swing.JRadioButton();
+			rbMargen.setBounds(10, 51, 286, 20);
+			rbMargen.setText(PluginServices.getText(this, "colocar_a_margenes"));
+		}
+
+		return rbMargen;
+	}
+
+	/**
+	 * This method initializes chbAgrupar
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbAgrupar() {
+		if (chbAgrupar == null) {
+			chbAgrupar = new javax.swing.JCheckBox();
+			chbAgrupar.setBounds(10, 70, 280, 20);
+			chbAgrupar.setText(PluginServices.getText(this, "agrupar_linea"));
+		}
+
+		return chbAgrupar;
+	}
+
+	/**
+	 * This method initializes pPosicion
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPPosicion() {
+		if (pPosicion == null) {
+			pPosicion = new javax.swing.JPanel();
+			pPosicion.setLayout(null);
+			pPosicion.add(getChbIgualLados(), null);
+			pPosicion.add(getLunidades(), null);
+			pPosicion.add(getTTodosLados(), null);
+			pPosicion.add(getLSuperior(), null);
+			pPosicion.add(getLInferior(), null);
+			pPosicion.add(getTSuperior(), null);
+			pPosicion.add(getTInferior(), null);
+			pPosicion.add(getLIzquierda(), null);
+			pPosicion.add(getLDerecha(), null);
+			pPosicion.add(getTIzquierda(), null);
+			pPosicion.add(getTDerecha(), null);
+			pPosicion.add(getLUnidades(), null);
+			pPosicion.setBounds(12, 92, 350, 97);
+			pPosicion.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "posicion_linea"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		}
+
+		return pPosicion;
+	}
+
+	/**
+	 * This method initializes chbIgualLados
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbIgualLados() {
+		if (chbIgualLados == null) {
+			chbIgualLados = new javax.swing.JCheckBox();
+			chbIgualLados.setBounds(10, 16, 243, 21);
+			chbIgualLados.setText(PluginServices.getText(this,
+					"igual_todos_lados"));
+			chbIgualLados.setSelected(true);
+			chbIgualLados.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						if (!chbIgualLados.isSelected()) {
+							getTTodosLados().setEnabled(false);
+							getTSuperior().setEnabled(true);
+							getTInferior().setEnabled(true);
+							getTIzquierda().setEnabled(true);
+							getTDerecha().setEnabled(true);
+						} else {
+							getTTodosLados().setEnabled(true);
+							getTSuperior().setEnabled(false);
+							getTInferior().setEnabled(false);
+							getTIzquierda().setEnabled(false);
+							getTDerecha().setEnabled(false);
+							getTSuperior().setText(tTodosLados.getText());
+							getTInferior().setText(tTodosLados.getText());
+							getTIzquierda().setText(tTodosLados.getText());
+							getTDerecha().setText(tTodosLados.getText());
+						}
+					}
+				});
+		}
+
+		return chbIgualLados;
+	}
+
+	/**
+	 * This method initializes lunidades
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLunidades() {
+		if (lunidades == null) {
+			lunidades = new javax.swing.JLabel();
+			lunidades.setBounds(264, 64, 78, 18);
+			lunidades.setText(m_NameUnit);
+		}
+
+		return lunidades;
+	}
+
+	/**
+	 * This method initializes tTodosLados
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTTodosLados() {
+		if (tTodosLados == null) {
+			tTodosLados = new javax.swing.JTextField();
+			tTodosLados.setBounds(267, 19, 48, 16);
+			tTodosLados.setText("0.5");
+			tTodosLados.addCaretListener(new javax.swing.event.CaretListener() {
+					public void caretUpdate(javax.swing.event.CaretEvent e) {
+						if (getChbIgualLados().isSelected()) {
+							getTSuperior().setText(tTodosLados.getText());
+							getTInferior().setText(tTodosLados.getText());
+							getTIzquierda().setText(tTodosLados.getText());
+							getTDerecha().setText(tTodosLados.getText());
+						}
+					}
+				});
+		}
+
+		return tTodosLados;
+	}
+
+	/**
+	 * This method initializes lSuperior
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLSuperior() {
+		if (lSuperior == null) {
+			lSuperior = new javax.swing.JLabel();
+			lSuperior.setBounds(10, 55, 62, 16);
+			lSuperior.setText(PluginServices.getText(this, "Superior"));
+		}
+
+		return lSuperior;
+	}
+
+	/**
+	 * This method initializes lInferior
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLInferior() {
+		if (lInferior == null) {
+			lInferior = new javax.swing.JLabel();
+			lInferior.setBounds(10, 72, 62, 16);
+			lInferior.setText(PluginServices.getText(this, "Inferior"));
+		}
+
+		return lInferior;
+	}
+
+	/**
+	 * This method initializes tSuperior
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTSuperior() {
+		if (tSuperior == null) {
+			tSuperior = new javax.swing.JTextField();
+			tSuperior.setBounds(78, 55, 48, 16);
+			tSuperior.setText("0.5");
+			tSuperior.setEnabled(false);
+		}
+
+		return tSuperior;
+	}
+
+	/**
+	 * This method initializes tInferior
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTInferior() {
+		if (tInferior == null) {
+			tInferior = new javax.swing.JTextField();
+			tInferior.setBounds(78, 72, 48, 16);
+			tInferior.setText("0.5");
+			tInferior.setEnabled(false);
+		}
+
+		return tInferior;
+	}
+
+	/**
+	 * This method initializes lIzquierda
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLIzquierda() {
+		if (lIzquierda == null) {
+			lIzquierda = new javax.swing.JLabel();
+			lIzquierda.setBounds(140, 55, 62, 16);
+			lIzquierda.setText(PluginServices.getText(this, "Izquierda"));
+		}
+
+		return lIzquierda;
+	}
+
+	/**
+	 * This method initializes lDerecha
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLDerecha() {
+		if (lDerecha == null) {
+			lDerecha = new javax.swing.JLabel();
+			lDerecha.setBounds(140, 72, 62, 16);
+			lDerecha.setText(PluginServices.getText(this, "Derecha"));
+		}
+
+		return lDerecha;
+	}
+
+	/**
+	 * This method initializes tIzquierda
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTIzquierda() {
+		if (tIzquierda == null) {
+			tIzquierda = new javax.swing.JTextField();
+			tIzquierda.setBounds(207, 55, 48, 16);
+			tIzquierda.setText("0.5");
+			tIzquierda.setEnabled(false);
+		}
+
+		return tIzquierda;
+	}
+
+	/**
+	 * This method initializes tDerecha
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTDerecha() {
+		if (tDerecha == null) {
+			tDerecha = new javax.swing.JTextField();
+			tDerecha.setBounds(207, 72, 48, 16);
+			tDerecha.setText("0.5");
+			tDerecha.setEnabled(false);
+		}
+
+		return tDerecha;
+	}
+
+	/**
+	 * This method initializes lUnidades
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLUnidades() {
+		if (lUnidades == null) {
+			lUnidades = new javax.swing.JLabel();
+			lUnidades.setBounds(207, 36, 134, 18);
+			lUnidades.setText(PluginServices.getText(this, "map_units"));
+		}
+
+		return lUnidades;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setTitle(PluginServices.getText(this, "ajustes_linea_grafica"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setBounds(134, 193, 100, 20);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						double x = Double.parseDouble(getTIzquierda().getText()
+														  .toString());
+						double y = Double.parseDouble(getTSuperior().getText()
+														  .toString());
+						double w = Double.parseDouble(getTDerecha().getText()
+														  .toString());
+						double h = Double.parseDouble(getTInferior().getText()
+														  .toString());
+
+						if (!getChbAgrupar().isSelected()) {
+							Rectangle2D.Double re = new Rectangle2D.Double();
+
+							if (getRbSeleccionados().isSelected()) {
+								if (selecList.size() > 0) {
+									re.setRect(((IFFrame) selecList.get(0)).getBoundBox());
+								}
+
+								for (int i = 1; i < selecList.size(); i++) {
+									Rectangle2D.Double rectaux = ((IFFrame) selecList.get(i)).getBoundBox();
+									re.add(rectaux);
+								}
+
+								//						crear un Rect�ngulo alrededor de los fframes seleccionados. 
+							} else if (getRbTodos().isSelected()) {
+								if (layout.getFFrames().size() > 0) {
+									re.setRect(((IFFrame) layout.getFFrames()
+																.get(0)).getBoundBox());
+								}
+
+								for (int i = 1; i < layout.getFFrames().size();
+										i++) {
+									Rectangle2D.Double rectaux = ((IFFrame) layout.getFFrames()
+																				  .get(i)).getBoundBox();
+									re.add(rectaux);
+								}
+
+								//						creaer un Rect�ngulo que incluya a todos los fframes.
+							} else if (getRbMargen().isSelected()) {
+								//						creaer un Rect�ngulo en los m�rgenes del Layout.
+								re.setRect(layout.getAtributes().getArea());
+							}
+
+							re.setRect(re.x - x, re.y - y, re.width + x + w,
+								re.height + y + h);
+
+							Rectangle2D.Double rectangle = FLayoutUtilities.fromSheetRect(re,
+									layout.getAT());
+
+							/*if (layout.isCuadricula()){
+							   FLayoutUtilities.setRectGrid(rectangle,
+							                      layout.getAtributes().getUnitInPixelsX(),layout.getAtributes().getUnitInPixelsY(), layout.getAT());
+							   }
+							 */
+							re = FLayoutUtilities.toSheetRect(rectangle,
+									layout.getAT());
+							fframegraphics.setBoundBox(re);
+							layout.addFFrame(fframegraphics, true);
+						} else { //Agrupar
+
+							Rectangle2D.Double re = new Rectangle2D.Double();
+							FFrameGroup fframegroup = new FFrameGroup();
+
+							if (getRbSeleccionados().isSelected()) {
+								if (selecList.size() > 0) {
+									re.setRect(((IFFrame) selecList.get(0)).getBoundBox());
+								}
+
+								for (int i = 1; i < selecList.size(); i++) {
+									Rectangle2D.Double rectaux = ((IFFrame) selecList.get(i)).getBoundBox();
+									re.add(rectaux);
+								}
+
+								//						crear un Rect�ngulo alrededor de los fframes seleccionados. 
+							} else if (getRbTodos().isSelected()) {
+								if (layout.getFFrames().size() > 0) {
+									re.setRect(((IFFrame) layout.getFFrames()
+																.get(0)).getBoundBox());
+								}
+
+								for (int i = 1; i < layout.getFFrames().size();
+										i++) {
+									Rectangle2D.Double rectaux = ((IFFrame) layout.getFFrames()
+																				  .get(i)).getBoundBox();
+									((IFFrame) layout.getFFrames().get(i)).setSelected(true);
+									re.add(rectaux);
+								}
+
+								//						creaer un Rect�ngulo que incluya a todos los fframes.
+							} else if (getRbMargen().isSelected()) {
+								//						creaer un Rect�ngulo en los m�rgenes del Layout.
+								re.setRect(layout.getAtributes().getArea());
+							}
+
+							re.setRect(re.x - x, re.y - y, re.width + x + w,
+								re.height + y + h);
+
+							Rectangle2D.Double rectangle = FLayoutUtilities.fromSheetRect(re,
+									layout.getAT());
+
+							/*if (layout.isCuadricula()){
+							   FLayoutUtilities.setRectGrid(rectangle,
+							                   layout.getAtributes().getUnitInPixelsX(),layout.getAtributes().getUnitInPixelsY(), layout.getAT());
+							   }*/
+							re.setRect(FLayoutUtilities.toSheetRect(rectangle,
+									layout.getAT()));
+							fframegraphics.setBoundBox(re);
+							layout.addFFrame(fframegraphics, false);
+							flg.grouping();
+						}
+
+						PluginServices.getMDIManager().closeView(FBorderDialog.this);
+						layout.setStatus(Layout.DESACTUALIZADO);
+						layout.repaint();
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setBounds(251, 193, 100, 20);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FBorderDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	/**
+	 * This method initializes bConfigurar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBConfigurar() {
+		if (bConfigurar == null) {
+			bConfigurar = new javax.swing.JButton();
+			bConfigurar.setBounds(17, 193, 100, 20);
+			bConfigurar.setText(PluginServices.getText(this, "configurar"));
+			bConfigurar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						FFrameGraphicsDialog graphicsdialog = new FFrameGraphicsDialog(layout,
+								fframegraphics);
+
+						PluginServices.getMDIManager().addView(graphicsdialog);
+					}
+				});
+		}
+
+		return bConfigurar;
+	}
+} 

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FBorderDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/EventsFAlign.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/EventsFAlign.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/EventsFAlign.java	(revision 1648)
@@ -0,0 +1,1026 @@
+/*
+ * Created on 22-jul-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.gui.layout.dialogs;
+
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import java.util.Iterator;
+import java.util.TreeMap;
+
+
+/**
+ * Clase que hace de Listener de FAlignDialog.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class EventsFAlign implements ActionListener {
+	private Layout m_layout;
+	private boolean inLayout = false;
+
+	/**
+	 * Crea un nuevo FAlign.
+	 *
+	 * @param layout Referencia al Layout.
+	 */
+	public EventsFAlign(Layout layout) {
+		m_layout = layout;
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la izquierda del fframe m�s
+	 * occidental.
+	 */
+	private void alignLeft() {
+		double xmin = Double.MAX_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (xmin > fframe.getBoundBox().getMinX()) {
+					xmin = fframe.getBoundBox().getMinX();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmin;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la izquierda del Layout.
+	 */
+	private void alignLeftL() {
+		double xmin = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmin;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados al centro del fframe mas ancho de
+	 * forma horizontal.
+	 */
+	private void alignCenterV() {
+		double xcenter = 0;
+		double w = Double.MIN_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (w < fframe.getBoundBox().getWidth()) {
+					w = fframe.getBoundBox().getWidth();
+					xcenter = fframe.getBoundBox().getCenterX();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xcenter -
+					(fframe.getBoundBox().width / 2);
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados al centro del Layout horizontalmente.
+	 */
+	private void alignCenterVL() {
+		double xcenter = 0;
+		xcenter = m_layout.getAtributes().m_sizePaper.getAncho() / 2;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xcenter -
+					(fframe.getBoundBox().width / 2);
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la parte derecha del fframe m�s
+	 * oriental.
+	 */
+	private void alignRight() {
+		double xmax = Double.MIN_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (xmax < fframe.getBoundBox().getMaxX()) {
+					xmax = fframe.getBoundBox().getMaxX();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmax -
+					((IFFrame) m_layout.getFFrames().get(i)).getBoundBox().width;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la parte derecha del Layout.
+	 */
+	private void alignRightL() {
+		double xmax = 0;
+		xmax = m_layout.getAtributes().m_sizePaper.getAncho();
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmax -
+					((IFFrame) m_layout.getFFrames().get(i)).getBoundBox().width;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la parte inferior del fframe m�s
+	 * hacia abajo.
+	 */
+	private void alignDown() {
+		double ymax = Double.MIN_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (ymax < fframe.getBoundBox().getMaxY()) {
+					ymax = fframe.getBoundBox().getMaxY();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymax - fframe.getBoundBox().height;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la parte inferior del Layout.
+	 */
+	private void alignDownL() {
+		double ymax = 0;
+		ymax = m_layout.getAtributes().m_sizePaper.getAlto();
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymax - fframe.getBoundBox().height;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la parte superior del fframe que
+	 * m�s arriba este colocado.
+	 */
+	private void alignUp() {
+		double ymin = Double.MAX_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (ymin > fframe.getBoundBox().getMinY()) {
+					ymin = fframe.getBoundBox().getMinY();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymin;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados a la parte superior del Layout.
+	 */
+	private void alignUpL() {
+		double ymin = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymin;
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados al centro del fframe m�s alto
+	 * verticalmente.
+	 */
+	private void alignCenterH() {
+		double ycenter = 0;
+		double h = Double.MIN_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (h < fframe.getBoundBox().getHeight()) {
+					h = fframe.getBoundBox().getHeight();
+					ycenter = fframe.getBoundBox().getCenterY();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ycenter -
+					(fframe.getBoundBox().height / 2);
+			}
+		}
+	}
+
+	/**
+	 * Desplaza los fframes seleccionados en el Layout al centro verticalmente.
+	 */
+	private void alignCenterHL() {
+		double ycenter = 0;
+		ycenter = m_layout.getAtributes().m_sizePaper.getAlto() / 2;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ycenter -
+					(fframe.getBoundBox().height / 2);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados de forma equidistante y vertical,
+	 * de izquierda a derecha.
+	 */
+	private void distLeft() {
+		double xmin = Double.MAX_VALUE;
+		double xmax = Double.MIN_VALUE;
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (xmin > fframe.getBoundBox().getMinX()) {
+					xmin = fframe.getBoundBox().getMinX();
+				}
+
+				if (xmax < fframe.getBoundBox().getMaxX()) {
+					xmax = fframe.getBoundBox().getMaxX();
+				}
+
+				num++;
+			}
+		}
+
+		double dif = xmax - xmin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmin + (dist * i);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados en el Layout de forma equidistante
+	 * y vertical, de izquierda a derecha.
+	 */
+	private void distLeftL() {
+		double xmin = 0;
+		double xmax = 0;
+		xmax = m_layout.getAtributes().m_sizePaper.getAncho();
+
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				num++;
+			}
+		}
+
+		double dif = xmax - xmin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmin + (dist * i);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados de forma equidistante y vertical,
+	 * de derecha a izquierda.
+	 */
+	private void distRight() {
+		double xmin = Double.MAX_VALUE;
+		double xmax = Double.MIN_VALUE;
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (xmin > fframe.getBoundBox().getMinX()) {
+					xmin = fframe.getBoundBox().getMinX();
+				}
+
+				if (xmax < fframe.getBoundBox().getMaxX()) {
+					xmax = fframe.getBoundBox().getMaxX();
+				}
+
+				num++;
+			}
+		}
+
+		double dif = xmax - xmin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmax - (dist * i) -
+					fframe.getBoundBox().width;
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados en el Layout de forma equidistante
+	 * y vertical, de derecha a izquierda.
+	 */
+	private void distRightL() {
+		double xmin = 0;
+		double xmax = 0;
+		xmax = m_layout.getAtributes().m_sizePaper.getAncho();
+
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				num++;
+			}
+		}
+
+		double dif = xmax - xmin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = xmax - (dist * i) -
+					fframe.getBoundBox().width;
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados de forma equidistante y vertical,
+	 * desde arriba hacia abajo.
+	 */
+	private void distUp() {
+		double ymin = Double.MAX_VALUE;
+		double ymax = Double.MIN_VALUE;
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (ymin > fframe.getBoundBox().getMinY()) {
+					ymin = fframe.getBoundBox().getMinY();
+				}
+
+				if (ymax < fframe.getBoundBox().getMaxY()) {
+					ymax = fframe.getBoundBox().getMaxY();
+				}
+
+				num++;
+			}
+		}
+
+		double dif = ymax - ymin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymin + (dist * i);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados en el Layout de forma equidistante
+	 * y vertical, desde arriba hacia abajo.
+	 */
+	private void distUpL() {
+		double ymin = 0;
+		double ymax = 0;
+		ymax = m_layout.getAtributes().m_sizePaper.getAlto();
+
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				num++;
+			}
+		}
+
+		double dif = ymax - ymin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymin + (dist * i);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados de forma equidistante y vertical,
+	 * desde bajo hacia arriba.
+	 */
+	private void distDown() {
+		double ymin = Double.MAX_VALUE;
+		double ymax = Double.MIN_VALUE;
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (ymin > fframe.getBoundBox().getMinY()) {
+					ymin = fframe.getBoundBox().getMinY();
+				}
+
+				if (ymax < fframe.getBoundBox().getMaxY()) {
+					ymax = fframe.getBoundBox().getMaxY();
+				}
+
+				num++;
+			}
+		}
+
+		double dif = ymax - ymin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymax - (dist * i) -
+					fframe.getBoundBox().height;
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados en el Layout de forma equidistante
+	 * y vertical, desde bajo hacia arriba.
+	 */
+	private void distDownL() {
+		double ymin = 0;
+		double ymax = 0;
+		ymax = m_layout.getAtributes().m_sizePaper.getAlto();
+
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				num++;
+			}
+		}
+
+		double dif = ymax - ymin;
+		double dist = dif / num;
+
+		for (int i = m_layout.getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = ymax - (dist * i) -
+					fframe.getBoundBox().height;
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados de forma equidistante y vertical.
+	 */
+	private void distCenterH() {
+		double xmin = Double.MAX_VALUE;
+		double xmax = Double.MIN_VALUE;
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (xmin > fframe.getBoundBox().getMinX()) {
+					xmin = fframe.getBoundBox().getMinX();
+				}
+
+				if (xmax < fframe.getBoundBox().getMaxX()) {
+					xmax = fframe.getBoundBox().getMaxX();
+				}
+
+				num++;
+			}
+		}
+
+		double dif = xmax - xmin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = (xmin +
+					(((dist) * (i + 1)) - (dist / 2))) -
+					(fframe.getBoundBox().width / 2);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados en el Layout de forma equidistante
+	 * y vertical.
+	 */
+	private void distCenterHL() {
+		double xmin = 0;
+		double xmax = 0;
+		xmax = m_layout.getAtributes().m_sizePaper.getAncho();
+
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				num++;
+			}
+		}
+
+		double dif = xmax - xmin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().x = (xmin +
+					(((dist) * (i + 1)) - (dist / 2))) -
+					(fframe.getBoundBox().width / 2);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados de forma equidistante y horizontal.
+	 */
+	private void distCenterV() {
+		double ymin = Double.MAX_VALUE;
+		double ymax = Double.MIN_VALUE;
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (ymin > fframe.getBoundBox().getMinY()) {
+					ymin = fframe.getBoundBox().getMinY();
+				}
+
+				if (ymax < fframe.getBoundBox().getMaxY()) {
+					ymax = fframe.getBoundBox().getMaxY();
+				}
+
+				num++;
+			}
+		}
+
+		double dif = ymax - ymin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = (ymin +
+					(((dist) * (i + 1)) - (dist / 2))) -
+					(fframe.getBoundBox().height / 2);
+			}
+		}
+	}
+
+	/**
+	 * Distribuye los fframes seleccionados en el Layout de forma equidistante
+	 * y horizontal.
+	 */
+	private void distCenterVL() {
+		double ymin = 0;
+		double ymax = 0;
+		ymax = m_layout.getAtributes().m_sizePaper.getAlto();
+
+		int num = 0;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				num++;
+			}
+		}
+
+		double dif = ymax - ymin;
+		double dist = dif / num;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().y = (ymin +
+					(((dist) * (i + 1)) - (dist / 2))) -
+					(fframe.getBoundBox().height / 2);
+			}
+		}
+	}
+
+	/**
+	 * Cambia la anchura de los fframes seleccionados por la anchura del m�s
+	 * ancho.
+	 */
+	private void sizeWidth() {
+		double wmax = Double.MIN_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (wmax < fframe.getBoundBox().getWidth()) {
+					wmax = fframe.getBoundBox().getWidth();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().width = wmax;
+			}
+		}
+	}
+
+	/**
+	 * Cambia la altura de los fframes seleccionados por la altura del mas
+	 * alto.
+	 */
+	private void sizeHeight() {
+		double hmax = Double.MIN_VALUE;
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				if (hmax < fframe.getBoundBox().getHeight()) {
+					hmax = fframe.getBoundBox().getHeight();
+				}
+			}
+		}
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				fframe.getBoundBox().height = hmax;
+			}
+		}
+	}
+
+	/**
+	 * Distribuye horizontalmente los fframes dejando como espacio entre ellos
+	 * la media de todos los espacios.
+	 */
+	private void spaceRight() {
+		double total = 0;
+		double num = 0;
+		double xmin = Double.MAX_VALUE;
+		double xmax = Double.MIN_VALUE;
+
+		TreeMap treemap = new TreeMap();
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				treemap.put((Object) new Double(fframe.getBoundBox().getMinX()),
+					(Object) fframe);
+				num++;
+			}
+		}
+
+		Iterator j = treemap.keySet().iterator();
+
+		if (j.hasNext()) {
+			IFFrame fframeA = (IFFrame) treemap.get(j.next());
+			IFFrame fframeS = null;
+			xmin = fframeA.getBoundBox().x;
+
+			while (j.hasNext()) {
+				fframeS = (IFFrame) treemap.get(j.next());
+				total += (fframeS.getBoundBox().getMinX() -
+				fframeA.getBoundBox().getMaxX());
+				fframeA = fframeS;
+			}
+
+			if (fframeS != null) {
+				xmax = fframeS.getBoundBox().getMaxX();
+			}
+		}
+
+		if (inLayout) {
+			total += (xmin +
+			(m_layout.getAtributes().m_sizePaper.getAncho() - xmax));
+			num += 2;
+		}
+
+		double dist = total / (num - 1);
+		Iterator k = treemap.keySet().iterator();
+
+		if (k.hasNext()) {
+			IFFrame fframeA = (IFFrame) treemap.get(k.next());
+
+			if (inLayout) {
+				fframeA.getBoundBox().x = dist;
+			}
+
+			while (k.hasNext()) {
+				IFFrame fframeS = (IFFrame) treemap.get(k.next());
+				fframeS.getBoundBox().x = fframeA.getBoundBox().getMaxX() +
+					dist;
+				fframeA = fframeS;
+			}
+		}
+	}
+
+	/**
+	 * Distribuye verticalmente los fframes dejando como espacio entre ellos la
+	 * media de todos los espacios.
+	 */
+	private void spaceDown() {
+		double total = 0;
+		double num = 0;
+		double ymin = Double.MAX_VALUE;
+		double ymax = Double.MIN_VALUE;
+
+		TreeMap treemap = new TreeMap();
+
+		for (int i = 0; i < m_layout.getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) m_layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != 0) {
+				treemap.put((Object) new Double(fframe.getBoundBox().getMinY()),
+					(Object) fframe);
+				num++;
+			}
+		}
+
+		Iterator j = treemap.keySet().iterator();
+
+		if (j.hasNext()) {
+			IFFrame fframeA = (IFFrame) treemap.get(j.next());
+			ymin = fframeA.getBoundBox().y;
+
+			IFFrame fframeS = null;
+
+			while (j.hasNext()) {
+				fframeS = (IFFrame) treemap.get(j.next());
+				total += (fframeS.getBoundBox().getMinY() -
+				fframeA.getBoundBox().getMaxY());
+				fframeA = fframeS;
+			}
+
+			if (fframeS != null) {
+				ymax = fframeS.getBoundBox().getMaxY();
+			}
+		}
+
+		if (inLayout) {
+			total += (ymin +
+			(m_layout.getAtributes().m_sizePaper.getAlto() - ymax));
+			num += 2;
+		}
+
+		double dist = total / (num - 1);
+		Iterator k = treemap.keySet().iterator();
+
+		if (k.hasNext()) {
+			IFFrame fframeA = (IFFrame) treemap.get(k.next());
+
+			if (inLayout) {
+				fframeA.getBoundBox().y = dist;
+			}
+
+			while (k.hasNext()) {
+				IFFrame fframeS = (IFFrame) treemap.get(k.next());
+				fframeS.getBoundBox().y = fframeA.getBoundBox().getMaxY() +
+					dist;
+				fframeA = fframeS;
+			}
+		}
+	}
+
+	//  class Listener implements ActionListener {
+
+	/**
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if (!inLayout) {
+			if (e.getActionCommand() == "LEFT") {
+				alignLeft();
+			} else if (e.getActionCommand() == "CENTERV") {
+				alignCenterV();
+			} else if (e.getActionCommand() == "RIGHT") {
+				alignRight();
+			} else if (e.getActionCommand() == "UP") {
+				alignUp();
+			} else if (e.getActionCommand() == "CENTERH") {
+				alignCenterH();
+			} else if (e.getActionCommand() == "DOWN") {
+				alignDown();
+			} else if (e.getActionCommand() == "DISTUP") {
+				distUp();
+			} else if (e.getActionCommand() == "DISTCENTERV") {
+				distCenterV();
+			} else if (e.getActionCommand() == "DISTDOWN") {
+				distDown();
+			} else if (e.getActionCommand() == "DISTLEFT") {
+				distLeft();
+			} else if (e.getActionCommand() == "DISTCENTERH") {
+				distCenterH();
+			} else if (e.getActionCommand() == "DISTRIGHT") {
+				distRight();
+			} else if (e.getActionCommand() == "SIZECENTERV") {
+				sizeWidth();
+			} else if (e.getActionCommand() == "SIZECENTERH") {
+				sizeHeight();
+			} else if (e.getActionCommand() == "SIZEOTHER") {
+				sizeWidth();
+				sizeHeight();
+			} else if (e.getActionCommand() == "SPACERIGHT") {
+				spaceRight();
+			} else if (e.getActionCommand() == "SPACEDOWN") {
+				spaceDown();
+			} else if (e.getActionCommand() == "INLAYOUT") {
+				inLayout = true;
+			}
+		} else {
+			if (e.getActionCommand() == "LEFT") {
+				alignLeftL();
+			} else if (e.getActionCommand() == "CENTERV") {
+				alignCenterVL();
+			} else if (e.getActionCommand() == "RIGHT") {
+				alignRightL();
+			} else if (e.getActionCommand() == "UP") {
+				alignUpL();
+			} else if (e.getActionCommand() == "CENTERH") {
+				alignCenterHL();
+			} else if (e.getActionCommand() == "DOWN") {
+				alignDownL();
+			} else if (e.getActionCommand() == "DISTUP") {
+				distUpL();
+			} else if (e.getActionCommand() == "DISTCENTERV") {
+				distCenterVL();
+			} else if (e.getActionCommand() == "DISTDOWN") {
+				distDownL();
+			} else if (e.getActionCommand() == "DISTLEFT") {
+				distLeftL();
+			} else if (e.getActionCommand() == "DISTCENTERH") {
+				distCenterHL();
+			} else if (e.getActionCommand() == "DISTRIGHT") {
+				distRightL();
+			} else if (e.getActionCommand() == "SIZECENTERV") {
+				sizeWidth();
+			} else if (e.getActionCommand() == "SIZECENTERH") {
+				sizeHeight();
+			} else if (e.getActionCommand() == "SIZEOTHER") {
+				sizeWidth();
+				sizeHeight();
+			} else if (e.getActionCommand() == "SPACERIGHT") {
+				spaceRight();
+			} else if (e.getActionCommand() == "SPACEDOWN") {
+				spaceDown();
+			} else if (e.getActionCommand() == "INLAYOUT") {
+				inLayout = false;
+			}
+		}
+
+		m_layout.refresh();
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/EventsFAlign.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FConfigLayoutDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FConfigLayoutDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FConfigLayoutDialog.java	(revision 1648)
@@ -0,0 +1,831 @@
+/*
+ * Created on 23-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.gui.layout.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.gui.layout.Attributes;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.Size;
+
+import java.awt.Dimension;
+
+import java.text.NumberFormat;
+
+import javax.swing.JPanel;
+
+
+/**
+ * Clase para configurar el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FConfigLayoutDialog extends JPanel implements View {
+	private javax.swing.JLabel lTamPag = null;
+	private javax.swing.JComboBox cbTipoFolio = null;
+	private javax.swing.JLabel lDistancia = null;
+	private javax.swing.JComboBox cbUnidades = null;
+	private javax.swing.JLabel lAnchura = null;
+	private javax.swing.JLabel lAltura = null;
+	private javax.swing.JTextField tAncho = null;
+	private javax.swing.JTextField tAlto = null;
+	private javax.swing.JLabel lOrientacion = null;
+	private javax.swing.JLabel lMargenes = null;
+	private javax.swing.JCheckBox chbMargenes = null;
+	private javax.swing.JLabel lSuperior = null;
+	private javax.swing.JTextField tSuperior = null;
+	private javax.swing.JLabel lIzquierdo = null;
+	private javax.swing.JTextField tIzquierdo = null;
+	private javax.swing.JLabel lInferior = null;
+	private javax.swing.JTextField tInferior = null;
+	private javax.swing.JLabel lDerecho = null;
+	private javax.swing.JTextField tDerecho = null;
+	private javax.swing.JLabel lResolucion = null;
+	private javax.swing.JComboBox cbResolucion = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+	private Layout m_layout = null;
+	private javax.swing.JCheckBox chbHorizontal = null;
+	private javax.swing.JCheckBox chbVertical = null;
+	private int unit = 2;
+	private int type = 0;
+	private boolean isLand = true;
+	private boolean margin = false;
+	private int resolution = 1;
+	private double der = 2.54;
+	private double izq = 2.54;
+	private double sup = 2.54;
+	private double inf = 2.54;
+	private NumberFormat nf = NumberFormat.getInstance();
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layout Referencia al Layout.
+	 */
+	public FConfigLayoutDialog(Layout layout) {
+		super();
+		m_layout = layout;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		nf.setMaximumFractionDigits(2);
+		this.setLayout(null);
+		type = m_layout.getAtributes().getType();
+		unit = m_layout.getAtributes().getSelTypeUnit();
+		isLand = m_layout.getAtributes().isLandSpace();
+		sup = m_layout.getAtributes().m_area[0];
+		inf = m_layout.getAtributes().m_area[1];
+		izq = m_layout.getAtributes().m_area[2];
+		der = m_layout.getAtributes().m_area[3];
+		this.add(getLTamPag(), null);
+		this.add(getCbTipoFolio(), null);
+		this.add(getLDistancia(), null);
+		this.add(getCbUnidades(), null);
+		this.add(getLAnchura(), null);
+		this.add(getLAltura(), null);
+		this.add(getTAncho(), null);
+		this.add(getTAlto(), null);
+		this.add(getLOrientacion(), null);
+		this.add(getLMargenes(), null);
+		this.add(getChbMargenes(), null);
+		this.add(getLSuperior(), null);
+		this.add(getTSuperior(), null);
+		this.add(getLIzquierdo(), null);
+		this.add(getTIzquierdo(), null);
+		this.add(getLInferior(), null);
+		this.add(getTInferior(), null);
+		this.add(getLDerecho(), null);
+		this.add(getTDerecho(), null);
+		this.add(getLResolucion(), null);
+		this.add(getCbResolucion(), null);
+		this.add(getBAceptar(), null);
+		this.add(getBCancelar(), null);
+		this.add(getChbHorizontal(), null);
+		this.add(getChbVertical(), null);
+		this.setPreferredSize(new Dimension(371, 300));
+	}
+
+	/**
+	 * This method initializes lTamPag
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLTamPag() {
+		if (lTamPag == null) {
+			lTamPag = new javax.swing.JLabel();
+			lTamPag.setSize(134, 20);
+			lTamPag.setText(PluginServices.getText(this, "tamano_pagina") +
+				":");
+			lTamPag.setLocation(25, 15);
+		}
+
+		return lTamPag;
+	}
+
+	/**
+	 * This method initializes cbTipoFolio
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbTipoFolio() {
+		if (cbTipoFolio == null) {
+			cbTipoFolio = new javax.swing.JComboBox();
+			cbTipoFolio.setSize(175, 20);
+			cbTipoFolio.setPreferredSize(new java.awt.Dimension(130, 20));
+			cbTipoFolio.setLocation(175, 15);
+			cbTipoFolio.addItem(PluginServices.getText(this,
+					"Igual_que_la_impresora"));
+			cbTipoFolio.addItem(PluginServices.getText(this, "A4"));
+			cbTipoFolio.addItem(PluginServices.getText(this, "A3"));
+			cbTipoFolio.addItem(PluginServices.getText(this, "A2"));
+			cbTipoFolio.addItem(PluginServices.getText(this, "A1"));
+			cbTipoFolio.addItem(PluginServices.getText(this, "A0"));
+			cbTipoFolio.addItem(PluginServices.getText(this, "Personalizado"));
+
+			cbTipoFolio.setSelectedIndex(m_layout.getAtributes().getType());
+			cbTipoFolio.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						type = cbTipoFolio.getSelectedIndex();
+
+						Size size = m_layout.getAtributes().getSizeinUnits(isLand,
+								type);
+						getTAlto().setText(String.valueOf(nf.format(
+									size.getAlto())));
+						getTAncho().setText(String.valueOf(nf.format(
+									size.getAncho())));
+						setMargin(margin);
+					}
+				});
+		}
+
+		return cbTipoFolio;
+	}
+
+	/**
+	 * This method initializes lDistancia
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLDistancia() {
+		if (lDistancia == null) {
+			lDistancia = new javax.swing.JLabel();
+			lDistancia.setSize(137, 19);
+			lDistancia.setText(PluginServices.getText(this, "distance_units"));
+			lDistancia.setLocation(25, 40);
+		}
+
+		return lDistancia;
+	}
+
+	/**
+	 * This method initializes cbUnidades
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbUnidades() {
+		if (cbUnidades == null) {
+			cbUnidades = new javax.swing.JComboBox(Attributes.NAMES);
+			cbUnidades.setSize(175, 20);
+			cbUnidades.setLocation(175, 40);
+			cbUnidades.setSelectedIndex(m_layout.getAtributes().getSelTypeUnit());
+			cbUnidades.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						unit = cbUnidades.getSelectedIndex();
+						m_layout.getAtributes().setUnit(unit);
+
+						Size size = m_layout.getAtributes().getSizeinUnits(isLand,
+								type);
+						getTAlto().setText(String.valueOf(nf.format(
+									size.getAncho())));
+						getTAncho().setText(String.valueOf(nf.format(
+									size.getAlto())));
+						setMargin(margin);
+					}
+				});
+		}
+
+		return cbUnidades;
+	}
+
+	/**
+	 * This method initializes lAnchura
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAnchura() {
+		if (lAnchura == null) {
+			lAnchura = new javax.swing.JLabel();
+			lAnchura.setSize(81, 21);
+			lAnchura.setText(PluginServices.getText(this, "anchura"));
+			lAnchura.setLocation(25, 65);
+		}
+
+		return lAnchura;
+	}
+
+	/**
+	 * This method initializes lAltura
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAltura() {
+		if (lAltura == null) {
+			lAltura = new javax.swing.JLabel();
+			lAltura.setSize(90, 21);
+			lAltura.setText(PluginServices.getText(this, "altura"));
+			lAltura.setLocation(180, 65);
+		}
+
+		return lAltura;
+	}
+
+	/**
+	 * This method initializes tAncho
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTAncho() {
+		if (tAncho == null) {
+			tAncho = new javax.swing.JTextField();
+			tAncho.setSize(60, 20);
+			tAncho.setLocation(110, 65);
+
+			Size size = m_layout.getAtributes().getSizeinUnits(isLand, type);
+			String s = String.valueOf(nf.format(size.getAncho()));
+			tAncho.setText(s);
+		}
+
+		return tAncho;
+	}
+
+	/**
+	 * This method initializes tAlto
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTAlto() {
+		if (tAlto == null) {
+			tAlto = new javax.swing.JTextField();
+			tAlto.setSize(60, 20);
+			tAlto.setLocation(280, 65);
+
+			Size size = m_layout.getAtributes().getSizeinUnits(isLand, type);
+			String s = String.valueOf(nf.format(size.getAlto()));
+			tAlto.setText(s);
+		}
+
+		return tAlto;
+	}
+
+	/**
+	 * This method initializes lOrientacion
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLOrientacion() {
+		if (lOrientacion == null) {
+			lOrientacion = new javax.swing.JLabel();
+			lOrientacion.setSize(102, 38);
+			lOrientacion.setText(PluginServices.getText(this, "orientacion"));
+			lOrientacion.setLocation(25, 100);
+		}
+
+		return lOrientacion;
+	}
+
+	/**
+	 * This method initializes lMargenes
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLMargenes() {
+		if (lMargenes == null) {
+			lMargenes = new javax.swing.JLabel();
+			lMargenes.setSize(95, 20);
+			lMargenes.setText(PluginServices.getText(this, "margenes"));
+			lMargenes.setLocation(25, 145);
+		}
+
+		return lMargenes;
+	}
+
+	/**
+	 * Inserta si se dibuja los margenes sobre el Layout o no.
+	 *
+	 * @param b True si se tiene que dibujar los margenes.
+	 */
+	private void setMargin(boolean b) {
+		margin = b;
+
+		if (b) {
+			getTSuperior().setText(String.valueOf(nf.format(
+						m_layout.getAtributes().toUnits(sup))));
+			getTIzquierdo().setText(String.valueOf(nf.format(
+						m_layout.getAtributes().toUnits(izq))));
+			getTInferior().setText(String.valueOf(nf.format(
+						m_layout.getAtributes().toUnits(inf))));
+			getTDerecho().setText(String.valueOf(nf.format(
+						m_layout.getAtributes().toUnits(der))));
+			getTSuperior().setEnabled(true);
+			getTIzquierdo().setEnabled(true);
+			getTInferior().setEnabled(true);
+			getTDerecho().setEnabled(true);
+		} else {
+			getTSuperior().setText("");
+			getTIzquierdo().setText("");
+			getTInferior().setText("");
+			getTDerecho().setText("");
+			getTSuperior().setEnabled(false);
+			getTIzquierdo().setEnabled(false);
+			getTInferior().setEnabled(false);
+			getTDerecho().setEnabled(false);
+		}
+	}
+
+	/**
+	 * This method initializes chbMargenes
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbMargenes() {
+		if (chbMargenes == null) {
+			chbMargenes = new javax.swing.JCheckBox();
+			chbMargenes.setSize(230, 21);
+			chbMargenes.setText(PluginServices.getText(this,
+					"utilizar_margenes_impresora"));
+			chbMargenes.setLocation(125, 145);
+			chbMargenes.setSelected(m_layout.getAtributes().isMargin());
+			setMargin(m_layout.getAtributes().isMargin());
+			chbMargenes.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						if (chbMargenes.isSelected()) {
+							margin = true;
+						} else {
+							margin = false;
+						}
+
+						setMargin(margin);
+					}
+				});
+		}
+
+		return chbMargenes;
+	}
+
+	/**
+	 * This method initializes lSuperior
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLSuperior() {
+		if (lSuperior == null) {
+			lSuperior = new javax.swing.JLabel();
+			lSuperior.setSize(81, 20);
+			lSuperior.setText(PluginServices.getText(this, "Superior"));
+			lSuperior.setLocation(25, 167);
+		}
+
+		return lSuperior;
+	}
+
+	/**
+	 * This method initializes tSuperior
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTSuperior() {
+		if (tSuperior == null) {
+			tSuperior = new javax.swing.JTextField();
+			tSuperior.setSize(60, 20);
+			tSuperior.setLocation(110, 167);
+
+			if (m_layout.getAtributes().isMargin()) {
+				tSuperior.setText(String.valueOf(nf.format(
+							m_layout.getAtributes().toUnits(sup))));
+			}
+		}
+
+		return tSuperior;
+	}
+
+	/**
+	 * This method initializes lIzquierdo
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLIzquierdo() {
+		if (lIzquierdo == null) {
+			lIzquierdo = new javax.swing.JLabel();
+			lIzquierdo.setSize(88, 20);
+			lIzquierdo.setText(PluginServices.getText(this, "Izquierdo"));
+			lIzquierdo.setLocation(180, 167);
+		}
+
+		return lIzquierdo;
+	}
+
+	/**
+	 * This method initializes tIzquierdo
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTIzquierdo() {
+		if (tIzquierdo == null) {
+			tIzquierdo = new javax.swing.JTextField();
+			tIzquierdo.setSize(60, 20);
+			tIzquierdo.setLocation(280, 167);
+
+			if (m_layout.getAtributes().isMargin()) {
+				tIzquierdo.setText(String.valueOf(nf.format(
+							m_layout.getAtributes().toUnits(izq))));
+			}
+		}
+
+		return tIzquierdo;
+	}
+
+	/**
+	 * This method initializes lInferior
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLInferior() {
+		if (lInferior == null) {
+			lInferior = new javax.swing.JLabel();
+			lInferior.setSize(81, 21);
+			lInferior.setText(PluginServices.getText(this, "Inferior"));
+			lInferior.setLocation(25, 190);
+		}
+
+		return lInferior;
+	}
+
+	/**
+	 * This method initializes tInferior
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTInferior() {
+		if (tInferior == null) {
+			tInferior = new javax.swing.JTextField();
+			tInferior.setSize(60, 20);
+			tInferior.setLocation(110, 190);
+
+			if (m_layout.getAtributes().isMargin()) {
+				tInferior.setText(String.valueOf(nf.format(
+							m_layout.getAtributes().toUnits(inf))));
+			}
+		}
+
+		return tInferior;
+	}
+
+	/**
+	 * This method initializes lDerecho
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLDerecho() {
+		if (lDerecho == null) {
+			lDerecho = new javax.swing.JLabel();
+			lDerecho.setSize(87, 21);
+			lDerecho.setText(PluginServices.getText(this, "Derecho"));
+			lDerecho.setLocation(180, 190);
+		}
+
+		return lDerecho;
+	}
+
+	/**
+	 * This method initializes tDerecho
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTDerecho() {
+		if (tDerecho == null) {
+			tDerecho = new javax.swing.JTextField();
+			tDerecho.setSize(60, 20);
+			tDerecho.setLocation(280, 190);
+
+			if (m_layout.getAtributes().isMargin()) {
+				tDerecho.setText(String.valueOf(nf.format(
+							m_layout.getAtributes().toUnits(der))));
+			}
+		}
+
+		return tDerecho;
+	}
+
+	/**
+	 * This method initializes lResolucion
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLResolucion() {
+		if (lResolucion == null) {
+			lResolucion = new javax.swing.JLabel();
+			lResolucion.setSize(164, 21);
+			lResolucion.setText(PluginServices.getText(this,
+					"resolucion_resultado"));
+			lResolucion.setLocation(25, 215);
+		}
+
+		return lResolucion;
+	}
+
+	/**
+	 * This method initializes cbResolucion
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbResolucion() {
+		if (cbResolucion == null) {
+			cbResolucion = new javax.swing.JComboBox();
+			cbResolucion.setSize(150, 20);
+			cbResolucion.setLocation(195, 215);
+			cbResolucion.addItem(PluginServices.getText(this, "alta"));
+			cbResolucion.addItem(PluginServices.getText(this, "normal"));
+			cbResolucion.addItem(PluginServices.getText(this, "baja"));
+			cbResolucion.setSelectedIndex(m_layout.getAtributes().getResolution());
+			cbResolucion.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						resolution = cbResolucion.getSelectedIndex();
+					}
+				});
+		}
+
+		return cbResolucion;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setSize(84, 23);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.setLocation(130, 245);
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						m_layout.getAtributes().setUnit(unit);
+
+						if (isLand) {
+							m_layout.getAtributes().setIsLandScape(true);
+						} else {
+							m_layout.getAtributes().setIsLandScape(false);
+						}
+
+						m_layout.getAtributes().setType(type);
+						m_layout.getAtributes().setSizeinUnits(isLand);
+						obtainArea();
+
+						double[] area = { sup, inf, izq, der };
+
+						if (type == Attributes.CUSTOM) {
+							Attributes.CUSTOM_PAPER_SIZE = new Size(Double.valueOf(
+										getTAncho().getText()).doubleValue(),
+									Double.valueOf(getTAlto().getText())
+										  .doubleValue());
+						}
+
+						m_layout.getAtributes().setSelectedOptions(type, unit,
+							isLand, margin, resolution, area);
+						m_layout.refresh();
+						PluginServices.getMDIManager().closeView(FConfigLayoutDialog.this);
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setSize(85, 23);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.setLocation(245, 245);
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						//setVisible(false);
+						PluginServices.getMDIManager().closeView(FConfigLayoutDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/**
+	 * This method initializes chbHorizontal
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbHorizontal() {
+		if (chbHorizontal == null) {
+			chbHorizontal = new javax.swing.JCheckBox();
+			chbHorizontal.setSize(99, 21);
+			chbHorizontal.setText(PluginServices.getText(this, "horizontal"));
+			chbHorizontal.setLocation(130, 110);
+			chbHorizontal.setSelected(isLand);
+			chbHorizontal.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						isLand = true;
+						getChbVertical().setSelected(false);
+
+						if (chbHorizontal.isSelected()) {
+							double iz = izq;
+							izq = inf;
+							inf = der;
+							der = sup;
+							sup = iz;
+
+							setMargin(margin);
+
+							//}else{
+							if (type == Attributes.CUSTOM) {
+								Attributes.CUSTOM_PAPER_SIZE = new Size(Double.valueOf(
+											getTAlto().getText()).doubleValue(),
+										Double.valueOf(getTAncho().getText())
+											  .doubleValue());
+							}
+
+							Size size = m_layout.getAtributes().getSizeinUnits(isLand,
+									type);
+							getTAncho().setText(String.valueOf(nf.format(
+										size.getAncho())));
+							getTAlto().setText(String.valueOf(nf.format(
+										size.getAlto())));
+						}
+
+						chbHorizontal.setSelected(true);
+					}
+				});
+		}
+
+		return chbHorizontal;
+	}
+
+	/**
+	 * This method initializes chbVertical
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbVertical() {
+		if (chbVertical == null) {
+			chbVertical = new javax.swing.JCheckBox();
+			chbVertical.setSize(94, 23);
+			chbVertical.setText(PluginServices.getText(this, "vertical"));
+			chbVertical.setLocation(245, 110);
+			chbVertical.setSelected(!isLand);
+			chbVertical.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						isLand = false;
+						getChbHorizontal().setSelected(false);
+
+						if (chbVertical.isSelected()) {
+							double in = inf;
+							inf = izq;
+							izq = sup;
+							sup = der;
+							der = in;
+
+							setMargin(margin);
+
+							//}else{
+							if (type == Attributes.CUSTOM) {
+								Attributes.CUSTOM_PAPER_SIZE = new Size(Double.valueOf(
+											getTAncho().getText()).doubleValue(),
+										Double.valueOf(getTAlto().getText())
+											  .doubleValue());
+							}
+
+							Size size = m_layout.getAtributes().getSizeinUnits(isLand,
+									type);
+							getTAncho().setText(String.valueOf(nf.format(
+										size.getAncho())));
+							getTAlto().setText(String.valueOf(nf.format(
+										size.getAlto())));
+						}
+
+						chbVertical.setSelected(true);
+					}
+				});
+		}
+
+		return chbVertical;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setWidth(371);
+		m_viewinfo.setHeight(300);
+		m_viewinfo.setTitle(PluginServices.getText(this, "Preparar_pagina"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	/**
+	 * Obtiene el �rea de los JtextField.
+	 */
+	private void obtainArea() {
+		String s = (getTSuperior().getText());
+		s = s.replace(',', '.');
+
+		if (s.length() == 0) {
+			s = "0";
+		}
+
+		sup = m_layout.getAtributes().fromUnits(Double.valueOf(s).doubleValue());
+		s = (getTIzquierdo().getText());
+		s = s.replace(',', '.');
+
+		if (s.length() == 0) {
+			s = "0";
+		}
+
+		izq = m_layout.getAtributes().fromUnits(Double.valueOf(s).doubleValue());
+		s = (getTInferior().getText());
+		s = s.replace(',', '.');
+
+		if (s.length() == 0) {
+			s = "0";
+		}
+
+		inf = m_layout.getAtributes().fromUnits(Double.valueOf(s).doubleValue());
+		s = (getTDerecho().getText());
+		s = s.replace(',', '.');
+
+		if (s.length() == 0) {
+			s = "0";
+		}
+
+		der = m_layout.getAtributes().fromUnits(Double.valueOf(s).doubleValue());
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FConfigLayoutDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FPositionDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FPositionDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FPositionDialog.java	(revision 1648)
@@ -0,0 +1,510 @@
+/*
+ * Created on 31-ago-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.gui.layout.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import java.awt.geom.Rectangle2D;
+
+import java.text.NumberFormat;
+
+import java.util.ArrayList;
+
+import javax.swing.JPanel;
+
+
+/**
+ * Di�logo que ofrece la posibilidad de posicionar el fframe en un punto en
+ * concreto del Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FPositionDialog extends JPanel implements View {
+	private javax.swing.JLabel lDesdeIzquierda = null;
+	private javax.swing.JLabel lDesdeArriba = null;
+	private javax.swing.JLabel lAnchura = null;
+	private javax.swing.JLabel lAltura = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+	private javax.swing.JTextField tDesdeIzquierda = null;
+	private javax.swing.JTextField tDesdeDerecha = null;
+	private javax.swing.JTextField tAnchura = null;
+	private javax.swing.JTextField tAltura = null;
+	private javax.swing.JLabel lNomUnidades = null;
+	private javax.swing.JLabel lUnidades = null;
+	private Layout layout = null;
+	private String m_NameUnit = null;
+	//private ArrayList selecList = new ArrayList();
+	NumberFormat nf = NumberFormat.getInstance();
+	private javax.swing.JLabel lAnchoUnidades = null;
+	private javax.swing.JLabel lAlto = null;
+	private javax.swing.JLabel lAltoUnidades = null;
+	private javax.swing.JLabel lAncho = null;
+	private javax.swing.JPanel pFolio = null;
+	private javax.swing.JLabel lSeparador = null;
+	private IFFrame fframe;
+	/**
+	 * This is the default constructor
+	 *
+	 * @param l Referencia al Layout.
+	 */
+	public FPositionDialog(Layout l,IFFrame fframe) {
+		super();
+		layout = l;
+		this.fframe=fframe;
+
+		/*for (int i = layout.getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != FFrame.NOSELECT) {
+				selecList.add(fframe);
+			}
+		}
+		*/
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(null);
+
+		if (layout.isCuadricula()) {
+			nf.setMaximumFractionDigits(1);
+		} else {
+			nf.setMaximumFractionDigits(2);
+		}
+
+		m_NameUnit = layout.getAtributes().getNameUnit();
+		this.add(getLDesdeIzquierda(), null);
+		this.add(getLDesdeArriba(), null);
+		this.add(getLAnchura(), null);
+		this.add(getLAltura(), null);
+		this.add(getBAceptar(), null);
+		this.add(getBCancelar(), null);
+		this.add(getTDesdeIzquierda(), null);
+		this.add(getTDesdeDerecha(), null);
+		this.add(getTAnchura(), null);
+		this.add(getTAltura(), null);
+		this.add(getLNomUnidades(), null);
+		this.add(getLUnidades(), null);
+		this.add(getPFolio(), null);
+		this.setSize(203, 215);
+	}
+
+	/**
+	 * This method initializes lDesdeIzquierda
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLDesdeIzquierda() {
+		if (lDesdeIzquierda == null) {
+			lDesdeIzquierda = new javax.swing.JLabel();
+			lDesdeIzquierda.setBounds(9, 85, 116, 20);
+			lDesdeIzquierda.setText(PluginServices.getText(this,
+					"desde_izquierda"));
+		}
+
+		return lDesdeIzquierda;
+	}
+
+	/**
+	 * This method initializes lDesdeArriba
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLDesdeArriba() {
+		if (lDesdeArriba == null) {
+			lDesdeArriba = new javax.swing.JLabel();
+			lDesdeArriba.setBounds(9, 110, 116, 20);
+			lDesdeArriba.setText(PluginServices.getText(this, "desde_arriba"));
+		}
+
+		return lDesdeArriba;
+	}
+
+	/**
+	 * This method initializes lAnchura
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAnchura() {
+		if (lAnchura == null) {
+			lAnchura = new javax.swing.JLabel();
+			lAnchura.setBounds(9, 135, 116, 20);
+			lAnchura.setText(PluginServices.getText(this, "anchura"));
+		}
+
+		return lAnchura;
+	}
+
+	/**
+	 * This method initializes lAltura
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAltura() {
+		if (lAltura == null) {
+			lAltura = new javax.swing.JLabel();
+			lAltura.setBounds(9, 160, 116, 20);
+			lAltura.setText(PluginServices.getText(this, "altura"));
+		}
+
+		return lAltura;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setBounds(12, 185, 85, 23);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						//if (selecList.size() == 1) {
+							Rectangle2D.Double r = new Rectangle2D.Double();
+
+							if (getTDesdeIzquierda().getText().equals("")) {
+								getTDesdeIzquierda().setText("0");
+							}
+
+							if (getTDesdeDerecha().getText().equals("")) {
+								getTDesdeDerecha().setText("0");
+							}
+
+							if (getTAnchura().getText().equals("")) {
+								getTAnchura().setText("0");
+							}
+
+							if (getTAltura().getText().equals("")) {
+								getTAltura().setText("0");
+							}
+
+							r.x = stringToDouble(getTDesdeIzquierda().getText()
+													 .toString());
+							r.y = stringToDouble(getTDesdeDerecha().getText()
+													 .toString());
+							r.width = stringToDouble(getTAnchura().getText()
+														 .toString());
+							r.height = stringToDouble(getTAltura().getText()
+														  .toString());
+
+							//((IFFrame) selecList.get(0)).setBoundBox(r);
+							fframe.setBoundBox(r);
+						//}
+
+						PluginServices.getMDIManager().closeView(FPositionDialog.this);
+						layout.setStatus(Layout.DESACTUALIZADO);
+						layout.repaint();
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * Paso de String a double.
+	 *
+	 * @param s String.
+	 *
+	 * @return double obtenido.
+	 */
+	private double stringToDouble(String s) {
+		String snew = s.replace(',', '.');
+
+		return layout.getAtributes().fromUnits(Double.parseDouble(snew));
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setBounds(107, 185, 87, 23);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FPositionDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/**
+	 * This method initializes tDesdeIzquierda
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTDesdeIzquierda() {
+		if (tDesdeIzquierda == null) {
+			tDesdeIzquierda = new javax.swing.JTextField();
+			tDesdeIzquierda.setBounds(132, 85, 53, 20);
+			tDesdeIzquierda.setText(String.valueOf(nf.format(
+						layout.getAtributes().toUnits(fframe.getBoundBox().x))));
+		}
+
+		return tDesdeIzquierda;
+	}
+
+	/**
+	 * This method initializes tDesdeDerecha
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTDesdeDerecha() {
+		if (tDesdeDerecha == null) {
+			tDesdeDerecha = new javax.swing.JTextField();
+			tDesdeDerecha.setBounds(132, 110, 53, 20);
+			tDesdeDerecha.setText(String.valueOf(nf.format(
+						layout.getAtributes().toUnits(fframe.getBoundBox().y))));
+		}
+
+		return tDesdeDerecha;
+	}
+
+	/**
+	 * This method initializes tAnchura
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTAnchura() {
+		if (tAnchura == null) {
+			tAnchura = new javax.swing.JTextField();
+			tAnchura.setBounds(132, 135, 53, 20);
+			tAnchura.setText(String.valueOf(nf.format(
+						layout.getAtributes().toUnits(fframe.getBoundBox().width))));
+		}
+
+		return tAnchura;
+	}
+
+	/**
+	 * This method initializes tAltura
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTAltura() {
+		if (tAltura == null) {
+			tAltura = new javax.swing.JTextField();
+			tAltura.setBounds(132, 160, 53, 20);
+			tAltura.setText(String.valueOf(nf.format(layout.getAtributes()
+														   .toUnits(fframe.getBoundBox().height))));
+		}
+
+		return tAltura;
+	}
+
+	/**
+	 * This method initializes lNomUnidades
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLNomUnidades() {
+		if (lNomUnidades == null) {
+			lNomUnidades = new javax.swing.JLabel();
+			lNomUnidades.setBounds(91, 7, 91, 20);
+			lNomUnidades.setText(m_NameUnit);
+		}
+
+		return lNomUnidades;
+	}
+
+	/**
+	 * This method initializes lUnidades
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLUnidades() {
+		if (lUnidades == null) {
+			lUnidades = new javax.swing.JLabel();
+			lUnidades.setBounds(7, 7, 72, 20);
+			lUnidades.setText(PluginServices.getText(this, "unidades"));
+		}
+
+		return lUnidades;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+
+		//vi.setResizable(false);
+		m_viewinfo.setTitle(PluginServices.getText(this, "tama�o_posicion"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	/**
+	 * This method initializes lAnchoUnidades
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAnchoUnidades() {
+		if (lAnchoUnidades == null) {
+			lAnchoUnidades = new javax.swing.JLabel();
+
+			if (layout.getAtributes().isLandSpace()) {
+				lAnchoUnidades.setText(String.valueOf(nf.format(
+							layout.getAtributes().getSizeInUnits().getAlto())));
+			} else {
+				lAnchoUnidades.setText(String.valueOf(nf.format(
+							layout.getAtributes().getSizeInUnits().getAncho())));
+			}
+		}
+
+		return lAnchoUnidades;
+	}
+
+	/**
+	 * This method initializes lAlto
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAlto() {
+		if (lAlto == null) {
+			lAlto = new javax.swing.JLabel();
+			lAlto.setText(PluginServices.getText(this, "alto"));
+		}
+
+		return lAlto;
+	}
+
+	/**
+	 * This method initializes lAltoUnidades
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAltoUnidades() {
+		if (lAltoUnidades == null) {
+			lAltoUnidades = new javax.swing.JLabel();
+
+			if (layout.getAtributes().isLandSpace()) {
+				lAltoUnidades.setText(String.valueOf(nf.format(
+							layout.getAtributes().getSizeInUnits().getAncho())));
+			} else {
+				lAltoUnidades.setText(String.valueOf(nf.format(
+							layout.getAtributes().getSizeInUnits().getAlto())));
+			}
+		}
+
+		return lAltoUnidades;
+	}
+
+	/**
+	 * This method initializes lAncho
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAncho() {
+		if (lAncho == null) {
+			lAncho = new javax.swing.JLabel();
+			lAncho.setText(PluginServices.getText(this, "ancho"));
+		}
+
+		return lAncho;
+	}
+
+	/**
+	 * This method initializes pFolio
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getPFolio() {
+		if (pFolio == null) {
+			pFolio = new javax.swing.JPanel();
+			pFolio.add(getLAltoUnidades(), null);
+			pFolio.add(getLAlto(), null);
+			pFolio.add(getLSeparador(), null);
+			pFolio.add(getLAnchoUnidades(), null);
+			pFolio.add(getLAncho(), null);
+			pFolio.setBounds(9, 31, 180, 43);
+			pFolio.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "tama�o_pagina"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		}
+
+		return pFolio;
+	}
+
+	/**
+	 * This method initializes lSeparador
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLSeparador() {
+		if (lSeparador == null) {
+			lSeparador = new javax.swing.JLabel();
+			lSeparador.setText("/");
+		}
+
+		return lSeparador;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/FPositionDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/Tag.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/Tag.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/Tag.java	(revision 1648)
@@ -0,0 +1,169 @@
+/* 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.gui.layout.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+
+/**
+ * Di�logo para insertar o modificar el Tag asociado a un FFrame.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Tag extends JPanel implements View {
+	private JTextField jTextField = null;
+	private JLabel jLabel = null;
+	private JButton jButton = null;
+	private JButton jButton1 = null;
+	private IFFrame fframe = null;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param f FFrame al que asociar el Tag.
+	 */
+	public Tag(IFFrame f) {
+		super();
+		fframe = f;
+		initialize();
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getJTextField() {
+		if (jTextField == null) {
+			jTextField = new JTextField();
+
+			if (fframe.getTag() != null) {
+				jTextField.setText(fframe.getTag());
+			}
+
+			jTextField.setPreferredSize(new java.awt.Dimension(200, 20));
+		}
+
+		return jTextField;
+	}
+
+	/**
+	 * This method initializes jButton
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getJButton() {
+		if (jButton == null) {
+			jButton = new JButton();
+			jButton.setText("Aceptar");
+			jButton.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						if (getJTextField().getText().compareTo("") == 0) {
+							fframe.setTag(null);
+						} else {
+							fframe.setTag(getJTextField().getText());
+						}
+
+						PluginServices.getMDIManager().closeView(Tag.this);
+					}
+				});
+		}
+
+		return jButton;
+	}
+
+	/**
+	 * This method initializes jButton1
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getJButton1() {
+		if (jButton1 == null) {
+			jButton1 = new JButton();
+			jButton1.setText("Cancelar");
+			jButton1.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(Tag.this);
+					}
+				});
+		}
+
+		return jButton1;
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		jLabel = new JLabel();
+		this.setSize(284, 100);
+		jLabel.setText("tag");
+		this.add(jLabel, null);
+		this.add(getJTextField(), null);
+		this.add(getJButton(), null);
+		this.add(getJButton1(), null);
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo();
+		m_viewinfo.setTitle(PluginServices.getText(this, "tag"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}  

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/dialogs/Tag.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGraphics.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGraphics.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGraphics.java	(revision 1648)
@@ -0,0 +1,343 @@
+/*
+ * Created on 22-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.core.FPoint2D;
+import com.iver.cit.gvsig.fmap.core.FPolygon2D;
+import com.iver.cit.gvsig.fmap.core.FPolyline2D;
+import com.iver.cit.gvsig.fmap.core.FShape;
+import com.iver.cit.gvsig.fmap.core.GeneralPathX;
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+
+/**
+ * FFrame para contener un gr�fico.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameGraphics extends FFrame {
+	private int m_type = FConstant.SHAPE_TYPE_POINT;
+	private FSymbol m_symbol = null;
+	private Color m_color = null;
+	private AffineTransform mT = null;
+	private AffineTransform aT = null;
+
+	/**
+	 * Crea un nuevo FFrameGraphics.
+	 */
+	public FFrameGraphics() {
+		mT = new AffineTransform();
+		mT.setToIdentity();
+	}
+
+	/**
+	 * Rellena el color que se utlizar� para dibujar el s�mbolo.
+	 *
+	 * @param color
+	 */
+	public void setColor(Color color) {
+		m_color = color;
+	}
+
+	/**
+	 * Actualiza el Fsymbol a partir del tipo de Gr�fico que se pase como
+	 * par�metro.
+	 *
+	 * @param type tipo de gr�fico.
+	 * @param at Transformada.
+	 */
+	public void update(int type, AffineTransform at) {
+		m_type = type;
+		aT = at;
+
+		if (m_color == null) {
+			m_color = Color.red;
+		}
+
+		switch (m_type) {
+			case (Layout.POINT):
+				m_symbol = new FSymbol(FConstant.SHAPE_TYPE_POINT, m_color);
+
+				break;
+
+			case (Layout.RECTANGLESIMPLE):
+				m_symbol = new FSymbol(FConstant.SYMBOL_TYPE_FILL, m_color);
+				m_symbol.setColor(null);
+
+				break;
+
+			case (Layout.LINE):
+				m_symbol = new FSymbol(FConstant.SYMBOL_TYPE_LINE, m_color);
+
+				break;
+
+			case (Layout.POLYLINE):
+				m_symbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, m_color);
+
+				break;
+
+			case (Layout.POLYGON):
+				m_symbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, m_color);
+
+				break;
+
+			case (Layout.CIRCLE):
+				m_symbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, m_color);
+				m_symbol.setStyle(FConstant.SYMBOL_STYLE_MARKER_CIRCLE);
+				m_symbol.setOutlined(true);
+				m_symbol.setOutlineColor(Color.red);
+				m_symbol.setColor(null);
+
+				break;
+		}
+	}
+
+	/**
+	 * Devuelve el FSymbol que se representa.
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public FSymbol getFSymbol() {
+		return m_symbol;
+	}
+
+	/**
+	 * Rellena el FSymbol que se representara al dibujar.
+	 *
+	 * @param symbol
+	 */
+	public void setFSymbol(FSymbol symbol) {
+		m_symbol = symbol;
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase DOCUMENT ME!
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) {
+		Rectangle2D.Double rect = getBoundingBox(at);
+
+		if (intersects(rv, rect)) {
+			g.setColor(Color.black);
+
+			FShape m_shape = null;
+
+			switch (m_type) {
+				case (Layout.POINT):
+
+					Point2D.Double p = new Point2D.Double((int) rect.getCenterX(),
+							(int) rect.getCenterY());
+					m_shape = new FPoint2D(p.x, p.y);
+
+					if (rect.width < rect.height) {
+						m_symbol.setSize((int) rect.width - 10);
+					} else {
+						m_symbol.setSize((int) rect.height - 10);
+					}
+
+					///m_symbol = new FSymbol(FConstant.SHAPE_TYPE_POINT, Color.red);
+					FGraphicUtilities.DrawShape(g, mT, m_shape, m_symbol);
+
+					break;
+
+				case (Layout.RECTANGLESIMPLE):
+
+					GeneralPathX rectAux = new GeneralPathX(rect);
+					rectAux.transform(mT);
+					m_shape = new FPolygon2D(rectAux); //FConstant.SHAPE_TYPE_POLYLINE, rectAux);
+
+					///m_symbol = new FSymbol(FConstant.SYMBOL_TYPE_LINE, Color.red);
+					FGraphicUtilities.DrawShape(g, mT, m_shape, m_symbol);
+
+					break;
+
+				case (Layout.LINE):
+
+					Line2D line = new Line2D.Double();
+					line.setLine(new Point2D.Double(rect.x, rect.y),
+						new Point2D.Double(rect.getMaxX(), rect.getMaxY()));
+
+					GeneralPathX rectA = new GeneralPathX(line);
+					rectA.transform(mT);
+					m_shape = new FPolyline2D(rectA);
+
+					///m_symbol = new FSymbol(FConstant.SYMBOL_TYPE_LINE, Color.red);
+					FGraphicUtilities.DrawShape(g, mT, m_shape, m_symbol);
+
+					//g.drawString("POLYLINE",(float)rect.getCenterX(),(float)rect.getCenterY());
+					break;
+
+				case (Layout.POLYLINE):
+					g.drawString("POLYLINE", (float) rect.getCenterX(),
+						(float) rect.getCenterY());
+
+					break;
+
+				case (Layout.POLYGON):
+					g.drawString("POLYGON", (float) rect.getCenterX(),
+						(float) rect.getCenterY());
+
+					break;
+
+				case (Layout.CIRCLE):
+
+					Point2D.Double pc = new Point2D.Double((int) rect.getCenterX(),
+							(int) rect.getCenterY());
+					m_shape = new FPoint2D(pc.x, pc.y);
+
+					if (rect.width < rect.height) {
+						m_symbol.setSize((int) rect.width - 10);
+					} else {
+						m_symbol.setSize((int) rect.height - 10);
+					}
+
+					///m_symbol = new FSymbol(FConstant.SHAPE_TYPE_POINT, Color.red);
+					FGraphicUtilities.DrawShape(g, mT, m_shape, m_symbol);
+
+					break;
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.GRAPHICS);
+
+		/// xml.putProperty("m_type", m_type);
+		xml.putProperty("tag", getTag());
+
+		/// xml.addChild(m_symbol.getXMLEntity());
+		return xml;
+	}
+
+	/**
+	 * Crea un Objeto de esta clase a partir de la informaci�n del XMLEntity.
+	 *
+	 * @param xml XMLEntity
+	 *
+	 * @return Objeto de esta clase.
+	 */
+	public static FFrameGraphics createFFrameGraphics(XMLEntity xml) {
+		FFrameGraphics fframe = new FFrameGraphics();
+
+		if (xml.getIntProperty("m_Selected") != 0) {
+			fframe.setSelected(true);
+		} else {
+			fframe.setSelected(false);
+		}
+
+		/// fframe.m_type = xml.getIntProperty("m_type");
+		/// fframe.m_symbol = FSymbol.createFSymbol(xml.getChild(0));
+		return fframe;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#updateNum()
+	 */
+	public void updateNum() {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNum()
+	 */
+	public int getNum() {
+		return 0;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
+	 * 		com.iver.cit.gvsig.project.Project)
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout p) {
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "Gr�ficos") + num;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at)
+		throws DriverException {
+		draw(g, at, null, null);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGraphics.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameGraphicsDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameGraphicsDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameGraphicsDialog.java	(revision 1648)
@@ -0,0 +1,184 @@
+/*
+ * Created on 02-ago-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.gui.layout.fframes.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.fmap.core.v02.FConstant;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics;
+import com.iver.cit.gvsig.gui.legendmanager.panels.FPanelLegendDefault;
+
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * Di�logo de las propiedades de los gr�ficos.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameGraphicsDialog extends FPanelLegendDefault
+	implements IFFrameDialog {
+	private Rectangle2D rect = new Rectangle2D.Double();
+	private Layout m_layout = null; //  @jve:visual-info  decl-index=0 visual-constraint="393,10"
+	private boolean isAcepted = false;
+	private FFrameGraphics fframegraphics = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+
+	/**
+	 * Crea un nuevo FFrameGraphicsDialog.
+	 *
+	 * @param layout Referencia al Layout.
+	 * @param fframe Referencia al fframe de gr�fico.
+	 */
+	public FFrameGraphicsDialog(Layout layout, FFrameGraphics fframe) {
+		m_layout = layout;
+		fframegraphics = fframe;
+		setFSymbol(fframegraphics.getFSymbol());
+		fillCheckBox.setSelected(false);
+
+		initialize();
+		this.getJPanelPoint().setVisible(false);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.add(getBAceptar(), null);
+		this.add(getBCancelar(), null);
+		this.setSize(532, 373);
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
+	 */
+	public Object getViewModel() {
+		return "FPanelLegendDefault";
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_grafico"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#setRectangle(java.awt.geom.Rectangle2D)
+	 */
+	public void setRectangle(Rectangle2D r) {
+		rect.setRect(r);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
+	 */
+	public boolean getIsAcepted() {
+		return isAcepted;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setBounds(85, 326, 122, 28);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						if (getFSymbol().getSymbolType() == FConstant.SYMBOL_TYPE_POINT) {
+							updateControls(false); // Para que lo que haya en 
+						}
+
+						// ese momento en los controles pase al m_FSymbol
+						///m_Renderer.setLegendType(FConstant.LEGEND_TYPE_DEFAULT);
+						fframegraphics.setFSymbol(getFSymbol());
+
+						///m_Renderer.setDefaultSymbol(m_defaultLegendPanel.getFSymbol());
+						PluginServices.getMDIManager().closeView(FFrameGraphicsDialog.this);
+						m_layout.refresh();
+						isAcepted = true;
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setBounds(292, 326, 122, 28);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FFrameGraphicsDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameGraphicsDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameTextDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameTextDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameTextDialog.java	(revision 1648)
@@ -0,0 +1,538 @@
+/*
+ * Created on 22-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.gui.layout.fframes.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.Abrir;
+import com.iver.cit.gvsig.gui.Dialogs.FontChooser;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameText;
+
+import java.awt.geom.Rectangle2D;
+
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JToggleButton;
+
+
+/**
+ * Dialogo para a�adir texto al Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameTextDialog extends JPanel implements IFFrameDialog {
+	public static final ImageIcon ileft = new ImageIcon(Abrir.class.getClassLoader()
+																   .getResource("images/left.PNG"));
+	public static final ImageIcon icenterV = new ImageIcon(Abrir.class.getClassLoader()
+																	  .getResource("images/centerV.PNG"));
+	public static final ImageIcon iright = new ImageIcon(Abrir.class.getClassLoader()
+																	.getResource("images/right.PNG"));
+	private javax.swing.JPanel jContentPane = null; //  @jve:visual-info  decl-index=0 visual-constraint="593,10"
+	private javax.swing.JScrollPane jScrollPane = null;
+	private javax.swing.JTextArea taTexto = null;
+	private javax.swing.JLabel lAlinear = null;
+	private JToggleButton bIzquierda = null;
+	private JToggleButton bCentro = null;
+	private JToggleButton bDerecha = null;
+	private javax.swing.JLabel jLabel1 = null;
+	private javax.swing.JComboBox jComboBox = null;
+	private javax.swing.JLabel jLabel2 = null;
+	private javax.swing.JLabel lRotacion = null;
+	private javax.swing.JTextField tRotacion = null;
+	private javax.swing.JLabel lGrados = null;
+	private javax.swing.JCheckBox chbEscalaVista = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+	private Layout m_layout = null;
+	private Rectangle2D rect = new Rectangle2D.Double();
+	private FFrameText fframetext = null; //new FFrameText();
+	private boolean isAcepted = false;
+	private javax.swing.JButton bFuente = null;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layout Referencia al Layout.
+	 * @param fframe Referencia al fframe de texto.
+	 */
+	public FFrameTextDialog(Layout layout, FFrameText fframe) {
+		super();
+		fframetext = fframe;
+		m_layout = layout;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(null);
+		this.add(getJContentPane(), null);
+		this.setSize(288, 218);
+	}
+
+	/**
+	 * Inserta el rect�ngulo a ocupar por el fframe de texto.
+	 *
+	 * @param r Rect�ngulo.
+	 */
+	public void setRectangle(Rectangle2D r) {
+		rect.setRect(r);
+	}
+
+	/**
+	 * This method initializes jContentPane
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJContentPane() {
+		if (jContentPane == null) {
+			jContentPane = new javax.swing.JPanel();
+			jContentPane.setLayout(null);
+			jContentPane.add(getJScrollPane(), null);
+			jContentPane.add(getLAlinear(), null);
+			jContentPane.add(getBIzquierda(), null);
+			jContentPane.add(getBCentro(), null);
+			jContentPane.add(getBDerecha(), null);
+
+			//jContentPane.add(getJLabel1(), null);
+			//jContentPane.add(getJComboBox(), null);
+			//jContentPane.add(getJLabel2(), null);
+			jContentPane.add(getLRotacion(), null);
+			jContentPane.add(getTRotacion(), null);
+			jContentPane.add(getLGrados(), null);
+			jContentPane.add(getChbEscalaVista(), null);
+			jContentPane.add(getBAceptar(), null);
+			jContentPane.add(getBCancelar(), null);
+			jContentPane.add(getBFuente(), null);
+			jContentPane.setSize(286, 227);
+			jContentPane.setLocation(6, 4);
+		}
+
+		return jContentPane;
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new javax.swing.JScrollPane();
+			jScrollPane.setViewportView(getTaTexto());
+			jScrollPane.setSize(261, 83);
+			jScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+			jScrollPane.setLocation(5, 5);
+		}
+
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes taTexto
+	 *
+	 * @return javax.swing.JTextArea
+	 */
+	private javax.swing.JTextArea getTaTexto() {
+		if (taTexto == null) {
+			taTexto = new javax.swing.JTextArea();
+
+			for (int i = 0; i < fframetext.getText().size(); i++) {
+				if (!((String) fframetext.getText().get(i)).equals("")) {
+					taTexto.append((String) fframetext.getText().get(i));
+				}
+
+				taTexto.setPreferredSize(new java.awt.Dimension(220, 80));
+			}
+		}
+
+		return taTexto;
+	}
+
+	/**
+	 * This method initializes lAlinear
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLAlinear() {
+		if (lAlinear == null) {
+			lAlinear = new javax.swing.JLabel();
+			lAlinear.setSize(74, 27);
+			lAlinear.setText(PluginServices.getText(this, "alinear"));
+			lAlinear.setLocation(5, 98);
+		}
+
+		return lAlinear;
+	}
+
+	/**
+	 * This method initializes bIzquierda
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JToggleButton getBIzquierda() {
+		if (bIzquierda == null) {
+			bIzquierda = new JToggleButton();
+			bIzquierda.setSize(30, 27);
+			bIzquierda.setPreferredSize(new java.awt.Dimension(28, 20));
+			bIzquierda.setLocation(87, 98);
+
+			if (fframetext.getPos() == FFrameText.LEFT) {
+				bIzquierda.setSelected(true);
+			}
+
+			bIzquierda.setIcon(ileft);
+			bIzquierda.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframetext.setPos(FFrameText.LEFT);
+						getBIzquierda().setSelected(true);
+						getBCentro().setSelected(false);
+						getBDerecha().setSelected(false);
+					}
+				});
+		}
+
+		return bIzquierda;
+	}
+
+	/**
+	 * This method initializes bCentro
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JToggleButton getBCentro() {
+		if (bCentro == null) {
+			bCentro = new JToggleButton();
+			bCentro.setSize(30, 27);
+			bCentro.setPreferredSize(new java.awt.Dimension(28, 20));
+			bCentro.setLocation(120, 98);
+
+			if (fframetext.getPos() == FFrameText.CENTER) {
+				bCentro.setSelected(true);
+			}
+
+			bCentro.setIcon(icenterV);
+			bCentro.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframetext.setPos(FFrameText.CENTER);
+						getBIzquierda().setSelected(false);
+						getBCentro().setSelected(true);
+						getBDerecha().setSelected(false);
+					}
+				});
+		}
+
+		return bCentro;
+	}
+
+	/**
+	 * This method initializes bDerecha
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JToggleButton getBDerecha() {
+		if (bDerecha == null) {
+			bDerecha = new JToggleButton();
+			bDerecha.setSize(30, 27);
+			bDerecha.setPreferredSize(new java.awt.Dimension(28, 20));
+			bDerecha.setLocation(153, 98);
+
+			if (fframetext.getPos() == FFrameText.RIGTH) {
+				bDerecha.setSelected(true);
+			}
+
+			bDerecha.setIcon(iright);
+			bDerecha.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframetext.setPos(FFrameText.RIGTH);
+						getBIzquierda().setSelected(false);
+						getBCentro().setSelected(false);
+						getBDerecha().setSelected(true);
+					}
+				});
+		}
+
+		return bDerecha;
+	}
+
+	/**
+	 * This method initializes jLabel1
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel1() {
+		if (jLabel1 == null) {
+			jLabel1 = new javax.swing.JLabel();
+			jLabel1.setSize(95, 16);
+			jLabel1.setText("Espacio Vertical:");
+			jLabel1.setLocation(5, 140);
+		}
+
+		return jLabel1;
+	}
+
+	/**
+	 * This method initializes jComboBox
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getJComboBox() {
+		if (jComboBox == null) {
+			jComboBox = new javax.swing.JComboBox();
+			jComboBox.addItem("0");
+			jComboBox.addItem("1");
+			jComboBox.addItem("2");
+
+			//jComboBox.setSelectedIndex(fframetext.getSpace());
+			jComboBox.setSize(102, 20);
+			jComboBox.setPreferredSize(new java.awt.Dimension(45, 20));
+			jComboBox.setLocation(130, 140);
+			jComboBox.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						//fframetext.setSpace(jComboBox.getSelectedIndex());
+					}
+				});
+		}
+
+		return jComboBox;
+	}
+
+	/**
+	 * This method initializes jLabel2
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel2() {
+		if (jLabel2 == null) {
+			jLabel2 = new javax.swing.JLabel();
+			jLabel2.setSize(34, 16);
+			jLabel2.setText("l�neas");
+			jLabel2.setLocation(238, 141);
+		}
+
+		return jLabel2;
+	}
+
+	/**
+	 * This method initializes lRotacion
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLRotacion() {
+		if (lRotacion == null) {
+			lRotacion = new javax.swing.JLabel();
+			lRotacion.setBounds(6, 131, 109, 16);
+			lRotacion.setText(PluginServices.getText(this, "angulo_rotacion"));
+		}
+
+		return lRotacion;
+	}
+
+	/**
+	 * This method initializes tRotacion
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTRotacion() {
+		if (tRotacion == null) {
+			tRotacion = new javax.swing.JTextField();
+			tRotacion.setBounds(154, 128, 64, 20);
+			tRotacion.setPreferredSize(new java.awt.Dimension(45, 20));
+			tRotacion.setText(Double.toString(fframetext.getRotation()));
+		}
+
+		return tRotacion;
+	}
+
+	/**
+	 * This method initializes lGrados
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLGrados() {
+		if (lGrados == null) {
+			lGrados = new javax.swing.JLabel();
+			lGrados.setSize(40, 16);
+			lGrados.setText(PluginServices.getText(this, "grados"));
+			lGrados.setLocation(226, 130);
+		}
+
+		return lGrados;
+	}
+
+	/**
+	 * This method initializes chbEscalaVista
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbEscalaVista() {
+		if (chbEscalaVista == null) {
+			chbEscalaVista = new javax.swing.JCheckBox();
+			chbEscalaVista.setSize(280, 24);
+			chbEscalaVista.setText(
+				"Redimensionar el texto a escala con la vista. ");
+			chbEscalaVista.setSelected(fframetext.isSizeFixed());
+			chbEscalaVista.setLocation(6, 153);
+			chbEscalaVista.setEnabled(false);
+		}
+
+		return chbEscalaVista;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setSize(79, 26);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.setLocation(46, 183);
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframetext.setBoundBox(FLayoutUtilities.toSheetRect(
+								rect, m_layout.getAT()));
+						fframetext.getText().clear();
+
+						for (int i = 0; i < getTaTexto().getLineCount(); i++) {
+							try {
+								String s = getTaTexto().getText(getTaTexto()
+																	.getLineStartOffset(i),
+										getTaTexto().getLineEndOffset(i) -
+										getTaTexto().getLineStartOffset(i));
+
+								if (!s.equals("")) {
+									fframetext.addText(s);
+								}
+							} catch (Exception ex) {
+							}
+						}
+
+						fframetext.setSizeFixed(!getChbEscalaVista().isSelected());
+						fframetext.setRotation(Double.parseDouble(
+								getTRotacion().getText()));
+						PluginServices.getMDIManager().closeView(FFrameTextDialog.this);
+						m_layout.refresh();
+						isAcepted = true;
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setSize(85, 26);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.setLocation(151, 183);
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FFrameTextDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+
+		//vi.setResizable(false);
+		m_viewinfo.setTitle(PluginServices.getText(this, "Propiedades_texto"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
+	 */
+	public boolean getIsAcepted() {
+		return isAcepted;
+	}
+
+	/**
+	 * This method initializes bFuente
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBFuente() {
+		if (bFuente == null) {
+			bFuente = new javax.swing.JButton();
+			bFuente.setBounds(184, 98, 82, 27);
+			bFuente.setText(PluginServices.getText(this, "fuente"));
+			bFuente.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframetext.setFont(FontChooser.showDialog(
+								"Selecci�n de fuente", fframetext.getFont())); // fchoser=new FontChooser();	
+					}
+				});
+		}
+
+		return bFuente;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameTextDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/IFFrameDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/IFFrameDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/IFFrameDialog.java	(revision 1648)
@@ -0,0 +1,79 @@
+/*
+ * Created on 06-jul-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.gui.layout.fframes.dialogs;
+
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * Interface para la creaci�n de los di�logos que a�aden elementos al Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public interface IFFrameDialog extends View {
+	/**
+	 * Rellena el Rect�ngulo que representa el tama�o y posici�n del fframe.
+	 *
+	 * @param r BoundingBox del fframe.
+	 */
+	public void setRectangle(Rectangle2D r);
+
+	/**
+	 * Devuelve la informaci�n de la ventana.
+	 *
+	 * @return Informaci�n referente a la ventana.
+	 */
+	public ViewInfo getViewInfo();
+
+	/**
+	 * Devuelve true si ha sido aceptado el di�logo.
+	 *
+	 * @return True si se ha aceptado.
+	 */
+	public boolean getIsAcepted();
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/IFFrameDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameViewDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameViewDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameViewDialog.java	(revision 1648)
@@ -0,0 +1,580 @@
+/*
+ * 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.gui.layout.fframes.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.ListViewModel;
+import com.iver.cit.gvsig.project.ProjectView;
+
+import java.awt.geom.Rectangle2D;
+
+import javax.swing.JPanel;
+
+
+/**
+ * Di�logo para a�adir una vista al Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameViewDialog extends JPanel implements IFFrameDialog {
+	private javax.swing.JPanel jContentPane = null;
+	private javax.swing.JLabel lVistas = null;
+	private javax.swing.JScrollPane jScrollPane = null;
+	private javax.swing.JList liVistas = null; //  @jve:visual-info  decl-index=0 visual-constraint="98,-3"
+	private javax.swing.JCheckBox chbEnlaceVivo = null;
+	private javax.swing.JLabel lEscala = null;
+	private javax.swing.JComboBox cbEscala = null;
+	private javax.swing.JLabel lEscalaNumerica = null;
+	private javax.swing.JTextField tEscalaNumerica = null;
+	private javax.swing.JLabel lExtension = null;
+	private javax.swing.JComboBox cbExtension = null;
+	private javax.swing.JLabel lVisualizacion = null;
+	private javax.swing.JComboBox cbVisualizacion = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+	private javax.swing.JLabel lCalidad = null;
+	private javax.swing.JComboBox cbCalidad = null;
+	private ProjectView m_projectView = null;
+	private Rectangle2D rect = new Rectangle2D.Double();
+	private FFrameView fframeview = null; //new FFrameView();
+	private Layout m_layout = null;
+	private boolean isAcepted = false;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layout Referencia al Layout.
+	 * @param fframe Referencia al fframe vista.
+	 */
+	public FFrameViewDialog(Layout layout, FFrameView fframe) {
+		super();
+		fframeview = fframe;
+		m_layout = layout;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(null);
+		this.add(getJContentPane(), null);
+		this.setSize(339, 273);
+
+		if (!fframeview.getLinked()) {
+			getTEscalaNumerica().setEnabled(true);
+		}
+	}
+
+	/**
+	 * Inserta el rect�ngulo que ocupar� el fframe vista.
+	 *
+	 * @param r Rect�ngulo.
+	 */
+	public void setRectangle(Rectangle2D r) {
+		rect.setRect(r);
+	}
+
+	/**
+	 * This method initializes jContentPane
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJContentPane() {
+		if (jContentPane == null) {
+			jContentPane = new javax.swing.JPanel();
+			jContentPane.setLayout(null);
+			jContentPane.add(getLVistas(), null);
+			jContentPane.add(getJScrollPane(), null);
+			jContentPane.add(getChbEnlaceVivo(), null);
+			jContentPane.add(getLEscala(), null);
+			jContentPane.add(getCbEscala(), null);
+			jContentPane.add(getLEscalaNumerica(), null);
+			jContentPane.add(getTEscalaNumerica(), null);
+			jContentPane.add(getLExtension(), null);
+			jContentPane.add(getCbExtension(), null);
+			jContentPane.add(getLVisualizacion(), null);
+			jContentPane.add(getCbVisualizacion(), null);
+			jContentPane.add(getLCalidad(), null);
+			jContentPane.add(getCbCalidad(), null);
+			jContentPane.add(getbAceptar(), null);
+			jContentPane.add(getBCancelar(), null);
+			jContentPane.setSize(337, 270);
+			jContentPane.setPreferredSize(new java.awt.Dimension(60, 60));
+			jContentPane.setLocation(0, 0);
+		}
+
+		return jContentPane;
+	}
+
+	/**
+	 * This method initializes lVistas
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLVistas() {
+		if (lVistas == null) {
+			lVistas = new javax.swing.JLabel();
+			lVistas.setSize(85, 19);
+			lVistas.setText(PluginServices.getText(this, "Vista"));
+			lVistas.setLocation(10, 10);
+		}
+
+		return lVistas;
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new javax.swing.JScrollPane();
+			jScrollPane.setViewportView(getLiVistas());
+			jScrollPane.setBounds(99, 8, 224, 64);
+			jScrollPane.setPreferredSize(new java.awt.Dimension(250, 60));
+		}
+
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes liVistas
+	 *
+	 * @return javax.swing.JList
+	 */
+	private javax.swing.JList getLiVistas() {
+		if (liVistas == null) {
+			ListViewModel listmodel = new ListViewModel();
+			listmodel.addViews();
+			liVistas = new javax.swing.JList();
+			liVistas.setModel(listmodel);
+
+			for (int i = 0; i < liVistas.getModel().getSize(); i++) {
+				if (fframeview.getFMap() != null) {
+					m_projectView = (ProjectView) liVistas.getModel()
+														  .getElementAt(i);
+
+					if (m_projectView.getMapContext() == fframeview.getFMap()) {
+						liVistas.setSelectedIndex(i);
+						fframeview.setMapUnits(m_projectView.getMapContext()
+															.getViewPort()
+															.getMapUnits());
+					}
+				}
+			}
+
+			liVistas.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+					public void valueChanged(
+						javax.swing.event.ListSelectionEvent e) {
+						int selectInt = (int) e.getFirstIndex();
+						m_projectView = (ProjectView) liVistas.getModel()
+															  .getElementAt(selectInt);
+
+						///fframeview=new FFrameView();
+						//Layout layout=(Layout)App.instance.getMDIContext().getActiveView();
+						fframeview.setBoundBox(FLayoutUtilities.toSheetRect(
+								rect, m_layout.getAT()));
+						fframeview.setView((ProjectView) m_projectView);
+
+						//fframeview.setFMap(m_projectView.getMapContext());
+						fframeview.setMapUnits(m_projectView.getMapContext()
+															.getViewPort()
+															.getMapUnits());
+						getTEscalaNumerica().setText(String.valueOf(
+								fframeview.getScale()));
+					}
+				});
+		}
+
+		return liVistas;
+	}
+
+	/**
+	 * This method initializes chbEnlaceVivo
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbEnlaceVivo() {
+		if (chbEnlaceVivo == null) {
+			chbEnlaceVivo = new javax.swing.JCheckBox();
+			chbEnlaceVivo.setSize(88, 24);
+			chbEnlaceVivo.setText(PluginServices.getText(this, "enlace_vivo"));
+			chbEnlaceVivo.setSelected(fframeview.getLinked());
+			chbEnlaceVivo.setLocation(10, 75);
+			chbEnlaceVivo.setEnabled(true);
+			chbEnlaceVivo.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
+					}
+				});
+		}
+
+		return chbEnlaceVivo;
+	}
+
+	/**
+	 * This method initializes lEscala
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLEscala() {
+		if (lEscala == null) {
+			lEscala = new javax.swing.JLabel();
+			lEscala.setSize(86, 16);
+			lEscala.setText(PluginServices.getText(this, "escala"));
+			lEscala.setLocation(10, 105);
+		}
+
+		return lEscala;
+	}
+
+	/**
+	 * This method initializes cbEscala
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbEscala() {
+		if (cbEscala == null) {
+			//String[] s={"Autom�tico","Conservar escala de visualizaci�n","Escala especificada por el usuario"};
+			cbEscala = new javax.swing.JComboBox();
+			cbEscala.setSize(220, 20);
+			cbEscala.addItem(PluginServices.getText(this, "automatico"));
+			cbEscala.addItem(PluginServices.getText(this,
+					"conservar_escala_visualizacion"));
+			cbEscala.addItem(PluginServices.getText(this, "escala_usuario"));
+			cbEscala.setSelectedIndex(fframeview.getTypeScale());
+
+			if (fframeview.getTypeScale() != 0) {
+				getTEscalaNumerica().setEnabled(true);
+			}
+
+			cbEscala.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbEscala.setLocation(100, 105);
+			cbEscala.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						if (cbEscala.getSelectedIndex() == 2) {
+							getTEscalaNumerica().setEnabled(true);
+						} else {
+							getTEscalaNumerica().setEnabled(false);
+						}
+					}
+				});
+		}
+
+		return cbEscala;
+	}
+
+	/**
+	 * This method initializes lEscalaNumerica
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLEscalaNumerica() {
+		if (lEscalaNumerica == null) {
+			lEscalaNumerica = new javax.swing.JLabel();
+			lEscalaNumerica.setSize(86, 16);
+			lEscalaNumerica.setText("1:");
+			lEscalaNumerica.setLocation(10, 130);
+		}
+
+		return lEscalaNumerica;
+	}
+
+	/**
+	 * This method initializes tEscalaNumerica
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTEscalaNumerica() {
+		if (tEscalaNumerica == null) {
+			tEscalaNumerica = new javax.swing.JTextField();
+			tEscalaNumerica.setSize(220, 20);
+			tEscalaNumerica.setPreferredSize(new java.awt.Dimension(200, 20));
+
+			if (m_projectView != null) {
+				tEscalaNumerica.setText(String.valueOf(fframeview.getScale()));
+			}
+
+			tEscalaNumerica.setLocation(100, 130);
+			tEscalaNumerica.setEnabled(false);
+		}
+
+		return tEscalaNumerica;
+	}
+
+	/**
+	 * This method initializes lExtension
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLExtension() {
+		if (lExtension == null) {
+			lExtension = new javax.swing.JLabel();
+			lExtension.setSize(86, 16);
+			lExtension.setText(PluginServices.getText(this, "extension"));
+			lExtension.setLocation(10, 155);
+		}
+
+		return lExtension;
+	}
+
+	/**
+	 * This method initializes cbExtension
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbExtension() {
+		if (cbExtension == null) {
+			//String[] s={"Rellenar marco de la vista","Recorte a vista"};
+			cbExtension = new javax.swing.JComboBox();
+			cbExtension.setSize(220, 20);
+			cbExtension.addItem(PluginServices.getText(this,
+					"rellenar_marco_vista"));
+			cbExtension.addItem(PluginServices.getText(this, "recorte_vista"));
+
+			cbExtension.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbExtension.setLocation(100, 155);
+			cbExtension.setEnabled(false);
+		}
+
+		return cbExtension;
+	}
+
+	/**
+	 * This method initializes jLabel4
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLVisualizacion() {
+		if (lVisualizacion == null) {
+			lVisualizacion = new javax.swing.JLabel();
+			lVisualizacion.setSize(86, 16);
+			lVisualizacion.setText(PluginServices.getText(this, "visualizacion"));
+			lVisualizacion.setLocation(10, 180);
+		}
+
+		return lVisualizacion;
+	}
+
+	/**
+	 * This method initializes cbVisualizacion
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbVisualizacion() {
+		if (cbVisualizacion == null) {
+			//String[] s={"Cuando activo","Siempre"};
+			cbVisualizacion = new javax.swing.JComboBox();
+			cbVisualizacion.setSize(220, 20);
+			cbVisualizacion.addItem(PluginServices.getText(this, "cuando_activo"));
+			cbVisualizacion.addItem(PluginServices.getText(this, "siempre"));
+			cbVisualizacion.setSelectedIndex(fframeview.getViewing());
+			cbVisualizacion.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbVisualizacion.setLocation(100, 180);
+			cbVisualizacion.setEnabled(false);
+		}
+
+		return cbVisualizacion;
+	}
+
+	/**
+	 * This method initializes jButton
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getbAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setSize(85, 26);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.setLocation(55, 229);
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframeview.setBoundBox(FLayoutUtilities.toSheetRect(
+								rect, m_layout.getAT()));
+
+						if (m_projectView != null) {
+							fframeview.setLinked(getChbEnlaceVivo().isSelected());
+							fframeview.setName(m_projectView.getName());
+
+							fframeview.setTypeScale(getCbEscala()
+														.getSelectedIndex());
+							fframeview.setScale(Double.parseDouble(
+									getTEscalaNumerica().getText()));
+							fframeview.setView((ProjectView) m_projectView);
+
+							//fframeview.setFMap(m_projectView.getMapContext());
+							fframeview.setExtension(getCbExtension()
+														.getSelectedIndex());
+							fframeview.setViewing(getCbVisualizacion()
+													  .getSelectedIndex());
+							fframeview.setQuality(getCbCalidad()
+													  .getSelectedIndex());
+							fframeview.setBoundBox(FLayoutUtilities.toSheetRect(
+									rect, m_layout.getAT()));
+
+							/*        for (int i=0;i<m_layout.getFFrames().size();i++){
+							   IFFrame fframe=(IFFrame)m_layout.getFFrames().get(i);
+							   if (fframe instanceof FFrameScaleBar){
+							           if (((FFrameScaleBar)fframe).getFFrameView()==fframeview){
+							           if (getJComboBox().getSelectedIndex()!=0){
+							           ((FFrameScaleBar)fframe).setIsFixed(true);
+							           ((FFrameScaleBar)fframe).setScaleView(Long.parseLong(getJTextField().getText()));
+							           }else{
+							                   ((FFrameScaleBar)fframe).setIsFixed(false);
+							           }
+							
+							           }
+							   }
+							
+							
+							   }
+							 */
+						}
+
+						isAcepted = true;
+
+						//}else{
+						//	isAcepted=false;
+						//}
+						PluginServices.getMDIManager().closeView(FFrameViewDialog.this);
+						m_layout.refresh();
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setSize(85, 26);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.setLocation(195, 229);
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FFrameViewDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/**
+	 * This method initializes lCalidad
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLCalidad() {
+		if (lCalidad == null) {
+			lCalidad = new javax.swing.JLabel();
+			lCalidad.setSize(86, 16);
+			lCalidad.setText(PluginServices.getText(this, "calidad"));
+			lCalidad.setLocation(10, 205);
+		}
+
+		return lCalidad;
+	}
+
+	/**
+	 * This method initializes cbCalidad
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbCalidad() {
+		if (cbCalidad == null) {
+			//String[] s={"Presentaci�n","Borrador"};
+			cbCalidad = new javax.swing.JComboBox();
+			cbCalidad.setSize(220, 20);
+			cbCalidad.addItem(PluginServices.getText(this, "presentacion"));
+			cbCalidad.addItem(PluginServices.getText(this, "borrador"));
+			cbCalidad.setSelectedIndex(fframeview.getQuality());
+			cbCalidad.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbCalidad.setLocation(100, 205);
+		}
+
+		return cbCalidad;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+
+		//vi.setResizable(false);
+		m_viewinfo.setTitle(PluginServices.getText(this,
+				"propiedades_marco_vista"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
+	 */
+	public boolean getIsAcepted() {
+		return isAcepted;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+} 
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameViewDialog.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFramePictureDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFramePictureDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFramePictureDialog.java	(revision 1648)
@@ -0,0 +1,389 @@
+/*
+ * Created on 02-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.gui.layout.fframes.dialogs;
+
+import java.awt.Component;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.MediaTracker;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.swing.ImageIcon;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFramePicture;
+import com.iver.utiles.GenericFileFilter;
+import com.sun.jimi.core.Jimi;
+
+
+/**
+ * Dialogo para a�adir una imagen al Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFramePictureDialog extends JPanel implements IFFrameDialog {
+	private javax.swing.JPanel jContentPane = null;
+	private javax.swing.JLabel lFichero = null;
+	private javax.swing.JTextField tFichero = null;
+	private javax.swing.JButton bExaminar = null;
+	private javax.swing.JLabel lVisualizacion = null;
+	private javax.swing.JComboBox cbVisualizacion = null;
+	private javax.swing.JLabel lCalidad = null;
+	private javax.swing.JComboBox cbCalidad = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+	private Rectangle2D rect = new Rectangle2D.Double();
+	private FFramePicture fframepicture = null; // = new FFramePicture();
+	private String namefile = null;
+	private Layout m_layout = null;
+	private boolean isAcepted = false;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layout Referencia al Layout.
+	 * @param fframe Referencia al fframe de imagen.
+	 */
+	public FFramePictureDialog(Layout layout, FFramePicture fframe) {
+		super();
+		fframepicture = fframe;
+		m_layout = layout;
+		initialize();
+	}
+
+	/**
+	 * Inserta el rect�ngulo que ocupar� el fframe de imagen.
+	 *
+	 * @param r Rect�ngulo.
+	 */
+	public void setRectangle(Rectangle2D r) {
+		rect.setRect(r);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(null);
+		this.add(getJContentPane(), null);
+		this.setSize(381, 127);
+	}
+
+	/**
+	 * This method initializes jContentPane
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJContentPane() {
+		if (jContentPane == null) {
+			jContentPane = new javax.swing.JPanel();
+			jContentPane.setLayout(null);
+			jContentPane.add(getLFichero(), null);
+			jContentPane.add(getLCalidad(), null);
+			jContentPane.add(getCbCalidad(), null);
+			jContentPane.add(getTFichero(), null);
+			jContentPane.add(getBExaminar(), null);
+			jContentPane.add(getLVisualizacion(), null);
+			jContentPane.add(getCbVisualizacion(), null);
+			jContentPane.add(getBAceptar(), null);
+			jContentPane.add(getBCancelar(), null);
+			jContentPane.setSize(385, 128);
+			jContentPane.setLocation(0, 0);
+		}
+
+		return jContentPane;
+	}
+
+	/**
+	 * This method initializes lFichero
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLFichero() {
+		if (lFichero == null) {
+			lFichero = new javax.swing.JLabel();
+			lFichero.setSize(42, 20);
+			lFichero.setText(PluginServices.getText(this, "Fichero"));
+			lFichero.setLocation(10, 9);
+		}
+
+		return lFichero;
+	}
+
+	/**
+	 * This method initializes tFichero
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTFichero() {
+		if (tFichero == null) {
+			tFichero = new javax.swing.JTextField();
+			tFichero.setBounds(62, 8, 200, 20);
+			tFichero.setPreferredSize(new java.awt.Dimension(200, 20));
+		}
+
+		if (fframepicture.getPath() != null) {
+			tFichero.setText(fframepicture.getPath());
+		}
+
+		return tFichero;
+	}
+
+	/**
+	 * This method initializes bExaminar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBExaminar() {
+		if (bExaminar == null) {
+			bExaminar = new javax.swing.JButton();
+			bExaminar.setSize(88, 23);
+			bExaminar.setText(PluginServices.getText(this, "Examinar"));
+			bExaminar.setLocation(275, 6);
+			bExaminar.setPreferredSize(new java.awt.Dimension(88, 23));
+			bExaminar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						String[] extensions = {
+								"jpeg", "jpg", "gif", "png", "bmp"
+							};
+						GenericFileFilter filter = new GenericFileFilter(extensions,
+								"Images files");
+
+						JFileChooser jfc = new JFileChooser();
+						jfc.addChoosableFileFilter(filter);
+
+						//jfc.addChoosableFileFilter(jpgFilter);
+						//jfc.addChoosableFileFilter(gifFilter);
+						//jfc.addChoosableFileFilter(pngFilter);
+						if (jfc.showOpenDialog(
+									(Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+							File file = jfc.getSelectedFile();
+							namefile = file.getName();
+							getTFichero().setText(file.getAbsolutePath());
+							fframepicture.setPath(file.getAbsolutePath());
+						}
+					}
+				});
+		}
+
+		return bExaminar;
+	}
+
+	/**
+	 * Inserta el path al TFichero.
+	 *
+	 * @param val path del fichero.
+	 */
+	public void setText(String val) {
+		getTFichero().setText(val);
+	}
+
+	/**
+	 * This method initializes lVisualizacion
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLVisualizacion() {
+		if (lVisualizacion == null) {
+			lVisualizacion = new javax.swing.JLabel();
+			lVisualizacion.setBounds(9, 62, 75, 20);
+			lVisualizacion.setText(PluginServices.getText(this, "visualizacion"));
+		}
+
+		return lVisualizacion;
+	}
+
+	/**
+	 * This method initializes cbVisualizacion
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbVisualizacion() {
+		if (cbVisualizacion == null) {
+			cbVisualizacion = new javax.swing.JComboBox();
+			cbVisualizacion.setSize(245, 20);
+			cbVisualizacion.addItem(PluginServices.getText(this, "cuando_activo"));
+			cbVisualizacion.addItem(PluginServices.getText(this, "siempre"));
+			cbVisualizacion.setSelectedIndex(fframepicture.getViewing());
+			cbVisualizacion.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbVisualizacion.setLocation(118, 62);
+			cbVisualizacion.setEnabled(false);
+		}
+
+		return cbVisualizacion;
+	}
+
+	/**
+	 * This method initializes lCalidad
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLCalidad() {
+		if (lCalidad == null) {
+			lCalidad = new javax.swing.JLabel();
+			lCalidad.setSize(42, 20);
+			lCalidad.setText(PluginServices.getText(this, "calidad"));
+			lCalidad.setLocation(10, 35);
+		}
+
+		return lCalidad;
+	}
+
+	/**
+	 * This method initializes cbCalidad
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbCalidad() {
+		if (cbCalidad == null) {
+			cbCalidad = new javax.swing.JComboBox();
+			cbCalidad.setSize(245, 20);
+			cbCalidad.addItem(PluginServices.getText(this, "presentacion"));
+			cbCalidad.addItem(PluginServices.getText(this, "borrador"));
+			cbCalidad.setSelectedIndex(fframepicture.getQuality());
+			cbCalidad.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbCalidad.setLocation(118, 35);
+		}
+
+		return cbCalidad;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setSize(85, 26);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.setLocation(70, 89);
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						try {
+						    // ImageIcon imageIcon = new ImageIcon(getTFichero().getText());
+						    Image image = fframepicture.load(getTFichero().getText());
+						} catch (Exception ex) {
+							NotificationManager.addError("Excepci�n :", ex);
+						}
+
+						fframepicture.setViewing(getCbVisualizacion()
+													 .getSelectedIndex());
+						fframepicture.setQuality(getCbCalidad()
+													 .getSelectedIndex());
+
+						if (namefile != null) {
+							fframepicture.setName(namefile);
+						}
+
+						fframepicture.setBoundBox(FLayoutUtilities.toSheetRect(
+								rect, m_layout.getAT()));
+						PluginServices.getMDIManager().closeView(FFramePictureDialog.this);
+						m_layout.refresh();
+						isAcepted = true;
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setSize(85, 26);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.setLocation(219, 89);
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FFramePictureDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setTitle(PluginServices.getText(this,
+				"propiedades_marco_imagenes"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
+	 */
+	public boolean getIsAcepted() {
+		return isAcepted;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFramePictureDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameScaleBarDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameScaleBarDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameScaleBarDialog.java	(revision 1648)
@@ -0,0 +1,1044 @@
+/*
+ * Created on 02-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.gui.layout.fframes.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.Abrir;
+import com.iver.cit.gvsig.gui.Dialogs.FontChooser;
+import com.iver.cit.gvsig.gui.layout.Attributes;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.ListViewModel;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.geom.Rectangle2D;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.ListCellRenderer;
+
+
+/**
+ * Dialogo para a�adir una barra de escala al Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameScaleBarDialog extends JPanel implements IFFrameDialog {
+	private static final ImageIcon inumero = new ImageIcon(Abrir.class.getClassLoader()
+																	  .getResource("images/numero.png"));
+	private static final ImageIcon ibarra1 = new ImageIcon(Abrir.class.getClassLoader()
+																	  .getResource("images/barra1.png"));
+	private static final ImageIcon ibarra2 = new ImageIcon(Abrir.class.getClassLoader()
+																	  .getResource("images/barra2.png"));
+	private static final ImageIcon ibarra3 = new ImageIcon(Abrir.class.getClassLoader()
+																	  .getResource("images/barra3.png"));
+	private javax.swing.JPanel jContentPane = null;
+	private javax.swing.JScrollPane jScrollPane = null;
+	private javax.swing.JList liVistas = null;
+	private javax.swing.JCheckBox chbMantenerIntervalo = null;
+	private javax.swing.JComboBox cbEscala = null;
+	private javax.swing.JComboBox cbUnidades = null;
+	private javax.swing.JLabel lIntervalo = null;
+	private javax.swing.JTextField tIntervalo = null;
+	private javax.swing.JLabel lNumIntervalos = null;
+	private javax.swing.JTextField tNumIntervalos = null;
+	private javax.swing.JLabel lDivIzquierda = null;
+	private javax.swing.JTextField tDivIzquierda = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+
+	//private ProjectView m_projectView=null;
+	private FFrameView fframeview = null;
+	private Rectangle2D rect = new Rectangle2D.Double();
+	private Layout m_layout = null;
+	private FFrameScaleBar fframescalebar = null; //new FFrameScaleBar();
+	private boolean isAcepted = false;
+	private ImageIcon[] images = new ImageIcon[4];
+	private javax.swing.JButton bFuente = null;
+	private JPanel pMarcoVista = null;
+	private JPanel pDescripcion = null;
+	private JTextField tfDescripcion = null;
+	private JPanel pUnidades = null;
+	private JCheckBox chbSobreDescripcion = null;
+	private JCheckBox chbMostrarUnidades = null;
+	private JCheckBox chbSobreUnidades = null;
+	private JPanel pEtiquetas = null;
+	private JCheckBox chbEtiquetas = null;
+	private JPanel pBarra = null;
+	private JPanel jPanel5 = null;
+	private JPanel jPanel6 = null;
+	private JPanel jPanel7 = null;
+	private JButton bUnidadesColor = null;
+	private JButton bBarraColor = null;
+	private Color barcolor = null;
+	private Color textcolor = null;
+
+	//private JPanel jPanel = null;
+	//private JPanel jPanel1 = null;
+	private JPanel jPanel2 = null;
+	private JCheckBox jCheckBox = null;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layout DOCUMENT ME!
+	 * @param fframe DOCUMENT ME!
+	 */
+	public FFrameScaleBarDialog(Layout layout, FFrameScaleBar fframe) {
+		super();
+		fframescalebar = fframe;
+		barcolor = fframescalebar.getBarColor();
+		textcolor = fframescalebar.getTextColor();
+
+		if (fframescalebar.getFFrameView() != null) {
+			getTfDescripcion().setText("escala 1:" +
+				String.valueOf(fframescalebar.getFFrameView().getScale()));
+		}
+
+		m_layout = layout;
+		initialize();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param r DOCUMENT ME!
+	 */
+	public void setRectangle(Rectangle2D r) {
+		rect.setRect(r);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(null);
+		this.add(getJContentPane(), null);
+		this.setSize(491, 400);
+
+		if (fframescalebar.getStyle() == 0) {
+			getChbMantenerIntervalo().setEnabled(false);
+
+			///getLUnidades().setEnabled(false);
+			getCbUnidades().setEnabled(false);
+			getChbEtiquetas().setEnabled(false);
+			getBBarraColor().setEnabled(false);
+			getChbMostrarUnidades().setEnabled(false);
+			getChbSobreUnidades().setEnabled(false);
+			getLIntervalo().setEnabled(false);
+			getTIntervalo().setEnabled(false);
+			getLNumIntervalos().setEnabled(false);
+			getTNumIntervalos().setEnabled(false);
+			getLDivIzquierda().setEnabled(false);
+			getTDivIzquierda().setEnabled(false);
+		}
+	}
+
+	/**
+	 * This method initializes jContentPane
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJContentPane() {
+		if (jContentPane == null) {
+			jContentPane = new javax.swing.JPanel();
+			jContentPane.setLayout(null);
+			jContentPane.add(getBAceptar(), null);
+			jContentPane.add(getBCancelar(), null);
+			jContentPane.setSize(488, 386);
+			jContentPane.setPreferredSize(new java.awt.Dimension(50, 50));
+			jContentPane.setLocation(0, 6);
+			jContentPane.add(getPMarcoVista(), null);
+			jContentPane.add(getPDescripcion(), null);
+			jContentPane.add(getPUnidades(), null);
+			jContentPane.add(getPBarra(), null);
+			jContentPane.add(getPEtiquetas(), null);
+		}
+
+		return jContentPane;
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new javax.swing.JScrollPane();
+			jScrollPane.setPreferredSize(new java.awt.Dimension(220, 50));
+			jScrollPane.setViewportView(getLiVistas());
+		}
+
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes liVistas
+	 *
+	 * @return javax.swing.JList
+	 */
+	private javax.swing.JList getLiVistas() {
+		if (liVistas == null) {
+			ListViewModel listmodel = new ListViewModel();
+			listmodel.addViewsforScale(m_layout);
+
+			///ArrayList list = listmodel.getViews();
+
+			liVistas = new javax.swing.JList();
+
+			liVistas.setModel(listmodel);
+
+			for (int i = 0; i < liVistas.getModel().getSize(); i++) {
+				if (fframescalebar.getFFrameView() != null) {
+					fframeview = (FFrameView) liVistas.getModel().getElementAt(i);
+
+					if (fframeview == fframescalebar.getFFrameView()) {
+						liVistas.setSelectedIndex(i);
+					}
+				}
+			}
+
+			liVistas.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+					public void valueChanged(
+						javax.swing.event.ListSelectionEvent e) {
+						int selectInt = (int) e.getFirstIndex();
+						fframeview = (FFrameView) liVistas.getModel()
+														  .getElementAt(selectInt);
+
+						for (int i = 0; i < m_layout.getFFrames().size();
+								i++) {
+							IFFrame f = (IFFrame) m_layout.getFFrames().get(i);
+
+							if (f instanceof FFrameView) {
+								if (((FFrameView) f).getView() == fframeview.getView()) {
+									fframescalebar.setFFrameView(fframeview);
+								}
+							}
+						}
+
+						getTNumIntervalos().setText(String.valueOf(
+								fframescalebar.getNumInterval()));
+						getTDivIzquierda().setText(String.valueOf(
+								fframescalebar.getNumLeft()));
+						getTIntervalo().setText(String.valueOf(
+								fframescalebar.obtainInterval()));
+						getTfDescripcion().setText(fframescalebar.getDescripcion());
+					}
+				});
+		}
+
+		return liVistas;
+	}
+
+	/**
+	 * This method initializes chbMantenerIntervalo
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private javax.swing.JCheckBox getChbMantenerIntervalo() {
+		if (chbMantenerIntervalo == null) {
+			chbMantenerIntervalo = new javax.swing.JCheckBox();
+			chbMantenerIntervalo.setSelected(fframescalebar.isbIntervalSet());
+			chbMantenerIntervalo.setText(PluginServices.getText(this,
+					"mantener_intervalo"));
+			chbMantenerIntervalo.setPreferredSize(new java.awt.Dimension(200, 20));
+			chbMantenerIntervalo.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframescalebar.setIntervalSet(getChbMantenerIntervalo()
+														  .isSelected());
+					}
+				});
+		}
+
+		return chbMantenerIntervalo;
+	}
+
+	/**
+	 * This method initializes cbEscala
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbEscala() {
+		if (cbEscala == null) {
+			//String[] s={"n�merico","barra1","barra2","barra3","barra4"};
+			cbEscala = new javax.swing.JComboBox();
+			images[0] = inumero;
+			images[1] = ibarra1;
+			images[2] = ibarra2;
+			images[3] = ibarra3;
+
+			/*  Image img=img = new BufferedImage(100, 25,
+			   BufferedImage.TYPE_INT_ARGB);
+			   img.getGraphics().drawImage(images[3].getImage(),0,0,null);
+			   img.getGraphics().setXORMode(Color.yellow);
+			    images[3]=new ImageIcon(img);
+			 */
+			ComboBoxRenderer renderer = new ComboBoxRenderer();
+			renderer.setPreferredSize(new Dimension(100, 25));
+			cbEscala.setRenderer(renderer);
+			cbEscala.setMaximumRowCount(4);
+
+			cbEscala.addItem("0");
+			cbEscala.addItem("1");
+			cbEscala.addItem("2");
+			cbEscala.addItem("3");
+			cbEscala.setSelectedIndex(fframescalebar.getStyle());
+			cbEscala.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbEscala.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframescalebar.setStyle(getCbEscala().getSelectedIndex());
+
+						if (cbEscala.getSelectedIndex() == 0) {
+							getChbMantenerIntervalo().setEnabled(false);
+							getChbMostrarUnidades().setEnabled(false);
+							getChbSobreUnidades().setEnabled(false);
+							getCbUnidades().setEnabled(false);
+							getChbEtiquetas().setEnabled(false);
+							getBBarraColor().setEnabled(false);
+							getLIntervalo().setEnabled(false);
+							getTIntervalo().setEnabled(false);
+							getLNumIntervalos().setEnabled(false);
+							getTNumIntervalos().setEnabled(false);
+							getLDivIzquierda().setEnabled(false);
+							getTDivIzquierda().setEnabled(false);
+						} else {
+							getChbMantenerIntervalo().setEnabled(true);
+							getChbMostrarUnidades().setEnabled(true);
+							getChbSobreUnidades().setEnabled(true);
+							getCbUnidades().setEnabled(true);
+							getChbEtiquetas().setEnabled(true);
+							getBBarraColor().setEnabled(true);
+							getLIntervalo().setEnabled(true);
+							getTIntervalo().setEnabled(true);
+							getLNumIntervalos().setEnabled(true);
+							getTNumIntervalos().setEnabled(true);
+							getLDivIzquierda().setEnabled(true);
+							getTDivIzquierda().setEnabled(true);
+						}
+					}
+				});
+		}
+
+		return cbEscala;
+	}
+
+	/**
+	 * This method initializes cbUnidades
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbUnidades() {
+		if (cbUnidades == null) {
+			//String[] s={"Kil�metros","metros","cent�metros","mil�metros","millas","yardas","pies","pulgadas"};
+			cbUnidades = new javax.swing.JComboBox(Attributes.NAMES);
+			cbUnidades.setSelectedIndex(fframescalebar.getUnits());
+			cbUnidades.setPreferredSize(new java.awt.Dimension(150, 20));
+			cbUnidades.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframescalebar.setUnits(getCbUnidades()
+													.getSelectedIndex());
+						getTIntervalo().setText(Long.toString(
+								fframescalebar.obtainInterval()));
+					}
+				});
+		}
+
+		return cbUnidades;
+	}
+
+	/**
+	 * This method initializes lIntervalo
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLIntervalo() {
+		if (lIntervalo == null) {
+			lIntervalo = new javax.swing.JLabel();
+			lIntervalo.setText(PluginServices.getText(this, "Intervalo"));
+			lIntervalo.setPreferredSize(new java.awt.Dimension(90, 20));
+		}
+
+		return lIntervalo;
+	}
+
+	/**
+	 * This method initializes tIntervalo
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTIntervalo() {
+		if (tIntervalo == null) {
+			tIntervalo = new javax.swing.JTextField();
+			tIntervalo.setPreferredSize(new java.awt.Dimension(90, 20));
+			tIntervalo.setText(Long.toString(fframescalebar.getInterval()));
+			tIntervalo.addKeyListener(new java.awt.event.KeyAdapter() {
+					public void keyReleased(java.awt.event.KeyEvent e) {
+						if (!tIntervalo.getText().toString().equals("")) {
+							fframescalebar.setInterval(Long.parseLong(
+									tIntervalo.getText().toString()));
+							getTNumIntervalos().setText(String.valueOf(
+									fframescalebar.getNumInterval()));
+						}
+					}
+				});
+		}
+
+		return tIntervalo;
+	}
+
+	/**
+	 * This method initializes lNumIntervalos
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLNumIntervalos() {
+		if (lNumIntervalos == null) {
+			lNumIntervalos = new javax.swing.JLabel();
+			lNumIntervalos.setText(PluginServices.getText(this, "N�m_intervalos"));
+			lNumIntervalos.setPreferredSize(new java.awt.Dimension(90, 20));
+		}
+
+		return lNumIntervalos;
+	}
+
+	/**
+	 * This method initializes tNumIntervalos
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTNumIntervalos() {
+		if (tNumIntervalos == null) {
+			tNumIntervalos = new javax.swing.JTextField();
+			tNumIntervalos.setPreferredSize(new java.awt.Dimension(90, 20));
+			tNumIntervalos.setText(Integer.toString(
+					fframescalebar.getNumInterval()));
+			tNumIntervalos.addKeyListener(new java.awt.event.KeyAdapter() {
+					public void keyReleased(java.awt.event.KeyEvent e) {
+						if (!tNumIntervalos.getText().toString().equals("")) {
+							fframescalebar.setNumInterval(Integer.parseInt(
+									tNumIntervalos.getText().toString()));
+							getTIntervalo().setText(String.valueOf(
+									fframescalebar.obtainInterval()));
+						}
+					}
+				});
+		}
+
+		return tNumIntervalos;
+	}
+
+	/**
+	 * This method initializes lDivIzquierda
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLDivIzquierda() {
+		if (lDivIzquierda == null) {
+			lDivIzquierda = new javax.swing.JLabel();
+			lDivIzquierda.setText(PluginServices.getText(this,
+					"divisiones_izquierda"));
+			lDivIzquierda.setPreferredSize(new java.awt.Dimension(90, 20));
+		}
+
+		return lDivIzquierda;
+	}
+
+	/**
+	 * This method initializes tDivIzquierda
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTDivIzquierda() {
+		if (tDivIzquierda == null) {
+			tDivIzquierda = new javax.swing.JTextField();
+			tDivIzquierda.setPreferredSize(new java.awt.Dimension(90, 20));
+			tDivIzquierda.setText(Integer.toString(fframescalebar.getNumLeft()));
+			tDivIzquierda.addKeyListener(new java.awt.event.KeyAdapter() {
+					public void keyReleased(java.awt.event.KeyEvent e) {
+						if (tDivIzquierda.getText().toString().equals("")) {
+							tDivIzquierda.setText("0");
+						} else {
+							fframescalebar.setNumLeft(Integer.parseInt(
+									tDivIzquierda.getText()));
+						}
+					}
+				});
+		}
+
+		return tDivIzquierda;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setSize(85, 26);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.setLocation(106, 347);
+			bAceptar.setPreferredSize(new java.awt.Dimension(79, 23));
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframescalebar.setUnits(getCbUnidades()
+													.getSelectedIndex());
+						fframescalebar.setBoundBox(FLayoutUtilities.toSheetRect(
+								rect, m_layout.getAT()));
+
+						fframescalebar.setBarColor(barcolor);
+						fframescalebar.setTextColor(textcolor);
+						fframescalebar.setShowNameUnits(getChbMostrarUnidades()
+															.isSelected());
+						fframescalebar.setShowDescription(getJCheckBox()
+															  .isSelected());
+						fframescalebar.setAboveDescription(getChbSobreDescripcion()
+															   .isSelected());
+						fframescalebar.setAboveIntervals(getChbEtiquetas()
+															 .isSelected());
+						fframescalebar.setAboveName(getChbSobreUnidades()
+														.isSelected());
+						fframescalebar.setDescripcion(getTfDescripcion()
+														  .getText());
+						PluginServices.getMDIManager().closeView(FFrameScaleBarDialog.this);
+						m_layout.refresh();
+						isAcepted = true;
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setSize(85, 26);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.setLocation(297, 347);
+			bCancelar.setPreferredSize(new java.awt.Dimension(85, 23));
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FFrameScaleBarDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setTitle(PluginServices.getText(this,
+				"Propiedades_escala_grafica"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
+	 */
+	public boolean getIsAcepted() {
+		return isAcepted;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	/**
+	 * This method initializes bFuente
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBFuente() {
+		if (bFuente == null) {
+			bFuente = new javax.swing.JButton();
+			bFuente.setText(PluginServices.getText(this, "fuente"));
+			bFuente.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						fframescalebar.setFont(FontChooser.showDialog(
+								PluginServices.getText(this, "seleccion_fuente"),
+								fframescalebar.getFont())); // fchoser=new FontChooser();
+					}
+				});
+		}
+
+		return bFuente;
+	}
+
+	/**
+	 * This method initializes pMarcoVista
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPMarcoVista() {
+		if (pMarcoVista == null) {
+			pMarcoVista = new JPanel();
+			pMarcoVista.setBounds(7, 9, 240, 86);
+			pMarcoVista.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "marco_vista"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			pMarcoVista.add(getJScrollPane(), null);
+		}
+
+		return pMarcoVista;
+	}
+
+	/**
+	 * This method initializes pDescripcion
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPDescripcion() {
+		if (pDescripcion == null) {
+			pDescripcion = new JPanel();
+			pDescripcion.setBounds(256, 9, 216, 110);
+			pDescripcion.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, "descripcion",
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			pDescripcion.add(getTfDescripcion(), null);
+			pDescripcion.add(getJCheckBox(), null);
+			pDescripcion.add(getChbSobreDescripcion(), null);
+		}
+
+		return pDescripcion;
+	}
+
+	/**
+	 * This method initializes tfDescripcion
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getTfDescripcion() {
+		if (tfDescripcion == null) {
+			tfDescripcion = new JTextField();
+			tfDescripcion.setPreferredSize(new java.awt.Dimension(190, 20));
+
+			/*if (fframeview!=null){
+			   getTfDescripcion().setText("escala 1:"+String.valueOf(fframeview.getScale()));
+			   }
+			 */
+			tfDescripcion.setText(fframescalebar.getDescripcion());
+		}
+
+		return tfDescripcion;
+	}
+
+	/**
+	 * This method initializes pUnidades
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPUnidades() {
+		if (pUnidades == null) {
+			pUnidades = new JPanel();
+			pUnidades.setLocation(255, 129);
+			pUnidades.setSize(216, 107);
+			pUnidades.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "unidades"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			pUnidades.add(getCbUnidades(), null);
+			pUnidades.add(getChbMostrarUnidades(), null);
+			pUnidades.add(getChbSobreUnidades(), null);
+		}
+
+		return pUnidades;
+	}
+
+	/**
+	 * This method initializes chbSobreDescripcion
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getChbSobreDescripcion() {
+		if (chbSobreDescripcion == null) {
+			chbSobreDescripcion = new JCheckBox();
+			chbSobreDescripcion.setSelected(fframescalebar.isAboveDescription());
+			chbSobreDescripcion.setText("sobre_la_barra");
+		}
+
+		return chbSobreDescripcion;
+	}
+
+	/**
+	 * This method initializes chbMostrarUnidades
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getChbMostrarUnidades() {
+		if (chbMostrarUnidades == null) {
+			chbMostrarUnidades = new JCheckBox();
+			chbMostrarUnidades.setText("mostrar_unidades");
+			chbMostrarUnidades.setSelected(fframescalebar.isShowNameUnits());
+			chbMostrarUnidades.setPreferredSize(new java.awt.Dimension(150, 24));
+		}
+
+		return chbMostrarUnidades;
+	}
+
+	/**
+	 * This method initializes chbSobreUnidades
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getChbSobreUnidades() {
+		if (chbSobreUnidades == null) {
+			chbSobreUnidades = new JCheckBox();
+			chbSobreUnidades.setSelected(fframescalebar.isAboveName());
+			chbSobreUnidades.setText("sobre_la_barra");
+			chbSobreUnidades.setPreferredSize(new java.awt.Dimension(150, 24));
+		}
+
+		return chbSobreUnidades;
+	}
+
+	/**
+	 * This method initializes pEtiquetas
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPEtiquetas() {
+		if (pEtiquetas == null) {
+			pEtiquetas = new JPanel();
+			pEtiquetas.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "etiquetas"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			pEtiquetas.setBounds(257, 246, 216, 93);
+			pEtiquetas.add(getChbEtiquetas(), null);
+			pEtiquetas.add(getJPanel2(), null);
+		}
+
+		return pEtiquetas;
+	}
+
+	/**
+	 * This method initializes chbEtiquetas
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getChbEtiquetas() {
+		if (chbEtiquetas == null) {
+			chbEtiquetas = new JCheckBox();
+			chbEtiquetas.setSelected(fframescalebar.isAboveIntervals());
+			chbEtiquetas.setText("sobre_la_barra");
+		}
+
+		return chbEtiquetas;
+	}
+
+	/**
+	 * This method initializes pBarra
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPBarra() {
+		if (pBarra == null) {
+			pBarra = new JPanel();
+			pBarra.setBounds(8, 104, 240, 235);
+			pBarra.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, "barra",
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			pBarra.add(getCbEscala(), null);
+			pBarra.add(getChbMantenerIntervalo(), null);
+			pBarra.add(getJPanel5(), null);
+			pBarra.add(getJPanel7(), null);
+			pBarra.add(getJPanel6(), null);
+			pBarra.add(getBBarraColor(), null);
+
+			//pBarra.add(getJPanel(), null);
+		}
+
+		return pBarra;
+	}
+
+	/**
+	 * This method initializes jPanel5
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel5() {
+		if (jPanel5 == null) {
+			jPanel5 = new JPanel();
+			jPanel5.setPreferredSize(new java.awt.Dimension(200, 30));
+			jPanel5.add(getLIntervalo(), null);
+			jPanel5.add(getTIntervalo(), null);
+		}
+
+		return jPanel5;
+	}
+
+	/**
+	 * This method initializes jPanel6
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel6() {
+		if (jPanel6 == null) {
+			jPanel6 = new JPanel();
+			jPanel6.add(getLDivIzquierda(), null);
+			jPanel6.add(getTDivIzquierda(), null);
+		}
+
+		return jPanel6;
+	}
+
+	/**
+	 * This method initializes jPanel7
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel7() {
+		if (jPanel7 == null) {
+			jPanel7 = new JPanel();
+			jPanel7.add(getLNumIntervalos(), null);
+			jPanel7.add(getTNumIntervalos(), null);
+		}
+
+		return jPanel7;
+	}
+
+	/**
+	 * This method initializes bUnidadesColor
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getBUnidadesColor() {
+		if (bUnidadesColor == null) {
+			bUnidadesColor = new JButton();
+			bUnidadesColor.setText("color");
+			bUnidadesColor.setForeground(Color.white);
+			bUnidadesColor.setBackground(textcolor);
+			bUnidadesColor.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						JDialog dlg;
+						JColorChooser colorChooser;
+						colorChooser = new JColorChooser();
+						dlg = JColorChooser.createDialog((JFrame) null,
+								PluginServices.getText(this, "Elegir_Color"),
+								true, colorChooser, null, null);
+						dlg.show(true);
+
+						textcolor = (Color) colorChooser.getColor();
+
+						//getJPanel1().setBackground(textcolor);
+						bUnidadesColor.setBackground(textcolor);
+					}
+				});
+		}
+
+		return bUnidadesColor;
+	}
+
+	/**
+	 * This method initializes bBarraColor
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getBBarraColor() {
+		if (bBarraColor == null) {
+			bBarraColor = new JButton();
+			bBarraColor.setText("color");
+			bBarraColor.setForeground(Color.white);
+			bBarraColor.setBackground(barcolor);
+			bBarraColor.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						JDialog dlg;
+						JColorChooser colorChooser;
+						colorChooser = new JColorChooser();
+						dlg = JColorChooser.createDialog((JFrame) null,
+								PluginServices.getText(this, "Elegir_Color"),
+								true, colorChooser, null, null);
+						dlg.show(true);
+
+						barcolor = (Color) colorChooser.getColor();
+
+						//getJPanel().setBackground(barcolor);
+						bBarraColor.setBackground(barcolor);
+					}
+				});
+		}
+
+		return bBarraColor;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+
+	/*private JPanel getJPanel() {
+	   if (jPanel == null) {
+	           jPanel = new JPanel();
+	           jPanel.setPreferredSize(new java.awt.Dimension(44,24));
+	           jPanel.setForeground(barcolor);
+	           jPanel.setBackground(barcolor);
+	   }
+	   return jPanel;
+	   }
+	 */
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+
+	/*        private JPanel getJPanel1() {
+	   if (jPanel1 == null) {
+	           jPanel1 = new JPanel();
+	           jPanel1.setBackground(textcolor);
+	           jPanel1.setPreferredSize(new java.awt.Dimension(44,24));
+	   }
+	   return jPanel1;
+	   }
+	 */
+
+	/**
+	 * This method initializes jPanel2
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel2() {
+		if (jPanel2 == null) {
+			jPanel2 = new JPanel();
+			jPanel2.add(getBFuente(), null);
+			jPanel2.add(getBUnidadesColor(), null);
+
+			//jPanel2.add(getJPanel1(), null);
+		}
+
+		return jPanel2;
+	}
+
+	/**
+	 * This method initializes jCheckBox
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getJCheckBox() {
+		if (jCheckBox == null) {
+			jCheckBox = new JCheckBox();
+			jCheckBox.setSelected(fframescalebar.isShowDescription());
+			jCheckBox.setText("mostrar_descripcion");
+		}
+
+		return jCheckBox;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @author Vicente Caballero Navarro
+	 */
+	class ComboBoxRenderer extends JLabel implements ListCellRenderer {
+		/**
+		 * Crea un nuevo ComboBoxRenderer.
+		 */
+		public ComboBoxRenderer() {
+			setOpaque(true);
+			setHorizontalAlignment(CENTER);
+			setVerticalAlignment(CENTER);
+		}
+
+		/*
+		 * This method finds the image and text corresponding
+		 * to the selected value and returns the label, set up
+		 * to display the text and image.
+		 */
+		public Component getListCellRendererComponent(JList list, Object value,
+			int index, boolean isSelected, boolean cellHasFocus) {
+			//Get the selected index. (The index param isn't
+			//always valid, so just use the value.)
+			///int selectedIndex = ((Integer)value).intValue();
+			if (isSelected) {
+				setBackground(list.getSelectionBackground());
+				setForeground(list.getSelectionForeground());
+			} else {
+				setBackground(list.getBackground());
+				setForeground(list.getForeground());
+			}
+
+			ImageIcon icon = images[Integer.parseInt((String) value)];
+			setIcon(icon);
+
+			return this;
+		}
+	}
+} //  @jve:decl-index=0:visual-constraint="17,10"
+//  @jve:visual-info  decl-index=0 visual-constraint="10,10"

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameScaleBarDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameLegendDialog.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameLegendDialog.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameLegendDialog.java	(revision 1648)
@@ -0,0 +1,427 @@
+/*
+ * Created on 02-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.gui.layout.fframes.dialogs;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.cit.gvsig.gui.Dialogs.FontChooser;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.ListViewModel;
+
+import java.awt.geom.Rectangle2D;
+import javax.swing.JPanel;
+
+
+/**
+ * Dialogo para a�adir la leyenda de alguna vista al Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameLegendDialog extends JPanel implements IFFrameDialog {
+	private javax.swing.JPanel jContentPane = null;
+	private javax.swing.JLabel lMarcoVista = null;
+	private javax.swing.JScrollPane jScrollPane = null;
+	private javax.swing.JLabel lVisualizacion = null;
+	private javax.swing.JComboBox cbVisualizacion = null;
+	private javax.swing.JLabel lCalidad = null;
+	private javax.swing.JComboBox cbCalidad = null;
+	private javax.swing.JButton bAceptar = null;
+	private javax.swing.JButton bCancelar = null;
+	private javax.swing.JList liVistas = null;
+	private Rectangle2D rect = new Rectangle2D.Double();
+	private Layout m_layout = null; //  @jve:visual-info  decl-index=0 visual-constraint="393,10"
+	private FFrameLegend fframelegend = null; //new FFrameLegend();
+	private boolean isAcepted = false;
+	private javax.swing.JButton bFuente = null;
+	private FFrameView fframeview = null;
+
+	/**
+	 * This is the default constructor
+	 *
+	 * @param layout Referencia al Layout.
+	 * @param fframe Referencia al FFrameLegend.
+	 */
+	public FFrameLegendDialog(Layout layout, FFrameLegend fframe) {
+		super();
+		m_layout = layout;
+		fframelegend = fframe;
+		initialize();
+	}
+
+	/**
+	 * Inserta el rect�ngulo que ocupar� el fframe de leyenda.
+	 *
+	 * @param r extent.
+	 */
+	public void setRectangle(Rectangle2D r) {
+		rect.setRect(r);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(null);
+		this.add(getJContentPane(), null);
+		this.setSize(406, 175);
+	}
+
+	/**
+	 * This method initializes jContentPane
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJContentPane() {
+		if (jContentPane == null) {
+			jContentPane = new javax.swing.JPanel();
+			jContentPane.setLayout(null);
+			jContentPane.add(getLMarcoVista(), null);
+			jContentPane.add(getJScrollPane(), null);
+			jContentPane.add(getLVisualizacion(), null);
+			jContentPane.add(getCbVisualizacion(), null);
+			jContentPane.add(getLCalidad(), null);
+			jContentPane.add(getCbCalidad(), null);
+			jContentPane.add(getBAceptar(), null);
+			jContentPane.add(getBCancelar(), null);
+			jContentPane.add(getBFuente(), null);
+			jContentPane.setBounds(3, 1, 402, 171);
+		}
+
+		return jContentPane;
+	}
+
+	/**
+	 * This method initializes lMarcoVista
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLMarcoVista() {
+		if (lMarcoVista == null) {
+			lMarcoVista = new javax.swing.JLabel();
+			lMarcoVista.setSize(156, 63);
+			lMarcoVista.setText(PluginServices.getText(this, "marco_vista"));
+			lMarcoVista.setLocation(5, 10);
+		}
+
+		return lMarcoVista;
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private javax.swing.JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new javax.swing.JScrollPane();
+			jScrollPane.setViewportView(getLiVistas());
+			jScrollPane.setSize(217, 65);
+			jScrollPane.setPreferredSize(new java.awt.Dimension(70, 60));
+			jScrollPane.setLocation(167, 10);
+		}
+
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes lVisualizacion
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLVisualizacion() {
+		if (lVisualizacion == null) {
+			lVisualizacion = new javax.swing.JLabel();
+			lVisualizacion.setSize(99, 16);
+			lVisualizacion.setText(PluginServices.getText(this, "visualizacion"));
+			lVisualizacion.setLocation(6, 83);
+		}
+
+		return lVisualizacion;
+	}
+
+	/**
+	 * This method initializes cbVisualizacion
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbVisualizacion() {
+		if (cbVisualizacion == null) {
+			cbVisualizacion = new javax.swing.JComboBox();
+			cbVisualizacion.addItem(PluginServices.getText(this, "cuando_activo"));
+			cbVisualizacion.addItem(PluginServices.getText(this, "siempre"));
+			cbVisualizacion.setSelectedIndex(fframelegend.getViewing());
+			cbVisualizacion.setSize(179, 20);
+			cbVisualizacion.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbVisualizacion.setLocation(111, 83);
+			cbVisualizacion.setEnabled(false);
+		}
+
+		return cbVisualizacion;
+	}
+
+	/**
+	 * This method initializes lCalidad
+	 *
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getLCalidad() {
+		if (lCalidad == null) {
+			lCalidad = new javax.swing.JLabel();
+			lCalidad.setSize(99, 16);
+			lCalidad.setText(PluginServices.getText(this, "calidad"));
+			lCalidad.setLocation(6, 103);
+		}
+
+		return lCalidad;
+	}
+
+	/**
+	 * This method initializes cbCalidad
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private javax.swing.JComboBox getCbCalidad() {
+		if (cbCalidad == null) {
+			cbCalidad = new javax.swing.JComboBox();
+			cbCalidad.addItem(PluginServices.getText(this, "presentacion"));
+			cbCalidad.addItem(PluginServices.getText(this, "borrador"));
+			cbCalidad.setSelectedIndex(fframelegend.getQuality());
+			cbCalidad.setSize(179, 20);
+			cbCalidad.setPreferredSize(new java.awt.Dimension(200, 20));
+			cbCalidad.setLocation(111, 103);
+		}
+
+		return cbCalidad;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new javax.swing.JButton();
+			bAceptar.setSize(79, 26);
+			bAceptar.setText(PluginServices.getText(this, "Aceptar"));
+			bAceptar.setLocation(77, 129);
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						for (int i = 0; i < m_layout.getFFrames().size();
+								i++) {
+							IFFrame f = (IFFrame) m_layout.getFFrames().get(i);
+
+							if (f instanceof FFrameView &&
+									(fframeview != null)) {
+								//if (f.getName().compareTo(m_projectView.getName())==0){
+								//Esto cambia para que la escala se calcule en fframeview y no en fframescalebar.
+								///	fframelegend.setFMap(((FFrameView)f).getFMap());
+								fframelegend.setName("Leyenda de " +
+									((FFrameView) f).toString());
+
+								///fframescalebar.setScaleView(((FFrameView)f).getScale());
+								//}
+							}
+						}
+
+						/*if (m_projectView!=null){
+						   fframelegend.setLayers(m_projectView.getMapContext().getLayers());
+						   }
+						 */
+						fframelegend.setViewing(cbVisualizacion.getSelectedIndex());
+						fframelegend.setQuality(cbCalidad.getSelectedIndex());
+						fframelegend.setBoundBox(FLayoutUtilities.toSheetRect(
+								rect, m_layout.getAT()));
+						PluginServices.getMDIManager().closeView(FFrameLegendDialog.this);
+						m_layout.refresh();
+						isAcepted = true;
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new javax.swing.JButton();
+			bCancelar.setSize(85, 26);
+			bCancelar.setText(PluginServices.getText(this, "Cancelar"));
+			bCancelar.setLocation(233, 129);
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						PluginServices.getMDIManager().closeView(FFrameLegendDialog.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/**
+	 * This method initializes liVistas
+	 *
+	 * @return javax.swing.JList
+	 */
+	private javax.swing.JList getLiVistas() {
+		if (liVistas == null) {
+			ListViewModel listmodel = new ListViewModel();
+
+			//listmodel.addViews();	
+			listmodel.addViewsforScale(m_layout);
+
+			///ArrayList list = listmodel.getViews();
+			liVistas = new javax.swing.JList();
+			liVistas.setModel(listmodel);
+
+			for (int i = 0; i < liVistas.getModel().getSize(); i++) {
+				if (fframelegend.getFFrameView() != null) {
+					fframeview = (FFrameView) liVistas.getModel().getElementAt(i);
+
+					if (fframeview == fframelegend.getFFrameView()) {
+						liVistas.setSelectedIndex(i);
+					}
+
+					/*m_projectView=(ProjectView)liVistas.getModel().getElementAt(i);
+					   if (m_projectView.getMapContext()==fframelegend.getFMap()){
+					           liVistas.setSelectedIndex(i);
+					   }
+					 */
+				}
+			}
+
+			liVistas.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
+					public void valueChanged(
+						javax.swing.event.ListSelectionEvent e) {
+						/*                        int selectInt=(int)e.getFirstIndex();
+						   m_projectView=(ProjectView)liVistas.getModel().getElementAt(selectInt);
+						 */
+						int selectInt = (int) e.getFirstIndex();
+						fframeview = (FFrameView) liVistas.getModel()
+														  .getElementAt(selectInt);
+
+						for (int i = 0; i < m_layout.getFFrames().size();
+								i++) {
+							IFFrame f = (IFFrame) m_layout.getFFrames().get(i);
+
+							if (f instanceof FFrameView) {
+								if (((FFrameView) f).getView() == fframeview.getView()) {
+									fframelegend.setFFrameView(fframeview);
+								}
+							}
+						}
+
+						//fframelegend.setFFrameView(fframeview);
+					}
+				});
+		}
+
+		return liVistas;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
+		m_viewinfo.setTitle(PluginServices.getText(this,
+				"propiedades_marco_leyenda"));
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog#getIsAcepted()
+	 */
+	public boolean getIsAcepted() {
+		return isAcepted;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	/**
+	 * This method initializes bFuente
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBFuente() {
+		if (bFuente == null) {
+			bFuente = new javax.swing.JButton();
+			bFuente.setSize(90, 23);
+			bFuente.setText(PluginServices.getText(this, "fuente"));
+			bFuente.setLocation(297, 89);
+			bFuente.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						if (fframelegend.getFont() != null) {
+							fframelegend.setFont(FontChooser.showDialog(
+									PluginServices.getText(this,
+										"seleccion_fuente"),
+									fframelegend.getFont())); // fchoser=new FontChooser();	
+						} else {
+							fframelegend.setFont(FontChooser.showDialog(
+									PluginServices.getText(this,
+										"seleccion_fuente"), getFont()));
+						}
+					}
+				});
+		}
+
+		return bFuente;
+	}
+} 
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/dialogs/FFrameLegendDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameText.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameText.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameText.java	(revision 1648)
@@ -0,0 +1,364 @@
+/*
+ * Created on 22-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.font.FontRenderContext;
+import java.awt.font.TextLayout;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import java.util.ArrayList;
+
+
+/**
+ * FFrame para introducir un texto en el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameText extends FFrame {
+	/** Localizaci�n del texto. */
+	public static final int LEFT = 0;
+	public static final int CENTER = 1;
+	public static final int RIGTH = 2;
+	private ArrayList m_text = new ArrayList();
+	private boolean m_isFixed = true;
+	private double m_rotation = 0;
+	private int m_pos = LEFT;
+
+	//private int m_space=0;
+	private Font m_f = null;
+
+	/**
+	 * Crea un nuevo FFrameText.
+	 */
+	public FFrameText() {
+		m_f = new Font("SansSerif", Font.PLAIN, 9);
+	}
+
+	/**
+	 * Inserta la fuente del texto.
+	 *
+	 * @param f Fuente del texto.
+	 */
+	public void setFont(Font f) {
+		m_f = f;
+	}
+
+	/**
+	 * Devuelve la fuente del texto.
+	 *
+	 * @return Fuente del texto.
+	 */
+	public Font getFont() {
+		return new Font(m_f.getFontName(), m_f.getStyle(), 9);
+	}
+
+	/*public void setSpace(int s){
+	   m_space=s;
+	   }
+	   public int getSpace(){
+	           return m_space;
+	   }*/
+
+	/**
+	 * Devuelve la posici�n izquierda, centro o derecha del texto.
+	 *
+	 * @return Posici�n del texto.
+	 */
+	public int getPos() {
+		return m_pos;
+	}
+
+	/**
+	 * Pone la posici�n izquierda, centro o derecha del texto.
+	 *
+	 * @param p 0=LEFT,1=CENTER,2=RIGTH.
+	 */
+	public void setPos(int p) {
+		m_pos = p;
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada af�n.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Imagen para acelerar el dibujado.
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) {
+		Rectangle2D.Double re = getBoundingBox(at);
+		int longmax = 1;
+
+		if (intersects(rv, re)) {
+			if (m_text.isEmpty()) {
+				drawEmpty(g);
+			} else {
+				for (int i = 0; i < m_text.size(); i++) {
+					if (((String) m_text.get(i)).length() > longmax) {
+						longmax = ((String) m_text.get(i)).length();
+					}
+				}
+
+				FontRenderContext frc = g.getFontRenderContext();
+				int scale = ((int) (re.width * 2.2)) / longmax;
+
+				if (scale > (int) ((re.height * 10) / 4 / (m_text.size() * 1.3))) {
+					scale = (int) (((re.height * 10) / 4) / (m_text.size() * 1.3));
+				}
+
+				int ht = (int) (re.height / m_text.size());
+
+				if (m_f != null) {
+					m_f = new Font(m_f.getFontName(), m_f.getStyle(), scale);
+				} else {
+					m_f = new Font("SansSerif", Font.PLAIN, scale);
+				}
+
+				for (int i = 0; i < m_text.size(); i++) {
+					if (!((String) m_text.get(i)).equals("")) {
+						TextLayout layout = new TextLayout((String) m_text.get(
+									i), m_f, frc);
+						g.setColor(Color.black);
+						g.rotate(Math.toRadians(m_rotation),
+							re.x + (re.width / 2), re.y + (re.height / 2));
+
+						int l = ((String) m_text.get(i)).length();
+
+						switch (m_pos) {
+							case (LEFT):
+								layout.draw(g, (float) re.getX(),
+									(float) (re.getY() + (ht * (i + 1)))); //- (ht / 2))));
+
+								break;
+
+							case (CENTER):
+
+								float pos1 = (float) ((re.width -
+									((l * scale) / 2.2)) / 2);
+								layout.draw(g, (float) re.getX() + pos1,
+									(float) (re.getY() + (ht * (i + 1)))); //- (ht / 2))));
+
+								break;
+
+							case (RIGTH):
+
+								float pos2 = (float) ((re.width -
+									((l * scale) / 2.2)));
+								layout.draw(g, (float) re.getX() + pos2,
+									(float) (re.getY() + (ht * (i + 1)))); //- (ht / 2))));
+
+								break;
+						}
+
+						g.rotate(Math.toRadians(-m_rotation),
+							re.x + (re.width / 2), re.y + (re.height / 2));
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at) {
+		draw(g, at, null, null);
+	}
+
+	/**
+	 * Rellenar el texto que se quiere a�adir al Layout.
+	 *
+	 * @param s String a a�adir.
+	 */
+	public void addText(String s) {
+		m_text.add(s);
+	}
+
+	/**
+	 * Devuelve el ArrayList que contiene las l�neas de texto.
+	 *
+	 * @return ArrayList.
+	 */
+	public ArrayList getText() {
+		return m_text;
+	}
+
+	/**
+	 * Seleccionar si se quiere un tama�o fijo o adecuado a la escala.
+	 *
+	 * @param b true si se quiere tama�o fijo.
+	 */
+	public void setSizeFixed(boolean b) {
+		m_isFixed = b;
+	}
+
+	/**
+	 * Devuelve si est� fijado el tama�o.
+	 *
+	 * @return True si est� fijado el tama�o.
+	 */
+	public boolean isSizeFixed() {
+		return m_isFixed;
+	}
+
+	/**
+	 * Rellenar la rotaci�n para aplicar al texto.
+	 *
+	 * @param rotation rotaci�n que se quiere aplicar.
+	 */
+	public void setRotation(double rotation) {
+		m_rotation = rotation;
+	}
+
+	/**
+	 * Devuelve la rotaci�n del texto.
+	 *
+	 * @return Rotaci�n del texto.
+	 */
+	public double getRotation() {
+		return m_rotation;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.RECTANGLETEXT);
+
+		String[] s = (String[]) m_text.toArray(new String[0]);
+		xml.putProperty("s", s);
+		xml.putProperty("m_isFixed", m_isFixed);
+
+		xml.putProperty("m_pos", m_pos);
+		xml.putProperty("m_rotation", m_rotation);
+		xml.putProperty("fontName", m_f.getFontName());
+		xml.putProperty("fontStyle", m_f.getStyle());
+		xml.putProperty("tag", getTag());
+
+		return xml;
+	}
+
+	/**
+	 * Crea un Objeto de esta clase a partir de la informaci�n del XMLEntity.
+	 *
+	 * @param xml XMLEntity
+	 * @param l DOCUMENT ME!
+	 */
+
+	/*  public static FFrameText createFFrameText(XMLEntity xml) {
+	   FFrameText fframe = new FFrameText();
+	
+	   if (xml.getIntProperty("m_Selected") != 0) {
+	       fframe.setSelected(true);
+	   } else {
+	       fframe.setSelected(false);
+	   }
+	   String[] s = xml.getStringArrayProperty("s");
+	   for (int i = 0; i < s.length; i++) {
+	       fframe.m_text.add(s[i]);
+	   }
+	   fframe.m_isFixed = xml.getBooleanProperty("m_isFixed");
+	   fframe.m_pos = xml.getIntProperty("m_pos");
+	   fframe.m_rotation = xml.getDoubleProperty("m_rotation");
+	   fframe.m_f = new Font(xml.getStringProperty("fontName"),
+	           xml.getIntProperty("fontStyle"), 9);
+	   return fframe;
+	   }
+	 */
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
+	 * 		com.iver.cit.gvsig.project.Project)
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l) {
+		if (xml.getIntProperty("m_Selected") != 0) {
+			this.setSelected(true);
+		} else {
+			this.setSelected(false);
+		}
+
+		String[] s = xml.getStringArrayProperty("s");
+
+		for (int i = 0; i < s.length; i++) {
+			this.m_text.add(s[i]);
+		}
+
+		this.m_isFixed = xml.getBooleanProperty("m_isFixed");
+		this.m_pos = xml.getIntProperty("m_pos");
+		this.m_rotation = xml.getDoubleProperty("m_rotation");
+		this.m_f = new Font(xml.getStringProperty("fontName"),
+				xml.getIntProperty("fontStyle"), 9);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "texto") + num;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameText.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameSymbol.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameSymbol.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameSymbol.java	(revision 1648)
@@ -0,0 +1,188 @@
+/*
+ * Created on 09-jul-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D;
+import com.iver.cit.gvsig.fmap.rendering.styling.SymbolPreviewDrawer;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+
+/**
+ * FFrame para introducir una S�mbolo en el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameSymbol extends FFrame {
+	private FSymbol m_Symbol;
+	private int m_type;
+
+	/**
+	 * Crea un nuevo FFrameSymbol.
+	 */
+	public FFrameSymbol() {
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Imagen para acelerar el dibujado.
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) {
+		Rectangle2D.Double re = getBoundingBox(at);
+
+		if (intersects(rv, re)) {
+			Rectangle r = new Rectangle((int) re.x, (int) re.y, (int) re.width,
+					(int) re.height);
+			AffineTransform mT2 = new AffineTransform();
+			mT2.setToIdentity();
+
+			Rectangle rec = new Rectangle((int) re.x, (int) re.y,
+			         (int) (re.width), (int) (re.height));
+			//SymbolPreviewDrawer pSD = new SymbolPreviewDrawer(m_Symbol);
+			//pSD.draw(g, r, m_type);
+
+			FGraphicUtilities.DrawSymbol((Graphics2D) g, mT2, rec, m_Symbol);
+		}
+	}
+
+	/**
+	 * Pone el FSymbol.
+	 *
+	 * @param symbol
+	 * @param type Tipo de s�mbolo.
+	 */
+	public void setSymbol(FSymbol symbol, int type) {
+		m_Symbol = symbol;
+		m_type = type;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.RECTANGLESYMBOL);
+		xml.putProperty("tag", getTag());
+
+		xml.addChild(m_Symbol.getXMLEntity());
+		return xml;
+	}
+
+	/**
+	 * Crea un Objeto de esta clase a partir de la informaci�n del XMLEntity.
+	 *
+	 * @param xml XMLEntity
+	 * @param l DOCUMENT ME!
+	 */
+
+	/*  public static FFrameSymbol createFFrameSymbol(XMLEntity xml) {
+	   FFrameSymbol fframe = new FFrameSymbol();
+	
+	   if (xml.getIntProperty("m_Selected") != 0) {
+	       fframe.setSelected(true);
+	   } else {
+	       fframe.setSelected(false);
+	   }
+	   fframe.m_Symbol = FSymbol.createFSymbol(xml.getChild(0));
+	   return fframe;
+	   }
+	 */
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
+	 * 		com.iver.cit.gvsig.project.Project)
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l) {
+		if (xml.getIntProperty("m_Selected") != 0) {
+			this.setSelected(true);
+		} else {
+			this.setSelected(false);
+		}
+
+		this.m_Symbol = FSymbol.createFromXML(xml.getChild(0));
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "simbolo");
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at)
+		throws DriverException {
+		draw(g, at, null, null);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameSymbol.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/ListViewModel.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/ListViewModel.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/ListViewModel.java	(revision 1648)
@@ -0,0 +1,118 @@
+/*
+ * Created on 02-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.ProjectExtension;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import java.util.ArrayList;
+
+import javax.swing.AbstractListModel;
+
+
+/**
+ * Modelo de la Lista de vistas a seleccionar.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ListViewModel extends AbstractListModel {
+	private ArrayList views = new ArrayList();
+
+	/**
+	 * A�ade las vistas que tiene el proyecto a la lista.
+	 */
+	public void addViews() {
+		ProjectExtension projectextension = (ProjectExtension) PluginServices.getExtension(com.iver.cit.gvsig.ProjectExtension.class);
+		views = projectextension.getProject().getViews();
+	}
+
+	/**
+	 * A�ade un FFrameView a la lista.
+	 *
+	 * @param l Referencia al Layout.
+	 */
+	public void addViewsforScale(Layout l) {
+		int num = 0;
+
+		for (int i = 0; i < l.getFFrames().size(); i++) {
+			IFFrame f = (IFFrame) l.getFFrames().get(i);
+
+			if (f instanceof FFrameView) {
+				//((FFrameView)f).getView().setName("FFrameView "+num+((FFrameView)f).getName());
+				views.add((FFrameView) f);
+				((FFrameView) f).setNum(num);
+				num++;
+			}
+		}
+
+		//ProjectExtension projectextension =(ProjectExtension)App.instance.getPc().getExtension(com.iver.cit.gvsig.ProjectExtension.class);
+		//views=projectextension.getProject().getViews();
+	}
+
+	/**
+	 * Devuelve el ArrayList con las FFrameView.
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	//public ArrayList getViews() {
+	//	return views;
+	//}
+
+	/**
+	 * @see javax.swing.ListModel#getSize()
+	 */
+	public int getSize() {
+		return views.size();
+	}
+
+	/**
+	 * @see javax.swing.ListModel#getElementAt(int)
+	 */
+	public Object getElementAt(int index) {
+		return views.get(index);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/ListViewModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/IFFrame.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/IFFrame.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/IFFrame.java	(revision 1648)
@@ -0,0 +1,293 @@
+/*
+ * Created on 20-feb-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.gui.layout.fframes;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.Cursor;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+
+/**
+ * Interface que implementa FFrame.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public interface IFFrame {
+	/**
+	 * Devuelve el boundingBox del fframe en funci�n de la transformada af�n
+	 * que se pasa como par�metro. Si se pasa como par�metro null, devuelve el
+	 * �ltimo boundingbox que se calcul�.
+	 *
+	 * @param at Transformada af�n
+	 *
+	 * @return Rect�ngulo que representa el BoundingBox del fframe.
+	 */
+	public Rectangle2D.Double getBoundingBox(AffineTransform at);
+
+	/**
+	 * Devuelve el rect�ngulo que representa el fframe en cent�metros.
+	 *
+	 * @return Rect�ngulo en centimetros.
+	 */
+	public Rectangle2D.Double getBoundBox();
+
+	/**
+	 * Rellena con el rect�ngulo que se pasa como par�metro el boundBox(en
+	 * cent�metros) del fframe del cual con una transformaci�n se podr�
+	 * calcular el BoundingBox (en pixels).
+	 *
+	 * @param rect Rect�ngulo en cent�metros.
+	 */
+	public void setBoundBox(Rectangle2D.Double rect);
+
+	/**
+	 * Este m�todo se implementa en cada una de las fframe, ya que cada una se
+	 * dibuja de una forma diferente sobre el graphics. M�todo que dibuja
+	 * sobre el graphics que se le pasa como par�metro, seg�n la transformada
+	 * afin que se debe de aplicar y el rect�ngulo que se debe de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param r rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Imagen para acelerar el dibujado.
+	 *
+	 * @throws DriverException
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D r,
+		BufferedImage imgBase) throws DriverException;
+
+	/**
+	 * Implementado para imprimir.
+	 *
+	 * @param g Graphics2D de la impresora sobre el que dibujar.
+	 * @param at DOCUMENT ME!
+	 *
+	 * @throws DriverException
+	 */
+	public void print(Graphics2D g, AffineTransform at)
+		throws DriverException;
+
+	/**
+	 * Devuelve el nombre que representa al fframe.
+	 *
+	 * @return String nombre del FFrame.
+	 */
+	public String getName();
+
+	/**
+	 * Rellena el String que representa al nombre del fframe.
+	 *
+	 * @param n nombre del fframe.
+	 */
+	public void setName(String n);
+
+	/**
+	 * Devuelve true, si el punto que se pasa como par�metro esta contenido
+	 * dentro del boundingbox del fframe.
+	 *
+	 * @param p punto a comprobar.
+	 *
+	 * @return true si el punto esta dentro del boundingbox.
+	 */
+	public boolean contains(Point2D.Double p);
+
+	/**
+	 * Dibuja los handlers sobre el boundingBox en el graphics que se pasa como
+	 * par�metro.
+	 *
+	 * @param g Graphics sobre el que dibujar.
+	 */
+	public void drawHandlers(Graphics2D g);
+
+	/**
+	 * Pasando como par�metro true,  se toma como que est� seleccionado el
+	 * fframe  y si es false como que esta sin seleccionar, de esta forma se
+	 * selecciona un fframe directamente sin comprobar si un punto est�
+	 * contenido en �l.
+	 *
+	 * @param b true si se quiere seleccionar y false si se quiere
+	 * 		  deseleccionar.
+	 */
+	public void setSelected(Point2D.Double b);
+
+	/**
+	 * Establece que tipo de selecci�n se realiza sobre el fframe.
+	 *
+	 * @param b punto sobre el que se debe de establecer si se selecciona o no
+	 * 		  el fframe.
+	 */
+	public void setSelected(boolean b);
+
+	/**
+	 * Devuelve un entero que representa el tipo de selecci�n que se ha
+	 * realizado sobre el fframe.
+	 *
+	 * @return tipo de selecci�n que se ha realizado.
+	 */
+	public int getSelected();
+
+	/**
+	 * Devuelve un entero que representa donde esta contenido el punto que se
+	 * pasa como par�metro.
+	 *
+	 * @param p punto a comparar.
+	 *
+	 * @return entero que representa como esta contenido el punto.
+	 */
+	public int getContains(Point2D.Double p);
+
+	/**
+	 * Devuelve el Cursor adecuado seg�n como est� contenido el punto, si es
+	 * para desplazamiento, o cambio de tama�o.
+	 *
+	 * @param p punto a comprobar.
+	 *
+	 * @return Cursor adecuado a la posici�n.
+	 */
+	public Cursor getMapCursor(Point2D.Double p);
+
+	/**
+	 * Devuelve el rect�ngulo a partir del desplazamiento en el eje x y el
+	 * desplazamiento en el eje y.
+	 *
+	 * @param difx desplazamiento sobre el eje x.
+	 * @param dify desplazamiento sobre el eje y.
+	 *
+	 * @return rect�ngulo modificado en funci�n del desplazamiento realizado.
+	 */
+	public Rectangle2D getMovieRect(int difx, int dify);
+
+	/**
+	 * Devuelve un Objeto XMLEntity con la informaci�n los atributos necesarios
+	 * para poder despu�s volver a crear el objeto original.
+	 *
+	 * @return XMLEntity.
+	 */
+	public XMLEntity getXMLEntity();
+
+	/**
+	 * Dibuja un rect�ngulo de color gris,  con el nombre en el centro y
+	 * escalado en forma de borrador.
+	 *
+	 * @param g Graphics sobre el que se dibuja.
+	 */
+	public void drawDraft(Graphics2D g);
+
+	/**
+	 * Actualiza el BoundBox del FFrame a partir de su rect�ngulo en pixels y
+	 * la matriz de transformaci�n.
+	 *
+	 * @param r Rect�ngulo.
+	 * @param at Matriz de transformaci�n.
+	 */
+	public void updateRect(Rectangle2D r, AffineTransform at);
+
+	/**
+	 * Devuelve true si el rect�ngulo primero es null o si es distinto de null
+	 * e intersecta.
+	 *
+	 * @param rv Rect�ngulo
+	 * @param r Rect�ngulo
+	 *
+	 * @return True si intersecta o es null.
+	 */
+	public boolean intersects(Rectangle2D rv, Rectangle2D r);
+
+	/**
+	 * Introduce el n�mero de FFrame en el que de que se trata.
+	 *
+	 * @param i n�mero de FFrame
+	 */
+	public void setNum(int i);
+
+	/**
+	 * A partir del xml y de Project inicia el objeto.
+	 *
+	 * @param xml XMLEntity
+	 * @param l Project
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l);
+
+	/**
+	 * Devuelve el nombre que representa al tipo de FFrame.
+	 *
+	 * @return nombre del elemento.
+	 */
+	public String getNameFFrame();
+
+	/**
+	 * Abre la ventana para modificar el tag.
+	 */
+	public void openTag();
+
+	/**
+	 * Rellena el tag.
+	 *
+	 * @param s valor del tag.
+	 */
+	public void setTag(String s);
+
+	/**
+	 * Devuelve el valor del tag.
+	 *
+	 * @return String del valor del tag.
+	 */
+	public String getTag();
+
+	/**
+	 * Dibuja el s�mbolo que indica que el FFrame contiene un tag.
+	 *
+	 * @param g Graphics sobre el que dibujar.
+	 */
+	public void drawSymbolTag(Graphics2D g);
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/IFFrame.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameView.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameView.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameView.java	(revision 1648)
@@ -0,0 +1,653 @@
+/*
+ * Created on 20-feb-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+
+import com.iver.cit.gvsig.ProjectExtension;
+import com.iver.cit.gvsig.fmap.ColorEvent;
+import com.iver.cit.gvsig.fmap.ExtentEvent;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.ViewPort;
+import com.iver.cit.gvsig.fmap.ViewPortListener;
+import com.iver.cit.gvsig.fmap.layers.XMLException;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.project.Project;
+import com.iver.cit.gvsig.project.ProjectView;
+
+import com.iver.utiles.XMLEntity;
+
+import org.apache.log4j.Logger;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import java.util.ArrayList;
+
+
+/**
+ * FFrame para introducir una vista en el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameView extends FFrame implements ViewPortListener {
+	private static Logger logger = Logger.getLogger(FFrameView.class.getName());
+	public static final int AUTOMATICO = 0;
+	public static final int CONSTANTE = 1;
+	public static final int MANUAL = 2;
+	public static final int PRESENTACION = 0;
+	public static final int BORRADOR = 1;
+	private int m_Mode;
+	private int m_typeScale = AUTOMATICO;
+	private int m_extension = 0;
+	private int m_quality = PRESENTACION;
+	private int m_viewing = 0;
+	private boolean m_bLinked = true;
+	private ProjectView view = null;
+	private FMap m_fmap = null;
+	private double m_Scale = 0;
+	private int m_mapUnits = 1; //Metros.
+	private int num = 0;
+	private BufferedImage m_image = null;
+	private AffineTransform at = null;
+	private Project project = null;
+
+	/**
+	 * Creates a new FFrameView object.
+	 */
+	public FFrameView() {
+	}
+
+	/**
+	 * Devuelve una descripci�n del FFrameView.
+	 *
+	 * @return Descripci�n.
+	 */
+	public String toString() {
+		if (getView() == null) {
+			return "FFrameView " + num + ": " + "Vacio";
+		}
+
+		return "FFrameView " + num + ": " + getView().getName();
+	}
+
+	/**
+	 * Rellena la escala de la vista que contiene el fframe.
+	 *
+	 * @param d escala de la vista.
+	 */
+	public void setScale(double d) {
+		m_Scale = d;
+	}
+
+	/**
+	 * Inserta el nuevo extent a la FFrameView.
+	 *
+	 * @param r Rect�ngulo a ocupar por el FFrameView.
+	 */
+	public void setNewExtent(Rectangle2D r) {
+		getFMap().getViewPort().setExtent(r);
+		m_Scale = FLayoutUtilities.getScaleView(getFMap(), getBoundBox().height);
+	}
+
+	/**
+	 * Devuelve el FMap de la vista o una clonaci�n de este si se utiliza una
+	 * escala fija.
+	 *
+	 * @return FMap.
+	 */
+	public FMap getFMap() {
+		return m_fmap;
+	}
+
+	/**
+	 * Rellena la calidad que se quiere aplicar.
+	 *
+	 * @param q entero que representa la calidad a aplicar.
+	 */
+	public void setQuality(int q) {
+		m_quality = q;
+	}
+
+	/**
+	 * Devuelve un entero que representa la calidad que est� seleccionada.
+	 *
+	 * @return tipo de calidad selccionada.
+	 */
+	public int getQuality() {
+		return m_quality;
+	}
+
+	/**
+	 * Devuelve un entero que representa la forma en que se actualiza la vista.
+	 *
+	 * @return forma que se actualiza la vista.
+	 */
+	public int getViewing() {
+		return m_viewing;
+	}
+
+	/**
+	 * Rellena la forma de actualizar la vista.
+	 *
+	 * @param v entero que representa la forma de actualizar la vista.
+	 */
+	public void setViewing(int v) {
+		m_viewing = v;
+	}
+
+	/**
+	 * Inserta el ProjectView de donde obtener las propiedades de la vista a
+	 * mostrar.
+	 *
+	 * @param v Modelo de la vista.
+	 */
+	public void setView(ProjectView v) {
+		view = v;
+
+		ViewPort vp = new ViewPort(v.getMapContext().getViewPort()
+									.getProjection());
+
+		if (m_bLinked) {
+			if (getTypeScale() == AUTOMATICO) {
+				m_fmap = v.getMapContext().createNewFMap(v.getMapContext()
+														  .getViewPort()
+														  .cloneViewPort());
+				v.getMapContext().getViewPort().removeViewPortListener(this);
+				v.getMapContext().getViewPort().addViewPortListener(this);
+			} else if (getTypeScale() == CONSTANTE) {
+				vp.setExtent((Rectangle2D) v.getMapContext().getViewPort()
+											.getExtent().clone());
+				m_fmap = v.getMapContext().createNewFMap(vp);
+				v.getMapContext().getViewPort().removeViewPortListener(this);
+			} else if (getTypeScale() == MANUAL) {
+				vp.setExtent(getNewExtent(getScale()));
+				m_fmap = v.getMapContext().createNewFMap(vp);
+				v.getMapContext().getViewPort().removeViewPortListener(this);
+			}
+		} else if (!m_bLinked) {
+			try {
+				if (getTypeScale() == AUTOMATICO) {
+					m_fmap = v.getMapContext().cloneFMap(); //(v.getMapContext().getViewPort().cloneViewPort());
+					m_fmap.setViewPort(v.getMapContext().getViewPort()
+										.cloneViewPort());
+					v.getMapContext().getViewPort().removeViewPortListener(this);
+					v.getMapContext().getViewPort().addViewPortListener(this);
+				} else if (getTypeScale() == CONSTANTE) {
+					vp.setExtent((Rectangle2D) v.getMapContext().getViewPort()
+												.getExtent().clone());
+					m_fmap = v.getMapContext().cloneFMap();
+					m_fmap.setViewPort(vp);
+					v.getMapContext().getViewPort().removeViewPortListener(this);
+				} else if (getTypeScale() == MANUAL) {
+					vp.setExtent(getNewExtent(getScale()));
+					m_fmap = v.getMapContext().cloneFMap();
+					m_fmap.setViewPort(vp);
+					v.getMapContext().getViewPort().removeViewPortListener(this);
+				}
+			} catch (XMLException e1) {
+				NotificationManager.addError("Cuando se a�ade una vista al Layout",
+					e1);
+			}
+		}
+
+		/*
+		   m_fmap = v.getMapContext();
+		
+		   v.getMapContext().getViewPort();
+		   ViewPort vp = new ViewPort();
+		   vp.setExtent(v.getMapContext().getViewPort().getExtent());
+		   m_fmap = m_fmap.createNewFMap(vp);
+		   view = v;
+		 */
+	}
+
+	/**
+	 * Devuelve el modelo de la vista.
+	 *
+	 * @return Modelo de la vista.
+	 */
+	public ProjectView getView() {
+		return view;
+	}
+
+	/**
+	 * Devuelve un Rect�ngulo que representa  el extent de la vista que se
+	 * requiere a partir  de una escala.
+	 *
+	 * @param scale Escala a mostrar.
+	 *
+	 * @return Rect�ngulo.
+	 */
+	private Rectangle2D.Double getNewExtent(long scale) {
+		double hview = getBoundBox().getHeight();
+		double wview = getBoundBox().getWidth();
+		double hextent = (scale * hview) / 100.0;
+		double wextent = (scale * wview) / 100.0;
+		double dif = hextent / m_fmap.getViewPort().getExtent().getHeight();
+		double newx = m_fmap.getViewPort().getExtent().getCenterX() -
+			((m_fmap.getViewPort().getExtent().getWidth() * dif) / 2.0);
+		double newy = m_fmap.getViewPort().getExtent().getCenterY() -
+			((m_fmap.getViewPort().getExtent().getHeight() * dif) / 2.0);
+
+		return new Rectangle2D.Double(newx, newy, wextent, hextent);
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics2D
+	 * @param at Transformada af�n.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Imagen para acelerar el dibujado.
+	 *
+	 * @throws com.iver.cit.gvsig.fmap.DriverException
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) throws com.iver.cit.gvsig.fmap.DriverException {
+		Rectangle2D.Double r = getBoundingBox(at);
+
+		if (intersects(rv, r)) {
+			if (getFMap() == null) {
+				drawEmpty(g);
+			} else {
+				if (rv != null) {
+					// Dibujamos en pantalla
+					Rectangle rclip = g.getClipBounds();
+					g.clipRect((int) r.getMinX(), (int) r.getMinY(),
+						(int) r.getWidth(), (int) r.getHeight());
+
+					if (getQuality() == PRESENTACION) {
+						/*     this.getFMap().setTransparent(true);
+						   this.getFMap().drawView((Graphics2D) g,
+						       new Rectangle((int) (r.x), (int) (r.y),
+						           (int) (r.width), (int) (r.height)),
+						       (Rectangle) rv, false, imgBase);
+						 */
+						if (rv.intersects(r)) {
+							this.getFMap().getViewPort().setOffset(new Point2D.Double(
+									r.x, r.y));
+							this.getFMap().getViewPort().setImageSize(new Dimension(
+									(int) r.width, (int) r.height));
+
+							try {
+							    ViewPort viewPort = this.getFMap().getViewPort();
+							    Color theBackColor = viewPort.getBackColor();
+							    if (theBackColor != null)
+							    {
+							        g.setColor(theBackColor);
+							        g.fillRect((int) r.x, (int) r.y, viewPort.getImageWidth(), viewPort.getImageHeight());
+							    }
+							    
+								this.getFMap().draw(imgBase, g);
+							} catch (com.iver.cit.gvsig.fmap.DriverException e) {
+								// TODO Auto-generated catch block
+								e.printStackTrace();
+							}
+						}
+
+						if (rclip != null) {
+							g.setClip(rclip.x, rclip.y, rclip.width,
+								rclip.height); 
+						} 
+					} else {
+						drawDraft(g);
+					}
+				} else {
+					print(g, at);
+				}
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at) {
+		Rectangle2D.Double r = getBoundingBox(at);
+
+		// Dibujamos en impresora
+		Rectangle rclip = g.getClipBounds();
+		g.clipRect((int) r.getMinX(), (int) r.getMinY(), (int) r.getWidth(),
+			(int) r.getHeight());
+		this.getFMap().getViewPort().setOffset(new Point2D.Double(r.x, r.y));
+		this.getFMap().getViewPort().setImageSize(new Dimension((int) r.width,
+				(int) r.height));
+
+		try {
+			this.getFMap().print(g);
+		} catch (com.iver.cit.gvsig.fmap.DriverException e) {
+			NotificationManager.addError(e.getMessage(), e);
+		}
+
+		g.setClip(rclip.x, rclip.y, rclip.width, rclip.height);
+	}
+
+	/**
+	 * Rellena la unidad de medida en la que est� la vista.
+	 *
+	 * @param i entero que representa la unidad de medida de la vista.
+	 */
+	public void setMapUnits(int i) {
+		m_mapUnits = i;
+	}
+
+	/**
+	 * Obtiene la unidad de medida en la que est� la vista.
+	 *
+	 * @return Unidad de medida.
+	 */
+	public int getMapUnits() {
+		return m_mapUnits;
+	}
+
+	/**
+	 * Devuelve la escala seg�n el tipo de escala que se haya seleccionado al
+	 * a�adida la vista.
+	 *
+	 * @return escala.
+	 */
+	public long getScale() {
+		/*if (m_bLinked){
+		   return getScaleView1(METROS);
+		       }
+		 */
+		if (getTypeScale() == AUTOMATICO) {
+			return FLayoutUtilities.getScaleView(getFMap(), getBoundBox().height);
+		} else if (getTypeScale() == CONSTANTE) {
+			return (long) m_Scale;
+		} else if (getTypeScale() == MANUAL) {
+			return (long) m_Scale;
+		}
+
+		return (long) m_Scale;
+	}
+
+	/**
+	 * Seleccionar si la vista esta relacionada o no con la original.
+	 *
+	 * @param b true si est� ligada y false si no lo est�.
+	 */
+	public void setLinked(boolean b) {
+		m_bLinked = b;
+	}
+
+	/**
+	 * Devuelve si est� ligada o no el FFrameView con la vista.
+	 *
+	 * @return True si la vista est� ligada.
+	 */
+	public boolean getLinked() {
+		return m_bLinked;
+	}
+
+	/**
+	 * Devuelve la opci�n seleccionada:Rellenar marco de la vista o recorte a
+	 * la vista.
+	 *
+	 * @return entero que representa la opci�n elegida.
+	 */
+	public int getExtension() {
+		return m_extension;
+	}
+
+	/**
+	 * Devuelve el tipo de escala que est� seleccionada AUTOMATICO,CONSTANTE o
+	 * MANUAL.
+	 *
+	 * @return entero que representa el tipo seleccionado.
+	 */
+	public int getTypeScale() {
+		return m_typeScale;
+	}
+
+	/**
+	 * Rellenar si se quiere:Rellenar marco de la vista o recorte a la vista.
+	 *
+	 * @param i entero que representa la opci�n elegida.
+	 */
+	public void setExtension(int i) {
+		m_extension = i;
+	}
+
+	/**
+	 * Rellenar el tipo de escala que se desea.
+	 *
+	 * @param i entero que representa el tipo de escala.
+	 */
+	public void setTypeScale(int i) {
+		m_typeScale = i;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.RECTANGLEVIEW);
+		xml.putProperty("m_Mode", m_Mode);
+		xml.putProperty("m_typeScale", m_typeScale);
+		xml.putProperty("m_extension", m_extension);
+		xml.putProperty("m_quality", m_quality);
+		xml.putProperty("m_viewing", m_viewing);
+		xml.putProperty("m_bLinked", m_bLinked);
+		xml.putProperty("m_mapUnits", m_mapUnits);
+		xml.putProperty("m_Scale", m_Scale);
+
+		xml.putProperty("extentX", getFMap().getViewPort().getExtent().getX());
+		xml.putProperty("extentY", getFMap().getViewPort().getExtent().getY());
+		xml.putProperty("extentW",
+			getFMap().getViewPort().getExtent().getWidth());
+		xml.putProperty("extentH",
+			getFMap().getViewPort().getExtent().getHeight());
+		xml.putProperty("tag", getTag());
+
+		ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
+		ArrayList views = pe.getProject().getViews();
+
+		boolean hasIndex = false;
+
+		for (int i = 0; i < views.size(); i++) {
+			if (view == ((ProjectView) views.get(i))) {
+				xml.putProperty("indice", i);
+				hasIndex = true;
+			}
+		}
+
+		if (!hasIndex) {
+			xml.putProperty("indice", -1);
+		}
+
+		xml.addChild(m_fmap.getXMLEntity());
+
+		return xml;
+	}
+
+	/**
+	 * Inserta la imagen para repintar el FFrameView.
+	 *
+	 * @param bi Imagen para repintar.
+	 */
+	public void setBufferedImage(BufferedImage bi) {
+		m_image = bi;
+	}
+
+	/**
+	 * Devuelve la imagen para repintar.
+	 *
+	 * @return Imagen para repintar.
+	 */
+	public BufferedImage getBufferedImage() {
+		return m_image;
+	}
+
+	/**
+	 * Devuelve la MAtriz de transformaci�n utilizada por la FFrameView.
+	 *
+	 * @return MAtriz de transformaci�n.
+	 */
+	public AffineTransform getAt() {
+		return at;
+	}
+
+	/**
+	 * Inserta la matriz de transformaci�n.
+	 *
+	 * @param transform Matriz de transformaci�n.
+	 */
+	public void setAt(AffineTransform transform) {
+		at = transform;
+	}
+
+	/**
+	 * Inserta el proyecto.
+	 *
+	 * @param p Proyecto.
+	 */
+	public void setProject(Project p) {
+		project = p;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
+	 * 		com.iver.cit.gvsig.project.Project)
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l) {
+		if (xml.getIntProperty("m_Selected") != 0) {
+			this.setSelected(true);
+		} else {
+			this.setSelected(false);
+		}
+
+		this.setName(xml.getStringProperty("m_name"));
+		this.setBoundBox(new Rectangle2D.Double(xml.getDoubleProperty("x"),
+				xml.getDoubleProperty("y"), xml.getDoubleProperty("w"),
+				xml.getDoubleProperty("h")));
+
+		this.m_Mode = xml.getIntProperty("m_Mode");
+		this.m_typeScale = xml.getIntProperty("m_typeScale");
+		this.m_extension = xml.getIntProperty("m_extension");
+		this.m_quality = xml.getIntProperty("m_quality");
+		this.m_viewing = xml.getIntProperty("m_viewing");
+		this.m_bLinked = xml.getBooleanProperty("m_bLinked");
+		this.m_mapUnits = xml.getIntProperty("m_mapUnits");
+
+		ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
+		this.m_Scale = xml.getDoubleProperty("m_Scale");
+
+		int indice = xml.getIntProperty("indice");
+
+		if (indice != -1) {
+			ProjectView view = (ProjectView) project.getViews().get(indice);
+			this.m_fmap = view.getMapContext();
+			this.setView((ProjectView) view);
+
+			try {
+				//this.m_fmap = view.getMapContext();
+
+				/*        this.getFMap().getViewPort().setExtent(new Rectangle2D.Double(
+				   xml.getDoubleProperty("extentX"),
+				   xml.getDoubleProperty("extentY"),
+				   xml.getDoubleProperty("extentW"),
+				   xml.getDoubleProperty("extentH")));
+				 */
+				if (m_bLinked) {
+					this.getFMap().getViewPort().setExtent(new Rectangle2D.Double(
+							xml.getDoubleProperty("extentX"),
+							xml.getDoubleProperty("extentY"),
+							xml.getDoubleProperty("extentW"),
+							xml.getDoubleProperty("extentH")));
+				} else if (!m_bLinked) {
+					this.m_fmap = FMap.createFromXML(xml.getChild(0));
+				}
+			} catch (XMLException e) {
+				NotificationManager.addError("Pasando las propiedades del XMLEntity al objeto",
+					e);
+			}
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "Vista") + num;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.ExtentListener#extentChanged(com.iver.cit.gvsig.fmap.ExtentEvent)
+	 */
+	public void extentChanged(ExtentEvent e) {
+		if (getTypeScale() == AUTOMATICO) {
+			m_fmap.getViewPort().setExtent(e.getNewExtent());
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.ViewPortListener#backColorChanged(com.iver.cit.gvsig.fmap.ColorEvent)
+	 */
+	public void backColorChanged(ColorEvent e) {
+	    m_fmap.getViewPort().setBackColor(e.getNewColor());
+	    System.out.println("pasa por backColorChanged");
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameView.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFramePicture.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFramePicture.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFramePicture.java	(revision 1648)
@@ -0,0 +1,269 @@
+/*
+ * Created on 20-feb-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import com.iver.utiles.XMLEntity;
+import com.sun.jimi.core.Jimi;
+
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.MediaTracker;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+import javax.swing.ImageIcon;
+
+
+/**
+ * FFrame para introducir una imagen en el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFramePicture extends FFrame {
+	private static final int PRESENTACION = 0;
+	private static final int BORRADOR = 1;
+	private static final int ACTIVO = 1;
+	private static final int SIEMPRE = 0;
+	private BufferedImage m_image = null;
+	private int m_quality = PRESENTACION;
+	private int m_viewing = ACTIVO;
+	private String m_path = null;
+
+	/**
+	 * Creates a new FFramePicture object.
+	 */
+	public FFramePicture() {
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Imagen para acelerar el dibujado.
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) {
+		Rectangle2D.Double r = getBoundingBox(at);
+		double x = r.getMinX();
+		double y = r.getMinY();
+		double w = r.getWidth();
+		double h = r.getHeight();
+
+		if (intersects(rv, r)) {
+			if (m_image == null) { //Que no hay una imagen.
+				drawEmpty(g);
+			} else {
+				if ((rv == null) || (getQuality() == PRESENTACION)) {
+					double scalex = (double) w / m_image.getWidth(null);
+					double scaley = (double) h / m_image.getHeight(null);
+					AffineTransform xform = AffineTransform.getScaleInstance(scalex,
+							scaley);
+					AffineTransform xpos = AffineTransform.getTranslateInstance(x,
+							y);
+					xpos.concatenate(xform);
+					g.drawRenderedImage(m_image, xpos);
+				} else {
+					drawDraft(g);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Rellena la calidad seg�n el entero que se pasa como par�metro.
+	 *
+	 * @param q entero que representa el tipo de calidad elegido.
+	 */
+	public void setQuality(int q) {
+		m_quality = q;
+	}
+
+	/**
+	 * Devuelve la calidad que est� seleccionada.
+	 *
+	 * @return entero que representa la calidad seleccionada.
+	 */
+	public int getQuality() {
+		return m_quality;
+	}
+
+	/**
+	 * Devuelve un entero que representa la forma en que se actualiza la vista.
+	 *
+	 * @return forma que se actualiza la vista.
+	 */
+	public int getViewing() {
+		return m_viewing;
+	}
+
+	/**
+	 * Rellena la forma de actualizar la vista.
+	 *
+	 * @param v entero que representa la forma de actualizar la vista.
+	 */
+	public void setViewing(int v) {
+		m_viewing = v;
+	}
+
+	/**
+	 * Rellena el nombre de la imagen.
+	 *
+	 * @param path nombre de la imagen.
+	 */
+	public void setPath(String path) {
+		m_path = path;
+	}
+
+	/**
+	 * Devuelve la ruta del fichero.
+	 *
+	 * @return String
+	 */
+	public String getPath() {
+		return m_path;
+	}
+
+	/**
+	 * Rellena la imagen.
+	 *
+	 * @param image
+	 */
+	public void setImage(BufferedImage image) {
+		m_image = image;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.RECTANGLEPICTURE);
+		xml.putProperty("m_path", m_path);
+		xml.putProperty("m_quality", m_quality);
+		xml.putProperty("m_viewing", m_viewing);
+		xml.putProperty("tag", getTag());
+
+		return xml;
+	}
+	public Image load(String file)
+	{
+	    ImageIcon tmpIcon = null;
+	    String iString = file.toLowerCase();
+        if (iString.endsWith("jpg") || iString.endsWith("jpeg") || iString.endsWith("gif")) {
+            tmpIcon = new ImageIcon(Jimi.getImage(file ,Jimi.VIRTUAL_MEMORY));//((File)main.allImages.elementAt(x)).getAbsolutePath());
+        } else if (iString.endsWith("png") || iString.endsWith("tif") || iString.endsWith("ico") ||  iString.endsWith("xpm") ||  iString.endsWith("bmp")) {
+            tmpIcon = new ImageIcon(Jimi.getImage(file ,Jimi.VIRTUAL_MEMORY)); //new ImageIcon(f.getPath());
+        }	            
+        Image image = tmpIcon.getImage();
+		setPath(file);
+		BufferedImage bi = new BufferedImage((int) image.getWidth(null),
+			(int) image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
+		Graphics2D biContext = bi.createGraphics();
+		biContext.drawImage(image, 0, 0, null);
+		setImage(bi);
+        
+		return image; 
+	}
+
+	/**
+	 * Incorpora los atributos del XMLEntity en el objeto actual.
+	 *
+	 * @param xml XMLEntity
+	 * @param l Referencia al Layout.
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l) {
+		if (xml.getIntProperty("m_Selected") != 0) {
+			this.setSelected(true);
+		} else {
+			this.setSelected(false);
+		}
+
+		this.m_path = xml.getStringProperty("m_path");
+
+		try {
+			load(this.m_path);
+		} catch (Exception ex) {
+			NotificationManager.addError("Excepci�n :", ex);
+		}
+
+		this.m_quality = xml.getIntProperty("m_quality");
+		this.m_viewing = xml.getIntProperty("m_viewing");
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "imagen") + num;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at)
+		throws DriverException {
+		draw(g, at, null, null);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFramePicture.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGroup.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGroup.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGroup.java	(revision 1648)
@@ -0,0 +1,270 @@
+/*
+ * Created on 15-jul-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.gui.layout.fframes;
+
+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.ArrayList;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.utiles.XMLEntity;
+
+
+/**
+ * FFrame que contiene a su vez un ArrayList de FFrames de cualquier tipo
+ * incluso de si mismo.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameGroup extends FFrame {
+	private ArrayList m_fframes = new ArrayList();
+	private Rectangle2D.Double rg = null;
+	private AffineTransform m_at;
+	private Rectangle2D.Double ra = null;
+
+	/**
+	 * Crea un nuevo FFrameGroup.
+	 */
+	public FFrameGroup() {
+	}
+
+	/**
+	 * A�ade al Arraylist un nuevo FFrame para formar parte del grupo.
+	 *
+	 * @param fframe FFrame a a�adir.
+	 */
+	public void addFFrame(IFFrame fframe) {
+		m_fframes.add(fframe);
+	}
+
+	/**
+	 * Devuelve una ArrayList que contiene todos los FFrames que forman parte
+	 * del grupo.
+	 *
+	 * @return Arraylist con los fframes.
+	 */
+	public ArrayList getFFrames() {
+		return m_fframes;
+	}
+
+	/**
+	 * Devuelve el rect�ngulo que contiene a todos los fframes seleccionados.
+	 *
+	 * @param at Matriz de transformaci�n
+	 *
+	 * @return Rect�ngulo.
+	 */
+	public Rectangle2D.Double getRectangle(AffineTransform at) {
+		double minX = 0;
+		double minY = 0;
+		double maxX = 0;
+		double maxY = 0;
+		boolean first = true;
+		Rectangle2D.Double rec = new Rectangle2D.Double();
+
+		for (int i = 0; i < m_fframes.size(); i++) {
+			Rectangle2D.Double rs = ((IFFrame) m_fframes.get(i)).getBoundingBox(at);
+
+			if (first) {
+				rec.setRect(rs);
+				first = false;
+			}
+
+			rec.add(rs);
+		}
+
+		rg = new Rectangle2D.Double();
+		rg.setRect(FLayoutUtilities.toSheetRect(rec, m_at));
+
+		return rec;
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Imagen utilizada para acelerar el dibujado.
+	 *
+	 * @throws DriverIOException
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) throws DriverException {
+		Rectangle2D.Double r = getBoundingBox(at);
+		m_at = at;
+
+		for (int i = 0; i < m_fframes.size(); i++) {
+			((IFFrame) m_fframes.get(i)).draw(g, at, rv, imgBase);
+		}
+	}
+
+	/**
+	 * Rellena la transformada que se esta utilizando en el Layout.
+	 *
+	 * @param at Matriz de transformaci�n.
+	 */
+	public void setAt(AffineTransform at) {
+		m_at = at;
+	}
+
+	/**
+	 * Reimplementaci�n del m�todo papa poder modificar los BoundBox  de cada
+	 * uno de los FFrames que contiene dentro este FFrameGroup.
+	 *
+	 * @param r Rect�ngulo.
+	 */
+	public void setBoundBox(Rectangle2D.Double r) {
+		getBoundBox().setRect(r.getX(), r.getY(), r.getWidth(), r.getHeight());
+
+		Rectangle2D.Double raux1 = new Rectangle2D.Double(rg.x, rg.y, rg.width,
+				rg.height);
+		double dx = r.x - raux1.x;
+		double dy = r.y - raux1.y;
+		double dw = r.width / raux1.width;
+		double dh = r.height / raux1.height;
+
+		for (int i = 0; i < getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) getFFrames().get(i);
+			Rectangle2D.Double raux = new Rectangle2D.Double();
+			raux.setRect(fframe.getBoundBox());
+
+			AffineTransform escalado = new AffineTransform();
+			double scalex = r.width / raux1.width;
+			double scaley = r.height / raux1.height;
+
+			escalado.setToScale(dw, dh);
+			escalado.translate(dx - r.x, dy - r.y);
+
+			Point2D.Double pd = new Point2D.Double();
+			escalado.transform(new Point2D.Double(raux.x, raux.y), pd);
+
+			raux.x = pd.x + r.x;
+			raux.y = pd.y + r.y;
+			raux.width = raux.width * dw;
+			raux.height = raux.height * dh;
+
+			fframe.setBoundBox(raux);
+		}
+
+		rg.setRect(r);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.RECTANGLEGROUP);
+		xml.putProperty("tag", getTag());
+
+		for (int i = 0; i < getFFrames().size(); i++) {
+			xml.addChild(((IFFrame) getFFrames().get(i)).getXMLEntity());
+		}
+
+		return xml;
+	}
+	
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity)
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l) {
+		if (xml.getIntProperty("m_Selected") != 0) {
+			this.setSelected(true);
+		} else {
+			this.setSelected(false);
+		}
+
+		IFFrame fframechild = null;
+
+		for (int i = 0; i < xml.getNumChild(); i++) {
+			try {
+				Class clase = Class.forName(xml.getStringProperty("className"));
+				fframechild = (IFFrame) clase.newInstance();
+			} catch (Exception e) {
+				NotificationManager.addError("Clase de Frame sobre el Layout no reconocida",
+					e);
+			}
+
+			fframechild.setXMLEntity(xml.getChild(i), l);
+			this.addFFrame(fframechild);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "grupo");
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at)
+		throws DriverException {
+		for (int i = 0; i < m_fframes.size(); i++) {
+			((IFFrame) m_fframes.get(i)).print(g, at);
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameGroup.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameScaleBar.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameScaleBar.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameScaleBar.java	(revision 1648)
@@ -0,0 +1,1185 @@
+/*
+ * Created on 20-feb-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.LayoutControls;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.gui.layout.Attributes;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.project.ProjectView;
+
+import com.iver.utiles.StringUtilities;
+import com.iver.utiles.XMLEntity;
+
+import org.apache.log4j.Logger;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+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.ArrayList;
+
+
+/**
+ * FFrame para introducir una barra de escala en el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameScaleBar extends FFrame {
+	private static Logger logger = Logger.getLogger(FFrameView.class.getName());
+	private static final int NUMERO = 0;
+	private static final int BARRA1 = 1;
+	private static final int BARRA2 = 2;
+	private static final int BARRA3 = 3;
+	private static final int BARRA4 = 4;
+	private double DIFDOWN = 1.5;
+	private double DIFL = 30;
+	private double DIFR = 30;
+	private double DIFUP = 10;
+	private boolean m_bIntervalSet = false;
+	private int m_style = NUMERO;
+	private int m_units = 1; //Metros
+	private int m_mapUnits = 1; //unidad de medida de la vista(Metros)
+	private long m_interval = 1;
+	private int m_numinterval = 3;
+	private int m_numleft = 2;
+	private double m_height = 0;
+
+	//private FMap m_fmap = null;
+	private FFrameView fframeview = null;
+	private double m_typeUnit = Attributes.CHANGE[1]; //METROS;
+	private String m_nameUnit = null;
+	private double m_numUnit = 0;
+	private double m_dif = 1;
+	private int m_hasleft = 0;
+	private Font m_f = new Font("SansSerif", Font.PLAIN, 9);
+	private ProjectView view = null;
+	private Color barcolor = Color.black;
+	private Color textcolor = Color.black;
+	private boolean showNameUnits = true;
+	private boolean showDescription = false;
+	private boolean aboveName = false;
+	private boolean aboveIntervals = true;
+	private boolean aboveDescription = false;
+	private String description = "";
+
+	/**
+	 * Creates a new FFrameScaleBar object.
+	 */
+	public FFrameScaleBar() {
+	}
+
+	/**
+	 * Inserta el FFrameView sobre el que obtener la escala gr�fica.
+	 *
+	 * @param f FFrameView sobre  el que obtener la escala.
+	 */
+	public void setFFrameView(FFrameView f) {
+		fframeview = f;
+		view = f.getView();
+		setMapUnits(f.getMapUnits());
+
+		//setFMap(f.getFMap());
+		setHeight(f.getBoundBox().height);
+		description = "escala 1:" + String.valueOf(fframeview.getScale());
+
+		/*if (f.getTypeScale()!=0){
+		   isFixed=true;
+		   }else{
+		           isFixed=false;
+		   }
+		 */
+	}
+
+	/**
+	 * Devuelve el FFrameView que se representa con la escala.
+	 *
+	 * @return FFrameView a representar.
+	 */
+	public FFrameView getFFrameView() {
+		return fframeview;
+	}
+
+	/**
+	 * Pone el FMap de la vista que representa a la escala.
+	 *
+	 * @return DOCUMENT ME!
+	 */
+
+	/*  public void setFMap(FMap map) {
+	   m_fmap = map;
+	   }
+	 */
+
+	/**
+	 * Devuelve el FMap de la vista que se representa en la escala.
+	 *
+	 * @return FMap.
+	 */
+	public FMap getFMap() {
+		return fframeview.getFMap();
+	}
+
+	/**
+	 * Rellenar el estilo de barra de escala que se elige.
+	 *
+	 * @param s entero que representa el tipo de barra seleccionada.
+	 */
+	public void setStyle(int s) {
+		m_style = s;
+	}
+
+	/**
+	 * Devuelve el tipo de escala a dibujar.
+	 *
+	 * @return entero.
+	 */
+	public int getStyle() {
+		return m_style;
+	}
+
+	/**
+	 * Rellenar el tama�o de un intervalo.
+	 *
+	 * @param s tama�o de un intervalo.
+	 */
+	public void setInterval(long s) {
+		m_interval = s;
+
+		if (m_numleft != 0) {
+			m_hasleft = 1;
+		}
+
+		Rectangle2D.Double rect = getBoundBox();
+		double difUp = (rect.height / DIFUP);
+		double difL = (rect.width / DIFL);
+		double difR = (rect.width / DIFR);
+		double n = (rect.width - difL - difR);
+		m_numUnit = (m_interval * m_typeUnit) / getScaleView();
+		m_numinterval = (int) (n / m_numUnit) - m_hasleft;
+		m_dif = 1;
+	}
+
+	/**
+	 * Devuelve el valor del intervalo.
+	 *
+	 * @return long.
+	 */
+	public long obtainInterval() {
+		Rectangle2D.Double rect = getBoundBox();
+
+		if (m_numleft != 0) {
+			m_hasleft = 1;
+		}
+
+		double difUp = (rect.height / DIFUP);
+		double difL = (rect.width / DIFL);
+		double difR = (rect.width / DIFR);
+		double n = (rect.width - difL - difR);
+		m_numUnit = n / (m_numinterval + m_hasleft);
+
+		double scaleXunit = (m_numUnit * getScaleView()) / m_typeUnit;
+		m_dif = getExact(scaleXunit);
+		m_numUnit = m_numUnit * m_dif;
+		m_interval = (long) (scaleXunit * m_dif);
+
+		return m_interval;
+	}
+
+	/**
+	 * Rellenar el n�mero de intervalos.
+	 *
+	 * @param s n�mero de intervalos.
+	 */
+	public void setNumInterval(int s) {
+		m_numinterval = s;
+
+		if (m_numleft != 0) {
+			m_hasleft = 1;
+		}
+
+		Rectangle2D.Double rect = getBoundBox();
+		double difUp = (rect.height / DIFUP);
+		double difL = (rect.width / DIFL);
+		double difR = (rect.width / DIFR);
+		double n = (rect.width - difL - difR);
+		m_numUnit = n / (m_numinterval + m_hasleft);
+
+		double scaleXunit = (m_numUnit * getScaleView()) / m_typeUnit;
+		m_dif = getExact(scaleXunit);
+		m_numUnit = m_numUnit * m_dif;
+		m_interval = (long) (scaleXunit * m_dif);
+	}
+
+	/**
+	 * Devuelve el n�mero de intervalos por encima del cero.
+	 *
+	 * @return entero.
+	 */
+	public int getNumInterval() {
+		return m_numinterval;
+	}
+
+	/**
+	 * Rellenar el n�mero de intervalos a la izquierda del cero.
+	 *
+	 * @param s n�mero de intervalos a la izquierda.
+	 */
+	public void setNumLeft(int s) {
+		m_numleft = s;
+	}
+
+	/**
+	 * Devuelve el n�mero de intervalos  en los que se quiere particionar el
+	 * intervalo  que se queda por debajo del cero.
+	 *
+	 * @return entero.
+	 */
+	public int getNumLeft() {
+		return m_numleft;
+	}
+
+	/**
+	 * Seleccionar ,a true, si se quiere o, a false, si no mantener los
+	 * intervalos.
+	 *
+	 * @param b boolean a true si se quiere mantener los intervalos.
+	 */
+	public void setIntervalSet(boolean b) {
+		m_bIntervalSet = b;
+	}
+
+	/**
+	 * Seleccionar la unidad de medida a representar en la barra de escala.
+	 *
+	 * @param s entero que representa la unidad de medida que se selecciona.
+	 */
+	public void setUnits(int s) {
+		m_units = s;
+		m_typeUnit = Attributes.CHANGE[s];
+		m_nameUnit = Attributes.NAMES[s];
+	}
+
+	/**
+	 * Devuelve un entero que representa el tipo de unidades que representamos.
+	 *
+	 * @return entero.
+	 */
+	public int getUnits() {
+		return m_units;
+	}
+
+	/**
+	 * Devuelve el long que representa el intervalo.
+	 *
+	 * @return Intervalo.
+	 */
+	public long getInterval() {
+		return m_interval;
+	}
+
+	/**
+	 * Rellenar el rect�ngulo de la vista sobre la que se obtiene la escala.
+	 *
+	 * @param d Rect�ngulo.
+	 */
+	public void setHeight(double d) {
+		m_height = d;
+	}
+
+	/**
+	 * Rellena la unidad de medida en la que est� la vista.
+	 *
+	 * @param i entero que representa la unidad de medida de la vista.
+	 */
+	public void setMapUnits(int i) {
+		m_mapUnits = i;
+	}
+
+	/*public void setIsFixed(boolean b){
+	   isFixed=b;
+	   }*/
+	/*public void setScaleView(long l){
+	   m_scaleView=l;
+	   }
+	 */
+
+	/**
+	 * Devuelve la escala de la vista seleccionada.
+	 *
+	 * @return la escala de la vista.
+	 */
+	private long getScaleView() {
+		return fframeview.getScale();
+
+		/*        if (isFixed){
+		   return m_scaleView;
+		   }
+		   return FLayoutUtilities.getScaleView(m_fmap, m_height);
+		 */
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Image para acelerar el dibujado.
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) {
+		Rectangle2D.Double r = getBoundingBox(at);
+
+		if (intersects(rv, r)) {
+			if ((fframeview == null) || (fframeview.getFMap() == null)) {
+				drawEmpty(g);
+			} else {
+				switch (m_style) {
+					case (NUMERO):
+
+						double scalex = r.getWidth() / (8);
+						g.setColor(textcolor);
+
+						if (m_f != null) {
+							m_f = new Font(m_f.getFontName(), m_f.getStyle(),
+									(int) (scalex));
+							g.setFont(m_f);
+						}
+
+						g.drawString(" 1:" + getScaleView(), (int) r.x,
+							(int) (r.y + (r.height / 2)));
+
+						//System.out.println("Escala real  " + getScaleView());
+						break;
+
+					case (BARRA1):
+					case (BARRA2):
+					case (BARRA3):
+					case (BARRA4):
+						drawBar(m_style, g, at);
+
+						break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Rellena con el rect�ngulo que se pasa como par�metro el boundBox(en
+	 * cent�metros) del fframe del cual con una transformaci�n se podr�
+	 * calcular el BoundingBox (en pixels).
+	 *
+	 * @param r Rect�ngulo en cent�metros.
+	 */
+	public void setBoundBox(Rectangle2D.Double r) {
+		if ((m_numUnit < 1) || (fframeview.getFMap() == null)) {
+			super.setBoundBox(r);
+
+			return;
+		}
+
+		double difL = (r.width / DIFL);
+		double difR = (r.width / DIFR);
+
+		if (m_bIntervalSet) {
+			m_numinterval = (int) (((r.width - (difL + difR)) * m_dif) / m_numUnit) -
+				m_hasleft;
+		}
+
+		if (m_numinterval < 1) {
+			m_numinterval = 1;
+			r.width = ((m_numinterval + m_hasleft) * m_numUnit) + difL + difR;
+		}
+
+		getBoundBox().setRect(r.getX(), r.getY(), r.getWidth(), r.getHeight());
+	}
+
+	/**
+	 * Dibuja sobre el Graphics la escala gr�fica.
+	 *
+	 * @param type Tipo de barra.
+	 * @param g Graphics sobre el que dibujar.
+	 * @param at Matriz de transformaci�n.
+	 */
+	private void drawBar(int type, Graphics2D g, AffineTransform at) {
+		Rectangle2D.Double rect = getBoundBox();
+		Rectangle2D.Double r = getBoundingBox(at);
+		double numleft = m_numleft;
+		initDistances();
+
+		double difDown = (rect.height / DIFDOWN);
+		double difUp = (rect.height / DIFUP);
+		double difL = (rect.width / DIFL);
+		double difR = (rect.width / DIFR);
+
+		//double difUp = (rect.height / DIFUP);
+		//double difL = (rect.width / DIFL);
+		//double difR = (rect.width / DIFR);
+		double n = (rect.width - difL - difR);
+
+		//double scalex = r.getWidth() / (8);
+		setDescripcion("escala 1:" + String.valueOf(fframeview.getScale()));
+		g.setStroke(new BasicStroke(0));
+
+		if (!m_bIntervalSet) {
+			m_numUnit = n / (m_numinterval + m_hasleft);
+
+			double scaleXunit = (m_numUnit * getScaleView()) / m_typeUnit;
+			m_dif = getExact(scaleXunit);
+			m_numUnit = m_numUnit * m_dif;
+			m_interval = (long) (scaleXunit * m_dif);
+		}
+
+		if (m_bIntervalSet) {
+			m_numUnit = (m_interval * m_typeUnit) / (m_dif * getScaleView());
+			m_numinterval = (int) (((rect.width - (difL + difR)) * m_dif) / m_numUnit) -
+				m_hasleft;
+		}
+
+		if (m_numinterval < 1) {
+			m_numinterval = 1;
+			rect.width = ((m_numinterval + m_hasleft) * m_numUnit) + difL +
+				difR;
+		}
+
+		double h = 0;
+
+		if (type == BARRA1) {
+			h = (rect.height - (difUp + difDown));
+		} else if ((type == BARRA2) || (type == BARRA3)) {
+			h = (rect.height - (difUp + difDown)) / 2;
+		}
+
+		//Dibujar el rect�ngulo que bordea todo.
+		Rectangle2D.Double rectotal = (FLayoutUtilities.fromSheetRect(new Rectangle2D.Double((rect.x +
+					difL), (rect.y + difUp),
+					m_numUnit * (m_hasleft + m_numinterval), h), at));
+		g.setColor(Color.white);
+		g.fillRect((int) rectotal.x, (int) rectotal.y, (int) (rectotal.width),
+			(int) rectotal.height);
+		g.setColor(barcolor);
+
+		/*if (m_f!=null){
+		   m_f = new Font(m_f.getFontName(), m_f.getStyle(),
+		           (int) ((r.getWidth() / 8) / (m_numinterval + m_hasleft)));
+		   }else{
+		           m_f=new Font("SansSerif", Font.PLAIN, (int) ((r.getWidth() / 8) / (m_numinterval + m_hasleft)));
+		   }*/
+		if (m_f != null) {
+			m_f = new Font(m_f.getFontName(), m_f.getStyle(),
+					(int) (r.getHeight() / 4));
+		} else {
+			m_f = new Font("SansSerif", Font.PLAIN, (int) (r.getHeight() / 4));
+		}
+
+		g.setFont(m_f);
+
+		//Derecha del cero
+		for (int i = 0; i < m_numinterval; i++) {
+			Rectangle2D.Double recder = FLayoutUtilities.fromSheetRect(new Rectangle2D.Double((rect.x +
+						(difL) + ((m_numUnit * i) + (m_hasleft * m_numUnit))),
+						(rect.y + (difUp)), (m_numUnit),
+						(rect.height - (difUp + difDown)) / 2), at);
+			Rectangle2D.Double recderB = FLayoutUtilities.fromSheetRect(new Rectangle2D.Double((rect.x +
+						(difL) + ((m_numUnit * i) + (m_hasleft * m_numUnit))),
+						(rect.y + difUp) +
+						((rect.height - (difUp + difDown)) / 2), (m_numUnit),
+						((rect.height - (difUp + difDown)) / 2)), at);
+
+			//			Correcci�n cuando la altura en pixels del rect�ngulo es impar.
+			rectotal.y = recder.y;
+			recderB.height = rectotal.height - recder.height + 0.5;
+
+			/**
+			 * if (i == (m_numinterval - 1)) { if (recder.getMaxX() !=
+			 * rectotal.getMaxX()) { recder.width = (recder.width +
+			 * recder.getMaxX()) - rectotal.getMaxX(); } if (recderB.getMaxX()
+			 * != rectotal.getMaxX()) { recderB.width = (recderB.width +
+			 * recderB.getMaxX()) - rectotal.getMaxX(); }} if
+			 * (recderB.getMaxY() != rectotal.getMaxY()) { recderB.height =
+			 * (recderB.height + recderB.getMaxY()) - rectotal.getMaxY(); }
+			 */
+			if ((m_numleft % 2) == 0) {
+				if ((i % 2) == 0) {
+					if ((type == BARRA1) || (type == BARRA2)) {
+						fillRect(g, recder);
+					} else if (type == BARRA3) {
+						g.drawRect((int) recder.x, (int) recder.y,
+							(int) recder.width, (int) recder.height);
+					}
+				} else if (type == BARRA1) {
+					fillRect(g, recderB);
+				}
+			} else {
+				if ((i % 2) != 0) {
+					if ((type == BARRA1) || (type == BARRA2)) {
+						fillRect(g, recder);
+					} else if (type == BARRA3) {
+						g.drawRect((int) recderB.x, (int) recderB.y,
+							(int) recderB.width, (int) recderB.height);
+					}
+				} else if (type == BARRA1) {
+					fillRect(g, recderB);
+				}
+			}
+
+			long inter = (long) (m_interval * i);
+			Long l = new Long(inter);
+
+			/* int pos = ((int) (r.getWidth() / (m_numinterval + m_hasleft)) * l.toString()
+			   .length()) / 24;
+			 */
+			int pos = ((int) (r.getHeight() / 4) * l.toString().length()) / 4;
+
+			///Point2D.Double p = new Point2D.Double(recder.x - pos, recder.y);
+			Point2D.Double p = null;
+
+			if (isAboveIntervals()) {
+				p = new Point2D.Double(recder.x - pos,
+						r.getMinY() + (r.getHeight() / DIFUP));
+			} else {
+				p = new Point2D.Double(recder.x - pos,
+						((r.getHeight() / 4) + r.getMaxY()) -
+						(r.getHeight() / DIFDOWN));
+			}
+
+			drawInterval(g, inter, p);
+		}
+
+		//�ltimo n�mero a dibujar.
+		long inter = (long) (m_interval * m_numinterval);
+		Long l = new Long(inter);
+
+		/* int pos = ((int) (r.getWidth() / (m_numinterval + m_hasleft)) * l.toString()
+		   .length()) / 24;
+		 */
+		int pos = ((int) (r.getHeight() / 4) * l.toString().length()) / 4;
+		Point2D.Double p = null;
+
+		if (isAboveIntervals()) {
+			p = new Point2D.Double(rectotal.getMaxX() - pos,
+					r.getMinY() + (r.getHeight() / DIFUP));
+		} else {
+			p = new Point2D.Double(rectotal.getMaxX() - pos,
+					((r.getHeight() / 4) + r.getMaxY()) -
+					(r.getHeight() / DIFDOWN));
+		}
+
+		/* Point2D.Double p = new Point2D.Double(rectotal.getMaxX() - pos,
+		   rectotal.y);
+		 */
+		drawInterval(g, inter, p);
+
+		//Izquierda del cero
+		for (int i = 0; i < m_numleft; i++) {
+			Rectangle2D.Double reciz = FLayoutUtilities.fromSheetRect(new Rectangle2D.Double((rect.x +
+						difL + ((m_numUnit / m_numleft) * i)),
+						(rect.y + difUp), (m_numUnit / numleft),
+						(rect.height - (difUp + difDown)) / 2), at);
+			Rectangle2D.Double recizB = FLayoutUtilities.fromSheetRect(new Rectangle2D.Double((rect.x +
+						difL + ((m_numUnit / m_numleft) * i)),
+						(rect.y + difUp) +
+						((rect.height - (difUp + difDown)) / 2),
+						(m_numUnit / numleft),
+						((rect.height - (difUp + difDown)) / 2)), at);
+
+			//Correcci�n cuando la altura en pixels del rectangulo es impar.
+			reciz.y = rectotal.y;
+			recizB.height = rectotal.height - reciz.height + 0.5;
+
+			if ((i % 2) == 0) {
+				if ((type == BARRA1) || (type == BARRA2)) {
+					fillRect(g, reciz);
+				} else if (type == BARRA3) {
+					g.drawRect((int) reciz.x, (int) reciz.y, (int) reciz.width,
+						(int) reciz.height);
+				}
+			} else if (type == BARRA1) {
+				fillRect(g, recizB);
+			}
+		}
+
+		if (m_numleft > 0) {
+			inter = (long) (m_interval);
+			l = new Long(inter);
+
+			/*pos = ((int) (r.getWidth() / (m_numinterval + m_hasleft)) * l.toString()
+			   .length()) / 24;
+			 */
+			pos = ((int) (r.getHeight() / 4) * l.toString().length()) / 4;
+
+			if (isAboveIntervals()) {
+				p = new Point2D.Double(rectotal.x - pos,
+						r.getMinY() + (r.getHeight() / DIFUP));
+			} else {
+				p = new Point2D.Double(rectotal.x - pos,
+						((r.getHeight() / 4) + r.getMaxY()) -
+						(r.getHeight() / DIFDOWN));
+			}
+
+			/// Point2D.Double p1 = new Point2D.Double(rectotal.x - pos, rectotal.y);
+			drawInterval(g, inter, p);
+		}
+
+		//Se dibuja el rect�ngulo que bordea toda la escala gr�fica.
+		g.drawRect((int) rectotal.x, (int) rectotal.y, (int) (rectotal.width),
+			(int) rectotal.height);
+
+		drawNameUnits(g, rect, at);
+		drawDescription(g, rect, at);
+	}
+
+	/**
+	 * Inicializa las distancias de la barra de escala.
+	 */
+	private void initDistances() {
+		int numUp = 0;
+		int numDown = 0;
+
+		DIFDOWN = 30;
+		DIFL = 40;
+		DIFR = 40;
+		DIFUP = 30;
+
+		if (isAboveName()) {
+			numUp++;
+		} else {
+			numDown++;
+		}
+
+		if (isAboveIntervals()) {
+			numUp++;
+		} else {
+			numDown++;
+		}
+
+		if (isAboveDescription()) {
+			numUp++;
+		} else {
+			numDown++;
+		}
+
+		if (numDown == 1) {
+			DIFDOWN = 3;
+		} else if (numDown == 2) {
+			DIFDOWN = 2;
+		} else if (numDown == 3) {
+			DIFDOWN = 1.2;
+		}
+
+		if (numUp == 1) {
+			DIFUP = 3;
+		} else if (numUp == 2) {
+			DIFUP = 2;
+		} else if (numUp == 3) {
+			DIFUP = 1.2;
+		}
+
+		//DIFDOWN=numDown;
+		//DIFUP=numUp;
+	}
+
+	/**
+	 * Dibuja sobre el Graphics el nombre de la unidad de medida de la escala.
+	 *
+	 * @param g Graphics sobre el que se dibuja.
+	 * @param rec Rect�ngulo que ocupa la escala gr�fica.
+	 * @param at Matriz de transformaci�n.
+	 */
+	private void drawNameUnits(Graphics g, Rectangle2D.Double rec,
+		AffineTransform at) {
+		//	Nombre de las unidades utilizadas.
+		Point2D.Double p = null;
+
+		if (isShowNameUnits()) {
+			if (isAboveName()) {
+				p = new Point2D.Double(rec.getCenterX() -
+						((rec.getHeight() * (m_nameUnit.length() / 6)) / 4),
+						
+					//(m_nameUnit.length() / 6),
+					(rec.getMinY() + (rec.getHeight() / (DIFUP))) -
+						(rec.getHeight() / 2));
+			} else {
+				p = new Point2D.Double(rec.getCenterX() -
+						((rec.getHeight() * (m_nameUnit.length() / 6)) / 4),
+						(
+					//(m_nameUnit.length() / 6),
+					rec.getHeight() / 1.4) +
+						(rec.getMaxY() - (rec.getHeight() / (DIFDOWN))));
+			}
+
+			p = FLayoutUtilities.fromSheetPoint(p, at);
+			g.setColor(textcolor);
+			g.drawString(m_nameUnit, (int) p.x, (int) p.y);
+		}
+	}
+
+	/**
+	 * Dibuja sobre el Graphics la descripci�n que por defecto sera la escala.
+	 *
+	 * @param g Graphics sobre el que se dibuja.
+	 * @param rec Rect�ngulo que ocupa la escala gr�fica.
+	 * @param at Matriz de transformaci�n.
+	 */
+	private void drawDescription(Graphics g, Rectangle2D.Double rec,
+		AffineTransform at) {
+		Point2D.Double p = null;
+
+		if (isShowDescription()) {
+			if (isAboveDescription()) {
+				p = new Point2D.Double(rec.getCenterX() -
+						((rec.getHeight() * (getDescripcion().length() / 6)) / 4),
+						
+					//(getDescripcion().length() / 6),
+					(rec.getMinY() + (rec.getHeight() / (DIFUP))) -
+						(rec.getHeight() / 5));
+			} else {
+				p = new Point2D.Double(rec.getCenterX() -
+						((rec.getHeight() * (getDescripcion().length() / 6)) / 4),
+						(
+					//(getDescripcion().length() / 6),
+					rec.getHeight() / 2) +
+						(rec.getMaxY() - (rec.getHeight() / (DIFDOWN))));
+			}
+
+			p = FLayoutUtilities.fromSheetPoint(p, at);
+			g.setColor(textcolor);
+			g.drawString(getDescripcion(), (int) p.x, (int) p.y);
+		}
+	}
+
+	/**
+	 * Rellena la fuente utilizada para dibujar los intervalos y la unidad de
+	 * medida utilizada.
+	 *
+	 * @param f fuente a utilizar.
+	 */
+	public void setFont(Font f) {
+		m_f = f;
+	}
+
+	/**
+	 * Devuelve la fuente con la que se est� dibujando sobre el graphics.
+	 *
+	 * @return fuente utilizada.
+	 */
+	public Font getFont() {
+		return new Font(m_f.getFontName(), m_f.getStyle(), 9);
+	}
+
+	/**
+	 * Devuelve si el intervalo es variable o si por el contrario es fijo.
+	 *
+	 * @return true si el intervalo es fijo.
+	 */
+	public boolean isbIntervalSet() {
+		return m_bIntervalSet;
+	}
+
+	/**
+	 * Especificar si el intervalo se debe mantener o es variable.
+	 *
+	 * @param b si se quiere mantener el intervalo especificado.
+	 */
+	public void setbIntervalSet(boolean b) {
+		m_bIntervalSet = b;
+	}
+
+	/**
+	 * Devuelve el porcentaje por el cual hay que multiplicar  el intervalo
+	 * para conseguir un intervalo redondeado,  de momento con una cifra
+	 * significativas(NUM=1).
+	 *
+	 * @param total intervalo.
+	 *
+	 * @return Porcentaje
+	 */
+	private double getExact(double total) {
+		int NUM = 1;
+		double t = 0;
+		double dif = 1;
+		Double d = new Double(total);
+		Long l = new Long(d.longValue());
+		int num = l.toString().length();
+		t = ((long) (total / Math.pow(10, num - NUM)) * Math.pow(10, num - NUM));
+		dif = t / total;
+
+		return dif;
+	}
+
+	/**
+	 * Rellena un rect�ngulo.
+	 *
+	 * @param g Graphics sobre el que dibujar.
+	 * @param r Rect�ngulo a rellenar.
+	 */
+	private void fillRect(Graphics2D g, Rectangle2D.Double r) {
+		g.fillRect((int) r.x, (int) r.y, (int) r.width, (int) r.height);
+	}
+
+	/**
+	 * Escribe sobre el Graphics y en la posici�n indicada el tama�o del
+	 * intervalo.
+	 *
+	 * @param g Graphics sobre el que dibujar.
+	 * @param inter Valor del intervalo.
+	 * @param p Punto donde dibujarlo.
+	 */
+	private void drawInterval(Graphics2D g, long inter, Point2D.Double p) {
+		Long l = new Long(inter);
+		g.setColor(textcolor);
+		g.drawString(l.toString(), (int) p.x, (int) p.y);
+		g.setColor(barcolor);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.RECTANGLESCALEBAR);
+		xml.putProperty("m_bIntervalSet", m_bIntervalSet);
+		xml.putProperty("m_dif", m_dif);
+		xml.putProperty("m_hasleft", m_hasleft);
+		xml.putProperty("m_nameUnit", m_nameUnit);
+		xml.putProperty("m_numUnit", m_numUnit);
+
+		xml.putProperty("m_height", m_height);
+
+		xml.putProperty("m_style", m_style);
+		xml.putProperty("m_units", m_units);
+		xml.putProperty("m_interval", m_interval);
+		xml.putProperty("m_numinterval", m_numinterval);
+		xml.putProperty("m_numleft", m_numleft);
+		xml.putProperty("m_mapUnits", m_mapUnits);
+		xml.putProperty("fontName", m_f.getFontName());
+		xml.putProperty("fontStyle", m_f.getStyle());
+		xml.putProperty("tag", getTag());
+
+		/*                xml.addChild(fframeview.getXMLEntity());
+		
+		                                      ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
+		                                      ArrayList views = pe.getProject().getViews();
+		                                      boolean hasIndex = false;
+		                                      for (int i = 0; i < views.size(); i++) {
+		                                              if (fframeview.getView() == ((ProjectView) views.get(i))) {
+		                                                      xml.putProperty("indice", i);
+		                                                      hasIndex = true;
+		                                              }
+		                                      }
+		                                      if (!hasIndex) {
+		                                              xml.putProperty("indice", -1);
+		                                      }
+		 */
+		LayoutControls lc = (LayoutControls) PluginServices.getExtension(LayoutControls.class);
+		Layout layout = lc.getLayout();
+		ArrayList fframes = layout.getFFrames();
+
+		for (int i = 0; i < fframes.size(); i++) {
+			if (fframes.get(i) instanceof FFrameView) {
+				if (fframeview.getView().getName().equals(((FFrameView) fframes
+															   .get(i)).getView()
+															   .getName())) {
+					xml.putProperty("index", i);
+				}
+			}
+		}
+
+		xml.putProperty("barcolor", StringUtilities.color2String(barcolor));
+		xml.putProperty("textcolor", StringUtilities.color2String(textcolor));
+		xml.putProperty("showNameUnits", showNameUnits);
+		xml.putProperty("showDescription", showDescription);
+		xml.putProperty("aboveName", aboveName);
+		xml.putProperty("aboveIntervals", aboveIntervals);
+		xml.putProperty("aboveDescription", aboveDescription);
+		xml.putProperty("description", description);
+
+		return xml;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
+	 * 		com.iver.cit.gvsig.project.Project)
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l) {
+		if (xml.getIntProperty("m_Selected") != 0) {
+			this.setSelected(true);
+		} else {
+			this.setSelected(false);
+		}
+
+		this.m_bIntervalSet = xml.getBooleanProperty("m_bIntervalSet");
+		this.m_dif = xml.getDoubleProperty("m_dif");
+		this.m_hasleft = xml.getIntProperty("m_hasleft");
+		this.m_nameUnit = xml.getStringProperty("m_nameUnit");
+		this.m_numUnit = xml.getDoubleProperty("m_numUnit");
+
+		this.m_height = xml.getDoubleProperty("m_height");
+
+		this.m_style = xml.getIntProperty("m_style");
+		this.m_interval = xml.getLongProperty("m_interval");
+		this.m_numinterval = xml.getIntProperty("m_numinterval");
+		this.m_numleft = xml.getIntProperty("m_numleft");
+		this.m_mapUnits = xml.getIntProperty("m_mapUnits");
+		this.m_f = new Font(xml.getStringProperty("fontName"),
+				xml.getIntProperty("fontStyle"), 9);
+
+		/*FFrameView fv=(FFrameView) FFrameView.createFFrame(xml.getChild(0),
+		   p);
+		   int indice = xml.getIntProperty("indice");
+		   if (indice != -1) {
+		           ProjectView view = (ProjectView) p.getViews().get(indice);
+		           fv.setView((ProjectView) view);
+		           fv.getFMap().setViewPort(((ProjectView) p.getViews().get(indice)).getMapContext().getViewPort());
+		   }
+		
+		   this.setFFrameView(fv);
+		 */
+		ArrayList fframes = l.getFFrames();
+		fframeview = (FFrameView) fframes.get(xml.getIntProperty("index"));
+
+		if (xml.contains("description")) { //Comprobar que es de la versi�n que cambia el di�logo.
+			this.barcolor = StringUtilities.string2Color(xml.getStringProperty(
+						"barcolor"));
+			this.textcolor = StringUtilities.string2Color(xml.getStringProperty(
+						"textcolor"));
+			this.showNameUnits = xml.getBooleanProperty("showNameUnits");
+			this.showDescription = xml.getBooleanProperty("showDescription");
+			this.aboveName = xml.getBooleanProperty("aboveName");
+			this.aboveIntervals = xml.getBooleanProperty("aboveIntervals");
+			this.aboveDescription = xml.getBooleanProperty("aboveDescription");
+			this.description = xml.getStringProperty("description");
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "escala") + num;
+	}
+
+	/**
+	 * Inserta el color de la escala gr�fica.
+	 *
+	 * @param color Color de la escala gr�fica.
+	 */
+	public void setBarColor(Color color) {
+		barcolor = color;
+	}
+
+	/**
+	 * Inserta el color del texto.
+	 *
+	 * @param color Color del texto.
+	 */
+	public void setTextColor(Color color) {
+		textcolor = color;
+	}
+
+	/**
+	 * Devuelve el color de la escala gr�fica.
+	 *
+	 * @return Color de la escala gr�fica.
+	 */
+	public Color getBarColor() {
+		return barcolor;
+	}
+
+	/**
+	 * Devuelve el color del texto.
+	 *
+	 * @return Color del texto.
+	 */
+	public Color getTextColor() {
+		return textcolor;
+	}
+
+	/**
+	 * Devuelve true si se debe mostrar el nombre de las unidades de medida de
+	 * la escala gr�fica.
+	 *
+	 * @return True si se muestra las unidades de medida.
+	 */
+	public boolean isShowNameUnits() {
+		return showNameUnits;
+	}
+
+	/**
+	 * Inserta si se debe de mostrar el nombre de las unidades de medida o no.
+	 *
+	 * @param showNameUnits True si se muestra el nombre de las unidades de
+	 * 		  medida.
+	 */
+	public void setShowNameUnits(boolean showNameUnits) {
+		this.showNameUnits = showNameUnits;
+	}
+
+	/**
+	 * Devuelve true si se muestra la descripci�n a la parte de arriba de la
+	 * escala gr�fica.
+	 *
+	 * @return True si se muestra arriba de la escala gr�fica.
+	 */
+	public boolean isAboveDescription() {
+		return aboveDescription;
+	}
+
+	/**
+	 * Introduce true si se muestra arriba de la escala gr�fica la descripci�n.
+	 *
+	 * @param aboveDescription True si se muestra arriba la descripci�n.
+	 */
+	public void setAboveDescription(boolean aboveDescription) {
+		this.aboveDescription = aboveDescription;
+	}
+
+	/**
+	 * Devuelve true si se muestran a la parte de arriba los valores de los
+	 * intervalos.
+	 *
+	 * @return True si se muestran arriba de la escala gr�fica.
+	 */
+	public boolean isAboveIntervals() {
+		return aboveIntervals;
+	}
+
+	/**
+	 * Inserta si se muestran los valores de los intervalos a la parte de
+	 * arriba de la escala o debajo.
+	 *
+	 * @param aboveIntervals True si se muestran los valores de los intervalos
+	 * 		  a la parte de arriba de la escala gr�fica.
+	 */
+	public void setAboveIntervals(boolean aboveIntervals) {
+		this.aboveIntervals = aboveIntervals;
+	}
+
+	/**
+	 * Devuelve si se muestra a la parte de arriba de la escala gr�fica el
+	 * nombre de las unidades de medida o debajo.
+	 *
+	 * @return True si se muestra a la parte de arriba de la escala gr�fica.
+	 */
+	public boolean isAboveName() {
+		return aboveName;
+	}
+
+	/**
+	 * Inserta si el nombre se muestra a la parte de arriba de la escala
+	 * gr�fica o a la parte de abajo.
+	 *
+	 * @param aboveName True si se muestra a la parte de arriba de la escala
+	 * 		  gr�fica.
+	 */
+	public void setAboveName(boolean aboveName) {
+		this.aboveName = aboveName;
+	}
+
+	/**
+	 * Devuelve si se debe mostrar la descripci�n o no.
+	 *
+	 * @return True si se muestra la descripci�n.
+	 */
+	public boolean isShowDescription() {
+		return showDescription;
+	}
+
+	/**
+	 * Inserta si se muestra o no la descripci�n.
+	 *
+	 * @param showDescription True si se muestra la descripci�n.
+	 */
+	public void setShowDescription(boolean showDescription) {
+		this.showDescription = showDescription;
+	}
+
+	/**
+	 * Devuelve la descripci�n de la escala.
+	 *
+	 * @return Descripci�n de la escala.
+	 */
+	public String getDescripcion() {
+		return description;
+	}
+
+	/**
+	 * Inserta la descripci�n de la escala.
+	 *
+	 * @param descripcion Descripci�n de la escala.
+	 */
+	public void setDescripcion(String descripcion) {
+		this.description = descripcion;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at)
+		throws DriverException {
+		draw(g, at, null, null);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameScaleBar.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameLegend.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameLegend.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameLegend.java	(revision 1648)
@@ -0,0 +1,680 @@
+/* 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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.LayoutControls;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.FMap;
+import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
+import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
+import com.iver.cit.gvsig.fmap.layers.FLayer;
+import com.iver.cit.gvsig.fmap.layers.FLayers;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
+import com.iver.cit.gvsig.fmap.layers.layerOperations.Classifiable;
+import com.iver.cit.gvsig.fmap.rendering.ClassifiedLegendInfo;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import java.util.ArrayList;
+
+
+/**
+ * FFrame para introducir una leyenda en el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FFrameLegend extends FFrame {
+	private static final int PRESENTACION = 0;
+	private static final int BORRADOR = 1;
+	private int m_quality = 0;
+	private int m_viewing = 0;
+	private FontRenderContext m_frc = null;
+	private FMap m_fmap = null;
+	private Font m_f = new Font("Monospaced", Font.PLAIN, 9);
+	private FFrameView fframeview = null;
+	private int num = 0;
+	private int m_max;
+	private int m_numLayers;
+	private FLayers layers = null;
+
+	/**
+	 * Rellena la calidad que se quiere aplicar.
+	 *
+	 * @param q entero que representa la calidad a aplicar.
+	 */
+	public void setQuality(int q) {
+		m_quality = q;
+	}
+
+	/**
+	 * Devuelve un entero que representa la calidad que est� seleccionada.
+	 *
+	 * @return tipo de calidad selccionada.
+	 */
+	public int getQuality() {
+		return m_quality;
+	}
+
+	/**
+	 * Devuelve un entero que representa la forma en que se actualiza la vista.
+	 *
+	 * @return forma que se actualiza la vista.
+	 */
+	public int getViewing() {
+		return m_viewing;
+	}
+
+	/**
+	 * Inserta una FFrameView de donde se obtiene la informaci�n de las capas
+	 * para generar la leyenda.
+	 *
+	 * @param f FFrameView para obtener los nombres de las capas.
+	 */
+	public void setFFrameView(FFrameView f) {
+		fframeview = f;
+	}
+
+	/**
+	 * Devuelve el FFrameView utilizado para obtener la leyenda.
+	 *
+	 * @return FFrameView utilizado.
+	 */
+	public FFrameView getFFrameView() {
+		return fframeview;
+	}
+
+	/**
+	 * Rellena la forma de actualizar la vista.
+	 *
+	 * @param v entero que representa la forma de actualizar la vista.
+	 */
+	public void setViewing(int v) {
+		m_viewing = v;
+	}
+
+	/**
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro, seg�n
+	 * la transformada afin que se debe de aplicar y el rect�ngulo que se debe
+	 * de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param rv rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase Imagen para acelerar el dibujado.
+	 *
+	 * @throws DriverException
+	 */
+	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
+		BufferedImage imgBase) throws DriverException {
+		Rectangle2D.Double re = getBoundingBox(at);
+
+		if ((fframeview != null) && (fframeview.getFMap() != null)) {
+			layers = fframeview.getFMap().getLayers();
+		}
+
+		m_max = 0;
+		m_numLayers = 0;
+
+		if (intersects(rv, re)) {
+			if (layers == null) { //Si no se ha seleccionado ninguna vista para crear la leyenda.
+				drawEmpty(g);
+			} else if ((rv == null) || (getQuality() == PRESENTACION)) {
+				m_numLayers = getSizeNum(layers);
+				m_frc = g.getFontRenderContext();
+
+				double h = re.getHeight() / m_numLayers;
+				int n = 0;
+				drawTheme(g, re, h, layers, n);
+			} else if (getQuality() == BORRADOR) { //Si se selecciona la calidad BORRADOR.
+				drawDraft(g);
+			}
+		}
+	}
+
+	/**
+	 * Dibuja el nombre u s�mbolo de la capa que se pasa como par�metro.
+	 *
+	 * @param g Graphics2D sobre el que se dibuja.
+	 * @param re Rectangle a rellenar.
+	 * @param h Altura en pixels.
+	 * @param layers Capa a representar.
+	 * @param n �ndice de la capa a dibujar.
+	 *
+	 * @return �ndice de la capa siguiente.
+	 *
+	 * @throws DriverException
+	 */
+	private int drawTheme(Graphics2D g, Rectangle2D re, double h,
+		FLayers layers, int n) throws DriverException {
+		//////Se recorren los layers dibujando el s�mbolo y su nombre sobre el graphics	
+		for (int i = 0; i < layers.getLayersCount(); i++) {
+			FLayer layer = (FLayer) layers.getLayer(i);
+
+			if (layer.isVisible()) {
+				if (layer instanceof FLayers) {
+					n += drawTheme(g, re, h, layers, n);
+				} else if (layer instanceof AlphanumericData) {
+					AlphanumericData cO = (AlphanumericData) layer;
+
+					if (((Classifiable) cO).getLegend() instanceof ClassifiedLegendInfo) {
+						ClassifiedLegendInfo cli = (ClassifiedLegendInfo) ((Classifiable) cO).getLegend();
+						double dX = 0;
+						double dY = n * h;
+
+						int xl = (int) (re.getX() + dX);
+						int yl = (int) (re.getY() + dY);
+						int sizefont = 0;
+
+						if ((re.getHeight() / m_numLayers) < (re.getWidth() / 8)) {
+							sizefont = (int) (re.getHeight() / m_numLayers);
+						} else {
+							sizefont = (int) (re.getWidth() / 8);
+						}
+
+						drawNameLegend(g, layer.getName(), re, sizefont,
+							(int) (xl - (re.getWidth() / 5)), yl, h);
+						n++;
+
+						for (int j = 0; j < cli.getValues().length; j++) {
+							dY = n * h;
+
+							xl = (int) (re.getX() + dX);
+							yl = (int) (re.getY() + dY);
+
+							String s = cli.getDescriptions()[j];
+							drawNameLegend(g, s, re, sizefont, xl, yl, h);
+
+							FSymbol fs2d = cli.getSymbols()[j];
+							drawSymbolLegend(g, re, xl, yl, fs2d, sizefont,
+								((Classifiable) cO).getShapeType(), h);
+
+							n++;
+						}
+					} else {
+						double dX = 0;
+						double dY = n * h;
+
+						int xl = (int) (re.getX() + dX);
+						int yl = (int) (re.getY() + dY);
+						int sizefont = 0;
+
+						if ((re.getHeight() / m_numLayers) < (re.getWidth() / 8)) {
+							sizefont = (int) (re.getHeight() / m_numLayers);
+						} else {
+							sizefont = (int) (re.getWidth() / 8);
+						}
+
+						drawNameLegend(g, layer.getName(), re, sizefont, xl,
+							yl, h);
+
+						//FStyle2D fs2d = cO.getLegendInfo().getSymbol();
+						//drawSymbolLegend(g, re, xl, yl, fs2d,sizefont,cO.getShapeType());
+						FSymbol fs2d = ((Classifiable) cO).getLegend()
+										.getDefaultSymbol();
+
+						//System.out.println("sizefont = " + sizefont);
+						drawSymbolLegend(g, re, xl, yl, fs2d, sizefont,
+							((Classifiable) cO).getShapeType(), h);
+
+						//System.out.println("cO.getShapeType()= " +
+						//    cO.getShapeType());
+						n++;
+					}
+				}
+			}
+		}
+
+		return n;
+	}
+
+	/**
+	 * Dibuja sobre el graphics el nombre de la capa que se pasa como
+	 * par�metro.
+	 *
+	 * @param g Graphics2D sobre el que dibujar.
+	 * @param name Nombre de la capa.
+	 * @param re Rect�ngulo a ocupar por el nombre.
+	 * @param sizefont tama�o de la fuente.
+	 * @param x Posici�n X.
+	 * @param y Posici�n Y.
+	 * @param h Altura.
+	 */
+	private void drawNameLegend(Graphics2D g, String name, Rectangle2D re,
+		int sizefont, int x, int y, double h) {
+		Font f = new Font("SansSerif", Font.PLAIN, sizefont);
+		g.setFont(f);
+		g.setColor(Color.black);
+		g.drawString(name, (int) (x + (re.getWidth() / 4)), (int) (y + (h / 2)));
+	}
+
+	/**
+	 * A�ade al Layout un nuevo FFrameText a partir de los par�metros de entrada.
+	 *
+	 * @param layout Layout sobre el que se crea el nuevo FFrame.
+	 * @param name Texto.
+	 * @param re Rect�ngulo del FFrame.
+	 * @param sizefont tama�o de la fuente.
+	 * @param x Posici�n X.
+	 * @param y Posici�n Y.
+	 * @param h Altura.
+	 */
+	private void toFFrameText(Layout layout, String name, Rectangle2D re,
+		int sizefont, int x, int y, double h) {
+		int wl = (int) (re.getWidth() / 1.5);
+		int haux = (int) (sizefont * 0.7);
+		Rectangle2D rAux = new Rectangle2D.Double((int) x, y, wl,
+				haux);
+		FFrameText text = new FFrameText();
+		text.setBoundBox(FLayoutUtilities.toSheetRect(rAux, layout.getAT()));
+		text.addText(name);
+		layout.addFFrame(text, false);
+	}
+
+	/**
+	 * Dibuja sobre el Graphics2D el s�mbolo.
+	 *
+	 * @param g Graphics2D.
+	 * @param re Rect�ngulo a cubrir por el s�mbolo.
+	 * @param x Posici�n X.
+	 * @param y Posici�n Y.
+	 * @param fs2d S�mbolo a dibujar.
+	 * @param sizefont Tama�o de la fuente.
+	 * @param type Tipo de s�mbolo.
+	 * @param h Altura.
+	 */
+	private void drawSymbolLegend(Graphics2D g, Rectangle2D re, int x, int y,
+		FSymbol fs2d, int sizefont, int type, double h) {
+		double pW = 5;
+		double pH = m_numLayers;
+		int wl = (int) (re.getWidth() / pW);
+		int haux = (int) (sizefont * 0.7);
+		FGraphicUtilities.DrawSymbol(g, new AffineTransform(),
+			new Rectangle(x, (int) ((y + (h / 2)) - haux), wl, haux), fs2d);
+	}
+
+	/**
+	 * A�ade al Layout un nuevo FFrameSymbol.
+	 *
+	 * @param layout Layout sobe el que se a�ade el FFrame.
+	 * @param re Rect�ngulo del FFrame.
+	 * @param x Posici�n X.
+	 * @param y Posici�n Y.
+	 * @param fs2d S�mbolo a a�adir.
+	 * @param sizefont tama�o de la fuente.
+	 * @param type Tipo de s�mbolo.
+	 * @param h Altura.
+	 */
+	private void toFFrameSymbol(Layout layout, Rectangle2D re, int x, int y,
+		FSymbol fs2d, int sizefont, int type, double h) {
+		double pW = 5;
+		double pH = m_numLayers;
+		int wl = (int) (re.getWidth() / pW);
+
+		int haux = (int) (sizefont * 0.7);
+		Rectangle2D rAux3 = new Rectangle2D.Double(x,
+				(int) ((y + (h / 2)) - haux), wl, haux);
+		FFrameSymbol symbol = new FFrameSymbol();
+		symbol.setBoundBox(FLayoutUtilities.toSheetRect(rAux3, layout.getAT()));
+		symbol.setSymbol(fs2d, type);
+		layout.addFFrame(symbol, false);
+	}
+
+	/**
+	 * Devuelve el n�mero total de capas incluyendo las subcapas.
+	 *
+	 * @param layers Capa a contar.
+	 *
+	 * @return N�mero de capas y subcapas.
+	 */
+	private int getSizeNum(FLayers layers) {
+		int n = 0;
+
+		/////Aqu� hay que calcular cuantos layers y sublayers hay, para saber que distancias dejar entre uno y otro.
+		///y adem�s el tama�o de cada uno de ellos para saber que anchura dejar.
+		for (int i = 0; i < layers.getLayersCount(); i++) {
+			FLayer layer = (FLayer) layers.getLayer(i);
+
+			if (layer.isVisible()) {
+				if (layer.getName().length() > m_max) {
+					m_max = layer.getName().length();
+				}
+
+				if (layer instanceof FLayers) {
+					n += getSizeNum((FLayers) layer); //m_numLayers += getNumInLyrGroup((FLayers) layer);
+				} else if (layer instanceof AlphanumericData) {
+					AlphanumericData cO = (AlphanumericData) layer;
+					n++;
+
+					if (((Classifiable) cO).getLegend() instanceof ClassifiedLegendInfo) {
+						ClassifiedLegendInfo cli = (ClassifiedLegendInfo) ((Classifiable) cO).getLegend();
+
+						for (int j = 0; j < cli.getValues().length; j++) {
+							String s = cli.getDescriptions()[j];
+
+							if (s.length() > m_max) {
+								m_max = s.length();
+							}
+
+							n++;
+						}
+					}
+				}
+			}
+		}
+
+		return n;
+	}
+
+	/**
+	 * Transforma el FFrameLegend en diferentes FFrameSymbol y FFrameText.
+	 *
+	 * @param layout Layout sobre el que a�adir los FFrame nuevos y sobre el que elimnar el FFrameLegend anterior.
+	 */
+	public void toFFrames(Layout layout) {
+		Rectangle2D rectangle = getBoundingBox(null);
+		double h = rectangle.getHeight() / m_numLayers;
+		FLayers lays = layers;
+		toFFrames(layout, lays, rectangle, h, 0);
+		layout.getFFrames().remove(this);
+	}
+
+	/**
+	 * Transforma el FFrameLegend en diferentes FFrameSymbol y FFrameText.
+	 *
+	 * @param layout Referencia al Layout.
+	 * @param lays Layers a a�adir
+	 * @param rectangle Rect�ngulo del FFrameLegend.
+	 * @param h Altura
+	 * @param n n�mero de Capa a�adida.
+	 *
+	 * @return n�mero de Capa a a�adir.
+	 */
+	public int toFFrames(Layout layout, FLayers lays, Rectangle2D rectangle,
+		double h, int n) {
+		//TODO Falta que implementar.
+		//////	Se recorren los layers dibujando el s�mbolo y su nombre sobre el graphics	
+		int d = 4;
+
+		for (int i = 0; i < lays.getLayersCount(); i++) {
+			FLayer layer = (FLayer) lays.getLayer(i);
+
+			if (layer.isVisible()) {
+				if (layer instanceof FLayers) {
+					rectangle.setRect(rectangle.getX(),
+						rectangle.getY() + (h * n), rectangle.getWidth(),
+						rectangle.getHeight());
+					n += toFFrames(layout, lays, rectangle, h, n); //drawTheme(g, re, h, layers, n);
+				} else if (layer instanceof AlphanumericData) {
+					AlphanumericData cO = (AlphanumericData) layer;
+
+					if (((Classifiable) cO).getLegend() instanceof ClassifiedLegendInfo) {
+						ClassifiedLegendInfo cli = (ClassifiedLegendInfo) ((Classifiable) cO).getLegend();
+						double dX = rectangle.getWidth() / 4;
+						double dY = n * h;
+
+						int xl = (int) (rectangle.getX() + dX);
+						int yl = (int) (rectangle.getY() + dY);
+						int sizefont = 0;
+
+						if ((rectangle.getHeight() / m_numLayers) < (rectangle.getWidth() / 8)) {
+							sizefont = (int) (rectangle.getHeight() / m_numLayers);
+						} else {
+							sizefont = (int) (rectangle.getWidth() / 8);
+						}
+						toFFrameText(layout, layer.getName(), rectangle,
+							sizefont, xl, yl, h);
+						n++;
+
+						for (int j = 0; j < cli.getValues().length; j++) {
+							dY = n * h;
+
+							xl = (int) (rectangle.getX() + dX);
+							yl = (int) (rectangle.getY() + dY);
+
+							String s = cli.getDescriptions()[j];
+							toFFrameText(layout, s, rectangle, sizefont, xl,
+								yl, h);
+							FSymbol fs2d = cli.getSymbols()[j];
+
+							try {
+								toFFrameSymbol(layout, rectangle,
+									(int) rectangle.getX(), yl, fs2d, sizefont,
+									((Classifiable) cO).getShapeType(), h);
+							} catch (DriverException e) {
+								e.printStackTrace();
+							}
+
+							n++;
+						}
+					} else {
+						double dX = rectangle.getWidth() / 4;
+						double dY = n * h;
+
+						int xl = (int) (rectangle.getX() + dX);
+						int yl = (int) (rectangle.getY() + dY);
+						int sizefont = 0;
+
+						if ((rectangle.getHeight() / m_numLayers) < (rectangle.getWidth() / 8)) {
+							sizefont = (int) (rectangle.getHeight() / m_numLayers);
+						} else {
+							sizefont = (int) (rectangle.getWidth() / 8);
+						}
+						toFFrameText(layout, layer.getName(), rectangle,
+							sizefont, xl, yl, h);
+						FSymbol fs2d = ((Classifiable) cO).getLegend()
+										.getDefaultSymbol();
+
+						try {
+							toFFrameSymbol(layout, rectangle,
+								(int) rectangle.getX(), yl, fs2d, sizefont,
+								((Classifiable) cO).getShapeType(), h);
+						} catch (DriverException e) {
+							e.printStackTrace();
+						}
+						n++;
+					}
+				}
+			}
+		}
+		return n;
+	}
+
+	/**
+	 * Rellena la fuente a utilizar al dibujar los String sobre el graphics.
+	 *
+	 * @param f Font.
+	 */
+	public void setFont(Font f) {
+		m_f = f;
+	}
+
+	/**
+	 * Devuelve la fuente que esta utilizando.
+	 *
+	 * @return Font.
+	 */
+	public Font getFont() {
+		if (m_f != null) {
+			return new Font(m_f.getFontName(), m_f.getStyle(), 9);
+		}
+
+		return null;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className", this.getClass().getName());
+		xml.putProperty("m_name", m_name);
+		xml.putProperty("x", getBoundBox().x);
+		xml.putProperty("y", getBoundBox().y);
+		xml.putProperty("w", getBoundBox().width);
+		xml.putProperty("h", getBoundBox().height);
+		xml.putProperty("m_Selected", m_Selected);
+		xml.putProperty("type", Layout.RECTANGLELEGEND);
+		xml.putProperty("m_numLayers", m_numLayers);
+		xml.putProperty("m_max", m_max);
+		xml.putProperty("m_quality", m_quality);
+		xml.putProperty("m_viewing", m_viewing);
+		xml.putProperty("fontName", m_f.getFontName());
+		xml.putProperty("fontStyle", m_f.getStyle());
+		xml.putProperty("tag", getTag());
+
+		///xml.addChild(fframeview.getXMLEntity());
+		LayoutControls lc = (LayoutControls) PluginServices.getExtension(LayoutControls.class);
+		Layout layout = lc.getLayout();
+		ArrayList fframes = layout.getFFrames();
+
+		for (int i = 0; i < fframes.size(); i++) {
+			if (fframes.get(i) instanceof FFrameView) {
+				if (fframeview.getView().getName().equals(((FFrameView) fframes
+															   .get(i)).getView()
+															   .getName())) {
+					xml.putProperty("index", i);
+				}
+			}
+		}
+
+		/*ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
+		   ArrayList views = pe.getProject().getViews();
+		   boolean hasIndex = false;
+		   for (int i = 0; i < views.size(); i++) {
+		           if (fframeview.getView() == ((ProjectView) views.get(i))) {
+		                   xml.putProperty("indice", i);
+		                   hasIndex = true;
+		           }
+		   }
+		   if (!hasIndex) {
+		           xml.putProperty("indice", -1);
+		   }
+		 */
+
+		//De este �ndice se debe de obtener el arrayList de layers.
+
+		/* ProjectExtension pe = (ProjectExtension) App.instance.getPc()
+		   .getExtension(ProjectExtension.class);
+		   ArrayList views = pe.getProject().getViews();
+		   boolean hasIndex = false;
+		   for (int i = 0; i < views.size(); i++) {
+		       if (m_fmap == ((ProjectView) views.get(i)).getMapContext()) {
+		           xml.putProperty("indice", i);
+		           hasIndex = true;
+		       }
+		   }
+		   if (!hasIndex) {
+		       xml.putProperty("indice", -1);
+		   }
+		 */
+		return xml;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
+	 * 		com.iver.cit.gvsig.project.Project)
+	 */
+	public void setXMLEntity(XMLEntity xml, Layout l) {
+		if (xml.getIntProperty("m_Selected") != 0) {
+			this.setSelected(true);
+		} else {
+			this.setSelected(false);
+		}
+
+		this.m_numLayers = xml.getIntProperty("m_numLayers");
+		this.m_max = xml.getIntProperty("m_max");
+		this.m_quality = xml.getIntProperty("m_quality");
+		this.m_viewing = xml.getIntProperty("m_viewing");
+		this.m_f = new Font(xml.getStringProperty("fontName"),
+				xml.getIntProperty("fontStyle"), 9);
+
+		//this.setFFrameView((FFrameView) FFrameView.createFFrame(xml.getChild(0),
+		//		p));
+
+		/*        int indice = xml.getIntProperty("indice");
+		   if (indice != -1) {
+		           ProjectView view = (ProjectView) p.getViews().get(indice);
+		
+		           fframeview.setView((ProjectView) view);
+		   }
+		 */
+		ArrayList fframes = l.getFFrames();
+		fframeview = (FFrameView) fframes.get(xml.getIntProperty("index"));
+
+		/*                LayoutControls lc=(LayoutControls)PluginServices.getExtension(LayoutControls.class);
+		   Layout layout=lc.getLayout();
+		   ArrayList fframes=layout.getFFrames();
+		   fframeview=(FFrameView)fframes.get(xml.getIntProperty("index"));
+		 */
+
+		//this.setFFrameView((FFrameView) FFrameView.createFFrame(xml.getChild(0),
+		//		p));
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
+	 */
+	public String getNameFFrame() {
+		return PluginServices.getText(this, "leyenda") + num;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
+	 * 		java.awt.geom.AffineTransform)
+	 */
+	public void print(Graphics2D g, AffineTransform at)
+		throws DriverException {
+		draw(g, at, null, null);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameLegend.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrame.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrame.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrame.java	(revision 1648)
@@ -0,0 +1,639 @@
+/*
+ * Created on 17-may-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.gui.layout.fframes;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+
+import com.iver.cit.gvsig.Abrir;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
+import com.iver.cit.gvsig.gui.layout.Layout;
+import com.iver.cit.gvsig.gui.layout.dialogs.Tag;
+import com.iver.cit.gvsig.project.Project;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import java.net.URL;
+
+import javax.swing.ImageIcon;
+
+
+/**
+ * Clase que implementa la interface IFFrame con los m�todos por defecto de
+ * todos los FFrames  que extenderan de este, dejando uno como m�todo
+ * abstracto para implementar por todos los  FFrames para ser dibujados.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public abstract class FFrame implements IFFrame {
+	private static final int N = 1;
+	private static final int NE = 2;
+	private static final int E = 3;
+	private static final int SE = 4;
+	private static final int S = 5;
+	private static final int SO = 6;
+	private static final int O = 7;
+	private static final int NO = 8;
+	private static final int RECT = 9;
+
+	/** FFrame no selecccionado. */
+	public static final int NOSELECT = 0;
+	protected String m_name = "FFrame";
+	private Rectangle2D.Double m_BoundBox = new Rectangle2D.Double();
+	private Rectangle2D.Double m_BoundingBox = new Rectangle2D.Double();
+	protected int m_Selected = 0;
+	private Rectangle n = new Rectangle();
+	private Rectangle ne = new Rectangle();
+	private Rectangle e = new Rectangle();
+	private Rectangle se = new Rectangle();
+	private Rectangle s = new Rectangle();
+	private Rectangle so = new Rectangle();
+	private Rectangle o = new Rectangle();
+	private Rectangle no = new Rectangle();
+	private String tag = null;
+	protected int num = 0;
+
+	/**
+	 * Dibuja los handlers sobre el boundingBox en el graphics que se pasa como
+	 * par�metro.
+	 *
+	 * @param g Graphics sobre el que dibujar.
+	 */
+	public void drawHandlers(Graphics2D g) {
+		int size = 10;
+		Rectangle2D.Double r = getBoundingBox(null);
+
+		//g.drawRect((int) r.x, (int) r.y, (int) r.width, (int) r.height);
+		g.fillRect((int) r.x - size, (int) r.y - size, size, size);
+		no.setRect((int) r.x - size, (int) r.y - size, size, size);
+		g.fillRect((int) r.getMaxX(), (int) r.y - size, size, size);
+		ne.setRect((int) r.getMaxX(), (int) r.y - size, size, size);
+		g.fillRect((int) r.x - size, (int) r.getMaxY(), size, size);
+		so.setRect((int) r.x - size, (int) r.getMaxY(), size, size);
+		g.fillRect((int) r.getMaxX(), (int) r.getMaxY(), size, size);
+		se.setRect((int) r.getMaxX(), (int) r.getMaxY(), size, size);
+		g.fillRect((int) r.getCenterX() - (size / 2), (int) r.y - size, size,
+			size);
+		n.setRect((int) r.getCenterX() - (size / 2), (int) r.y - size, size,
+			size);
+		g.fillRect((int) r.getCenterX() - (size / 2), (int) r.getMaxY(), size,
+			size);
+		s.setRect((int) r.getCenterX() - (size / 2), (int) r.getMaxY(), size,
+			size);
+		g.fillRect((int) r.x - size, (int) r.getCenterY() - (size / 2), size,
+			size);
+		o.setRect((int) r.x - size, (int) r.getCenterY() - (size / 2), size,
+			size);
+		g.fillRect((int) r.getMaxX(), (int) r.getCenterY() - (size / 2), size,
+			size);
+		e.setRect((int) r.getMaxX(), (int) r.getCenterY() - (size / 2), size,
+			size);
+	}
+
+	/**
+	 * Establece que tipo de selecci�n se realiza sobre el fframe.
+	 *
+	 * @param p punto sobre el que se debe de establecer si se selecciona o no
+	 * 		  el fframe.
+	 */
+	public void setSelected(Point2D.Double p) {
+		m_Selected = getContains(p);
+	}
+
+	/**
+	 * Actualiza el BoundBox del FFrame a partir de su rect�ngulo en pixels y
+	 * la matriz de transformaci�n.
+	 *
+	 * @param r Rect�ngulo.
+	 * @param at Matriz de transformaci�n.
+	 */
+	public void updateRect(Rectangle2D r, AffineTransform at) {
+		Rectangle2D.Double rec = FLayoutUtilities.toSheetRect(r, at);
+		rec.setRect((int) rec.getMinX(), (int) rec.getMinY(),
+			(int) rec.getWidth(), (int) rec.getHeight());
+		setBoundBox(rec);
+	}
+
+	/**
+	 * Devuelve el rect�ngulo a partir del desplazamiento en el eje x y el
+	 * desplazamiento en el eje y.
+	 *
+	 * @param difx desplazamiento sobre el eje x.
+	 * @param dify desplazamiento sobre el eje y.
+	 *
+	 * @return rect�ngulo modificado en funci�n del desplazamiento realizado.
+	 */
+	public Rectangle2D getMovieRect(int difx, int dify) {
+		double x = 0;
+		double y = 0;
+		double w = 0;
+		double h = 0;
+
+		Rectangle2D.Double rectaux = new Rectangle2D.Double(this.getBoundingBox(
+					null).x, this.getBoundingBox(null).y,
+				this.getBoundingBox(null).width,
+				this.getBoundingBox(null).height);
+		Rectangle2D.Double rec = this.getBoundingBox(null);
+		int difn = 0;
+		difn = difx;
+		x = rectaux.x;
+		y = rectaux.y;
+		w = rectaux.width;
+		h = rectaux.height;
+
+		switch (this.getSelected()) {
+			case (RECT):
+				rectaux.setRect((x + difx), (y + dify), w, h);
+
+				break;
+
+			case (N):
+
+				if ((y + dify) > rec.getMaxY()) {
+					y = rec.getMaxY();
+				} else {
+					y = y + dify;
+				}
+
+				rectaux.setRect(x, y, w, Math.abs(h - dify));
+
+				break;
+
+			case (O):
+
+				if ((x + difx) > rec.getMaxX()) {
+					x = rec.getMaxX();
+				} else {
+					x = x + difx;
+				}
+
+				rectaux.setRect(x, y, Math.abs(w - difx), h);
+
+				break;
+
+			case (S):
+
+				if (y > (rec.getMaxY() + dify)) {
+					y = rec.getMaxY() + dify;
+				}
+
+				rectaux.setRect(x, y, w, Math.abs(h + dify));
+
+				break;
+
+			case (E):
+
+				if (x > (rec.getMaxX() + difx)) {
+					x = rec.getMaxX() + difx;
+				}
+
+				rectaux.setRect(x, y, Math.abs(w + difx), h);
+
+				break;
+
+			case (NE):
+
+				if ((y - difn) > rec.getMaxY()) {
+					y = rec.getMaxY();
+					x = rec.getMaxX() + difn;
+				} else {
+					y = y - difn;
+				}
+
+				rectaux.setRect(x, y, Math.abs(w + difn), Math.abs(h + difn));
+
+				break;
+
+			case (NO):
+
+				if ((y + difn) > rec.getMaxY()) {
+					y = rec.getMaxY();
+					x = rec.getMaxX();
+				} else {
+					x = x + difn;
+					y = y + difn;
+				}
+
+				rectaux.setRect(x, y, Math.abs(w - difn), Math.abs(h - difn));
+
+				break;
+
+			case (SE):
+
+				if (y > (rec.getMaxY() + difn)) {
+					y = rec.getMaxY() + difn;
+					x = rec.getMaxX() + difn;
+				}
+
+				rectaux.setRect(x, y, Math.abs(w + difn), Math.abs(h + difn));
+
+				break;
+
+			case (SO):
+
+				if ((x + difn) > rec.getMaxX()) {
+					x = rec.getMaxX();
+					y = rec.getMaxY() - difn;
+				} else {
+					x = x + difn;
+				}
+
+				rectaux.setRect(x, y, Math.abs(w - difn), Math.abs(h - difn));
+
+				break;
+
+			default:
+				rectaux.setRect((x), (y), w, h);
+		}
+
+		return rectaux;
+	}
+
+	/**
+	 * Devuelve un entero que representa el tipo de selecci�n que se ha
+	 * realizado sobre el fframe.
+	 *
+	 * @return tipo de selecci�n que se ha realizado.
+	 */
+	public int getSelected() {
+		return m_Selected;
+	}
+
+	/**
+	 * Devuelve true, si el punto que se pasa como par�metro esta contenido
+	 * dentro del boundingbox del fframe.
+	 *
+	 * @param p punto a comprobar.
+	 *
+	 * @return true si el punto esta dentro del boundingbox.
+	 */
+	public boolean contains(Point2D.Double p) {
+		return getBoundingBox(null).contains(p.x, p.y);
+	}
+
+	/**
+	 * Devuelve un entero que representa donde esta contenido el punto que se
+	 * pasa como par�metro.
+	 *
+	 * @param p punto a comparar.
+	 *
+	 * @return entero que representa como esta contenido el punto.
+	 */
+	public int getContains(Point2D.Double p) {
+		if (n.contains(p.x, p.y)) {
+			return N;
+		} else if (ne.contains(p.x, p.y)) {
+			return NE;
+		} else if (e.contains(p.x, p.y)) {
+			return E;
+		} else if (e.contains(p.x, p.y)) {
+			return E;
+		} else if (se.contains(p.x, p.y)) {
+			return SE;
+		} else if (s.contains(p.x, p.y)) {
+			return S;
+		} else if (so.contains(p.x, p.y)) {
+			return SO;
+		} else if (o.contains(p.x, p.y)) {
+			return O;
+		} else if (no.contains(p.x, p.y)) {
+			return NO;
+		} else if (getBoundingBox(null).contains(p.x, p.y)) {
+			return RECT;
+		}
+
+		return 0;
+	}
+
+	/**
+	 * Devuelve el Cursor adecuado seg�n como est� contenido el punto, si es
+	 * para desplazamiento, o cambio de tama�o.
+	 *
+	 * @param p punto a comprobar.
+	 *
+	 * @return Cursor adecuado a la posici�n.
+	 */
+	public Cursor getMapCursor(Point2D.Double p) {
+		int select = getContains(p);
+
+		switch (select) {
+			case (N):
+				return Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR);
+
+			case (NE):
+				return Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR);
+
+			case (E):
+				return Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
+
+			case (SE):
+				return Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR);
+
+			case (S):
+				return Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
+
+			case (SO):
+				return Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR);
+
+			case (O):
+				return Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR);
+
+			case (NO):
+				return Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR);
+
+			case (RECT):
+				return Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR);
+		}
+
+		return null;
+	}
+
+	/**
+	 * Este m�todo se implementa en cada una de las fframe, ya que cada una se
+	 * dibuja de una forma diferente sobre el graphics. M�todo que dibuja
+	 * sobre el graphics que se le pasa como par�metro, seg�n la transformada
+	 * afin que se debe de aplicar y el rect�ngulo que se debe de dibujar.
+	 * M�todo que dibuja sobre el graphics que se le pasa como par�metro,
+	 * seg�n la transformada afin que se debe de aplicar y el rect�ngulo que
+	 * se debe de dibujar.
+	 *
+	 * @param g Graphics
+	 * @param at Transformada afin.
+	 * @param r rect�ngulo sobre el que hacer un clip.
+	 * @param imgBase DOCUMENT ME!
+	 *
+	 * @throws DriverException
+	 */
+	public abstract void draw(Graphics2D g, AffineTransform at, Rectangle2D r,
+		BufferedImage imgBase) throws DriverException;
+
+	/**
+	 * Devuelve el nombre que representa al fframe.
+	 *
+	 * @return String
+	 */
+	public String getName() {
+		return m_name;
+	}
+
+	/**
+	 * Rellena el String que representa al nombre del fframe.
+	 *
+	 * @param n nombre del fframe.
+	 */
+	public void setName(String n) {
+		m_name = n;
+	}
+
+	/**
+	 * Devuelve el boundingBox del fframe en funci�n de la transformada af�n
+	 * que se pasa como par�metro. Si se pasa como par�metro null, devuelve el
+	 * �ltimo boundingbox que se calcul�.
+	 *
+	 * @param at Transformada af�n
+	 *
+	 * @return Rect�ngulo que representa el BoundingBox del fframe.
+	 */
+	public Rectangle2D.Double getBoundingBox(AffineTransform at) {
+		if (at == null) {
+			return m_BoundingBox;
+		}
+
+		m_BoundingBox = FLayoutUtilities.fromSheetRect(m_BoundBox, at);
+
+		return m_BoundingBox;
+	}
+
+	/**
+	 * Rellena con el rect�ngulo que se pasa como par�metro el boundBox(en
+	 * cent�metros) del fframe del cual con una transformaci�n se podr�
+	 * calcular el BoundingBox (en pixels).
+	 *
+	 * @param r Rect�ngulo en cent�metros.
+	 */
+	public void setBoundBox(Rectangle2D.Double r) {
+		m_BoundBox.setRect(r.getX(), r.getY(), r.getWidth(), r.getHeight());
+	}
+
+	/**
+	 * Devuelve el rect�ngulo que representa el fframe en cent�metros.
+	 *
+	 * @return Rect�ngulo en centimetros.
+	 */
+	public Rectangle2D.Double getBoundBox() {
+		return m_BoundBox;
+	}
+
+	/**
+	 * Pasando como par�metro true,  se toma como que esta seleccionado el
+	 * fframe  y si es false como que esta sin seleccionar,  de esta forma se
+	 * selecciona un fframe directamente  sin comprobar si un punto esta
+	 * contenido en �l.
+	 *
+	 * @param b true si se quiere seleccionar y false si se quiere
+	 * 		  deseleccionar.
+	 */
+	public void setSelected(boolean b) {
+		if (b) {
+			m_Selected = RECT;
+		} else {
+			m_Selected = NOSELECT;
+		}
+	}
+
+	/**
+	 * Crea un Objeto FFrame seg�n el tipo que sea, a partir de la informaci�n
+	 * del XMLEntity.
+	 *
+	 * @param xml XMLEntity
+	 * @param l Layout.
+	 * @param p Proyecto.
+	 *
+	 * @return Objeto de esta clase.
+	 */
+	public static IFFrame createFFrame(XMLEntity xml, Layout l, Project p) {
+		IFFrame fframe = null;
+
+		try {
+			Class clase = Class.forName(xml.getStringProperty("className"));
+			fframe = (IFFrame) clase.newInstance();
+		} catch (Exception e) {
+			NotificationManager.addError("Clase de Frame sobre el Layout no reconocida",
+				e);
+		}
+
+		if (fframe instanceof FFrameView) {
+			((FFrameView) fframe).setProject(p);
+		}
+
+		fframe.setXMLEntity(xml, l);
+		fframe.setName(xml.getStringProperty("m_name"));
+		fframe.setBoundBox(new Rectangle2D.Double(xml.getDoubleProperty("x"),
+				xml.getDoubleProperty("y"), xml.getDoubleProperty("w"),
+				xml.getDoubleProperty("h")));
+		fframe.setTag(xml.getStringProperty("tag"));
+
+		return fframe;
+	}
+
+	/**
+	 * Dibuja sobre el graphics el rect�ngulo del fframe en modo borrador.
+	 *
+	 * @param g Graphics so bre el que dibujar.
+	 */
+	public void drawDraft(Graphics2D g) {
+		Rectangle2D.Double r = getBoundingBox(null);
+		g.setColor(Color.lightGray);
+		g.fillRect((int) r.x, (int) r.y, (int) r.width, (int) r.height);
+		g.setColor(Color.black);
+
+		int scale = (int) (r.width / 12);
+		Font f = new Font("SansSerif", Font.PLAIN, scale);
+		g.setFont(f);
+		g.drawString(getName(),
+			(int) (r.getCenterX() - ((getName().length() * scale) / 4)),
+			(int) (r.getCenterY()));
+	}
+
+	/**
+	 * Rellena con el n�mero de FFrame.
+	 *
+	 * @param i n�mero
+	 */
+	public void setNum(int i) {
+		num = i;
+	}
+
+	/**
+	 * Dibuja sobre el graphics el rect�ngulo del fframe pero vacio, mostrando
+	 * el nombre del fframe y vacio.
+	 *
+	 * @param g Graphics sobre el que dibujar.
+	 */
+	public void drawEmpty(Graphics2D g) {
+		Rectangle2D.Double r = getBoundingBox(null);
+		g.setColor(Color.lightGray);
+		g.fillRect((int) r.x, (int) r.y, (int) r.width, (int) r.height);
+		g.setColor(Color.black);
+
+		int scale = (int) (r.width / 12);
+		Font f = new Font("SansSerif", Font.PLAIN, scale);
+		g.setFont(f);
+
+		String s = this.getNameFFrame() + " " +
+			PluginServices.getText(this, "vacia");
+
+		g.drawString(s, (int) (r.getCenterX() - ((s.length() * scale) / 4)),
+			(int) (r.getCenterY()));
+	}
+
+	/**
+	 * Devuelve true si el rect�ngulo primero es null o si es distinto de null
+	 * e intersecta.
+	 *
+	 * @param rv Rect�ngulo
+	 * @param r Rect�ngulo
+	 *
+	 * @return True si intersecta o es null.
+	 */
+	public boolean intersects(Rectangle2D rv, Rectangle2D r) {
+		return (((rv != null) && rv.intersects(r)) || (rv == null));
+	}
+
+	/**
+	 * Abre el di�logo para cambiar o a�adir el tag.
+	 */
+	public void openTag() {
+		Tag tag = new Tag(this);
+		PluginServices.getMDIManager().addView(tag);
+	}
+
+	/**
+	 * Rellena el tag del FFrame.
+	 *
+	 * @param s String que representa el valor a guardar en el tag.
+	 */
+	public void setTag(String s) {
+		tag = s;
+	}
+
+	/**
+	 * Devuelve el tag.
+	 *
+	 * @return tag.
+	 */
+	public String getTag() {
+		return tag;
+	}
+
+	/**
+	 * Dibuja sobre el graphics que se pasa como par�metro el icono que
+	 * representa que contiene un tag.
+	 *
+	 * @param g Graphics sobre el que dibujar el icono.
+	 */
+	public void drawSymbolTag(Graphics2D g) {
+		Rectangle2D.Double rec = getBoundingBox(null);
+
+		try {
+			URL url = Abrir.class.getClassLoader().getResource("images/symbolTag.gif");
+			Image image = new ImageIcon(url).getImage();
+			g.drawImage(image, (int) rec.x, (int) rec.y, 25, 30, null);
+		} catch (NullPointerException npe) {
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrame.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutGraphics.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutGraphics.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutGraphics.java	(revision 1648)
@@ -0,0 +1,324 @@
+/*
+ * Created on 27-jul-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.gui.layout;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.cit.gvsig.gui.layout.dialogs.FAlignDialog;
+import com.iver.cit.gvsig.gui.layout.dialogs.FBorderDialog;
+import com.iver.cit.gvsig.gui.layout.dialogs.FPositionDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGroup;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend;
+import com.iver.cit.gvsig.gui.layout.fframes.FFramePicture;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameText;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import java.awt.geom.Rectangle2D;
+
+import java.util.ArrayList;
+
+
+/**
+ * Operaciones realizadas sobre el conjunto de FFrames.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FLayoutGraphics {
+	private Layout layout;
+	private FAlignDialog m_alignLayout = null;
+	private FBorderDialog borderdialog = null;
+	private FPositionDialog positiondialog = null;
+
+	/**
+	 * Crea un nuevo FLayoutGraphics.
+	 *
+	 * @param l Referencia al Layout.
+	 */
+	public FLayoutGraphics(Layout l) {
+		layout = l;
+	}
+
+	/**
+	 * Transforma un FFrameLegend a FFrames de tipo FFrameSymbol y FFrameText.
+	 */
+	public void simplify() {
+		for (int i = layout.getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+
+			if (fframe instanceof FFrameLegend) {
+				if (fframe.getSelected() != FFrame.NOSELECT) {
+					((FFrameLegend) fframe).toFFrames(layout);
+				}
+			}
+		}
+
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Agrupar en un FFrameGroup todos los FFrames seleccionados.
+	 */
+	public void grouping() {
+		//Rectangle2D rex = new Rectangle2D.Double();
+		//		Se debe controlar de alguna forma si hay varios seleccionados.
+		IFFrame fframegroup = new FFrameGroup();
+
+		if (layout.getFFrames().size() > 1) {
+			ArrayList selecList = new ArrayList();
+
+			for (int i = layout.getFFrames().size() - 1; i >= 0; i--) {
+				IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+
+				if (fframe.getSelected() != FFrame.NOSELECT) {
+					selecList.add(fframe);
+
+					layout.getFFrames().remove(fframe);
+				}
+			}
+
+			for (int i = selecList.size() - 1; i >= 0; i--) {
+				((FFrameGroup) fframegroup).addFFrame((IFFrame) selecList.get(i));
+			}
+
+			((FFrameGroup) fframegroup).setAt(layout.getAT());
+
+			Rectangle2D.Double rd = ((FFrameGroup) fframegroup).getRectangle(layout.getAT());
+
+			//Rectangle re=new Rectangle((int)rd.getMinX(),(int)rd.getMinY(),(int)rd.getWidth(),(int)rd.getHeight());
+			Rectangle2D.Double rd1 = FLayoutUtilities.toSheetRect(rd,
+					layout.getAT());
+
+			fframegroup.setBoundBox(rd1);
+			fframegroup.setSelected(true);
+			layout.addFFrame(fframegroup, true);
+			layout.setStatus(Layout.DESACTUALIZADO);
+			layout.repaint();
+		}
+	}
+
+	/**
+	 * Desagrupar los FFrames que estan contenidos dentro del FFrameGroup en
+	 * FFrames individuales.
+	 */
+	public void ungrouping() {
+		for (int i = layout.getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != FFrame.NOSELECT) {
+				if (fframe instanceof FFrameGroup) {
+					FFrameGroup fframegroup = (FFrameGroup) fframe;
+					ArrayList selecList = new ArrayList();
+
+					for (int j = fframegroup.getFFrames().size() - 1; j >= 0;
+							j--) {
+						selecList.add(fframegroup.getFFrames().get(j));
+
+						fframegroup.getFFrames().remove(j);
+					}
+
+					for (int j = selecList.size() - 1; j >= 0; j--) {
+						layout.addFFrame((IFFrame) selecList.get(j), false);
+					}
+
+					if (fframegroup.getFFrames().isEmpty()) {
+						layout.getFFrames().remove(fframegroup);
+					}
+				}
+			}
+		}
+
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Abre el di�logo para alinear los FFrames.
+	 */
+	public void aligning() {
+		m_alignLayout = new FAlignDialog(layout);
+		PluginServices.getMDIManager().addView(m_alignLayout);
+	}
+
+	/**
+	 * Posiciona los FFrames seleccionados delante de los no seleccionados.
+	 */
+	public void before() {
+		ArrayList auxList = new ArrayList();
+		int num = 0;
+
+		for (int i = layout.getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != FFrame.NOSELECT) {
+				auxList.add(fframe);
+				layout.getFFrames().remove(fframe);
+				num++;
+			}
+		}
+
+		for (int i = num - 1; i >= 0; i--) {
+			layout.getFFrames().add((IFFrame) auxList.get(i));
+		}
+
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Posiciona los FFrames seleccionados detr�s de los FFrames no
+	 * seleccionados.
+	 */
+	public void behind() {
+		ArrayList auxList = new ArrayList();
+		int num = 0;
+
+		for (int i = layout.getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+
+			if (fframe.getSelected() != FFrame.NOSELECT) {
+				auxList.add(fframe);
+				layout.getFFrames().remove(fframe);
+				num++;
+			}
+		}
+
+		for (int i = 0; i < num; i++) {
+			layout.getFFrames().add(0, (IFFrame) auxList.get(i));
+		}
+
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Abre el di�logo adecuadao a las propiedades del FFrame seleccionado,
+	 * ahora mismo solo se abre cuando hay un solo FFrame seleccionado.
+	 */
+	public void openFFrameDialog() {
+		ArrayList selecList = new ArrayList();
+
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			//Abrir el di�logo de cada uno de los fframe seleccionados o 
+			//uno que sea general como en arcView.
+			if (((IFFrame) layout.getFFrames().get(i)).getSelected() != FFrame.NOSELECT) {
+				selecList.add(layout.getFFrames().get(i));
+			}
+		}
+
+		if (selecList.size() == 1) {
+			int toolaux = layout.getTool();
+			layout.setTool(getType((IFFrame) selecList.get(0)));
+			layout.openFFrameDialog(((IFFrame) selecList.get(0)));
+			layout.setTool(toolaux);
+		}
+	}
+
+	/**
+	 * Devuelve un entero que representa el tipo de FFrame  que se le pasa como
+	 * par�metro.
+	 *
+	 * @param fframe FFrame que se pasa como par�metro, para saber de que tipo
+	 * 		  es.
+	 *
+	 * @return entero.
+	 */
+	private int getType(IFFrame fframe) {
+		if (fframe instanceof FFrameView) {
+			return Layout.RECTANGLEVIEW;
+		} else if (fframe instanceof FFrameText) {
+			return Layout.RECTANGLETEXT;
+		} else if (fframe instanceof FFrameScaleBar) {
+			return Layout.RECTANGLESCALEBAR;
+		} else if (fframe instanceof FFramePicture) {
+			return Layout.RECTANGLEPICTURE;
+		} else if (fframe instanceof FFrameLegend) {
+			return Layout.RECTANGLELEGEND;
+		} else if (fframe instanceof FFrameGraphics) {
+			return Layout.GRAPHICS;
+		}
+
+		return Layout.SELECT;
+	}
+
+	/**
+	 * Selecci�n de todos los FFrames del Layout.
+	 */
+	public void selecAll() {
+		for (int i = layout.getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) layout.getFFrames().get(i);
+			fframe.setSelected(true);
+		}
+
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Abre el di�logo para a�adir un borde a los fframes.
+	 */
+	public void border() {
+		borderdialog = new FBorderDialog(layout);
+		PluginServices.getMDIManager().addView(borderdialog);
+	}
+
+	/**
+	 * Abre el di�logo de cambio de posici�n y tama�o del FFrame.
+	 */
+	public void position() {
+		
+		IFFrame[] fframes=layout.getFFrameSelected();
+		if (fframes.length!=0){
+			for (int i=0;i<fframes.length;i++){
+				positiondialog = new FPositionDialog(layout,fframes[i]);
+				PluginServices.getMDIManager().addView(positiondialog);
+			}
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutGraphics.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Attributes.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Attributes.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Attributes.java	(revision 1648)
@@ -0,0 +1,1086 @@
+/*
+ * Created on 25-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.gui.layout;
+
+import com.iver.andami.PluginServices;
+
+import com.iver.utiles.XMLEntity;
+
+import java.awt.Rectangle;
+import java.awt.geom.Rectangle2D;
+import java.awt.print.PageFormat;
+import java.awt.print.Paper;
+
+import java.text.NumberFormat;
+
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.standard.Copies;
+import javax.print.attribute.standard.Fidelity;
+import javax.print.attribute.standard.Media;
+import javax.print.attribute.standard.MediaPrintableArea;
+import javax.print.attribute.standard.MediaSizeName;
+import javax.print.attribute.standard.OrientationRequested;
+import javax.print.attribute.standard.PrintQuality;
+import javax.print.attribute.standard.Sides;
+
+
+/**
+ * Atributos del Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Attributes {
+	/** KILOMETROS,METROS,CENTIMETROS,MILIMETROS,MILLAS,YARDAS,PIES,PULGADAS */
+	public static final double[] CHANGE = {
+			100000, 100, 1, 0.1, 160934.4, 91.44, 30.48, 2.54
+		};
+	public static String[] NAMES;
+	public static final double[] UNIT = {
+			0.0000025, 0.0025, 0.25, 2.5, 0.0000025, 0.025, 0.025, 0.25
+		};
+	public static final int RALTO = 0;
+	public static final int RNORMAL = 1;
+	public static final int RBAJO = 2;
+
+	//	Para impresi�n
+	public final static double PULGADA = 2.54;
+
+	//public final static Size CUSTOM_PAPER_SIZE = new Size(8.5, 11.0);
+	public final static Size STANDARD_LETTER_PAPER_SIZE = new Size(8.5, 11.0);
+	public final static Size STANDARD_FOLIO_PAPER_SIZE = new Size(8.5, 13.0);
+	public final static Size STANDARD_LEGAL_PAPER_SIZE = new Size(8.5, 14.0);
+	public final static Size STANDARD_TABLOID_PAPER_SIZE = new Size(11.0, 17.0);
+	public final static Size METRIC_A0_PAPER_SIZE = new Size(118.9, 84.1);
+	public final static Size METRIC_A1_PAPER_SIZE = new Size(84.1, 59.4);
+	public final static Size METRIC_A2_PAPER_SIZE = new Size(59.4, 42.0);
+	public final static Size METRIC_A3_PAPER_SIZE = new Size(42.0, 29.7);
+	public final static Size METRIC_A4_PAPER_SIZE = new Size(29.7, 21.0);
+	public final static Size METRIC_A5_PAPER_SIZE = new Size(21.0, 14.8);
+	public final static Size ANSI_ENG_A_PAPER_SIZE = new Size(11.0, 8.5);
+	public final static Size ANSI_ENG_B_PAPER_SIZE = new Size(17.0, 11.0);
+	public final static Size ANSI_ENG_C_PAPER_SIZE = new Size(22.0, 17.0);
+	public final static Size ANSI_ENG_D_PAPER_SIZE = new Size(34.0, 22.0);
+	public final static Size ANSI_ENG_E_PAPER_SIZE = new Size(44.0, 34.0);
+	public final static Size ANSI_ARCH_A_PAPER_SIZE = new Size(12.0, 9.0);
+	public final static Size ANSI_ARCH_B_PAPER_SIZE = new Size(18.0, 12.0);
+	public final static Size ANSI_ARCH_C_PAPER_SIZE = new Size(24.0, 18.0);
+	public final static Size ANSI_ARCH_D_PAPER_SIZE = new Size(36.0, 24.0);
+	public final static Size ANSI_ARCH_E_PAPER_SIZE = new Size(42.0, 30.0);
+	public static Size CUSTOM_PAPER_SIZE = new Size(100.0, 100.0);
+	public final static int PRINT = 0;
+	public final static int CUSTOM = 6;
+	public final static int A0 = 5;
+	public final static int A1 = 4;
+	public final static int A2 = 3;
+	public final static int A3 = 2;
+	public final static int A4 = 1;
+	public static int DPI = 300;
+	public static int DPISCREEN = 72;
+	public static Rectangle clipRect = new Rectangle();
+
+	static {
+		new Attributes();
+	}
+
+	private PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
+	private MediaSizeName m_type = MediaSizeName.ISO_A4;
+	private boolean m_isLandSel;
+	private boolean m_LastLandSel = true;
+	private OrientationRequested m_Orientation;
+	private double m_TypeUnit = CHANGE[2]; //CENTIMETROS;
+	private String m_NameUnit;
+	private double m_numX = 0.25;
+	private double m_numY = 0.25;
+	private double m_unitX = 0;
+	private double m_unitY = 0;
+	private boolean hasmargin;
+	private int m_resolutionSel = RNORMAL;
+	private PrintQuality m_resolution;
+	private int m_typeSel = 0;
+	private int m_selTypeUnit = 2;
+	public Size m_sizePaper = new Size(METRIC_A4_PAPER_SIZE.getAlto(),
+			METRIC_A4_PAPER_SIZE.getAncho());
+	public double[] m_area = { PULGADA, PULGADA, PULGADA, PULGADA };
+	private double anchoXalto = m_sizePaper.getAlto() / m_sizePaper.getAncho();
+	private Size m_sizeinUnits = m_sizePaper;
+
+	/**
+	 * Creates a new Attributes object.
+	 */
+	public Attributes() {
+		if (NAMES == null) {
+			int i = 0;
+			NAMES = new String[8];
+			NAMES[i++] = PluginServices.getText(this, "Kilometros");
+			NAMES[i++] = PluginServices.getText(this, "Metros");
+			NAMES[i++] = PluginServices.getText(this, "Centimetros");
+			NAMES[i++] = PluginServices.getText(this, "Milimetros");
+			NAMES[i++] = PluginServices.getText(this, "Millas");
+			NAMES[i++] = PluginServices.getText(this, "Yardas");
+			NAMES[i++] = PluginServices.getText(this, "Pies");
+			NAMES[i++] = PluginServices.getText(this, "Pulgadas");
+		}
+
+		m_NameUnit = NAMES[2];
+		m_type = MediaSizeName.ISO_A4;
+		m_isLandSel = true;
+		setSizeinUnits(m_isLandSel);
+
+		hasmargin = false;
+		m_Orientation = OrientationRequested.LANDSCAPE;
+		attributes.add(new Copies(1));
+		attributes.add(MediaSizeName.ISO_A4);
+		attributes.add(Sides.ONE_SIDED);
+		attributes.add(Fidelity.FIDELITY_FALSE);
+		attributes.add(PrintQuality.NORMAL);
+
+		setType(m_typeSel);
+
+		attributes.add(new MediaPrintableArea((float) 0, (float) 0,
+				(float) ((m_sizePaper.getAlto() * DPISCREEN) / PULGADA),
+				(float) ((m_sizePaper.getAncho() * DPISCREEN) / PULGADA),
+				MediaPrintableArea.MM));
+	}
+
+	/**
+	 * Seleccionar el tipo de unidad que representa el Layout.
+	 *
+	 * @param s entero.
+	 */
+	public void setUnits(int s) {
+		m_TypeUnit = CHANGE[s];
+		m_NameUnit = NAMES[s];
+	}
+
+	/**
+	 * Rellena las propiedades del Layout.
+	 *
+	 * @param typeSel tipo de folio.
+	 * @param units unidad de medida.
+	 * @param isLand si es horizontal o vertical.
+	 * @param margin si se deben de coger los margenes que marca la impresora o
+	 * 		  no.
+	 * @param resolution tipo de resoluci�n a aplicar.
+	 * @param area area imprimible.
+	 */
+	public void setSelectedOptions(int typeSel, int units, boolean isLand,
+		boolean margin, int resolution, double[] area) {
+		setType(typeSel);
+		setUnit(units);
+		setIsLandScape(isLand);
+		hasmargin = margin;
+		setResolution(resolution);
+		m_area = area;
+	}
+
+	/**
+	 * Devuelve un PageFormat con las propiedades seleccionadas.
+	 *
+	 * @return PageFormat
+	 */
+	public PageFormat getPageFormat() {
+		PageFormat pf1 = new PageFormat();
+		Paper paper = pf1.getPaper();
+
+		if (isLandSpace()) {
+			pf1.setOrientation(0);
+			paper.setSize((m_sizePaper.getAncho() * DPISCREEN) / PULGADA,
+				(m_sizePaper.getAlto() * DPISCREEN) / PULGADA);
+
+			double aux = m_area[0];
+			m_area[0] = m_area[3];
+			m_area[3] = m_area[1];
+			m_area[1] = m_area[2];
+			m_area[2] = aux;
+			paper.setImageableArea(getInPixels(m_area[2]),
+				getInPixels(m_area[0]),
+				getInPixels(m_sizeinUnits.getAncho() - m_area[2] - m_area[3]),
+				getInPixels(m_sizeinUnits.getAlto() - m_area[0] - m_area[1]));
+		} else {
+			pf1.setOrientation(1);
+			paper.setSize((m_sizePaper.getAlto() * DPISCREEN) / PULGADA,
+				(m_sizePaper.getAncho() * DPISCREEN) / PULGADA);
+			paper.setImageableArea(getInPixels(m_area[2]),
+				getInPixels(m_area[0]),
+				getInPixels(m_sizeinUnits.getAlto() - m_area[2] - m_area[3]),
+				getInPixels(m_sizeinUnits.getAncho() - m_area[0] - m_area[1]));
+		}
+
+		pf1.setPaper(paper);
+
+		return pf1;
+	}
+
+	/**
+	 * Devuelve en Pixels los cent�metros que se le pasan como par�metro.
+	 *
+	 * @param d cent�metros.
+	 *
+	 * @return Pixels.
+	 */
+	private double getInPixels(double d) {
+		return d * (DPISCREEN / PULGADA);
+	}
+
+	/**
+	 * Devuelve en cent�metros los pixels que se le pasan como par�metro.
+	 *
+	 * @param d Pixel.
+	 *
+	 * @return Cent�metros.
+	 */
+	private double getInCM(double d) {
+		return d / (DPISCREEN / PULGADA);
+	}
+
+	/**
+	 * Devuelve un ret�ngulo que representa el �rea imprimible.
+	 *
+	 * @return Rect�ngulo.
+	 */
+	public Rectangle2D.Double getArea() {
+		Rectangle2D.Double rect = new Rectangle2D.Double();
+		rect.setRect(m_area[0], m_area[1],
+			m_sizePaper.getAncho() - m_area[0] - m_area[2],
+			m_sizePaper.getAlto() - m_area[1] - m_area[3]);
+
+		return rect;
+	}
+
+	/**
+	 * Se rellenan los atributos a partir de un PageFormat que se introduce
+	 * como parametro.
+	 *
+	 * @param pf PageFormat
+	 */
+	public void setPageFormat(PageFormat pf) {
+		Size size = null;
+
+		if (pf.getOrientation() == 0) {
+			setIsLandScape(true);
+			m_Orientation = OrientationRequested.LANDSCAPE;
+			size = new Size(pf.getHeight(), pf.getWidth());
+		} else {
+			setIsLandScape(false);
+			m_Orientation = OrientationRequested.PORTRAIT;
+			size = new Size(pf.getHeight(), pf.getWidth());
+		}
+
+		attributes.add(m_Orientation);
+
+		//area
+		m_area[0] = getInCM(pf.getImageableY());
+		m_area[2] = getInCM(pf.getImageableX());
+		m_area[1] = m_sizePaper.getAlto() - getInCM(pf.getImageableHeight()) -
+			m_area[0];
+		m_area[3] = m_sizePaper.getAncho() - getInCM(pf.getImageableWidth()) -
+			m_area[2];
+
+		//	tipo formato
+		if (isLandSpace()) {
+			//double aux = m_area[0];
+			//m_area[0] = m_area[3];
+			//m_area[3] = m_area[1];
+			//m_area[1] = m_area[2];
+			//m_area[2] = aux;
+			attributes.add(new MediaPrintableArea((float) (m_area[2] * 10),
+					(float) (m_area[0] * 10),
+					(float) (m_sizeinUnits.getAlto() - m_area[0] - m_area[1]) * 10,
+					(float) (m_sizeinUnits.getAncho() - m_area[2] - m_area[3]) * 10,
+					MediaPrintableArea.MM));
+		} else {
+			attributes.add(new MediaPrintableArea((float) (m_area[0] * 10),
+					(float) (m_area[1] * 10),
+					(float) (getInCM(pf.getImageableWidth()) * 10),
+					(float) (getInCM(pf.getImageableHeight()) * 10),
+					MediaPrintableArea.MM));
+		}
+
+		setType(getTypePaper(size));
+	}
+
+	/**
+	 * Preparamos un PrintRequestAttributeSet con nuestras opciones para
+	 * pasarselo como parametro al PrintDialog.
+	 *
+	 * @return
+	 */
+	public PrintRequestAttributeSet toPrintAttributes() {
+		HashPrintRequestAttributeSet resul = new HashPrintRequestAttributeSet();
+
+		setType(m_typeSel);
+
+		resul.add(m_type);
+
+		//units, no hace falta a�adirlo a attributes
+		resul.add(m_Orientation);
+		setArea(m_area);
+		resul.add(new MediaPrintableArea((float) 0, (float) 0,
+				(float) ((m_sizePaper.getAlto() * DPISCREEN) / PULGADA),
+				(float) ((m_sizePaper.getAncho() * DPISCREEN) / PULGADA),
+				MediaPrintableArea.MM));
+
+		//resul.add(MediaSize.Other.PERSONAL_ENVELOPE);
+		//attributes.add(m_resolution);
+		return resul;
+	}
+
+	/**
+	 * rellenar el �rea imprimible.
+	 *
+	 * @param area �rea imprimible.
+	 */
+	private void setArea(double[] area) {
+		if (!isLandSpace()) {
+			attributes.add(new MediaPrintableArea((float) (area[2] * 10),
+					(float) (area[0] * 10),
+					(float) ((m_sizePaper.getAncho() - area[2] - area[3]) * 10),
+					(float) ((m_sizePaper.getAlto() - area[0] - area[1]) * 10),
+					MediaPrintableArea.MM));
+
+			clipRect.setRect((area[2] / PULGADA * DPI),
+				area[0] / PULGADA * DPI,
+				(m_sizePaper.getAncho() - area[2] - area[3]) / PULGADA * DPI,
+				(m_sizePaper.getAlto() - area[0] - area[1]) / PULGADA * DPI);
+		} else {
+			attributes.add(new MediaPrintableArea((float) (area[0] * 10),
+					(float) (area[3] * 10),
+					(float) ((m_sizePaper.getAlto() - area[0] - area[1]) * 10),
+					(float) ((m_sizePaper.getAncho() - area[3] - area[2]) * 10),
+					MediaPrintableArea.MM));
+
+			clipRect.setRect((area[1] / PULGADA * DPI),
+				area[2] / PULGADA * DPI,
+				(m_sizePaper.getAncho() - area[1] - area[0]) / PULGADA * DPI,
+				(m_sizePaper.getAlto() - area[2] - area[3]) / PULGADA * DPI);
+		}
+	}
+
+	/**
+	 * Devuelve true si est� seleccionada la opci�n de utilizar los margenes de
+	 * impresi�n.
+	 *
+	 * @return true si est� seleccionada la opci�n de utilizar margenes.
+	 */
+	public boolean isMargin() {
+		return hasmargin;
+	}
+
+	/**
+	 * Devuelve la resoluci�n para imprimir.
+	 *
+	 * @return Resoluci�n seleccionada.
+	 */
+	public int getResolution() {
+		return m_resolutionSel;
+	}
+
+	/**
+	 * Selecciona la resoluci�n a aplicar.
+	 *
+	 * @param i tipo de resoluci�n.
+	 */
+	private void setResolution(int i) {
+		m_resolutionSel = i;
+
+		switch (i) {
+			case (RALTO):
+
+				//m_resolution=PrintQuality.HIGH;
+				DPI = 600;
+
+				break;
+
+			case (RNORMAL):
+
+				//m_resolution=PrintQuality.NORMAL;
+				DPI = 300;
+
+				break;
+
+			case (RBAJO):
+
+				//m_resolution=PrintQuality.DRAFT;
+				DPI = 72;
+
+				break;
+		}
+	}
+
+	/**
+	 * Devuelve los Attributes que se pasan como parametro al PrintDialog.
+	 *
+	 * @return Attributes de impresi�n.
+	 */
+	public PrintRequestAttributeSet getAttributes() {
+		return attributes;
+	}
+
+	/**
+	 * Devuelve true si la posici�n elegida para el folio es horizontal y false
+	 * si es vertical.
+	 *
+	 * @return true si la posici�n elegida es horizontal.
+	 */
+	public boolean isLandSpace() {
+		return m_isLandSel;
+	}
+
+	/**
+	 * Devuelve el formato de folio seleccionado.
+	 *
+	 * @return entero que representa el tipo de folio seleccionado.
+	 */
+	public int getType() {
+		return m_typeSel;
+	}
+
+	/**
+	 * Devuelve el n�mero de pixels que representa a la unidad que est�
+	 * seleccionada.
+	 *
+	 * @return n�mero de pixels que representa la unidad seleccionada.
+	 */
+	public double getUnitInPixelsY() {
+		return m_unitY;
+	}
+
+	/**
+	 * Devuelve el n�mero de pixels que representa a la unidad que est�
+	 * seleccionada.
+	 *
+	 * @return n�mero de pixels que representa la unidad seleccionada.
+	 */
+	public double getUnitInPixelsX() {
+		return m_unitX;
+	}
+
+	/**
+	 * Establece el n�mero de unidades para el grid.
+	 *
+	 * @param d n�mero que representa la distancia entre los puntos del grid
+	 * 		  del Layout.
+	 */
+	public void setNumUnitsX(double d) {
+		m_numX = d;
+	}
+
+	/**
+	 * Devuelve el n�mero de unidades del espacio de cuadr�cula horizontal en
+	 * la medida que est� seleccionada,  por defecto en cent�metros.
+	 *
+	 * @return double
+	 */
+	public double getNumUnitsX() {
+		return m_numX;
+	}
+
+	/**
+	 * Devuelve el n�mero de unidades del espacio de cuadr�cula vertical en la
+	 * medida que est� seleccionada,  por defecto en cent�metros.
+	 *
+	 * @return double
+	 */
+	public double getNumUnitsY() {
+		return m_numY;
+	}
+
+	/**
+	 * Establece el n�mero de unidades para el grid.
+	 *
+	 * @param d n�mero que representa la distancia entre los puntos del grid
+	 * 		  del Layout.
+	 */
+	public void setNumUnitsY(double d) {
+		m_numY = d;
+	}
+
+	/**
+	 * Rellena la forma de visualizaci�n del folio, tru si es horizontal y
+	 * false si es vertical.
+	 *
+	 * @param b true si se quiere a horizontal.
+	 */
+	public void setIsLandScape(boolean b) {
+		m_LastLandSel = m_isLandSel;
+		m_isLandSel = b;
+		setType(m_typeSel);
+
+		if (m_isLandSel) {
+			m_Orientation = OrientationRequested.LANDSCAPE;
+		} else {
+			m_Orientation = OrientationRequested.PORTRAIT;
+		}
+	}
+
+	/**
+	 * Selecci�n del tipo de folio a mostrar.
+	 *
+	 * @param t tipo de folio.
+	 */
+	public void setType(int t) {
+		m_typeSel = t;
+
+		//m_sizePaper=getSizePaper(t);
+		switch (t) {
+			case (PRINT):
+				m_type = ((MediaSizeName) attributes.get(Media.class));
+
+				if (isLandSpace()) {
+					m_sizePaper = new Size(METRIC_A4_PAPER_SIZE.getAncho(),
+							METRIC_A4_PAPER_SIZE.getAlto());
+				} else {
+					m_sizePaper = METRIC_A4_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A4):
+				m_type = MediaSizeName.ISO_A4;
+
+				if (isLandSpace()) {
+					m_sizePaper = new Size(METRIC_A4_PAPER_SIZE.getAncho(),
+							METRIC_A4_PAPER_SIZE.getAlto());
+				} else {
+					m_sizePaper = METRIC_A4_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A3):
+				m_type = MediaSizeName.ISO_A3;
+
+				if (isLandSpace()) {
+					m_sizePaper = new Size(METRIC_A3_PAPER_SIZE.getAncho(),
+							METRIC_A3_PAPER_SIZE.getAlto());
+				} else {
+					m_sizePaper = METRIC_A3_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A2):
+				m_type = MediaSizeName.ISO_A2;
+
+				if (isLandSpace()) {
+					m_sizePaper = new Size(METRIC_A2_PAPER_SIZE.getAncho(),
+							METRIC_A2_PAPER_SIZE.getAlto());
+				} else {
+					m_sizePaper = METRIC_A2_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A1):
+				m_type = MediaSizeName.ISO_A1;
+
+				if (isLandSpace()) {
+					m_sizePaper = new Size(METRIC_A1_PAPER_SIZE.getAncho(),
+							METRIC_A1_PAPER_SIZE.getAlto());
+				} else {
+					m_sizePaper = METRIC_A1_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A0):
+				m_type = MediaSizeName.ISO_A0;
+
+				if (isLandSpace()) {
+					m_sizePaper = new Size(METRIC_A0_PAPER_SIZE.getAncho(),
+							METRIC_A0_PAPER_SIZE.getAlto());
+				} else {
+					m_sizePaper = METRIC_A0_PAPER_SIZE;
+				}
+
+				break;
+
+			case (CUSTOM):
+				m_type = MediaSizeName.PERSONAL_ENVELOPE;
+
+				if (isLandSpace()) {
+					m_sizePaper = new Size(CUSTOM_PAPER_SIZE.getAncho(),
+							CUSTOM_PAPER_SIZE.getAlto());
+				} else {
+					m_sizePaper = CUSTOM_PAPER_SIZE;
+				}
+
+				break;
+		}
+
+		setSizeinUnits(isLandSpace());
+		m_sizeinUnits = getSizeInUnits();
+	}
+
+	/**
+	 * Selecci�n del tipo de folio a mostrar.
+	 *
+	 * @param isLand tipo de folio.
+	 * @param type Tipo de folio.
+	 *
+	 * @return Tama�o del folio seleccionado.
+	 */
+	public Size getSizeinUnits(boolean isLand, int type) {
+		Size size = null;
+
+		switch (type) {
+			case (PRINT):
+
+				if (isLand) {
+					size = new Size(METRIC_A4_PAPER_SIZE.getAncho(),
+							METRIC_A4_PAPER_SIZE.getAlto());
+				} else {
+					size = METRIC_A4_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A4):
+
+				if (isLand) {
+					size = new Size(METRIC_A4_PAPER_SIZE.getAncho(),
+							METRIC_A4_PAPER_SIZE.getAlto());
+				} else {
+					size = METRIC_A4_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A3):
+
+				if (isLand) {
+					size = new Size(METRIC_A3_PAPER_SIZE.getAncho(),
+							METRIC_A3_PAPER_SIZE.getAlto());
+				} else {
+					size = METRIC_A3_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A2):
+
+				if (isLand) {
+					size = new Size(METRIC_A2_PAPER_SIZE.getAncho(),
+							METRIC_A2_PAPER_SIZE.getAlto());
+				} else {
+					size = METRIC_A2_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A1):
+
+				if (isLand) {
+					size = new Size(METRIC_A1_PAPER_SIZE.getAncho(),
+							METRIC_A1_PAPER_SIZE.getAlto());
+				} else {
+					size = METRIC_A1_PAPER_SIZE;
+				}
+
+				break;
+
+			case (A0):
+
+				if (isLand) {
+					size = new Size(METRIC_A0_PAPER_SIZE.getAncho(),
+							METRIC_A0_PAPER_SIZE.getAlto());
+				} else {
+					size = METRIC_A0_PAPER_SIZE;
+				}
+
+				break;
+
+			case (CUSTOM):
+
+				if (isLand) {
+					size = new Size(CUSTOM_PAPER_SIZE.getAncho(),
+							CUSTOM_PAPER_SIZE.getAlto());
+				} else {
+					size = CUSTOM_PAPER_SIZE;
+				}
+
+				break;
+		}
+
+		m_sizeinUnits = new Size(size.getAlto() / m_TypeUnit,
+				size.getAncho() / m_TypeUnit);
+
+		return m_sizeinUnits;
+	}
+
+	/**
+	 * Obtiene el entero que representa el tipo de unidad de medida
+	 * seleccionada.
+	 *
+	 * @return tipo de unidad de medida seleccionada.
+	 */
+	public int getSelTypeUnit() {
+		return m_selTypeUnit;
+	}
+
+	/**
+	 * Devuelve el nombre de la unidad de medida seleccionada.
+	 *
+	 * @return String
+	 */
+	public String getNameUnit() {
+		return m_NameUnit;
+	}
+
+	/**
+	 * Selecci�n de la unidad de medida.
+	 *
+	 * @param sel tipo de unidad de medida.
+	 */
+	public void setUnit(int sel) {
+		m_selTypeUnit = sel;
+		setUnits(sel);
+		m_numX = m_numY = UNIT[sel];
+	}
+
+	/**
+	 * Actualiza m_sizeinUnits con la altura y anchura del folio en las
+	 * unidades de mediada seleccionada.
+	 *
+	 * @param b True si es en horizontal.
+	 */
+	public void setSizeinUnits(boolean b) {
+		if (b) {
+			m_sizeinUnits = new Size(m_sizePaper.getAlto() / m_TypeUnit,
+					m_sizePaper.getAncho() / m_TypeUnit);
+		} else {
+			m_sizeinUnits = new Size(m_sizePaper.getAncho() / m_TypeUnit,
+					m_sizePaper.getAlto() / m_TypeUnit);
+		}
+	}
+
+	/**
+	 * Devuelve un double en la unidad de medida seleccionada a partir del
+	 * double en cent�metros que se le pasa como parametro.
+	 *
+	 * @param d distancia en cent�metros.
+	 *
+	 * @return distancia en la unidad de medida seleccionada.
+	 */
+	public double toUnits(double d) {
+		NumberFormat nf = NumberFormat.getInstance();
+		nf.setMaximumFractionDigits(2);
+
+		String s = String.valueOf(nf.format(d));
+		s = s.replace(',', '.');
+
+		return (Double.valueOf(s).doubleValue() / m_TypeUnit);
+	}
+
+	/**
+	 * Devuelve un double en cent�metros a partir del double que se pasa como
+	 * par�metro en la unidad de medida establecida.
+	 *
+	 * @param d distancia en unidad de medida seleccionada.
+	 *
+	 * @return distancia en cent�metros.
+	 */
+	public double fromUnits(double d) {
+		return (d * m_TypeUnit);
+	}
+
+	/**
+	 * Devuelve los pixels por cent�metro.
+	 *
+	 * @param rect Rect�ngulo.
+	 *
+	 * @return Pixels por cent�metro.
+	 */
+	public double getPixXCm(Rectangle2D.Double rect) {
+		double value = m_sizePaper.getAncho();
+		double cm = CHANGE[2];
+		double unidades = 0;
+		unidades = ((double) (rect.getMaxX() - rect.getMinX()) / (double) ((value / cm)));
+
+		return unidades;
+	}
+
+	/**
+	 * Establece el n�mero de pixels que representan un cent�metro.
+	 *
+	 * @param rect rect�ngulo que representa el folio en pixels.
+	 */
+	public void setDistanceUnitX(Rectangle2D.Double rect) {
+		double value = m_sizePaper.getAncho();
+		double unidades = 0;
+		unidades = ((double) (rect.getMaxX() - rect.getMinX()) / (double) ((value / m_TypeUnit) / m_numX));
+		m_unitX = unidades;
+	}
+
+	/**
+	 * Establece el n�mero de pixels que representan un cent�metro.
+	 *
+	 * @param rect rect�ngulo que representa el folio en pixels.
+	 */
+	public void setDistanceUnitY(Rectangle2D.Double rect) {
+		double value = m_sizePaper.getAncho();
+		double unidades = 0;
+		unidades = ((double) (rect.getMaxX() - rect.getMinX()) / (double) ((value / m_TypeUnit) / m_numY));
+		m_unitY = unidades;
+	}
+
+	/**
+	 * Obtiene el rect�ngulo que representa el folio con las caracter�sticas
+	 * que contiene attributes y diferenciando si es para visualizar en
+	 * pantalla o para imprimir.
+	 *
+	 * @param isPrint si es para imprimir.
+	 * @param rect rect�ngulo a modificar.
+	 * @param w anchura
+	 * @param h altura
+	 *
+	 * @return Rect�ngulo que representa el folio en horizontal o vertical
+	 * 		   seg�n se haya seleccionado.
+	 */
+	public Rectangle2D.Double obtainRect(boolean isPrint,
+		Rectangle2D.Double rect, int w, int h) {
+		double value1 = 0;
+		double value2 = 0;
+
+		if (!isPrint) {
+			if (isLandSpace()) {
+				anchoXalto = m_sizePaper.getAncho() / m_sizePaper.getAlto();
+				rect = getRectangleLandscape(rect, w, h);
+			} else {
+				anchoXalto = m_sizePaper.getAlto() / m_sizePaper.getAncho();
+				rect = getRectanglePortrait(rect, w, h);
+			}
+		} else {
+			value1 = m_sizePaper.getAncho();
+			value2 = m_sizePaper.getAlto();
+			rect.setRect(0, 0, ((value1 / PULGADA) * DPI),
+				((value2 / PULGADA) * DPI));
+		}
+
+		setDistanceUnitX(rect);
+		setDistanceUnitY(rect);
+
+		return rect;
+	}
+
+	/**
+	 * Modifica el rect�ngulo que representa al folio en una posici�n
+	 * horizontal.
+	 *
+	 * @param rect Rect�ngulo que representa el folio en pixels.
+	 * @param w anchura del Layout.
+	 * @param h altura del Layout.
+	 *
+	 * @return Rect�ngulo modificado.
+	 */
+	public Rectangle2D.Double getRectangleLandscape(Rectangle2D.Double rect,
+		int w, int h) {
+		Rectangle2D.Double rectaux = new Rectangle2D.Double();
+		int x0 = (int) rect.getMinX();
+		int y0 = (int) rect.getMinY();
+		int y1;
+		int x1;
+		y1 = (int) (h - (2 * y0));
+		x1 = (int) (y1 * anchoXalto);
+
+		if (((int) (((h) - (2 * y0)) * anchoXalto)) > ((w) - (2 * x0))) {
+			x1 = (int) ((w) - (2 * x0));
+			y1 = (int) (x1 / anchoXalto);
+		}
+
+		rectaux.setRect(x0, y0, x1, y1);
+
+		return rectaux;
+	}
+
+	/**
+	 * Devuelve un Size con las medidas del folio en las unidades de mediada
+	 * seleccionada.
+	 *
+	 * @return Tama�o del folio en las unidades seleccionadas.
+	 */
+	public Size getSizeInUnits() {
+		return m_sizeinUnits;
+	}
+
+	/**
+	 * Modifica el rect�ngulo que representa al folio en una posici�n vertical.
+	 *
+	 * @param rect Rect�ngulo que representa el folio en pixels.
+	 * @param w anchura del Layout.
+	 * @param h altura del Layout.
+	 *
+	 * @return Rect�ngulo modificado.
+	 */
+	public Rectangle2D.Double getRectanglePortrait(Rectangle2D.Double rect,
+		int w, int h) {
+		Rectangle2D.Double rectaux = new Rectangle2D.Double();
+		int x0 = (int) rect.getMinX();
+		int y0 = (int) rect.getMinY();
+		int y1;
+		int x1;
+		x1 = (int) (w - (2 * x0));
+		y1 = (int) (x1 * anchoXalto);
+
+		if (((int) (((w) - (2 * x0)) * anchoXalto)) > ((h) - (2 * y0))) {
+			y1 = (int) (h - (2 * y0));
+			x1 = (int) (y1 / anchoXalto);
+		}
+
+		rectaux.setRect(x0, y0, x1, y1);
+
+		return rectaux;
+	}
+
+	/**
+	 * Obtiene el tipo de los diferentes formatos de papel.
+	 *
+	 * @param size tipo de paper.
+	 *
+	 * @return Medidas del papel seleccionado.
+	 */
+	private int getTypePaper(Size size) {
+		int tol = 1;
+		Size auxSize = size;
+
+		if (isLandSpace()) {
+			auxSize = new Size(size.getAncho(), size.getAlto());
+		}
+
+		if ((((auxSize.getAncho() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A4_PAPER_SIZE.getAncho())) &&
+				(((auxSize.getAlto() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A4_PAPER_SIZE.getAlto()))) {
+			return A4;
+		} else if ((((auxSize.getAncho() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A3_PAPER_SIZE.getAncho())) &&
+				(((auxSize.getAlto() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A3_PAPER_SIZE.getAlto()))) {
+			return A3;
+		} else if ((((auxSize.getAncho() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A2_PAPER_SIZE.getAncho())) &&
+				(((auxSize.getAlto() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A2_PAPER_SIZE.getAlto()))) {
+			return A2;
+		} else if ((((auxSize.getAncho() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A1_PAPER_SIZE.getAncho())) &&
+				(((auxSize.getAlto() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A1_PAPER_SIZE.getAlto()))) {
+			return A1;
+		} else if ((((auxSize.getAncho() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A0_PAPER_SIZE.getAncho())) &&
+				(((auxSize.getAlto() * PULGADA) / DPISCREEN) < (tol +
+				METRIC_A0_PAPER_SIZE.getAlto()))) {
+			return A0;
+		}
+
+		return A4;
+	}
+
+	/**
+	 * Devuelve un Objeto XMLEntity con la informaci�n los atributos necesarios
+	 * para poder despu�s volver a crear el objeto original.
+	 *
+	 * @return XMLEntity.
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("DPI", DPI);
+		xml.putProperty("DPISCREEN", DPISCREEN);
+		xml.putProperty("m_TypeUnit", m_TypeUnit);
+		xml.putProperty("m_numX", m_numX);
+		xml.putProperty("m_numY", m_numY);
+		xml.putProperty("m_unitX", m_unitX);
+		xml.putProperty("m_unitY", m_unitY);
+		xml.putProperty("hasmargin", hasmargin);
+		xml.putProperty("m_resolutionSel", m_resolutionSel);
+		xml.putProperty("m_typeSel", m_typeSel);
+		xml.putProperty("m_selTypeUnit", m_selTypeUnit);
+		xml.addChild(m_sizePaper.getXMLEntity());
+		xml.putProperty("m_area", m_area);
+		xml.putProperty("anchoXalto", anchoXalto);
+		xml.addChild(m_sizeinUnits.getXMLEntity());
+
+		// Landscape
+		xml.putProperty("m_isLandSel", m_isLandSel);
+
+		return xml;
+	}
+
+	/**
+	 * Crea un Objeto de esta clase a partir de la informaci�n del XMLEntity.
+	 *
+	 * @param xml XMLEntity
+	 *
+	 * @return Objeto de esta clase.
+	 */
+	public static Attributes createAtributes(XMLEntity xml) {
+		Attributes atri = new Attributes();
+		DPI = xml.getIntProperty("DPI");
+		DPISCREEN = xml.getIntProperty("DPISCREEN");
+		atri.m_TypeUnit = xml.getDoubleProperty("m_TypeUnit");
+		atri.m_numX = xml.getDoubleProperty("m_numX");
+		atri.m_numY = xml.getDoubleProperty("m_numY");
+		atri.m_unitX = xml.getDoubleProperty("m_unitX");
+		atri.m_unitY = xml.getDoubleProperty("m_unitY");
+		atri.hasmargin = xml.getBooleanProperty("hasmargin");
+		atri.m_resolutionSel = xml.getIntProperty("m_resolutionSel");
+		atri.m_typeSel = xml.getIntProperty("m_typeSel");
+		atri.m_selTypeUnit = xml.getIntProperty("m_selTypeUnit");
+		atri.m_sizePaper = Size.createSize(xml.getChild(0));
+
+		if (atri.hasmargin) {
+			atri.m_area = xml.getDoubleArrayProperty("m_area");
+		}
+
+		atri.anchoXalto = xml.getDoubleProperty("anchoXalto");
+		atri.m_sizeinUnits = Size.createSize(xml.getChild(1));
+		atri.m_isLandSel = xml.getBooleanProperty("m_isLandSel");
+
+		return atri;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Attributes.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Popupmenu.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Popupmenu.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Popupmenu.java	(revision 1648)
@@ -0,0 +1,148 @@
+/*
+ * Created on 12-ago-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.gui.layout;
+
+import java.awt.Font;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+
+import com.iver.andami.PluginServices;
+
+
+/**
+ * Popupmenu de bot�n derecho que se abre sobre el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Popupmenu extends JPopupMenu {
+    private final static Font theFont = new Font("SansSerif", Font.PLAIN, 10);
+    private JMenuItem m_properties=null;
+    private JMenuItem m_selecAll = null;
+    private JMenuItem m_behind = null;
+    private JMenuItem m_before = null;
+	private JMenuItem m_position = null;
+    private JMenuItem m_simplify = null;
+    private JMenuItem m_refresh = null;
+    private FLayoutGraphics m_flg = null;
+    private Layout m_layout = null;
+    private Point m_p = null;
+
+    /**
+     * Crea un nuevo Popupmenu.
+     *
+     * @param layout Layout sobre el que se abre el Popupmenu.
+     * @param p punto donde se abre el popupmenu.
+     */
+    public Popupmenu(Layout layout, Point p) {
+        m_layout = layout;
+        m_flg = new FLayoutGraphics(m_layout);
+        m_p = p;
+        initialize();
+    }
+
+    /**
+     * Inicializa los componentes del Popupmenu.
+     */
+    private void initialize() {
+    	m_properties=new JMenuItem(PluginServices.getText(this,"propiedades"));
+        m_selecAll = new JMenuItem(PluginServices.getText(this,"seleccionar_todos"));
+        m_behind = new JMenuItem(PluginServices.getText(this,"colocar_detras"));
+        m_before = new JMenuItem(PluginServices.getText(this,"colocar_delante"));
+        m_position = new JMenuItem(PluginServices.getText(this,"tama�o_posicion"));
+        m_simplify = new JMenuItem(PluginServices.getText(this,"simplificar"));
+        m_refresh = new JMenuItem(PluginServices.getText(this,"refrescar"));
+        add(m_properties);
+        addSeparator();
+        add(m_selecAll);
+        addSeparator();
+        add(m_behind);
+        add(m_before);
+        add(m_position);
+		addSeparator();
+        add(m_simplify);
+        addSeparator();
+        add(m_refresh);
+		m_properties.addActionListener(new ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					m_flg.openFFrameDialog();
+				}
+			});
+        m_selecAll.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    m_flg.selecAll();
+                }
+            });
+        m_behind.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    m_flg.behind();
+                }
+            });
+        m_before.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    m_flg.before();
+                }
+            });
+		m_position.addActionListener(new ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					m_flg.position();
+				}
+			});
+        m_simplify.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    m_flg.simplify();
+                }
+            });
+        m_refresh.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    m_layout.refresh();
+                }
+            });
+        this.show(m_layout, m_p.x, m_p.y);
+    }
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Popupmenu.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Size.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Size.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Size.java	(revision 1648)
@@ -0,0 +1,116 @@
+/*
+ * Created on 19-may-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.gui.layout;
+
+import com.iver.utiles.XMLEntity;
+
+
+/**
+ * Clase que almacena la altura y anchura de un folio.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Size {
+	private double alto;
+	private double ancho;
+
+	/**
+	 * Creates a new Size object.
+	 *
+	 * @param al Altura
+	 * @param an Anchura
+	 */
+	public Size(double al, double an) {
+		alto = al;
+		ancho = an;
+	}
+
+	/**
+	 * Devuelve el alto del folio.
+	 *
+	 * @return altura.
+	 */
+	public double getAlto() {
+		return alto;
+	}
+
+	/**
+	 * Devuelve la anchura del folio.
+	 *
+	 * @return Anchura.
+	 */
+	public double getAncho() {
+		return ancho;
+	}
+
+	/**
+	 * Devuelve un Objeto XMLEntity con la informaci�n los atributos necesarios
+	 * para poder despu�s volver a crear el objeto original.
+	 *
+	 * @return XMLEntity.
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.putProperty("ancho", ancho);
+		xml.putProperty("alto", alto);
+
+		return xml;
+	}
+
+	/**
+	 * Crea un Objeto de esta clase a partir de la informaci�n del XMLEntity.
+	 *
+	 * @param xml XMLEntity
+	 *
+	 * @return Objeto de esta clase.
+	 */
+	public static Size createSize(XMLEntity xml) {
+		Size size = new Size(xml.getDoubleProperty("alto"),
+				xml.getDoubleProperty("ancho"));
+
+		return size;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Size.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutZooms.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutZooms.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutZooms.java	(revision 1648)
@@ -0,0 +1,422 @@
+/*
+ * Created on 17-sep-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.gui.layout;
+
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * Clase contenedora de los m�todos para cambiar los zooms.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FLayoutZooms {
+	private Layout layout = null;
+	private FLayoutFunctions functions = null;
+
+	/**
+	 * Crea un nuevo Zooms.
+	 *
+	 * @param l Mapa sobre el que se actua.
+	 */
+	public FLayoutZooms(Layout l) {
+		layout = l;
+		functions = new FLayoutFunctions(layout);
+	}
+
+	/**
+	 * Realiza un zoom por rect�ngulo o por punto con un escalado por defecto
+	 * sobre el Layout que se le pasa como par�metro.
+	 *
+	 * @param p1 punto de inicio del rect�ngulo.
+	 * @param p2 punto final del rec�ngulo.
+	 */
+	public void setZoomIn(Point p1, Point p2) {
+		if (p1.y != p2.y) {
+			double points = (p2.x - p1.x) / (p2.y - p1.y);
+			double window = (double) layout.getWidth() / layout.getHeight();
+
+			if (points < window) {
+				p2.x = (int) (p1.x + ((p2.x - p1.x) * window));
+			}
+		}
+
+		Point2D.Double pSheet1 = FLayoutUtilities.toSheetPoint(new Point2D.Double(
+					p1.getX(), p1.getY()), layout.getAT());
+		Point2D.Double pSheet2 = FLayoutUtilities.toSheetPoint(new Point2D.Double(
+					p2.getX(), p2.getY()), layout.getAT());
+
+		double xmin = 0;
+		double xmax = 0;
+		double ymin = 0;
+
+		if (pSheet1.x > pSheet2.x) {
+			xmin = pSheet2.x;
+			xmax = pSheet1.x;
+		} else {
+			xmin = pSheet1.x;
+			xmax = pSheet2.x;
+		}
+
+		if (pSheet1.y > pSheet2.y) {
+			ymin = pSheet2.y;
+		} else {
+			ymin = pSheet1.y;
+		}
+
+		Rectangle2D.Double rScreen = new Rectangle2D.Double();
+		Rectangle2D.Double rSheet = new Rectangle2D.Double();
+
+		if (java.lang.Math.abs(layout.getFirstPoint().x - p2.x) < 4) {
+			double w = FLayoutUtilities.toSheetDistance(layout.getVisibleRect()
+															  .getWidth(),
+					layout.getAT());
+			double difw = 2;
+
+			rSheet.x = (-pSheet2.getX() * difw) -
+				FLayoutUtilities.toSheetDistance(layout.getRect().getX(),
+					layout.getAT()) +
+				FLayoutUtilities.toSheetDistance(layout.getWidth() / 2,
+					layout.getAT());
+			rSheet.y = (-pSheet2.getY() * difw) -
+				FLayoutUtilities.toSheetDistance(layout.getRect().getY(),
+					layout.getAT()) +
+				FLayoutUtilities.toSheetDistance(layout.getHeight() / 2,
+					layout.getAT());
+
+			rSheet.width = FLayoutUtilities.toSheetDistance(layout.getRect()
+																  .getWidth(),
+					layout.getAT()) * difw;
+			rSheet.height = FLayoutUtilities.toSheetDistance(layout.getRect()
+																   .getHeight(),
+					layout.getAT()) * difw;
+
+			rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet,
+					layout.getAT()));
+		} else {
+			double w = FLayoutUtilities.toSheetDistance(layout.getVisibleRect()
+															  .getWidth(),
+					layout.getAT());
+			double mw = xmax - xmin;
+			double difw = w / mw;
+
+			rSheet.x = (-xmin * difw) -
+				FLayoutUtilities.toSheetDistance(layout.getRect().getX(),
+					layout.getAT());
+			rSheet.y = (-ymin * difw) -
+				FLayoutUtilities.toSheetDistance(layout.getRect().getY(),
+					layout.getAT());
+
+			rSheet.width = FLayoutUtilities.toSheetDistance(layout.getRect()
+																  .getWidth(),
+					layout.getAT()) * difw;
+			rSheet.height = FLayoutUtilities.toSheetDistance(layout.getRect()
+																   .getHeight(),
+					layout.getAT()) * difw;
+
+			rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet,
+					layout.getAT()));
+		}
+
+		if (FLayoutUtilities.isPosible(rScreen)) {
+			layout.getRect().setRect(rScreen);
+		}
+	}
+
+	/**
+	 * Realiza un zoom out sobre el Layout que se le pasa como par�metro.
+	 *
+	 * @param p2 punto final del rec�ngulo.
+	 */
+	public void setZoomOut(Point p2) {
+		Point2D.Double pSheet2 = FLayoutUtilities.toSheetPoint(new Point2D.Double(
+					p2.getX(), p2.getY()), layout.getAT());
+
+		Rectangle2D.Double rScreen = new Rectangle2D.Double();
+		Rectangle2D.Double rSheet = new Rectangle2D.Double();
+
+		double w = FLayoutUtilities.toSheetDistance(layout.getVisibleRect()
+														  .getWidth(),
+				layout.getAT());
+		double difw = 0.5;
+
+		rSheet.x = (-pSheet2.getX() * difw) -
+			FLayoutUtilities.toSheetDistance(layout.getRect().getX(),
+				layout.getAT()) +
+			FLayoutUtilities.toSheetDistance(layout.getWidth() / 2,
+				layout.getAT());
+		rSheet.y = (-pSheet2.getY() * difw) -
+			FLayoutUtilities.toSheetDistance(layout.getRect().getY(),
+				layout.getAT()) +
+			FLayoutUtilities.toSheetDistance(layout.getHeight() / 2,
+				layout.getAT());
+
+		rSheet.width = FLayoutUtilities.toSheetDistance(layout.getRect()
+															  .getWidth(),
+				layout.getAT()) * difw;
+		rSheet.height = FLayoutUtilities.toSheetDistance(layout.getRect()
+															   .getHeight(),
+				layout.getAT()) * difw;
+
+		rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet, layout.getAT()));
+
+		if (FLayoutUtilities.isPosible(rScreen)) {
+			layout.getRect().setRect(rScreen);
+		}
+	}
+
+	/**
+	 * Realiza un zoom out sobre el Layout que se le pasa como par�metro.
+	 *
+	 * @param dif punto de inicio del rect�ngulo.
+	 * @param p2 punto final del rec�ngulo.
+	 */
+	public void setZoom(double dif, Point p2) {
+		Point2D.Double pSheet2 = FLayoutUtilities.toSheetPoint(new Point2D.Double(
+					p2.getX(), p2.getY()), layout.getAT());
+		Rectangle2D.Double rScreen = new Rectangle2D.Double();
+		Rectangle2D.Double rSheet = new Rectangle2D.Double();
+
+		double w = FLayoutUtilities.toSheetDistance(layout.getVisibleRect()
+														  .getWidth(),
+				layout.getAT());
+		double difw = dif;
+
+		rSheet.x = (-pSheet2.getX() * difw) -
+			FLayoutUtilities.toSheetDistance(layout.getRect().getX(),
+				layout.getAT()) +
+			FLayoutUtilities.toSheetDistance(layout.getWidth() / 2,
+				layout.getAT());
+		rSheet.y = (-pSheet2.getY() * difw) -
+			FLayoutUtilities.toSheetDistance(layout.getRect().getY(),
+				layout.getAT()) +
+			FLayoutUtilities.toSheetDistance(layout.getHeight() / 2,
+				layout.getAT());
+
+		rSheet.width = FLayoutUtilities.toSheetDistance(layout.getRect()
+															  .getWidth(),
+				layout.getAT()) * difw;
+		rSheet.height = FLayoutUtilities.toSheetDistance(layout.getRect()
+															   .getHeight(),
+				layout.getAT()) * difw;
+
+		rScreen.setRect(FLayoutUtilities.fromSheetRect(rSheet, layout.getAT()));
+
+		if (FLayoutUtilities.isPosible(rScreen)) {
+			layout.getRect().setRect(rScreen);
+		}
+	}
+
+	/**
+	 * Realiza un zoom a escala 1:1.
+	 */
+	public void realZoom() {
+		double cm = layout.getAtributes().getPixXCm(layout.getRect());
+		Toolkit kit = Toolkit.getDefaultToolkit();
+		int resolution = kit.getScreenResolution();
+		double dif = (cm * Attributes.PULGADA) / resolution;
+		setZoom(1 / dif,
+			new Point(layout.getWidth() / 2, layout.getHeight() / 2));
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Realiza un zoom m�s a partir del punto central de pantalla.
+	 */
+	public void zoomIn() {
+		setZoom(2, new Point(layout.getWidth() / 2, layout.getHeight() / 2));
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Realiza un zoom menos a partir del punto central de pantalla.
+	 */
+	public void zoomOut() {
+		setZoom(0.5, new Point(layout.getWidth() / 2, layout.getHeight() / 2));
+		layout.setStatus(Layout.DESACTUALIZADO);
+		layout.repaint();
+	}
+
+	/**
+	 * Realiza un zoom a los elementos que esten seleccionados, si no hay
+	 * ning�n elemento seleccionado no realiza ning�n zoom
+	 */
+	public void zoomSelect() {
+		Rectangle2D.Double recaux = null;
+
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			if (((IFFrame) layout.getFFrames().get(i)).getSelected() != FFrame.NOSELECT) {
+				if (recaux == null) {
+					recaux = ((IFFrame) layout.getFFrames().get(i)).getBoundingBox(layout.getAT());
+				} else {
+					recaux.add(((IFFrame) layout.getFFrames().get(i)).getBoundingBox(
+							layout.getAT()));
+				}
+			}
+		}
+
+		if (recaux != null) {
+			Point p1 = new Point((int) recaux.x, (int) recaux.y);
+			Point p2 = new Point((int) recaux.getMaxX(), (int) recaux.getMaxY());
+			setZoomIn(p1, p2);
+			layout.setStatus(Layout.DESACTUALIZADO);
+			layout.repaint();
+		}
+	}
+
+	/**
+	 * Realiza un zoom m�s sobre la vista del FFrameView seleccionado.
+	 *
+	 * @param p1 punto inicial.
+	 * @param p2 punto final.
+	 */
+	public void setViewZoomIn(Point2D p1, Point2D p2) {
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			if (layout.getFFrames().get(i) instanceof FFrameView) {
+				FFrameView fframe = (FFrameView) layout.getFFrames().get(i);
+
+				if (fframe.getSelected() != FFrame.NOSELECT) {
+					p1 = functions.toMapPoint(p1, fframe.getAt());
+					p2 = functions.toMapPoint(p2, fframe.getAt());
+
+					// Borramos el anterior
+					layout.setStatus(Layout.DESACTUALIZADO);
+
+					if (java.lang.Math.abs(p1.getX() - p2.getX()) <= 3) {
+						double nuevoX;
+						double nuevoY;
+						double cX;
+						double cY;
+
+						cX = p2.getX();
+						cY = p2.getY();
+
+						double factor = 0.6;
+						Rectangle2D.Double r = new Rectangle2D.Double();
+
+						nuevoX = cX -
+							((fframe.getFMap().getViewPort().getExtent()
+									.getWidth() * factor) / 2.0);
+						nuevoY = cY -
+							((fframe.getFMap().getViewPort().getExtent()
+									.getHeight() * factor) / 2.0);
+						r.x = nuevoX;
+						r.y = nuevoY;
+						r.width = fframe.getFMap().getViewPort().getExtent()
+										.getWidth() * factor;
+						r.height = fframe.getFMap().getViewPort().getExtent()
+										 .getHeight() * factor;
+
+						fframe.setNewExtent(r);
+					} else {
+						//	Fijamos el nuevo extent
+						Rectangle2D.Double r = new Rectangle2D.Double();
+
+						r.setFrameFromDiagonal(p1, p2);
+
+						fframe.setNewExtent(r);
+					}
+
+					// Fin del else
+					layout.repaint();
+				}
+			}
+		}
+	}
+
+	/**
+	 * Realiza un zoom menos sobre la vista del FFrameView seleccionado.
+	 *
+	 * @param p2 Punto sobre el que realizar el zoom menos.
+	 */
+	public void setViewZoomOut(Point p2) {
+		Point2D.Double pWorld;
+
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			if (layout.getFFrames().get(i) instanceof FFrameView) {
+				FFrameView fframe = (FFrameView) layout.getFFrames().get(i);
+
+				if (fframe.getSelected() != FFrame.NOSELECT) {
+					double nuevoX;
+					double nuevoY;
+					double cX;
+					double cY;
+					Point pScreen = new Point((int) p2.getX(), (int) p2.getY());
+					pWorld = functions.toMapPoint(pScreen, fframe.getAt());
+
+					cX = pWorld.getX();
+					cY = pWorld.getY();
+
+					double factor = 1.8;
+					Rectangle2D.Double r = new Rectangle2D.Double();
+
+					nuevoX = cX -
+						((fframe.getFMap().getViewPort().getExtent().getWidth() * factor) / 2.0);
+					nuevoY = cY -
+						((fframe.getFMap().getViewPort().getExtent().getHeight() * factor) / 2.0);
+					r.x = nuevoX;
+					r.y = nuevoY;
+					r.width = fframe.getFMap().getViewPort().getExtent()
+									.getWidth() * factor;
+					r.height = fframe.getFMap().getViewPort().getExtent()
+									 .getHeight() * factor;
+
+					fframe.setNewExtent(r);
+
+					///fframe.getFMap().setCancelDrawing(false);
+				}
+			}
+		}
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutZooms.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutFunctions.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutFunctions.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutFunctions.java	(revision 1648)
@@ -0,0 +1,232 @@
+/*
+ * Created on 16-sep-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.gui.layout;
+
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGroup;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend;
+import com.iver.cit.gvsig.gui.layout.fframes.FFramePicture;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameText;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+
+import java.awt.Point;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * Funciones utilizadas desde la clase EventsHandler.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FLayoutFunctions {
+	private Layout layout = null;
+
+	/**
+	 * Crea un nuevo FLayoutFunctions.
+	 *
+	 * @param l Referencia al Layout.
+	 */
+	public FLayoutFunctions(Layout l) {
+		layout = l;
+	}
+
+	/**
+	 * Gestiona la herramienta de selecci�n sobre el Mapa.
+	 */
+	public void setSelect() {
+		IFFrame fframe = null;
+		boolean isUpdate = false;
+
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			fframe = (IFFrame) layout.getFFrames().get(i);
+
+			int difx = (layout.getLastPoint().x - layout.getFirstPoint().x);
+			int dify = (layout.getLastPoint().y - layout.getFirstPoint().y);
+
+			if (((Math.abs(difx) > 3) || (Math.abs(dify) > 3)) &&
+					(fframe.getSelected() != FFrame.NOSELECT)) {
+				Rectangle2D rectangle = fframe.getMovieRect(difx, dify);
+
+				if (layout.isCuadricula()) {
+					//cuadrar con la cuadr�cula dibujada y despu�s en el mouseReleased guardar ese rect�ngulo de la misma forma.
+					FLayoutUtilities.setRectGrid(rectangle,
+						layout.getAtributes().getUnitInPixelsX(),
+						layout.getAtributes().getUnitInPixelsY(), layout.getAT());
+				}
+
+				if (fframe instanceof FFrameGroup) {
+					((FFrameGroup) fframe).setAt(layout.getAT());
+				}
+
+				fframe.setBoundBox(FLayoutUtilities.toSheetRect(rectangle,
+						layout.getAT()));
+				isUpdate = true;
+			}
+
+			if (layout.isReSel() &&
+					(layout.getReSel().contains(fframe.getBoundingBox(
+							layout.getAT())))) {
+				fframe.setSelected(true);
+			}
+
+			if (isUpdate) {
+				layout.setStatus(Layout.DESACTUALIZADO);
+			} else {
+				layout.setStatus(Layout.ACTUALIZADO);
+			}
+		}
+
+		layout.setIsReSel(true);
+	}
+
+	/**
+	 * A�ade un fframe al Layout del tipo preseleccionado  y abre el di�logo
+	 * para configurar las caracter�sticas.
+	 */
+	public void setFFrame() {
+		IFFrame fframe = null;
+		boolean isadd = false;
+
+		if (layout.getTool() == Layout.RECTANGLEVIEW) {
+			fframe = new FFrameView();
+			isadd = true;
+		} else if (layout.getTool() == Layout.RECTANGLEPICTURE) {
+			fframe = new FFramePicture();
+			isadd = true;
+		} else if (layout.getTool() == Layout.RECTANGLESCALEBAR) {
+			fframe = new FFrameScaleBar();
+			isadd = true;
+		} else if (layout.getTool() == Layout.RECTANGLELEGEND) {
+			fframe = new FFrameLegend();
+			isadd = true;
+		} else if (layout.getTool() == Layout.RECTANGLETEXT) {
+			fframe = new FFrameText();
+			isadd = true;
+		} else if ((layout.getTool() == Layout.RECTANGLESIMPLE) ||
+				(layout.getTool() == Layout.LINE) ||
+				(layout.getTool() == Layout.POLYLINE) ||
+				(layout.getTool() == Layout.POLYGON) ||
+				(layout.getTool() == Layout.CIRCLE) ||
+				(layout.getTool() == Layout.POINT)) {
+			fframe = new FFrameGraphics();
+			isadd = true;
+			((FFrameGraphics) fframe).update(layout.getTool(), layout.getAT());
+		}
+
+		if (isadd) {
+			Rectangle2D r = new Rectangle2D.Double(); //rectOrigin.x+m_PointAnt.x,rectOrigin.y+m_PointAnt.y,m_LastPoint.x-m_PointAnt.x,m_LastPoint.y-m_PointAnt.y);
+			r.setFrameFromDiagonal(layout.getFirstPoint(), layout.getLastPoint());
+
+			if (layout.isCuadricula()) {
+				//cuadrar con la cuadr�cula dibujada y despu�s en el mouseReleased guardar ese rect�ngulo de la misma forma.
+				FLayoutUtilities.setRectGrid(r,
+					layout.getAtributes().getUnitInPixelsX(),
+					layout.getAtributes().getUnitInPixelsY(), layout.getAT());
+			}
+
+			fframe.setBoundBox(FLayoutUtilities.toSheetRect(r, layout.getAT()));
+
+			if (layout.openFFrameDialog(fframe)) {
+				layout.addFFrame(fframe, true);
+			}
+		}
+	}
+
+	/**
+	 * Pan sobre la vista del FFrameView.
+	 *
+	 * @param p1 Punto inicial del desplazamiento.
+	 * @param p2 Punto final del desplazamiento.
+	 */
+	public void setViewPan(Point p1, Point p2) {
+		for (int i = 0; i < layout.getFFrames().size(); i++) {
+			if (layout.getFFrames().get(i) instanceof FFrameView) {
+				FFrameView fframe = (FFrameView) layout.getFFrames().get(i);
+
+				if (fframe.getSelected() != FFrame.NOSELECT) {
+					Rectangle2D.Double r = new Rectangle2D.Double();
+					Rectangle2D extent = fframe.getFMap().getViewPort()
+											   .getExtent();
+					Point2D mp1 = toMapPoint(p1, fframe.getAt());
+					Point2D mp2 = toMapPoint(p2, fframe.getAt());
+					r.x = extent.getX() - (mp2.getX() - mp1.getX());
+					r.y = extent.getY() - (mp2.getY() - mp1.getY());
+					r.width = extent.getWidth();
+					r.height = extent.getHeight();
+					fframe.getFMap().getViewPort().setExtent(r);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Devuelve un punto real a partir de un punto en pixels sobre la vista.
+	 *
+	 * @param pScreen Punto en pixels.
+	 * @param at1 Matriz de transformaci�n.
+	 *
+	 * @return Punto real.
+	 */
+	public Point2D.Double toMapPoint(Point2D pScreen, AffineTransform at1) {
+		Point2D.Double pWorld = new Point2D.Double();
+
+		AffineTransform at;
+
+		try {
+			at = at1.createInverse();
+			at.transform(pScreen, pWorld);
+		} catch (NoninvertibleTransformException e) {
+			//				 throw new RuntimeException(e);
+		}
+
+		return pWorld;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutFunctions.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Layout.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Layout.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Layout.java	(revision 1648)
@@ -0,0 +1,1257 @@
+/*
+ * Created on 20-feb-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.gui.layout;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.andami.ui.mdiManager.ViewListener;
+
+import com.iver.cit.gvsig.Abrir;
+import com.iver.cit.gvsig.fmap.ColorEvent;
+import com.iver.cit.gvsig.fmap.DriverException;
+import com.iver.cit.gvsig.fmap.ExtentEvent;
+import com.iver.cit.gvsig.fmap.ViewPortListener;
+import com.iver.cit.gvsig.gui.layout.dialogs.FConfigLayoutDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend;
+import com.iver.cit.gvsig.gui.layout.fframes.FFramePicture;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameScaleBar;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameText;
+import com.iver.cit.gvsig.gui.layout.fframes.FFrameView;
+import com.iver.cit.gvsig.gui.layout.fframes.IFFrame;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameGraphicsDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameLegendDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFramePictureDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameScaleBarDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameTextDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.FFrameViewDialog;
+import com.iver.cit.gvsig.gui.layout.fframes.dialogs.IFFrameDialog;
+import com.iver.cit.gvsig.gui.project.MapProperties;
+import com.iver.cit.gvsig.project.Project;
+import com.iver.cit.gvsig.project.ProjectMap;
+
+import com.iver.utiles.XMLEntity;
+
+import org.apache.log4j.Logger;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+
+import javax.print.Doc;
+import javax.print.DocFlavor;
+import javax.print.DocPrintJob;
+import javax.print.PrintException;
+import javax.print.PrintService;
+import javax.print.PrintServiceLookup;
+import javax.print.ServiceUI;
+import javax.print.SimpleDoc;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.event.PrintJobAdapter;
+import javax.print.event.PrintJobEvent;
+import javax.print.event.PrintJobListener;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.KeyStroke;
+
+
+/**
+ * Mapa.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class Layout extends JPanel implements SingletonView, ViewPortListener,
+	ViewListener {
+	private static Logger logger = Logger.getLogger(Layout.class.getName());
+	public static final int ZOOM_MAS = 1;
+	public static final int ZOOM_MENOS = 2;
+	public static final int PAN = 3;
+	public static final int DESACTUALIZADO = 4;
+	public static final int RECTANGLEVIEW = 5;
+	public static final int RECTANGLEPICTURE = 6;
+	public static final int RECTANGLESCALEBAR = 7;
+	public static final int RECTANGLELEGEND = 8;
+	public static final int RECTANGLETEXT = 9;
+	public static final int RECTANGLE = 10;
+	public static final int ACTUALIZADO = 11;
+	public static final int SELECT = 12;
+	public static final int POINT = 13;
+	public static final int LINE = 14;
+	public static final int POLYLINE = 15;
+	public static final int RECTANGLESIMPLE = 16;
+	public static final int CIRCLE = 17;
+	public static final int POLYGON = 18;
+	public static final int GRAPHICS = 19;
+	public static final int RECTANGLESYMBOL = 20;
+	public static final int RECTANGLEGROUP = 21;
+	public static final int VIEW_ZOOMIN = 22;
+	public static final int VIEW_ZOOMOUT = 23;
+	public static final int VIEW_FULL = 24;
+	public static final int VIEW_PAN = 25;
+	public static final int SET_TAG = 26;
+	public static final Image iLayoutpan = new ImageIcon(Abrir.class.getClassLoader()
+																	.getResource("images/LayoutHand.gif")).getImage();
+	public static final Image ipan = new ImageIcon(Abrir.class.getClassLoader()
+															  .getResource("images/Hand.gif")).getImage();
+	public static final Image iLayoutzoomin = new ImageIcon(Abrir.class.getClassLoader()
+																	   .getResource("images/LayoutZoomInCursor.gif")).getImage();
+	public static final Image izoomin = new ImageIcon(Abrir.class.getClassLoader()
+																 .getResource("images/ZoomInCursor.gif")).getImage();
+	public static final Image iLayoutzoomout = new ImageIcon(Abrir.class.getClassLoader()
+																		.getResource("images/LayoutZoomOutCursor.gif")).getImage();
+	public static final Image izoomout = new ImageIcon(Abrir.class.getClassLoader()
+																  .getResource("images/ZoomOutCursor.gif")).getImage();
+	public static final Image iinfo = new ImageIcon(Abrir.class.getClassLoader()
+															   .getResource("images/InfoCursor.gif")).getImage();
+	public static final Image icrux = new ImageIcon(Abrir.class.getClassLoader()
+															   .getResource("images/CruxCursor.png")).getImage();
+	public static final Image itag = new ImageIcon(Abrir.class.getClassLoader()
+															  .getResource("images/tagCursor.gif")).getImage();
+	public static final Image iPoint = new ImageIcon(Abrir.class.getClassLoader()
+																.getResource("images/PointCursor.png")).getImage();
+	public static final Image iRect = new ImageIcon(Abrir.class.getClassLoader()
+															   .getResource("images/RectCursor.png")).getImage();
+	public static final Image iLine = new ImageIcon(Abrir.class.getClassLoader()
+															   .getResource("images/LineCursor.png")).getImage();
+	public static final Image iRectangle = new ImageIcon(Abrir.class.getClassLoader()
+																	.getResource("images/RectangleCursor.png")).getImage();
+	public static final Image iCircle = new ImageIcon(Abrir.class.getClassLoader()
+																 .getResource("images/CircleCursor.png")).getImage();
+	public static final Image iPoligon = new ImageIcon(Abrir.class.getClassLoader()
+																  .getResource("images/PoligonCursor.png")).getImage();
+	public static Hashtable nums = new Hashtable();
+	private Point origin = new Point(50, 50);
+	private Point rectOrigin = new Point(origin);
+	private Rectangle2D.Double rect = new Rectangle2D.Double(rectOrigin.x,
+			rectOrigin.y, 400, 300);
+	private Point m_FirstPoint = new Point(0, 0);
+	private Point m_PointAnt = new Point(0, 0);
+	private Point m_LastPoint = new Point(0, 0);
+	private EventsHandler events;
+	private int tool = ZOOM_MAS;
+	private int status = DESACTUALIZADO;
+	private BufferedImage img = null;
+	private AffineTransform m_MatrizTransf;
+	private Rectangle2D rectVisible;
+	private IFFrameDialog fframedialog = null;
+	private ArrayList m_fframes = new ArrayList();
+	private FConfigLayoutDialog m_configLayout = null;
+	private MapProperties m_propertiesLayout = null;
+	private Attributes m_attributes = null;
+	private PrintService[] m_cachePrintServices = null;
+	private PrintRequestAttributeSet m_cachePrintRequestAtributeSet = null;
+	private PrintService m_cachePrintService = null;
+	private boolean m_bCancelDrawing = false;
+	private boolean isCuadricula = false;
+	private boolean initial = true;
+	private ProjectMap map = null;
+	private Rectangle reSel = null;
+	private boolean isReSel = true;
+
+	// private String m_name = null;
+	private boolean m_showRuler = true;
+	private FLayoutDraw layoutPaint = null;
+	private boolean isDrawCuadricula = true;
+	private Doc doc = null;
+	private PrintRequestAttributeSet att = null;
+
+	/**
+	 * Creates a new Layout object.
+	 */
+	public Layout() {
+		this.setLayout(null);
+		events = new EventsHandler(this);
+		layoutPaint = new FLayoutDraw(this);
+		addComponentListener(events);
+		addMouseMotionListener(events);
+		addMouseListener(events);
+		m_MatrizTransf = new AffineTransform();
+		m_MatrizTransf.setToIdentity();
+		this.initComponents();
+	}
+
+	/**
+	 * Rellena el ProjectMap del Layout.
+	 *
+	 * @param m ProjectMap.
+	 */
+	public void setProjectMap(ProjectMap m) {
+		map = m;
+	}
+
+	/**
+	 * Devuelve el rect�ngulo de selecci�n por rect�ngulo.
+	 *
+	 * @return Rect�ngulo de selecci�n.
+	 */
+	public Rectangle getReSel() {
+		return reSel;
+	}
+
+	/**
+	 * Devuelve true si se debe dibujar el rect�ngulo de selecci�n y realizar
+	 * la sellecci�n.
+	 *
+	 * @return true si se realiza la selecci�n por rect�ngulo.
+	 */
+	public boolean isReSel() {
+		return isReSel;
+	}
+
+	/**
+	 * Rellena con true si se debe de dibujar y seleccionar por rect�ngulo de
+	 * selecci�n.
+	 *
+	 * @param b boolean.
+	 */
+	public void setIsReSel(boolean b) {
+		isReSel = b;
+	}
+
+	/**
+	 * Devuelve true si el dibujado ha sido cancelado.
+	 *
+	 * @return true si el dibujado ha sido cancelado.
+	 */
+	public synchronized boolean isDrawingCancelled() {
+		return m_bCancelDrawing;
+	}
+
+	/**
+	 * Pone el dibuja a cancelado o no seg�n se quiera.
+	 *
+	 * @param b true si se quiere cancelar el dibujado.
+	 */
+	public synchronized void setCancelDrawing(boolean b) {
+		m_bCancelDrawing = b;
+
+		for (int i = 0; i < getFFrames().size(); i++) {
+			IFFrame fframe = (IFFrame) getFFrames().get(i);
+
+			if (fframe instanceof FFrameView &&
+					(((FFrameView) fframe).getFMap() != null)) {
+				////TODO((FFrameView) getFFrames().get(i)).getFMap().setCancelDrawing(b);
+			}
+		}
+	}
+
+	/**
+	 * Obtiene el ArrayList con todos los FFrames que se han a�adido al Layout.
+	 *
+	 * @return Array con todos los fframes que contiene el Layout.
+	 */
+	public ArrayList getFFrames() {
+		return m_fframes;
+	}
+
+	/**
+	 * Obtiene el rect que se ajusta al tama�o de la ventana, para ver el folio
+	 * entero.
+	 */
+	public void fullRect() {
+		rect.setRect(origin.x, origin.y, getWidth() - (origin.x * 2),
+			getHeight() - (origin.x * 2));
+
+		if (m_attributes.isLandSpace()) {
+			rect = m_attributes.getRectangleLandscape(rect, getWidth(),
+					getHeight());
+		} else {
+			rect = m_attributes.getRectanglePortrait(rect, getWidth(),
+					getHeight());
+		}
+
+		status = DESACTUALIZADO;
+		repaint();
+	}
+
+	/**
+	 * M�todo para imprimir el Layout sin modificar la matriz de
+	 * transformaci�n.
+	 *
+	 * @param g2
+	 */
+	public void drawLayoutPrint(Graphics2D g2) {
+		setCancelDrawing(false);
+
+		setCursor(Cursor.getDefaultCursor());
+
+		double scale = 0;
+
+		///if (rect.width > rect.height) {
+		///    scale = rect.width / m_attributes.m_sizePaper.getAlto() * 1;
+		///} else {
+		scale = rect.height / m_attributes.m_sizePaper.getAlto() * 1;
+
+		///}
+		AffineTransform escalado = new AffineTransform();
+		AffineTransform translacion = new AffineTransform();
+		translacion.setToTranslation(rect.getMinX(), rect.getMinY());
+		escalado.setToScale(scale, scale);
+		m_MatrizTransf.setToIdentity();
+		m_MatrizTransf.concatenate(translacion);
+		m_MatrizTransf.concatenate(escalado);
+		m_attributes.setDistanceUnitX(rect);
+		m_attributes.setDistanceUnitY(rect);
+
+		for (int i = 0; i < getFFrames().size(); i++) {
+			try {
+				((IFFrame) getFFrames().get(i)).print(g2, getAT());
+			} catch (DriverException e) {
+				NotificationManager.addError(e.getMessage(), e);
+			}
+		}
+
+		setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+	}
+
+	/**
+	 * Clip sobre el rect�ngulo visible.
+	 *
+	 * @param g2d Graphics sobre el que hacer el clip.
+	 */
+	private void clipVisibleRect(Graphics2D g2d) {
+		rectVisible = this.getVisibleRect();
+		g2d.clipRect((int) rectVisible.getMinX(), (int) rectVisible.getMinY(),
+			(int) rectVisible.getWidth(), (int) rectVisible.getHeight());
+	}
+
+	/**
+	 * Inicializa los componentes.
+	 */
+	private void initComponents() {
+		m_attributes = new Attributes();
+		m_attributes.setDistanceUnitX(rect);
+		m_attributes.setDistanceUnitY(rect);
+		actionDelFFrame();
+	}
+
+	/**
+	 * Crea un ActionEvent para controlar las teclas que se pulsen cuando este
+	 * el Layout Focusable a true.
+	 */
+	private void actionDelFFrame() {
+		Action doNothing = new AbstractAction() {
+				public void actionPerformed(ActionEvent e) {
+					for (int i = getFFrames().size() - 1; i >= 0; i--) {
+						IFFrame fframe = (IFFrame) getFFrames().get(i);
+
+						if (fframe.getSelected() != FFrame.NOSELECT) {
+							getFFrames().remove(i);
+						}
+					}
+
+					refresh();
+				}
+			};
+
+		this.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
+			"doNothing");
+		this.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0),
+			"doNothing");
+		this.getActionMap().put("doNothing", doNothing);
+	}
+
+	/**
+	 * paintComponent del Layout.
+	 *
+	 * @param g Graphics del Layout.
+	 */
+	protected void paintComponent(Graphics g) {
+		super.paintComponent(g);
+		
+		clipVisibleRect((Graphics2D) g);
+		Rectangle rClip = g.getClipBounds();
+		if (rClip == null) System.err.println("clip = null");
+		switch (status) {
+			case ZOOM_MAS:
+				logger.debug("zoom mas");
+				layoutPaint.drawRectangle((Graphics2D) g);
+
+				g.drawImage(img, 0, 0, this);
+				
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);				
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+				g.setColor(Color.black);
+				g.setXORMode(Color.white);
+
+				Rectangle r = new Rectangle();
+
+				r.setFrameFromDiagonal(m_FirstPoint, m_LastPoint);
+				g.drawRect(r.x, r.y, r.width, r.height);
+
+				break;
+
+			case RECTANGLE:
+				logger.debug("rectangle");
+				layoutPaint.drawRectangle((Graphics2D) g);
+
+				g.drawImage(img, 0, 0, this);
+
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);				
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+				g.setColor(Color.black);
+				g.setXORMode(Color.white);
+
+				Rectangle re = new Rectangle();
+				re.setFrameFromDiagonal(m_FirstPoint, m_LastPoint);
+
+				if (isCuadricula()) {
+					FLayoutUtilities.setRectGrid(re,
+						m_attributes.getUnitInPixelsX(),
+						m_attributes.getUnitInPixelsY(), m_MatrizTransf);
+				}
+
+				g.drawRect(re.x, re.y, re.width, re.height);
+
+				break;
+
+			case PAN:
+				logger.debug("pan");
+
+				//g.setXORMode(Color.black);
+				rect.x = rectOrigin.x + (m_LastPoint.x - m_PointAnt.x);
+				rect.y = rectOrigin.y + (m_LastPoint.y - m_PointAnt.y);
+
+				//g.clearRect(0, 0, getWidth(), getHeight());
+				layoutPaint.drawRectangle((Graphics2D) g);
+
+				if (img != null) {
+					g.drawImage(img, (getLastPoint().x - getPointAnt().x),
+						(m_LastPoint.y - m_PointAnt.y), this);
+				}
+
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+
+				break;
+
+			case VIEW_PAN:
+
+				// logger.debug("View pan");
+				layoutPaint.drawRectangle((Graphics2D) g);
+
+				for (int i = 0; i < getFFrames().size(); i++) {
+					if (getFFrames().get(i) instanceof FFrameView) {
+						FFrameView fframe = (FFrameView) getFFrames().get(i);
+
+						if (fframe.getSelected() != FFrame.NOSELECT) {
+							Rectangle2D.Double rec = fframe.getBoundingBox(getAT());
+
+							if (img != null) {
+								//g.drawImage(img, 0, 0, this);
+								rec = (Rectangle2D.Double) rec.createIntersection(getVisibleRect());
+
+								//((Graphics2D)g).clearRect((int)rec.x,(int)rec.y,(int)rec.width,(int)rec.height);
+							}
+
+							if (fframe.getBufferedImage() != null) {
+								layoutPaint.drawHandlers((Graphics2D) g,
+									Color.black);
+								g.clipRect((int) rec.x, (int) rec.y,
+									(int) rec.width, (int) rec.height);
+
+								//g.setColor(Color.gray);
+								//g.fillRect(0,0,getWidth(),getHeight());
+								layoutPaint.drawRectangle((Graphics2D) g);
+								layoutPaint.drawRuler((Graphics2D) g,
+									Color.black);
+
+								g.drawImage(fframe.getBufferedImage(),
+									m_LastPoint.x - m_PointAnt.x,
+									m_LastPoint.y - m_PointAnt.y, this);
+								/*System.out.println(
+									"m_LastPoint.x - m_PointAnt.x" +
+									(m_LastPoint.x - m_PointAnt.x));
+								System.out.println(
+									"m_LastPoint.y - m_PointAnt.y" +
+									(m_LastPoint.y - m_PointAnt.y));
+							*/
+							}
+						}
+					}
+				}
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+				//g.setXORMode(Color.black);
+				break;
+
+			case SELECT:
+				logger.debug("select");
+				layoutPaint.drawRectangle((Graphics2D) g);
+
+				g.drawImage(img, 0, 0, this);
+
+				if (isReSel) {
+					reSel = new Rectangle();
+					reSel.setFrameFromDiagonal(m_FirstPoint, m_LastPoint);
+					g.drawRect(reSel.x, reSel.y, reSel.width, reSel.height);
+				}
+
+				for (int i = 0; i < getFFrames().size(); i++) {
+					IFFrame fframe = (IFFrame) getFFrames().get(i);
+
+					if (fframe.getSelected() != FFrame.NOSELECT) {
+						g.setColor(Color.black);
+						fframe.drawHandlers((Graphics2D) g);
+
+						int difx = (m_LastPoint.x - m_FirstPoint.x);
+						int dify = (m_LastPoint.y - m_FirstPoint.y);
+
+						if ((Math.abs(difx) > 3) || (Math.abs(dify) > 3)) {
+							Rectangle2D rectangle = fframe.getMovieRect(difx,
+									dify);
+
+							if (rectangle != null) {
+								if (isCuadricula) {
+									FLayoutUtilities.setRectGrid(rectangle,
+										m_attributes.getUnitInPixelsX(),
+										m_attributes.getUnitInPixelsY(),
+										m_MatrizTransf);
+								}
+
+								g.drawRect((int) rectangle.getMinX(),
+									(int) rectangle.getMinY(),
+									(int) rectangle.getWidth(),
+									(int) rectangle.getHeight());
+							}
+						}
+					}
+				}
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+
+				break;
+
+			case GRAPHICS:
+				layoutPaint.drawRectangle((Graphics2D) g);
+				g.drawImage(img, 0, 0, this);
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);				
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+
+				break;
+
+			case DESACTUALIZADO:
+				logger.debug("desactualizado");
+				img = new BufferedImage(getWidth(), getHeight(),
+						BufferedImage.TYPE_INT_ARGB);
+
+				Graphics gimag = img.getGraphics();
+				clipVisibleRect((Graphics2D) gimag);
+
+				if (initial) {
+					fullRect();
+					initial = false;
+				}
+				try {
+					layoutPaint.drawLayout((Graphics2D) gimag, img);
+				} catch (DriverException e) {
+					e.printStackTrace();
+				}
+				
+				g.setClip(rClip);
+				layoutPaint.drawRectangle((Graphics2D) g);
+
+				g.drawImage(img, 0, 0, this);
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);				
+				layoutPaint.drawHandlers((Graphics2D) g, Color.black);
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+
+				break;
+
+			case ACTUALIZADO:
+				layoutPaint.drawRectangle((Graphics2D) g);
+
+				g.drawImage(img, 0, 0, this);
+
+				g.setClip(rClip);
+				layoutPaint.drawGrid((Graphics2D) g);
+				
+				layoutPaint.drawHandlers((Graphics2D) g, Color.black);
+				layoutPaint.drawRuler((Graphics2D) g, Color.black);
+				
+		}
+
+	}
+
+	/**
+	 * A�ade un fframe al Arraylist m_fframes.
+	 *
+	 * @param frame fframe a a�adir.
+	 * @param clearSelection para que se quede seleccionado �nicamente  el que
+	 * 		  a�adimos y false si lo que se pretende es que no se
+	 * 		  deseleccionen lo que ya est�n seleccionados.
+	 */
+	public void addFFrame(IFFrame frame, boolean clearSelection) {
+		if (clearSelection) {
+			for (int i = getFFrames().size() - 1; i >= 0; i--) {
+				IFFrame fframe1 = (IFFrame) getFFrames().get(i);
+				fframe1.setSelected(false);
+			}
+		}
+
+		if (frame instanceof FFrameView &&
+				(((FFrameView) frame).getFMap() != null)) {
+			((FFrameView) frame).getFMap().getViewPort().addViewPortListener(this);
+		}
+
+		if (nums.containsKey(frame.getClass())) {
+			nums.put(frame.getClass(),
+				new Integer(Integer.parseInt(nums.get(frame.getClass())
+												 .toString()) + 1));
+		} else {
+			nums.put(frame.getClass(), new Integer(0));
+		}
+
+		frame.setNum(Integer.parseInt(nums.get(frame.getClass()).toString()));
+		getFFrames().add(frame);
+		frame.setSelected(true);
+	}
+
+	/**
+	 * Abre el di�logo de propiedades del folio, pasando como par�metro el
+	 * PrinterJob.
+	 *
+	 * @param job
+	 */
+	public void showPagePropertiesWindow(PrinterJob job) {
+		PageFormat pf1; //=new PageFormat();
+
+		pf1 = m_attributes.getPageFormat();
+		pf1 = job.pageDialog(pf1);
+		m_attributes.setPageFormat(pf1);
+		refresh();
+	}
+
+	/**
+	 * Refresca el Layout.
+	 */
+	public void refresh() {
+		rect = m_attributes.obtainRect(false, rect, getWidth(), getHeight());
+		status = DESACTUALIZADO;
+		repaint();
+	}
+
+	/**
+	 * Obtiene el rect�ngulo que representa el folio con las caracter�sticas
+	 * que contiene attributes y diferenciando si es para visualizar en
+	 * pantalla o para imprimir.
+	 *
+	 * @param isPrint si es para imprimir.
+	 */
+	public void obtainRect(boolean isPrint) {
+		m_attributes.obtainRect(isPrint, rect, getWidth(), getHeight());
+	}
+
+	/**
+	 * Muestra el di�logo de configuraci�n del Layout.
+	 */
+	public void showFConfig() {
+		FConfigLayoutDialog m_configLayout = new FConfigLayoutDialog(this);
+		PluginServices.getMDIManager().addView(m_configLayout);
+	}
+
+	/**
+	 * Mestra el di�logo de propiedades del Layout.
+	 */
+	public void showFProperties() {
+		if (map == null) {
+			map = new ProjectMap();
+			map.setModel(this);
+			map.setName(getName());
+		}
+
+		m_propertiesLayout = new MapProperties(map);
+		PluginServices.getMDIManager().addView(m_propertiesLayout);
+	}
+
+	/**
+	 * Muestra el di�logo de imprimir pasandole el printerJob como par�metro.
+	 *
+	 * @param job
+	 */
+	public void showPrintDialog(PrinterJob job) {
+		if (job != null) {
+			job.printDialog();
+
+			try {
+				job.setPrintable((Printable) PluginServices.getExtension(
+						com.iver.cit.gvsig.Print.class));
+				job.print();
+			} catch (PrinterException e) {
+				e.printStackTrace();
+			}
+		} else {
+			boolean print = false;
+
+			//Actualizar attributes
+			att = m_attributes.toPrintAttributes();
+
+			//------------------ The Printing things --------------------- //
+			DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
+
+			// returns the set of printers that support printing a specific document type (such as GIF)
+			// with a specific set of attributes (such as two sided).
+			// PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
+			// interestingly, the printer dialog's default behavior has changed with the new API: by default the dialog is not shown.
+			// So we must use the ServiceUI class to create a print dialog
+			// returns the default print service.
+			if (m_cachePrintServices == null) {
+				m_cachePrintServices = PrintServiceLookup.lookupPrintServices(flavor,
+						null);
+			}
+
+			PrintService defaultService = null;
+
+			if (m_cachePrintService == null) {
+				defaultService = PrintServiceLookup.lookupDefaultPrintService();
+			}
+
+			if (m_cachePrintService == null) {
+				m_cachePrintService = ServiceUI.printDialog(null, 200, 200,
+						m_cachePrintServices, defaultService, flavor, att);
+
+				// m_cachePrintRequestAtributeSet = new HashPrintRequestAttributeSet();
+				// m_cachePrintRequestAtributeSet.addAll(pras);
+			} else {
+				m_cachePrintService = ServiceUI.printDialog(null, 200, 200,
+						m_cachePrintServices, m_cachePrintService, flavor, att);
+			}
+
+			if (m_cachePrintService != null) {
+				DocPrintJob jobNuevo = m_cachePrintService.createPrintJob();
+				PrintJobListener pjlistener = new PrintJobAdapter() {
+						public void printDataTransferCompleted(PrintJobEvent e) {
+							System.out.println("Fin de impresi�n");
+						}
+					};
+
+				jobNuevo.addPrintJobListener(pjlistener);
+
+				// DocAttributeSet das = new HashDocAttributeSet();
+				doc = new SimpleDoc((Printable) PluginServices.getExtension(
+							com.iver.cit.gvsig.Print.class), flavor, null);
+
+				try {
+					jobNuevo.print(doc, att);
+
+					// m_attributes.
+				} catch (PrintException pe) {
+					pe.printStackTrace();
+				}
+			}
+		}
+
+		/* try {
+		   print = job.printDialog(att);
+		   } catch (Exception e) {
+		       logger.error("Abriendo el Di�logo de imprimir"); //System.out.println("Excepci�n "+e);
+		   }
+		   if (print) {
+		       job.setPrintable((Printable) App.instance.getPc().getExtension(com.iver.cit.gvsig.Print.class));
+		       try {
+		           job.print(att);
+		       } catch (Exception ex) {
+		           ex.printStackTrace();
+		       }
+		   } */
+		fullRect();
+	}
+
+	/**
+	 * Sustituye el puntero del rat�n por la imagen que se le pasa como
+	 * par�metro.
+	 *
+	 * @param image
+	 */
+	public void setMapCursor(Image image) {
+		Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(image,
+				new Point(16, 16), "");
+		setCursor(cur);
+	}
+
+	/**
+	 * Cambia el puntero del raton al cusor que se le introduce como par�metro.
+	 *
+	 * @param cursor cursor a mostrar en el puntero del rat�n.
+	 */
+	public void setMapCursor(Cursor cursor) {
+		setCursor(cursor);
+	}
+
+	/**
+	 * Pone como seleccionada a la herramienta a partir de su n�mero.
+	 *
+	 * @param i
+	 */
+	public void setTool(int i) {
+		tool = i;
+
+		if (getTool() == PAN) {
+			setMapCursor(ipan);
+		} else if (getTool() == ZOOM_MAS) {
+			setMapCursor(izoomin);
+		} else if (getTool() == ZOOM_MENOS) {
+			setMapCursor(izoomout);
+		} else if (getTool() == RECTANGLEVIEW) {
+			setMapCursor(icrux);
+		} else if (getTool() == RECTANGLEPICTURE) {
+			setMapCursor(icrux);
+		} else if (getTool() == RECTANGLESCALEBAR) {
+			setMapCursor(icrux);
+		} else if (getTool() == RECTANGLELEGEND) {
+			setMapCursor(icrux);
+		} else if (getTool() == RECTANGLETEXT) {
+			setMapCursor(icrux);
+		} else if (getTool() == SELECT) {
+			setCursor(Cursor.getDefaultCursor());
+		} else if (getTool() == SET_TAG) {
+			setMapCursor(itag);
+		} else if (getTool() == POINT) {
+			setMapCursor(iPoint);
+		} else if (getTool() == LINE) {
+			setMapCursor(iRect);
+		} else if (getTool() == RECTANGLESIMPLE) {
+			setMapCursor(iRectangle);
+		} else if (getTool() == POLYLINE) {
+			setMapCursor(iLine);
+		} else if (getTool() == POLYGON) {
+			setMapCursor(iPoligon);
+		} else if (getTool() == CIRCLE) {
+			setMapCursor(iCircle);
+		}
+	}
+
+	/**
+	 * Se crean aqu� los dialogos cada vez que se necesitan.
+	 *
+	 * @param fframe Rectangle que representa el lugar que ocupara el elemento
+	 * 		  a�adido.
+	 *
+	 * @return true si se debe de a�adir el fframe.
+	 */
+	public boolean openFFrameDialog(IFFrame fframe) {
+		switch (tool) {
+			case RECTANGLEVIEW:
+				fframedialog = new FFrameViewDialog(this, (FFrameView) fframe);
+
+				break;
+
+			case RECTANGLEPICTURE:
+				fframedialog = new FFramePictureDialog(this,
+						(FFramePicture) fframe);
+
+				break;
+
+			case RECTANGLESCALEBAR:
+				fframedialog = new FFrameScaleBarDialog(this,
+						(FFrameScaleBar) fframe);
+
+				break;
+
+			case RECTANGLELEGEND:
+				fframedialog = new FFrameLegendDialog(this,
+						(FFrameLegend) fframe);
+
+				break;
+
+			case RECTANGLETEXT:
+				fframedialog = new FFrameTextDialog(this, (FFrameText) fframe);
+
+				break;
+
+			case GRAPHICS:
+				fframedialog = new FFrameGraphicsDialog(this,
+						(FFrameGraphics) fframe);
+
+				break;
+
+			default:
+				return true;
+		}
+
+		if (fframedialog != null) {
+			fframedialog.setRectangle(fframe.getBoundingBox(m_MatrizTransf));
+			PluginServices.getMDIManager().addView(fframedialog);
+		}
+
+		return fframedialog.getIsAcepted();
+	}
+
+	/**
+	 * Devuelve el Rectangle2D que representa en pixels al folio.
+	 *
+	 * @return Rectangle2D.Double
+	 */
+	public Rectangle2D.Double getRect() {
+		return rect;
+	}
+
+	/**
+	 * Obtiene un entero que representa la herramienta seleccionada.
+	 *
+	 * @return entero.
+	 */
+	public int getTool() {
+		return tool;
+	}
+
+	/**
+	 * Devuelve la Matriz transformada que se esta plicando al Layout.
+	 *
+	 * @return AffineTransform
+	 */
+	public AffineTransform getAT() {
+		return m_MatrizTransf;
+	}
+
+	/**
+	 * Devuelve los atributos del Mapa.
+	 *
+	 * @return Attributes.
+	 */
+	public Attributes getAtributes() {
+		return m_attributes;
+	}
+
+	/**
+	 * Pone el estado que se quiera.
+	 *
+	 * @param s estado.
+	 */
+	public void setStatus(int s) {
+		status = s;
+	}
+
+	/**
+	 * Devuelve el punto que representa la esquina noroeste del mapa.
+	 *
+	 * @return un punto.
+	 */
+	public Point getRectOrigin() {
+		return rectOrigin;
+	}
+
+	/**
+	 * Devuelve el punto del primer click de rat�n.
+	 *
+	 * @return un punto.
+	 */
+	public Point getFirstPoint() {
+		return m_FirstPoint;
+	}
+
+	/**
+	 * Devuelve el punto de click de rat�n anterior.
+	 *
+	 * @return un punto.
+	 */
+	public Point getPointAnt() {
+		return m_PointAnt;
+	}
+
+	/**
+	 * Devuelve el punto donde se solt� el bot�n del rat�n.
+	 *
+	 * @return un punto.
+	 */
+	public Point getLastPoint() {
+		return m_LastPoint;
+	}
+
+	/**
+	 * Rellena el primer punto de click de rat�n.
+	 *
+	 * @param p punto.
+	 */
+	public void setFirstPoint(Point p) {
+		m_FirstPoint = p;
+	}
+
+	/**
+	 * Rellena el punto de click de rat�n anterior.
+	 *
+	 * @param p punto.
+	 */
+	public void setPointAnt(Point p) {
+		m_PointAnt = p;
+	}
+
+	/**
+	 * Rellena el punto donde se solto el bot�n del rat�n.
+	 *
+	 * @param p punto.
+	 */
+	public void setLastPoint(Point p) {
+		m_LastPoint = p;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo m_viewinfo = new ViewInfo(ViewInfo.ICONIFIABLE |
+				ViewInfo.MAXIMIZABLE | ViewInfo.RESIZABLE);
+
+		m_viewinfo.setWidth(500);
+		m_viewinfo.setHeight(400);
+
+		m_viewinfo.setTitle(PluginServices.getText(this, "Mapa") + " : " +
+			getName());
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * Inserta si se muestra o no la regla del Layout.
+	 *
+	 * @param b True si se muestra la regla.
+	 */
+	public void setRuler(boolean b) {
+		m_showRuler = b;
+	}
+
+	/**
+	 * Devuelve si se muestra la regla del Layout.
+	 *
+	 * @return True si se muestra la regla.
+	 */
+	public boolean getRuler() {
+		return m_showRuler;
+	}
+
+	/**
+	 * Devuelve si se esta aplicando en los fframes que se a�den al Layout la
+	 * cuadr�cula, o no.
+	 *
+	 * @return true si se esta aplicando la cuadr�cula.
+	 */
+	public boolean isCuadricula() {
+		return isCuadricula;
+	}
+
+	/**
+	 * Se actualiza el estado de la cuadr�cula, si se aplica o no.
+	 *
+	 * @param b true si se aplica la cuadr�cula.
+	 */
+	public void setIsCuadricula(boolean b) {
+		isCuadricula = b;
+	}
+
+	/**
+	 * Realiza una exteni�n completa de las capas que contiene la vista del
+	 * FFrameView.
+	 *
+	 * @throws DriverException
+	 */
+	public void viewFull() throws DriverException {
+		for (int i = 0; i < getFFrames().size(); i++) {
+			if (getFFrames().get(i) instanceof FFrameView) {
+				FFrameView fframe = (FFrameView) getFFrames().get(i);
+
+				if (fframe.getSelected() != FFrame.NOSELECT) {
+					fframe.getFMap().getViewPort().setExtent(fframe.getFMap()
+																   .getFullExtent());
+				}
+			}
+		}
+
+		setStatus(DESACTUALIZADO);
+		repaint();
+	}
+
+	/**
+	 * Devuelve un Objeto XMLEntity con la informaci�n los atributos necesarios
+	 * para poder despu�s volver a crear el objeto original.
+	 *
+	 * @return XMLEntity.
+	 */
+	public XMLEntity getXMLEntity() {
+		XMLEntity xml = new XMLEntity();
+		xml.putProperty("className",this.getClass().getName());
+		xml.setName("layout");
+		xml.putProperty("isCuadricula", isCuadricula());
+		xml.putProperty("m_name", this.getName());
+		xml.addChild(getAtributes().getXMLEntity());
+
+		for (int i = 0; i < getFFrames().size(); i++) {
+			xml.addChild(((IFFrame) getFFrames().get(i)).getXMLEntity());
+		}
+
+		return xml;
+	}
+
+	/**
+	 * Crea un Objeto de esta clase a partir de la informaci�n del XMLEntity.
+	 *
+	 * @param xml XMLEntity
+	 * @param p Proyecto.
+	 *
+	 * @return Objeto de esta clase.
+	 */
+	public static Layout createLayout(XMLEntity xml, Project p) {
+		Layout layout = new Layout();
+		layout.isCuadricula = xml.getBooleanProperty("isCuadricula");
+		layout.setName(xml.getStringProperty("m_name"));
+		layout.m_attributes = Attributes.createAtributes(xml.getChild(0));
+
+		for (int i = 1; i < xml.getNumChild(); i++) {
+			if (xml.getChild(i).getStringProperty("className").equals("com.iver.cit.gvsig.gui.layout.fframe.FFrameView")) {
+				layout.addFFrame(FFrame.createFFrame(xml.getChild(i), layout, p),
+					true);
+			}
+		}
+
+		for (int i = 1; i < xml.getNumChild(); i++) {
+			if (!xml.getChild(i).getStringProperty("className").equals("com.iver.cit.gvsig.gui.layout.fframe.FFrameView")) {
+				layout.addFFrame(FFrame.createFFrame(xml.getChild(i), layout, p),
+					true);
+			}
+		}
+
+		return layout;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+		PluginServices.getMainFrame().getStatusBar().setMessage("1",
+			getAtributes().getNameUnit());
+
+		///System.out.println("---------- 1 "+ getAtributes().getNameUnit());
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.IMapExtentListener#extentChanged(java.awt.geom.Rectangle2D)
+	 */
+	public void extentChanged(Rectangle2D newExtent) {
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.SingletonView#getViewModel()
+	 */
+	public Object getViewModel() {
+		return map;
+	}
+
+	/**
+	 * Devuelve si se dibuja el Grid en el Layout o no.
+	 *
+	 * @return True si se dibuja el Grid en el Layout.
+	 */
+	public boolean getIsDrawGrid() {
+		return isDrawCuadricula;
+	}
+
+	/**
+	 * Inserta si se muestra el Grid del Layout.
+	 *
+	 * @param b True si se muestra el Grid del Layout.
+	 */
+	public void setIsDrawGrid(boolean b) {
+		isDrawCuadricula = b;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.ExtentListener#extentChanged(com.iver.cit.gvsig.fmap.ExtentEvent)
+	 */
+	public void extentChanged(ExtentEvent e) {
+	}
+
+	/**
+	 * @see com.iver.andami.ui.mdiManager.ViewListener#viewClosed()
+	 */
+	public void viewClosed() {
+		///PluginServices.getMainFrame().getStatusBar().setMessage("1","");
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.ViewPortListener#backColorChanged(com.iver.cit.gvsig.fmap.ColorEvent)
+	 */
+	public void backColorChanged(ColorEvent e) {
+	}
+	public IFFrame[] getFFrameSelected(){
+		ArrayList selecList=new ArrayList();
+		for (int i = getFFrames().size() - 1; i >= 0; i--) {
+			IFFrame fframe = (IFFrame) getFFrames().get(i);
+
+			if (fframe.getSelected() != FFrame.NOSELECT) {
+				selecList.add(fframe);
+			}
+		}
+		return (IFFrame[])selecList.toArray(new IFFrame[0]);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Layout.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutUtilities.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutUtilities.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutUtilities.java	(revision 1648)
@@ -0,0 +1,288 @@
+/*
+ * Created on 16-jul-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.gui.layout;
+
+import com.iver.cit.gvsig.fmap.FMap;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import java.util.ArrayList;
+
+
+/**
+ * Clase que recoge m�todos est�ticos sobre el Layout.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class FLayoutUtilities {
+	/**
+	 * Devuelve true si las dos ArrayList que se le pasan como parametro son
+	 * iguales.
+	 *
+	 * @param n lista anterior
+	 * @param l lista actual
+	 *
+	 * @return true si los ArrayList son iguales.
+	 */
+	public static boolean isEqualList(ArrayList n, ArrayList l) {
+		if (n.size() != l.size()) {
+			return false;
+		}
+
+		for (int i = 0; i < n.size(); i++) {
+			if (l.get(i) != n.get(i)) {
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * Pasa una distancia en pixels a unidades del folio.
+	 *
+	 * @param d distancia en pixels.
+	 * @param at Matriz de transformaci�n.
+	 *
+	 * @return distancia en unidades de folio.
+	 */
+	public static double toSheetDistance(double d, AffineTransform at) {
+		double dist = d / at.getScaleX(); // pProv.x;
+
+		return dist;
+	}
+
+	/**
+	 * Pasa una distancia de coordenadas del folio a pixels.
+	 *
+	 * @param d distancia en coordenadas de folio.
+	 * @param at Matriz de transformaci�n.
+	 *
+	 * @return double en pixels.
+	 */
+	public static double fromSheetDistance(double d, AffineTransform at) {
+		Point2D.Double pSheet1 = new Point2D.Double(0, 0);
+		Point2D.Double pSheet2 = new Point2D.Double(1, 0);
+		Point2D.Double pScreen1 = new Point2D.Double();
+		Point2D.Double pScreen2 = new Point2D.Double();
+
+		try {
+			at.transform(pSheet1, pScreen1);
+			at.transform(pSheet2, pScreen2);
+		} catch (Exception e) {
+			System.err.print(e.getMessage());
+		}
+
+		return pScreen1.distance(pScreen2) * d;
+	}
+
+	/**
+	 * Pasa un punto en pixels a coordenadas del folio.
+	 *
+	 * @param pScreen pixels.
+	 * @param at Matriz de transformaci�n.
+	 *
+	 * @return Point2D en coordenadas de folio.
+	 */
+	public static Point2D.Double toSheetPoint(Point2D.Double pScreen,
+		AffineTransform at) {
+		Point2D.Double pWorld = new Point2D.Double();
+		AffineTransform at1;
+
+		try {
+			at1 = at.createInverse();
+			at1.transform(pScreen, pWorld);
+		} catch (NoninvertibleTransformException e) {
+		}
+
+		return pWorld;
+	}
+
+	/**
+	 * Pasa un ret�ngulo de pixels a coordenadas del folio.
+	 *
+	 * @param r rect�ngulo en coordenadas de pixels a coordenadas de folio.
+	 * @param at Matriz de transformaci�n.
+	 *
+	 * @return Rectangle2D en coordenadas de folio.
+	 */
+	public static Rectangle2D.Double toSheetRect(Rectangle2D r,
+		AffineTransform at) {
+		Point2D.Double pSheet = toSheetPoint(new Point2D.Double(r.getX(),
+					r.getY()), at);
+		Point2D.Double pSheetX = toSheetPoint(new Point2D.Double(r.getMaxX(),
+					r.getMinY()), at);
+		Point2D.Double pSheetY = toSheetPoint(new Point2D.Double(r.getMinX(),
+					r.getMaxY()), at);
+		Rectangle2D.Double res = new Rectangle2D.Double();
+		res.setRect(pSheet.getX(), pSheet.getY(), pSheet.distance(pSheetX),
+			pSheet.distance(pSheetY));
+
+		return res;
+	}
+
+	/**
+	 * Pasa de un punto en coordenadas del folio a pixels.
+	 *
+	 * @param pSheet punto en coordenadas de folio.
+	 * @param at Matriz de transformaci�n.
+	 *
+	 * @return Point2D en pixels.
+	 */
+	public static Point2D.Double fromSheetPoint(Point2D.Double pSheet,
+		AffineTransform at) {
+		Point2D.Double pScreen = new Point2D.Double();
+
+		try {
+			at.transform(pSheet, pScreen);
+		} catch (Exception e) {
+			System.err.print(e.getMessage());
+		}
+
+		return pScreen;
+	}
+
+	/**
+	 * Pasa un rect�ngulo en coordenadas del folio a pixels.
+	 *
+	 * @param r rect�ngulo en coordenadas de folio.
+	 * @param at Matriz de transformaci�n.
+	 *
+	 * @return Rectangle2D en pixels.
+	 */
+	public static Rectangle2D.Double fromSheetRect(Rectangle2D.Double r,
+		AffineTransform at) {
+		Point2D.Double pSheet = new Point2D.Double(r.getX(), r.getY());
+		Point2D.Double pSX = new Point2D.Double(r.getMaxX(), r.getMinY());
+		Point2D.Double pSY = new Point2D.Double(r.getMinX(), r.getMaxY());
+		Point2D.Double pScreen = new Point2D.Double();
+		Point2D.Double pScreenX = new Point2D.Double();
+		Point2D.Double pScreenY = new Point2D.Double();
+
+		try {
+			at.transform(pSheet, pScreen);
+			at.transform(pSX, pScreenX);
+			at.transform(pSY, pScreenY);
+		} catch (Exception e) {
+			System.err.print(e.getMessage());
+		}
+
+		Rectangle2D.Double res = new Rectangle2D.Double();
+		res.setRect(pScreen.getX(), pScreen.getY(), pScreen.distance(pScreenX),
+			pScreen.distance(pScreenY));
+
+		return res;
+	}
+
+	/**
+	 * Obtiene el rect�ngulo ajustado al grid del layout.
+	 *
+	 * @param re Rect�ngulo a ajustar.
+	 * @param distX Distancia m�nima en pixels de X.
+	 * @param distY Distancia m�nima en pixels de Y.
+	 * @param at Matriz de transformaci�n.
+	 */
+	public static void setRectGrid(Rectangle2D re, double distX, double distY,
+		AffineTransform at) {
+		Point2D.Double auxp = FLayoutUtilities.fromSheetPoint(new Point2D.Double(
+					0, 0), at);
+		double x = ((re.getMinX() - distX) % distX) - ((auxp.x) % distX);
+		double y = ((re.getMinY() - distY) % distY) - ((auxp.y) % distY);
+		double w = (((re.getWidth() + (distX / 2)) % distX));
+		double h = (((re.getHeight() + (distY / 2)) % distY));
+		re.setRect(re.getMinX() - (x), re.getMinY() - (y),
+			(re.getWidth() + (distX / 2)) - (w),
+			(re.getHeight() + (distY / 2)) - (h));
+	}
+
+	/**
+	 * Cuando se dibuja sobre el graphics todo se tiene que situar en enteros y
+	 * aqu� lo que se comprueba es que si los valores que contiene el
+	 * Rectangle2D, que toma como par�metro, supera los valores soportados por
+	 * un entero.
+	 *
+	 * @param r Rectangle2D a comprobar si los valores que contiene no superan
+	 * 		  a los que puede tener un entero.
+	 *
+	 * @return true si no se han superado los l�mites.
+	 */
+	public static boolean isPosible(Rectangle2D.Double r) {
+		if ((r.getMaxX() > Integer.MAX_VALUE) ||
+				(r.getMaxY() > Integer.MAX_VALUE) ||
+				(r.getMinX() < Integer.MIN_VALUE) ||
+				(r.getMinY() < Integer.MIN_VALUE) ||
+				(r.getWidth() > Integer.MAX_VALUE) ||
+				(r.getHeight() > Integer.MAX_VALUE)) {
+			return false;
+		}
+
+		return true;
+	}
+
+	/**
+	 * Devuelve un long representando a la escala en funci�n  de que unidad de
+	 * medida se pase como par�metro.
+	 *
+	 * @param map FMap
+	 * @param h Rect�ngulo.
+	 *
+	 * @return escala.
+	 */
+	public static long getScaleView(FMap map, double h) {
+		if (map == null) {
+			return 0;
+		}
+
+		long scaleView = 1;
+		double hextent = map.getViewPort().getExtent().getHeight();
+		double hview = h;
+		scaleView = (long) (Attributes.CHANGE[map.getViewPort().getMapUnits()] * (hextent / hview));
+
+		return scaleView;
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutUtilities.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelExtentSelector.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelExtentSelector.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelExtentSelector.java	(revision 1648)
@@ -0,0 +1,307 @@
+/* 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.gui;
+
+import java.util.ArrayList;
+
+import javax.swing.JPanel;
+import javax.swing.ListModel;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.Utilities;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Fernando Gonz�lez Cort�s
+ */
+public class FPanelExtentSelector extends JPanel implements View {
+    private javax.swing.JScrollPane jScrollPane = null;
+    private javax.swing.JList lista = null;
+    private javax.swing.JButton btnAceptar = null;
+    private ListModel modelo = null;
+	private ArrayList selectionListeners = new ArrayList();
+	private javax.swing.JButton btnEliminar = null;
+	private javax.swing.JPanel jPanel = null;
+	private javax.swing.JPanel jPanel1 = null;
+	private javax.swing.JLabel jLabel = null;
+	private javax.swing.JTextField txtGuardar = null;
+	private javax.swing.JButton btnGuardar = null;
+	private ViewInfo m_viewinfo = null;
+    /**
+     * This is the default constructor
+     */
+    public FPanelExtentSelector() {
+        super();
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        this.add(getJPanel(), null);
+        this.add(getJPanel1(), null);
+    }
+
+    /**
+     * This method initializes jScrollPane
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private javax.swing.JScrollPane getJScrollPane() {
+        if (jScrollPane == null) {
+            jScrollPane = new javax.swing.JScrollPane();
+            jScrollPane.setViewportView(getLista());
+            jScrollPane.setBounds(11, 26, 400, 150);
+            jScrollPane.setPreferredSize(new java.awt.Dimension(400,150));
+        }
+
+        return jScrollPane;
+    }
+
+    /**
+     * This method initializes lista
+     *
+     * @return javax.swing.JList
+     */
+    private javax.swing.JList getLista() {
+        if (lista == null) {
+            lista = new javax.swing.JList();
+        }
+
+        return lista;
+    }
+
+    /**
+     * Asigna el el array que se va a representar. Se crea una
+     * copia del modelo, de forma que modificaciones en el modelo
+     * fuera de esta clase ya no afectan al modelo copiado
+     *
+     * @param model DOCUMENT ME!
+     */
+    public void setModel(ListModel model) {
+    	//modelo de la lista
+        modelo = model;    
+		getLista().setModel(modelo);
+    }
+    
+    public void addSelectionListener(ListSelectorListener listener){
+    	getSelectionListeners().add(listener);
+    }
+    
+    public void removeSelectionListener(ListSelectorListener listener){
+    	getSelectionListeners().remove(listener);
+    }
+
+	private void callIndexesRemoved(int[] indices){
+		for (int i = 0; i < selectionListeners.size(); i++){
+			((ListSelectorListener) selectionListeners.get(i)).indexesRemoved(indices);
+		}
+	}
+
+	private void callIndexesSelected(int[] indices){
+		for (int i = 0; i < selectionListeners.size(); i++){
+			((ListSelectorListener) selectionListeners.get(i)).indexesSelected(indices);
+		}
+	}
+
+	private void callNewElement(String name){
+		for (int i = 0; i < selectionListeners.size(); i++){
+			((ListSelectorListener) selectionListeners.get(i)).newElement(name);
+		}
+	}
+
+    /**
+     * This method initializes btnAceptar
+     *
+     * @return javax.swing.JButton
+     */
+    private javax.swing.JButton getBtnAceptar() {
+        if (btnAceptar == null) {
+            btnAceptar = new javax.swing.JButton();
+            btnAceptar.setBounds(415, 27, 102, 26);
+            btnAceptar.setText(PluginServices.getText(this,"Seleccionar"));
+            btnAceptar.addActionListener(new java.awt.event.ActionListener() { 
+            	public void actionPerformed(java.awt.event.ActionEvent e) {
+            		int[] indices = lista.getSelectedIndices();
+            		
+            		if (indices.length != 0)
+            			callIndexesSelected(indices);
+            	}
+            });
+        }
+
+        return btnAceptar;
+    }
+
+	/**
+	 * @return
+	 */
+	private ArrayList getSelectionListeners() {
+		return selectionListeners;
+	}
+
+	/**
+	 * This method initializes btnEliminar
+	 * 
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnEliminar() {
+		if(btnEliminar == null) {
+			btnEliminar = new javax.swing.JButton();
+			btnEliminar.setBounds(415, 62, 102, 26);
+			btnEliminar.setText(PluginServices.getText(this,"Eliminar"));
+			btnEliminar.setPreferredSize(new java.awt.Dimension(102,26));
+			btnEliminar.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {    
+					int[] indices = lista.getSelectedIndices();
+            		
+					if (indices.length != 0)
+						callIndexesRemoved(indices);
+				}
+			});
+		}
+		return btnEliminar;
+	}
+	/**
+	 * This method initializes jPanel
+	 * 
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel() {
+		if(jPanel == null) {
+			jPanel = new javax.swing.JPanel();
+			jPanel.setLayout(null);
+			jPanel.add(getTxtGuardar(), null);
+			jPanel.add(getJLabel(), null);
+			jPanel.add(getBtnGuardar(), null);
+			jPanel.setPreferredSize(new java.awt.Dimension(530,100));
+			jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"Guardar_el_zoom_actual"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		}
+		return jPanel;
+	}
+	/**
+	 * This method initializes jPanel1
+	 * 
+	 * @return javax.swing.JPanel
+	 */
+	private javax.swing.JPanel getJPanel1() {
+		if(jPanel1 == null) {
+			jPanel1 = new javax.swing.JPanel();
+			jPanel1.setLayout(null);
+			jPanel1.add(getJScrollPane(), null);
+			jPanel1.add(getBtnAceptar(), null);
+			jPanel1.add(getBtnEliminar(), null);
+			jPanel1.setPreferredSize(new java.awt.Dimension(530,180));
+			jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"Recuperar_y_eliminar_otros_zoom"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		}
+		return jPanel1;
+	}
+	/**
+	 * This method initializes jLabel
+	 * 
+	 * @return javax.swing.JLabel
+	 */
+	private javax.swing.JLabel getJLabel() {
+		if(jLabel == null) {
+			jLabel = new javax.swing.JLabel();
+			jLabel.setBounds(7, 35, 178, 16);
+			jLabel.setText(PluginServices.getText(this,"Nombre_que_se_le_dara_al_zoom")+":");
+		}
+		return jLabel;
+	}
+	/**
+	 * This method initializes txtGuardar
+	 * 
+	 * @return javax.swing.JTextField
+	 */
+	private javax.swing.JTextField getTxtGuardar() {
+		if(txtGuardar == null) {
+			txtGuardar = new javax.swing.JTextField();
+			txtGuardar.setBounds(187, 34, 333, 20);
+			txtGuardar.setPreferredSize(new java.awt.Dimension(330,20));
+		}
+		return txtGuardar;
+	}
+	/**
+	 * This method initializes btnGuardar
+	 * 
+	 * @return javax.swing.JButton
+	 */
+	private javax.swing.JButton getBtnGuardar() {
+		if(btnGuardar == null) {
+			btnGuardar = new javax.swing.JButton();
+			btnGuardar.setSize(106, 26);
+			btnGuardar.setText(PluginServices.getText(this,"Guardar"));
+			btnGuardar.setLocation(415, 65);
+			btnGuardar.addActionListener(new java.awt.event.ActionListener() { 
+				public void actionPerformed(java.awt.event.ActionEvent e) {
+					String text = txtGuardar.getText().trim();
+					if (text.length() > 0)
+						callNewElement(text);   
+				}
+			});
+		}
+		return btnGuardar;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		if (m_viewinfo==null){
+    		m_viewinfo=new ViewInfo(ViewInfo.MODELESSDIALOG);
+			m_viewinfo.setWidth(539);
+			m_viewinfo.setHeight(296);
+		}
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+}  

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FPanelExtentSelector.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/PrintProperties.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/PrintProperties.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/PrintProperties.java	(revision 1648)
@@ -0,0 +1,114 @@
+/*
+ * Created on 19-may-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 java.awt.geom.Rectangle2D;
+import java.awt.print.Paper;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.cit.gvsig.gui.layout.Layout;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author vcn
+ */
+public class PrintProperties implements Extension {
+    private Layout l;
+    private Paper paper;
+    Rectangle2D.Double aux = null;
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param s DOCUMENT ME!
+     */
+    public void execute(String s) {
+        l = (Layout) PluginServices.getMDIManager().getActiveView();
+		l.showFConfig();
+        //l.showPagePropertiesWindow(Print.printerJob);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public boolean isVisible() {
+        View f = PluginServices.getMDIManager().getActiveView();
+
+        if (f == null) {
+            return false;
+        }
+
+        return (f.getClass() == Layout.class);
+    }
+
+    /**
+     * @see com.iver.mdiApp.plugins.Extension#isEnabled()
+     */
+    public boolean isEnabled() {
+        Layout f = (Layout) PluginServices.getMDIManager().getActiveView();
+
+        if (f == null) {
+            return false;
+        }
+
+        return true;
+    }
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/PrintProperties.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/About.java
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/About.java	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/About.java	(revision 1648)
@@ -0,0 +1,91 @@
+/*
+ * Created on 17-feb-2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+/* 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 com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+
+import com.iver.cit.gvsig.gui.Panels.FPanelAbout;
+
+
+/**
+ * Extensi�n que abre una nueva ventana mostrando la informaci�n sobre el
+ * gvSIG.
+ *
+ * @author Francisco Jos� Pe�arrubia
+ */
+public class About implements Extension {
+	/**
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		return true;
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		FPanelAbout panelAbout = new FPanelAbout();
+
+		// panelAbout.setPreferredSize(panelAbout.getSize());                
+		PluginServices.getMDIManager().addView(panelAbout);
+	}
+}

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/src/com/iver/cit/gvsig/About.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/A.txt
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/A.txt	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/A.txt	(revision 1648)
@@ -0,0 +1,45 @@
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+ 
+ Copyright (C) 2000 The Apache Software Foundation. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+ 
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+ 
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+ 
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+ 
+ 4. The names "Batik" and  "Apache Software Foundation"  must not be  used to
+    endorse  or promote  products derived  from this  software without  prior
+    written permission. For written permission, please contact
+    apache@apache.org.
+ 
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+ 
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf  of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/A.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.xml
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.xml	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.xml	(revision 1648)
@@ -0,0 +1,98 @@
+<project name="Generar extension en MDIAPP" default="dist" basedir=".">
+    <description>
+        Instala el plugin
+    </description>
+  <!-- set global properties for this build -->
+  <property name="buildDate" value="20041018"/>
+  <property name="version" value="0.3.0 beta ${buildDate}"/>
+  <property name="src" location="src"/>
+  <property name="build" location="bin"/>
+  <property name="dist"  location="dist"/>
+  <property name="plugin" value="com.iver.cit.gvsig"/>
+  <property name="fmapdir" value="../FMap 03 CAD"/>
+  <property name="extensionDir" location="../Andami CAD/gvSIG/extensiones"/>
+  <property name="makeZip" location="makeZip"/>
+  <property name="zipName" value="gvSIG-${version}"/>
+
+  <target name="init">
+    <!-- Create the time stamp -->
+    <tstamp/>
+    <!-- Create the build directory structure used by compile -->
+    <mkdir dir="${build}"/>
+  	<!-- Creamos un fichero con el timeStamp para que lo lea el FPanelAbout -->
+  	<buildnumber/>
+  	
+  </target>
+	
+
+  <target name="compile" depends="init"
+        description="compile the source " >
+    <!-- Compile the java code from ${src} into ${build} 
+    <javac srcdir="${src}" destdir="${build}"/>-->
+  </target>
+
+  <target name="dist" depends="compile"
+        description="generate the distribution" >
+    <!-- Create the distribution directory -->
+    <mkdir dir="${dist}"/>
+
+    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
+    <copy todir="${dist}/lib">
+    	<fileset dir="./lib" includes="*.jar,*.zip"/>
+    </copy>
+    <copy todir="${dist}/lib">
+    	<fileset dir="${fmapdir}/lib" includes="*.jar"/>
+    </copy>
+    <jar jarfile="${dist}/lib/fmap.jar" basedir="${fmapdir}/bin"/>
+    <jar jarfile="${dist}/lib/${plugin}.jar" basedir="${build}"/>
+    <copy file="config/config.xml" todir="${dist}"/>
+    <copy file="config/about.htm" todir="${dist}"/>  	
+    <copy file="build.number" todir="${dist}"/>
+    <copy todir="${dist}">
+    	<fileset dir="." includes="text*.properties"/>
+    </copy>
+    <copy todir="${dist}/images">
+    	<fileset dir="images/" includes="*"/>
+    </copy>
+
+    <move todir="${extensionDir}/${plugin}/">
+    	<fileset dir="${dist}" includes="**/**"/>
+    </move>
+  </target>
+
+  <target name="makeZip"
+  	description="Genera un zip con todo lo necesario para ejecutar gvSIG"
+  	depends="dist">
+    <!-- Create the distribution directory -->
+    <mkdir dir="${dist}/${zipName}"/>
+    <jar jarfile="${dist}/${zipName}/gvSIG.jar" basedir="../mdiApp/bin" manifest="../mdiApp/manifest.mf"/>
+    <jar jarfile="${dist}/${zipName}/gvSIG.jar" basedir="../mdiApp/" includes="images/*" update="true"/>
+    <jar jarfile="${dist}/${zipName}/gvSIG.jar" basedir="../mdiApp/" includes="plugin.dtd" update="true"/>
+    <copy todir="${dist}/${zipName}">
+		<fileset dir="../mdiApp">
+			<include name="extensiones/${plugin}/**"/>
+			<include name="extensiones/plugin.*"/>
+			<include name="plugin.*"/>
+		</fileset>  
+		<!-- fileset dir="${dist}" includes="gvSIG.jar"/ -->
+		<fileset dir="../mdiApp_v02_estable">
+			<include name="lib/**"/>
+		</fileset>  
+		<fileset dir="distFiles" includes="**/**"/>
+    </copy>
+	<zip zipfile="${zipName}.zip">
+		<fileset dir="${dist}">
+			<include name="**/**"/>
+		</fileset>
+	</zip>
+    <delete dir="${dist}"/>
+  </target>
+
+  <target name="clean"
+        description="clean up" >
+    <!-- Delete the ${build} and ${dist} directory trees -->
+    <delete dir="${build}"/>
+    <delete dir="${dist}"/>
+  </target>
+</project>
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.classpath
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.classpath	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.classpath	(revision 1648)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="lib" path="lib/JimiProClasses.zip"/>
+	<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
+	<classpathentry kind="lib" path="lib/batik-awt-util.jar"/>
+	<classpathentry kind="lib" path="lib/batik-ext.jar"/>
+	<classpathentry kind="lib" path="lib/batik-gui-util.jar"/>
+	<classpathentry kind="lib" path="lib/batik-gvt.jar"/>
+	<classpathentry kind="lib" path="lib/batik-util.jar"/>
+	<classpathentry kind="lib" path="lib/xml-apis.jar"/>
+	<classpathentry kind="lib" path="lib/jep-2.24.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="lib/wmsclient.jar"/>
+	<classpathentry sourcepath="/gt" kind="lib" path="/FMap 03/lib/main-2.1.x.jar"/>
+	<classpathentry kind="lib" path="/FMap 03/lib/geoapi-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="/FMap 03/lib/cms.jar"/>
+	<classpathentry kind="lib" path="/FMap 03/lib/driver-manager-1.0.jar"/>
+	<classpathentry kind="lib" path="/FMap 03/lib/jts-1.5.jar"/>
+	<classpathentry kind="src" path="/Andami"/>
+	<classpathentry kind="lib" path="/Andami/lib/castor-0.9.5.3-xml.jar"/>
+	<classpathentry sourcepath="/Utiles/src" kind="lib" path="/Andami/lib/iver-utiles.jar"/>
+	<classpathentry kind="lib" path="/Andami/lib/log4j-1.2.8.jar"/>
+	<classpathentry kind="lib" path="/FMap 03/lib/gdbms.jar"/>
+	<classpathentry kind="src" path="/FMap 03 CAD"/>
+	<classpathentry kind="lib" path="lib/fsac.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/.classpath
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/gpl.txt
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/gpl.txt	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/gpl.txt	(revision 1648)
@@ -0,0 +1,340 @@
+		    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.

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/gpl.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/jalopy-config.xml
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/jalopy-config.xml	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/jalopy-config.xml	(revision 1648)
@@ -0,0 +1,385 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jalopy>
+    <general>
+        <compliance>
+            <version>14</version>
+        </compliance>
+        <style>
+            <description>Sun Java Coding Convention</description>
+            <name>Sun</name>
+        </style>
+    </general>
+    <inspector>
+        <enable>false</enable>
+        <naming>
+            <classes>
+                <abstract>[A-Z][a-zA-Z0-9]+</abstract>
+                <general>[A-Z][a-zA-Z0-9]+</general>
+            </classes>
+            <fields>
+                <default>[a-z][\w]+</default>
+                <defaultStatic>[a-z][\w]+</defaultStatic>
+                <defaultStaticFinal>[a-zA-Z][\w]+</defaultStaticFinal>
+                <private>[a-z][\w]+</private>
+                <privateStatic>[a-z][\w]+</privateStatic>
+                <privateStaticFinal>[a-zA-Z][\w]+</privateStaticFinal>
+                <protected>[a-z][\w]+</protected>
+                <protectedStatic>[a-z][\w]+</protectedStatic>
+                <protectedStaticFinal>[a-zA-Z][\w]+</protectedStaticFinal>
+                <public>[a-z][\w]+</public>
+                <publicStatic>[a-z][\w]+</publicStatic>
+                <publicStaticFinal>[a-zA-Z][\w]+</publicStaticFinal>
+            </fields>
+            <interfaces>[A-Z][a-zA-Z0-9]+</interfaces>
+            <labels>\w+</labels>
+            <methods>
+                <default>[a-z][\w]+</default>
+                <defaultStatic>[a-z][\w]+</defaultStatic>
+                <defaultStaticFinal>[a-z][\w]+</defaultStaticFinal>
+                <private>[a-z][\w]+</private>
+                <privateStatic>[a-z][\w]+</privateStatic>
+                <privateStaticFinal>[a-z][\w]+</privateStaticFinal>
+                <protected>[a-z][\w]+</protected>
+                <protectedStatic>[a-z][\w]+</protectedStatic>
+                <protectedStaticFinal>[a-z][\w]+</protectedStaticFinal>
+                <public>[a-z][\w]+</public>
+                <publicStatic>[a-z][\w]+</publicStatic>
+                <publicStaticFinal>[a-z][\w]+</publicStaticFinal>
+            </methods>
+            <packages>[a-z]+(?:\.[a-z]+)*</packages>
+            <parameters>
+                <default>[a-z][\w]+</default>
+                <final>[a-z][\w]+</final>
+            </parameters>
+            <variables>[a-z][\w]*</variables>
+        </naming>
+        <tips>
+            <adhereToNamingConvention>false</adhereToNamingConvention>
+            <alwaysOverrideHashCode>false</alwaysOverrideHashCode>
+            <avoidThreadGroups>false</avoidThreadGroups>
+            <declareCollectionComment>false</declareCollectionComment>
+            <dontIgnoreExceptions>false</dontIgnoreExceptions>
+            <dontSubstituteObjectEquals>false</dontSubstituteObjectEquals>
+            <neverDeclareException>false</neverDeclareException>
+            <neverDeclareThrowable>false</neverDeclareThrowable>
+            <neverInvokeWaitOutsideLoop>false</neverInvokeWaitOutsideLoop>
+            <neverReturnZeroArrays>false</neverReturnZeroArrays>
+            <neverUseEmptyFinally>false</neverUseEmptyFinally>
+            <obeyContractEquals>false</obeyContractEquals>
+            <overrideToString>false</overrideToString>
+            <referToObjectsByInterface>false</referToObjectsByInterface>
+            <replaceStructureWithClass>false</replaceStructureWithClass>
+            <stringLiterallI18n>false</stringLiterallI18n>
+            <useInterfaceOnlyForTypes>false</useInterfaceOnlyForTypes>
+            <wrongCollectionComment>false</wrongCollectionComment>
+        </tips>
+    </inspector>
+    <internal>
+        <version>6</version>
+    </internal>
+    <messages>
+        <priority>
+            <general>30000</general>
+            <parser>30000</parser>
+            <parserJavadoc>30000</parserJavadoc>
+            <printer>30000</printer>
+            <printerJavadoc>30000</printerJavadoc>
+            <transform>30000</transform>
+        </priority>
+        <showErrorStackTrace>true</showErrorStackTrace>
+    </messages>
+    <misc>
+        <threadCount>1</threadCount>
+    </misc>
+    <printer>
+        <alignment>
+            <methodCallChain>true</methodCallChain>
+            <parameterMethodDeclaration>false</parameterMethodDeclaration>
+            <ternaryOperator>true</ternaryOperator>
+            <variableAssignment>false</variableAssignment>
+            <variableIdentifier>false</variableIdentifier>
+        </alignment>
+        <backup>
+            <directory>bak</directory>
+            <level>0</level>
+        </backup>
+        <blanklines>
+            <after>
+                <block>1</block>
+                <braceLeft>0</braceLeft>
+                <class>1</class>
+                <declaration>0</declaration>
+                <footer>1</footer>
+                <header>0</header>
+                <interface>1</interface>
+                <lastImport>2</lastImport>
+                <method>1</method>
+                <package>1</package>
+            </after>
+            <before>
+                <block>1</block>
+                <braceRight>0</braceRight>
+                <caseBlock>1</caseBlock>
+                <comment>
+                    <javadoc>1</javadoc>
+                    <multiline>1</multiline>
+                    <singleline>1</singleline>
+                </comment>
+                <controlStatement>1</controlStatement>
+                <declaration>1</declaration>
+                <footer>0</footer>
+                <header>0</header>
+            </before>
+            <keepUpTo>1</keepUpTo>
+        </blanklines>
+        <braces>
+            <empty>
+                <cuddle>false</cuddle>
+                <insertStatement>false</insertStatement>
+            </empty>
+            <insert>
+                <dowhile>false</dowhile>
+                <for>false</for>
+                <ifelse>true</ifelse>
+                <while>false</while>
+            </insert>
+            <remove>
+                <block>true</block>
+                <dowhile>false</dowhile>
+                <for>false</for>
+                <ifelse>false</ifelse>
+                <while>false</while>
+            </remove>
+            <treatDifferent>
+                <methodClass>false</methodClass>
+                <methodClassIfWrapped>false</methodClassIfWrapped>
+            </treatDifferent>
+        </braces>
+        <chunks>
+            <blanklines>true</blanklines>
+            <comments>true</comments>
+        </chunks>
+        <comments>
+            <format>
+                <multiline>true</multiline>
+            </format>
+            <javadoc>
+                <check>
+                    <innerclass>true</innerclass>
+                    <tags>true</tags>
+                    <throwsTags>true</throwsTags>
+                </check>
+                <fieldsShort>true</fieldsShort>
+                <generate>
+                    <class>23</class>
+                    <constructor>23</constructor>
+                    <field>1</field>
+                    <method>23</method>
+                </generate>
+                <parseComments>true</parseComments>
+                <tags>
+                    <in-line />
+                    <standard />
+                </tags>
+                <templates>
+                    <class>/**| * DOCUMENT ME!| *| * @author $author$| */</class>
+                    <constructor>
+                        <bottom> */</bottom>
+                        <exception> * @throws $exceptionType$ DOCUMENT ME!</exception>
+                        <param> * @param $paramType$ DOCUMENT ME!</param>
+                        <top>/**| * Crea un nuevo $objectType$.</top>
+                    </constructor>
+                    <interface>/**| * DOCUMENT ME!| *| * @author $author$| */</interface>
+                    <method>
+                        <bottom> */</bottom>
+                        <exception> * @throws $exceptionType$ DOCUMENT ME!</exception>
+                        <param> * @param $paramType$ DOCUMENT ME!</param>
+                        <return> * @return DOCUMENT ME!</return>
+                        <top>/**| * DOCUMENT ME!</top>
+                    </method>
+                    <variable>/**| * DOCUMENT ME!| */</variable>
+                </templates>
+            </javadoc>
+            <remove>
+                <javadoc>false</javadoc>
+                <multiline>false</multiline>
+                <singleline>false</singleline>
+            </remove>
+            <separator>
+                <fillCharacter>-</fillCharacter>
+                <insert>false</insert>
+                <insertRecursive>false</insertRecursive>
+                <text>
+                    <class>Inner Classes</class>
+                    <constructor>Constructors</constructor>
+                    <field>Instance fields</field>
+                    <initializer>Instance initializers</initializer>
+                    <interface>Inner Interfaces</interface>
+                    <method>Methods</method>
+                    <static>Static fields/initializers</static>
+                </text>
+            </separator>
+        </comments>
+        <environment />
+        <footer>
+            <keys />
+            <smartMode>0</smartMode>
+            <use>false</use>
+        </footer>
+        <header>
+            <keys />
+            <smartMode>0</smartMode>
+            <use>false</use>
+        </header>
+        <history>
+            <policy>disabled</policy>
+        </history>
+        <imports>
+            <grouping>
+                <defaultDepth>3</defaultDepth>
+                <packages>*:0|gnu:2|java:2|javax:2</packages>
+            </grouping>
+            <policy>disabled</policy>
+            <sort>true</sort>
+        </imports>
+        <indentation>
+            <caseFromSwitch>true</caseFromSwitch>
+            <continuation>
+                <block>true</block>
+                <operator>false</operator>
+            </continuation>
+            <firstColumnComments>true</firstColumnComments>
+            <label>false</label>
+            <policy>
+                <deep>false</deep>
+            </policy>
+            <sizes>
+                <braceCuddled>1</braceCuddled>
+                <braceLeft>1</braceLeft>
+                <braceRight>0</braceRight>
+                <braceRightAfter>1</braceRightAfter>
+                <continuation>4</continuation>
+                <deep>55</deep>
+                <extends>-1</extends>
+                <general>4</general>
+                <implements>-1</implements>
+                <leading>0</leading>
+                <tabs>8</tabs>
+                <throws>-1</throws>
+                <trailingComment>1</trailingComment>
+            </sizes>
+            <tabs>
+                <enable>false</enable>
+                <onlyLeading>false</onlyLeading>
+            </tabs>
+        </indentation>
+        <misc>
+            <arrayBracketsAfterIdent>false</arrayBracketsAfterIdent>
+            <forceFormatting>false</forceFormatting>
+            <insertExpressionParentheses>true</insertExpressionParentheses>
+            <insertLoggingConditional>false</insertLoggingConditional>
+            <insertTrailingNewline>true</insertTrailingNewline>
+            <insertUID>false</insertUID>
+        </misc>
+        <sorting>
+            <declaration>
+                <class>false</class>
+                <constructor>false</constructor>
+                <enable>true</enable>
+                <interface>false</interface>
+                <method>false</method>
+                <order>static|field|initializer|constructor|method|interface|class</order>
+                <variable>false</variable>
+            </declaration>
+            <modifier>
+                <enable>false</enable>
+                <order>public|protected|private|abstract|static|final|synchronized|transient|volatile|native|strictfp</order>
+            </modifier>
+        </sorting>
+        <whitespace>
+            <after>
+                <comma>true</comma>
+                <semicolon>true</semicolon>
+                <typeCast>true</typeCast>
+            </after>
+            <before>
+                <braces>true</braces>
+                <brackets>false</brackets>
+                <bracketsTypes>false</bracketsTypes>
+                <caseColon>false</caseColon>
+                <operator>
+                    <not>false</not>
+                </operator>
+                <parentheses>
+                    <methodCall>false</methodCall>
+                    <methodDeclaration>false</methodDeclaration>
+                    <statement>true</statement>
+                </parentheses>
+            </before>
+            <padding>
+                <braces>true</braces>
+                <brackets>false</brackets>
+                <operator>
+                    <assignment>true</assignment>
+                    <bitwise>true</bitwise>
+                    <logical>true</logical>
+                    <mathematical>true</mathematical>
+                    <relational>true</relational>
+                    <shift>true</shift>
+                </operator>
+                <parenthesis>false</parenthesis>
+                <typeCast>false</typeCast>
+            </padding>
+        </whitespace>
+        <wrapping>
+            <always>
+                <after>
+                    <arrayElement>0</arrayElement>
+                    <braceRight>false</braceRight>
+                    <extendsTypes>false</extendsTypes>
+                    <implementsTypes>false</implementsTypes>
+                    <label>true</label>
+                    <methodCallChained>false</methodCallChained>
+                    <ternaryOperator>
+                        <first>false</first>
+                        <second>false</second>
+                    </ternaryOperator>
+                    <throwsTypes>false</throwsTypes>
+                </after>
+                <before>
+                    <braceLeft>false</braceLeft>
+                    <extends>false</extends>
+                    <implements>false</implements>
+                    <throws>false</throws>
+                </before>
+                <parameter>
+                    <methodCall>false</methodCall>
+                    <methodCallNested>false</methodCallNested>
+                    <methodDeclaration>false</methodDeclaration>
+                </parameter>
+            </always>
+            <general>
+                <beforeOperator>false</beforeOperator>
+                <enable>true</enable>
+                <lineLength>80</lineLength>
+            </general>
+            <ondemand>
+                <after>
+                    <assignment>false</assignment>
+                    <leftParenthesis>false</leftParenthesis>
+                    <parameter>false</parameter>
+                    <types>
+                        <extends>false</extends>
+                        <implements>false</implements>
+                        <throws>false</throws>
+                    </types>
+                </after>
+                <before>
+                    <rightParenthesis>false</rightParenthesis>
+                </before>
+                <groupingParentheses>false</groupingParentheses>
+            </ondemand>
+        </wrapping>
+    </printer>
+</jalopy>
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/jalopy-config.xml
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_en.properties
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_en.properties	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_en.properties	(revision 1648)
@@ -0,0 +1,428 @@
+(escala_m�xima)=(maximum scale)                
+(escala_m�nima)=(minimum scale)
+A0=A0
+A1=A1
+A2=A2
+A3=A3
+A4=A4
+A5=A5
+A6=A6
+abajo=Abajo
+abrir=Open
+Abrir_Imagen=Open Picture
+abrir_proyecto=Open project
+abrir_tooltip=Open an existing project
+Abrir_una_capa=Open Layer
+Accion_Predefinida=Predefined Action
+Aceptar=OK
+acerca_de=About...
+activar_regla=Activate ruler
+activos=Active
+adjust_transparency=Set Transparency
+agrupar=Group
+agrupar_graficos=Group graphics
+agrupar_linea=Grouping graphic line with graphics.  
+Ajustar_transparencia=Adjust Transparency
+ajustes_linea_grafica=Adjustments of graphic line
+alias=Alias
+alineamiento=Alignment:
+alinear=Align
+alinear_graficos=Align graphics
+alta=High
+alto=Height
+altura=Height:
+Altura_fija_de_texto=Fixed text hight
+Anadir=Add
+Anadir=Add
+Anadir_al_conjunto=Add to set
+Anadir_Capa= Add Layer
+Anadir_capa=Add layer
+Anadir_todos=Add All
+Anadir_todos=Add all
+ancho=Width
+Ancho_Contorno=Wide Outline
+Ancho_de_l�nea= Wide Line
+anchura=Width:
+angulo_rotacion=Angle of rotation:
+Anterior=Previous
+anterior=Previous
+Aplicar=Apply
+Aplicar=Apply
+Archivo=File
+Archivos_de_Disco=Disc files
+arriba=Up
+automatico=Automatic
+Ayuda=Help
+background_color=Background color
+baja=Low
+Bajar_capa=Move layer down
+bmp=BMP files
+Bold=Bold
+borra_seleccion=Del selection
+borrador=Draft
+borrar=Remove
+Calcular_intervalos=Compute intervals
+calidad=Quality
+Cambios_de_estilo=Style changes
+Cambio_Color=Change Color
+Cambio_de_estilo=Style change
+Cambio_Estilo=Change Style
+Campo=Field
+campo=Field
+Campos=Fields
+campo_altura_texto=Higth of text field:
+Campo_clasifica=Classification field
+Campo_de_clasificacion=Clasification field
+Campo_de_etiquetado=Labelling field
+cancel=Cancel
+Cancelar=Cancel
+Cancelar=Cancel
+Capas=Layers
+Capas=Layers
+Capas_del_localizador=Locator layers
+capaWMS=WMSLayer
+cargar_leyenda=Load legendactivar_regla=Activate ruler
+Centimetros=Centimeters
+Cerrar=Close
+Circulo=Circle
+circulo=Circle
+coincidir_tama�o=Coinciding size:
+colocar_alrededor_seleccionados=To place around the graphics selected.  
+colocar_alrededor_todos=Placing around all the graphics.  
+colocar_a_margenes=Placing with reference to margins.
+colocar_delante=Before
+colocar_detras=Behind
+color=Color:
+Color_Contorno= Color Outline
+Color_de_la_L�nea=Line Color
+Color_de_Relleno= Fill color: 
+Color_final=End color
+Color_final=Final color: 
+Color_inicial=Intial color: 
+Color_inicio=Begin color
+color_texto=Text color:
+comentarios=Comments
+configurar=Configuring
+configurar_localizador=Configure Locator Map ...
+Configurar_localizador=Configure locator
+confirmar_borrar=The element will be removed. Are you sure?
+conservar_escala_visualizacion=Maintain scale of viewing
+creation_date=Creation date
+Cruz=Cross
+Cuadrado=Square
+cuando_activo=When active
+Derecha=Right
+Derecho=Right
+desagrupar=Ungroup
+desagrupar_graficos=Ungroup graphics
+Descripcion=Description
+descripcion=Description
+desde_arriba=Since up:
+desde_izquierda=Since the left:
+Desplazamiento=Displacement
+Detalles=Details
+detalles=Details
+DGNFiles=DGNFiles
+DGNFiles=DGNFiles
+distance_units=Distance units
+distribuir=Distributing:
+divisiones_izquierda=Divisions to the left
+documentos_existentes=Existing documents
+Dxffiles=DXFFiles
+Editar_leyenda=Edit style
+editar_propiedades=Edit properties
+Elegir_Color=Select Color
+Elegir_Fuente=Font Choose
+Eliminar=Delete
+eliminar_capa=Delete Layer
+Encuadre=Zooms
+Encuadre_Vista=View frame Pan
+enlace_vivo=Alive link
+Enlazar_a_ficheros_de_imagen=Link to image files
+Enlazar_a_fichero_de_texto=Link to text files
+en_el_mapa= In the Layout:
+En_metros=In meters
+En_pixels=In pixels
+Error_abriendo_el_fichero=Error opening file
+error_escritura=Can't write file
+error_lectura=Can't read file
+Escala=Scale
+escala=Scale
+Escala_Maxima=Maximum scale
+Escala_Minima=Minimum scale
+escala_usuario=Scale specified by the user
+espaciado_horizontal=Horizontal grid spacing
+espaciado_vertical=Vertical grid spacing
+espacio=Space:
+Estilo=Style: 
+Etiqueta=Label
+Etiqueta=Label
+Etiquetado=Labelling
+Examinar=Browser
+exportar=Export
+exportar_a=Export to...
+extension=Extension
+Fichero=File
+filtro=Filter
+finalizar=Finalize
+Font=Font
+Fuente=Font
+fuente=Font
+General=General
+Generar_Intervalos=Generate Intervals
+gestion_encuadre=Management of Fit in
+grados=degrees
+Grosor_de_linea=Line width
+grosor_linea=Line width:
+Gr�ficos=Graphics
+guardado=Saved in
+Guardar=Save
+Guardar=Save
+guardar_cambios=save changes?
+guardar_como=Save as...
+Guardar_el_zoom_actual=Save present zoom
+guardar_leyenda=Save legend
+Guardar_leyenda=Save Style
+guardar_proyecto=Save project
+guardar_tooltip=Save the project
+Habilitar_etiquetado=Enble labelling
+hasta=to
+Herramientas=Tools
+Herramientas_vista=View tools
+Hiperenlace=Hiperlink
+horizontal=Horizontal
+Identificar_Resultados=Identify Results
+Igual_que_la_impresora=Igual que la impresora
+igual_todos_lados=Equal displacement for all sides.
+Imagen=Image
+imagen=Image
+importar=Import
+Imprimir=Print
+Inferior=Lower
+infobreak=It shows the elements of the layer using a range of colors.  
+infodef=It shows all the elements of a layer using the same symbol.  
+informacion=Information
+Informaci�n=Information
+infovalue=It shows elements of the layer using a symbol by each value. 
+Inicializando=Initializing
+Insertar=Insert
+insertar_circulo=Insert Circle
+insertar_escala=Insert Scale
+insertar_imagen=Insert Image
+insertar_leyenda=Insert Legend
+insertar_linea=Insert Line
+insertar_poligono=Insert Poligon
+insertar_punto=Insert Point
+insertar_recta=Insert Rect
+insertar_rectangulo=Insert Rectangle
+insertar_texto=Insert Text
+insertar_vista=Insert View
+Intervalo=Interval
+Intervalos=Intervals
+Intervalos=Intervals
+Intervalos_equidistantes=    Equality Intervals
+Intervalos_por_rupturas_naturales=    Intervals by natural breaks.
+introduce_nombre=Type the new name
+Italic=Italic
+Izquierda=Left
+Izquierdo=Left
+jpg=JPEG files
+Kilometros=Kilometers
+kilometros=Kilometers
+leyenda=Legend
+Linea=Line
+linea=Line
+linea_grafica=Graphic line
+Link=Link
+malla_activada=Active grid
+mantener_intervalo=Maintaining interval
+Mapa=Map
+mapas=Maps
+map_units=Map units
+marco_vista=Framework of the View
+marco_vista=Framework of the view
+margenes=Margins:
+medir_area=Measure area
+medir_distancias=Measure distances
+Metros=Meters
+metros=Meters
+Milimetros=Milimeters
+Millas=Miles
+modification_date=Modification date
+Mostrar_Contorno=Show Outline
+Mostrar_siempre=To show always
+Muestra_atributos=Show attributes of selected layers.
+Muestra_los_atributos_de_las_capas_seleccionadas=Show selected layers attributes
+M�s_100=The number of values is over 100, and does not contribute information
+Nivel_de_transparencia=Transparency Level
+nombre=Name
+Nombres=Names
+nombre_capa=Name of the layer
+Nombre_que_se_le_dara_al_zoom=Name for the zoom
+nombre_sesion=Session name
+normal=Normal
+no_activos=Not active
+No_de_intervalos=Nr of intervals
+No_mostrar=Not to show the layer when the scale 
+No_reconocido=Nor recognized
+No_Shape=This Layer is not of type Shape
+no_visibles=Not visible
+Nueva_tabla=New Table
+nuevo=New
+Nuevo_conjunto=New set
+nuevo_proyecto=New project
+nuevo_tamano_fuente=New size of font:
+nuevo_tooltip=Create a new project
+N�m_intervalos=Number of Intervals
+ok=Ok
+orientacion=Orientation:
+Origen_de_Datos=Data Origin: 
+Otros=Other
+owner=Owner
+path=Path
+Perimetro=Perimeter
+Personalizado=Custom
+Pies=Feet
+Plain=Plain
+png=PNG files
+poligono=Poligon
+poner_temas_a=Set themes to ...  
+por_debajo_de =under: 
+por_encima_de=above:
+Por_favor_active_el_tema=You must active theme first
+posicion_linea=Position of the line
+Preparar_pagina=Prepare Page
+preparar_pagina=Prepare page
+presentacion=Presentation
+Previsualizacion=Preview
+Previsualizacion_de_simbolo=Symbol preview
+propiedades=Properties
+Propiedades_del_Tema=Theme properties
+Propiedades_de_la_Capa=Properties of the layer
+Propiedades_escala_grafica=Properties of the scale bar
+propiedades_grafico=Graphic properties
+propiedades_mapa=Map properties
+propiedades_marco_imagenes=Properties of the framework of the Picture
+propiedades_marco_leyenda=Properties of the framework of the legend
+propiedades_marco_vista=Properties of the framework of the view
+propiedades_sesion=Session properties
+propiedades_tabla=Table properties
+Propiedades_texto=Properties of text
+propiedades_tema=Layer properties
+propiedades_vista=View properties
+Pulgadas=Inches
+punto=Point
+Quitar=Remove
+Quitar=Remove
+Quitar_capa=Remove layer
+Quitar_Todos=Remove All
+Quitar_todos=Remove all
+Rango_de_escalas=Rank of Scales
+Rasterfiles=Rasterfiles
+recorte_vista=Cut to view
+recta=Rect
+rectangulo=Rectangle
+Recuperar_leyenda=Load Style
+Recuperar_y_eliminar_otros_zoom=Recover and delete other zoom
+refrescar=Refresh
+registros=registers
+rellenar_marco_vista=Fill framework of the view
+relleno=Fill:
+renombrar=Rename
+resolucion_resultado=Resolution of the result:
+Sample=Sample
+Seleccionar=Select
+seleccionar_capas=Select Layers
+Seleccionar_del_conjunto=Select from set
+Seleccionar_fichero=Select file
+seleccionar_formato=Select Format
+seleccionar_por_punto=Select by point
+seleccionar_por_rectangulo=Select by rectangle
+seleccionar_todos=Select all
+seleccione_fecha=Select date...
+seleccion_fuente=Selection of font
+Seleccion_por_tema=Selection by theme
+selection_color=Selection color
+Servidor=Server
+servidor=Server
+Se_va_a_tener_en_cuenta_para_borrar_los_registros_desde=... to delete registers from
+shape_seleccion=Export selection. 
+Shapefile=Shapefile
+Shapefiles=Shapefiles
+siempre=Allways
+Siguiente=Next
+siguiente=Next
+Simbolo=Symbol
+Simbolog�a=Symbology
+Simbolo_unico=Unique symbol
+simplificar=Simplify
+sin_titulo=No title
+sincronizar_color_borde_relleno=Sincronize color of stroke and fill:
+Size=Size
+Solo_para_capas_vectoriales=Only for vector layers
+Style=Style
+Subir_capa=Move layer up
+Superior=Upper
+S�mbolo=Symbol
+S�mbolo_�nico=Unique symbol
+Tabla=Table
+Tabla=Table
+tablas=Tables
+Tabla_de_Atributos=Table of Attributes
+Tabla_de_prueba=Test Table
+tamano=Tama�o:
+tamano_metros=Size in meters
+tama�o_pagina=Pase Size
+tama�o_posicion=Size and position
+Tema=Layer
+texto=Text
+tipos_de_documentos=Document types
+Tipo_de_intervalos=Type of intervals
+Tipo_de_leyenda=Type of legend
+Tipo_de_linea=Line type
+tipo_fichero_proyecto=gvSIG project file (*.GVP)
+tipo_leyenda=Legend files (*.GVL)
+tipo_linea=Stroke:
+Tipo_no_reconocido=Type not recognized
+tipo_relleno=Fill:
+tipo_simbolo=Type of symbol:
+titulo=Project manager
+titulo_confirmar=Confirmaci�n
+Transparencia=Transparency
+transparencia=Transparency
+Triangulo=Triangle
+Unidades=Units
+unidades=Units:
+untitled=untitled
+Un_Layer=It should select a layer
+utilizar_margenes_impresora=Utilizing margins of the printer. 
+vacia=Empty
+Valor=Value
+Valor=Value
+Valores=Values
+Valores_unicos=single values
+Valores_�nicos=Unique values
+ventana_proyecto=Project window
+Ver=View
+vertical=Vertical
+ver_tabla_atributos=See table of attributes
+ver_tooltip=Show project window
+visible=Visible
+visibles=Visible
+Vista=View
+vistas=Views
+visualizacion= Viewing
+Visualizacion=Visualization
+visualizar_cuadricula=Visualize Grid
+WMS=WMS
+Yardas=Yards
+Zoom_al_Tema=Zoom to layer
+Zoom_Completo= Full Extent
+Zoom_Completo_Vista= View frame Full Extent 
+Zoom_Menos=Zoom Out
+Zoom_Menos_Vista=View frame Zoom Out
+Zoom_M�s=Zoom In
+Zoom_M�s_Vista=View frame Zoom In 
+Zoom_Previo=Zoom Previous
+Zoom_Real=Zoom 1:1
+Zoom_Select=Zoom to selected

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/text_en.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build_sources.xml
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build_sources.xml	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build_sources.xml	(revision 1648)
@@ -0,0 +1,80 @@
+<project name="Copiar las fuentes a un directorio" default="dist" basedir=".">
+    <description>
+        Copiar las fuentes a un directorio
+    </description>
+  <!-- set global properties for this build -->
+  <property name="buildDate" value="${TSTAMP}"/>
+  <property name="version" value="0.3"/>
+  <property name="dist"  location="d:/fjp/COPUT/instala_gvsig/fuentes"/>
+  <property name="fmapdir" value="../FMAP 03"/>
+  <property name="andamidir" value="../Andami"/>
+  <property name="makeZip" location="makeZip"/>
+  <property name="zipName" value="gvSIG-${version}"/>
+
+  <target name="init" depends="clean">
+    <!-- Create the time stamp -->
+    <tstamp/>
+  	
+  </target>
+	
+
+
+  <target name="dist" depends="init"
+        description="generate the distribution" >
+    <!-- Create the distribution directory -->
+    <mkdir dir="${dist}"/>
+    <mkdir dir="${dist}/Andami"/>
+    <mkdir dir="${dist}/Andami/src"/>
+    <mkdir dir="${dist}/Andami/lib"/>
+    <mkdir dir="${dist}/FMap"/>        
+    <mkdir dir="${dist}/FMap/src"/>    
+    <mkdir dir="${dist}/FMap/lib"/>        
+    <mkdir dir="${dist}/gvSIG"/>        
+    <mkdir dir="${dist}/gvSIG/src"/>    
+    <mkdir dir="${dist}/gvSIG/lib"/> 
+    <mkdir dir="${dist}/gvSIG/images"/>       
+
+    <!-- Put everything into the directory ${dist} -->
+    <copy todir="${dist}/Andami/lib">
+    	<fileset dir="${andamidir}/lib" includes="*.jar,*.zip"/>
+    </copy>
+    <copy todir="${dist}/FMap/lib">
+    	<fileset dir="${fmapdir}/lib" includes="*.jar,*.zip"/>
+    </copy>
+    <copy todir="${dist}/gvSIG/lib">
+    	<fileset dir="./lib" includes="*.jar,*.zip"/>
+    </copy>
+    <copy todir="${dist}/Andami/src">
+    	<fileset dir="${andamidir}/src" includes="**/**"/>
+    </copy>
+    <copy todir="${dist}/FMap/src">
+    	<fileset dir="${fmapdir}/src" includes="**/**" />
+    </copy>
+    <copy todir="${dist}/gvSIG/src">
+    	<fileset dir="./src" includes="**/**"/>
+    </copy>
+    <copy todir="${dist}/gvSIG">
+    	<fileset dir="." includes="text*.properties"/>
+    </copy>
+    <copy todir="${dist}/gvSIG/images">
+    	<fileset dir="./images/" includes="*"/>
+    </copy>
+    <!-- BORRAMOS EL DIRECTIORIO DE EDICIÓN (PROVISIONAL) -->
+	<delete dir="${dist}/FMap/src/com/iver/cit/gvsig/fmap/edition"/>
+
+  </target>
+
+  <target name="makeZip"
+  	description="Genera un zip con todas las fuentes"
+  	depends="dist">
+	<zip destfile="${dist}/${zipName}.zip" basedir="${dist}" />
+    <!-- <delete dir="${dist}"/> -->
+  </target>
+
+  <target name="clean"
+        description="clean up" >
+    <!-- Delete the ${build} and ${dist} directory trees -->
+    <delete dir="${dist}"/>
+  </target>
+</project>
+

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/build_sources.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/NotasFJP.txt
===================================================================
--- tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/NotasFJP.txt	(revision 0)
+++ tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/NotasFJP.txt	(revision 1648)
@@ -0,0 +1,136 @@
+- v03: Para los s�mbolos. Cada s�mbolo sigue el patr�n Composite,
+  y habr� un ComplexSymbol que tendr� un s�mbolo para cada
+  tipo de entidad: Un s�mbolo para puntos, otro para l�neas, 
+  otro para pol�gonos y otro para textos.
+
+- v03: Revisar el sistema de Reproyecci�n al vuelo. Demasiado lento,
+  se puede mejorar, pero es posible que sea mejor no hacerlo y 
+  crear un shape reprojectado cada vez => �Y si es un DGN, qu� escribimos?
+  => Nuestro formato shp modificado es una opci�n => Definir nuestro
+  shp modificado. (Que admita textos, mezcla de tipos de entidades, etc)
+
+- Cuando se abre el cuadro de di�logo de leyenda, cargar bien
+  los datos del s�mbolo actual.
+
+- Internacionalizar los strings.
+
+- Corregir la pantalla de inicio, y hacer un cuadro de di�logo "About"
+
+- Habilitar el fileChooser que usa la aplicaci�n mdi para que permita
+  devolver un array de Files (File[]), y abrirlo para que pueda seleccionar
+  varios ficheros a la vez.
+
+- Algunos arcos no se dibujan bien en los dgn. Meter lo del libro de java.
+
+- Hay que completar el soporte de shape file. Ahora mismo no acepta multipunto, ni shapes 3D
+  ni escritura.
+
+- P�gina 75, �ltimo p�rrafo del libro de software libre:
+"Las condiciones y/o restricciones que imponen las licencias s�lo pueden
+ser precisadas por los propios autores, que seg�n la normativa de propiedad
+intelectual son los propietarios de la obra. En cualquier caso, la
+propiedad de la obra ser� de los autores, ya que la licencia no supone
+transferencia de propiedad, sino solamente derecho de uso y, en algunos
+casos, de distribuci�n."
+"...tambi�n es necesario saber
+que cada nueva versi�n de un programa es considerada como una nueva
+obra. El autor tiene, otra vez, plena potestad para hacer con su obra
+lo que le apetezca, incluso distribuirla con t�rminos y condiciones totalmente
+diferentes (o sea, una licencia diferente a la anterior). As�, si el lector
+es autor �nico de un programa podr� publicar una versi�n bajo una
+licencia de software libre y, si le apeteciere, otra posterior bajo una licencia
+propietaria. En caso de existir m�s autores, y que la nueva versi�n
+contenga c�digo cuya autor�a les corresponda y que se vaya a publicar
+bajo otras condiciones, todos ellos han de dar el visto bueno al cambio
+de licencia." 
+
+- Consideraciones sobre modelo de negocio para el software libre:
+	� En realidad hacemos lo mismo que ahora, solo que la licencia de MapObjects y ArcView ya
+	no existe. En lugar de que se la lleve Esri, no se la lleva nadie. A nosotros no nos deja
+	en peor lugar que ahora, en todo caso mejor: Se puede dar formaci�n sobre nuestra herramienta
+	a otros desarrolladores, e incluso cobrarles por una Certificaci�n en el uso de nuestras
+	librer�as.
+	� Los servicios se dividen en 2: Soporte t�cnico para usuarios del programa b�sico y/o 
+	funcionalidades nuevas que se hayan desarrollado para un cliente y Proyectos en los que
+	se necesite programar nuevas funcionalidades o integrar el programa con otras aplicaciones
+	del cliente final.
+	� Con el CIT se deber�a firmar un contrato de mantenimiento especial (que se vean favorecidos
+	respecto al resto de clientes, pero que no deje de ser una entrada fija de dinero a IVER).
+	� Es posible que exista financiaci�n de Europa para proyectos de este tipo. Ya no solo en
+	el desarrollo, que no creo que sea mucho lo que se pueda sacar, sino en proyectos de 
+	implantaci�n y soporte a gran escala (a partir de la Comunidad Valenciana, por ejemplo).
+
+- Sugerencia de Felipe: Ojo con copiar demasiado al ArcView, porque nos pueden meter puros
+  legales los de ESRI (aunque no los ganen, nos pueden putear). (Dise�o de los formularios).
+
+- Pasar los cuadros de di�logo m�s usuados (leyendas y abrir capas al FMap, y utilizar unos
+  derivados dentro de GVSIG.
+
+- �Se puede utilizar los datasources de GT2?. Derivar de ellos para que entreguen entidades
+  de las nuestras adem�s de las de JTS.
+
+- La ventana de asignaci�n de leyendas no debe depender del TOC. Se debe abrir con un layer
+  para inicializar como m�ximo, y fuera de la ventana que se asigne su leyenda a los temas
+  activos.
+  
+- Ser�a una buena idea eliminar la dependencia de las capas con el FMap que las contiene. De
+  esta forma, una misma capa podr�a estar en 2 MapControls a la vez, y supongo que nos
+  evitar�amos problemas cuando tengamos un "pool" de capas abierta.
+
+- Cambiar el sistema de s�mbolos por los Style2D de Geotools.
+
+- Revisar el FLyrVect. Puede no estar basado en un fichero (capa en memoria, FLyrWFS, etc),
+  as� que habr� que quitar el m_Path. Y si permitimos capas mixtas, quitar el
+  m_shapeType.
+
+- Cambiar el bitmap (boolean []) por una clase BitSet.
+
+- Quitar m_legendValues y m_labelValues de FLyrVect como Object [] y String []
+  y ponerlos como ArrayList para que FLyrMem no tenga que pedir un Object[] cada
+  vez que le hacen un addShape.
+
+- �Merece la pena poner el dgn y el dxf como un grupo de layers?
+	� Se podr�a permitir capas mixtas, con textos, puntos, lineas y pol�gonos.
+	  (Distinguir LAYER_TYPE de SHAPE_TYPE). Y en lugar de funcionar con tipos, es
+	  probable que sea mejor funcionar con clases distintas y jerarqu�a, usando
+	  "instanceof"
+	 
+	� En el TOC aparecer�an con un s�mbolo compuesto.
+	� El FLegendManagerWindow no mostrar�a solo la posibilidad de cambiar un s�mbolo
+	  de l�neas sino algo como ArcView (puedes fijar un s�mbolo de pol�gono para una 
+	  capa e l�neas, aunque no se pinte.
+	  
+- En lugar de meter el DGN y el DXF en memoria, hacer una librer�a que permita ir
+  cargando del disco duro.
+  
+- Mantener un "pool" con las capas abiertas, de forma que si trabajamos en memoria, 
+  no haga falta consumir memoria para 2 capas iguales. Las 2 capas deben apuntar a 
+  los mismos datos en memoria.
+  
+- Sustituir FRecordset por el interfaz TableModel. Es m�s simple, y es nativo de Java.
+
+- Capa DWG.
+
+- Implementar el resto de tipo de Shape en nuestro lector de shapes. �Usar otro (GT2)?
+
+- Mejorar la velocidad del lector de DBF.
+
+- Meter en FLyrMemory un DefaultTableModel y guardar ah� los atributos que deseemos.
+
+- Atributos de DGN que vamos a mostrar por ahora:
+	� Entity => Line String, Shape, Cell, Point
+	� Layer (= Level)
+	� Color
+	� Elevation
+	� LineTypeId
+	� LineWidth
+	� Text
+	
+- Atributos de DXF que vamos a mostrar por ahora:
+	� Entity => Line, Polyline, Insert, Point
+	� Layer
+	� Color
+	� Elevation
+	� LineTypeId
+	� LineWidth
+	� Text	
\ No newline at end of file

Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG/NotasFJP.txt
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native


Property changes on: tags/Root_gvSIG_CAD_Layout_version/applications/appgvSIG
___________________________________________________________________
Added: svn:ignore
   + bin
dist
gvSIG*.zip


