Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverLoadException.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverLoadException.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverLoadException.java	(revision 4539)
@@ -0,0 +1,35 @@
+package com.hardcode.driverManager;
+
+
+public class DriverLoadException extends RuntimeException {
+
+	/**
+	 * 
+	 */
+	public DriverLoadException() {
+		super();
+
+	}
+	/**
+	 * @param message
+	 */
+	public DriverLoadException(String message) {
+		super(message);
+
+	}
+	/**
+	 * @param message
+	 * @param cause
+	 */
+	public DriverLoadException(String message, Throwable cause) {
+		super(message, cause);
+
+	}
+	/**
+	 * @param cause
+	 */
+	public DriverLoadException(Throwable cause) {
+		super(cause);
+
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverLoadException.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/Driver.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/Driver.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/Driver.java	(revision 4539)
@@ -0,0 +1,17 @@
+package com.hardcode.driverManager;
+
+/**
+ * Interfaz que debe ser implementada por todos l
+ *
+ * @author Fernando González Cortés
+ */
+public interface Driver {
+    /**
+     * Debe devolver un objeto que se asociará en el manager al driver. El
+     * DriverManager recibirá peticiones de un objeto y deberá devolver el
+     * driver asociado
+     *
+     * @return Objeto asociado al driver. Se recomienda que sea un String
+     */
+    public String getName();
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/Driver.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/DriverManagerMain.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/DriverManagerMain.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/DriverManagerMain.java	(revision 4539)
@@ -0,0 +1,22 @@
+package com.hardcode.driverManager.pruebas;
+
+import java.io.File;
+import java.io.IOException;
+
+import com.hardcode.driverManager.DriverLoadException;
+import com.hardcode.driverManager.DriverManager;
+
+/**
+ * @author Fernando González Cortés
+ */
+public class DriverManagerMain {
+
+	public static void main(String[] args) throws IOException, DriverLoadException {
+		DriverManager dm = new DriverManager();
+		dm.loadDrivers(new File ("c:\\tirar\\"));
+		Adder a = (Adder) dm.getDriver("num");
+		System.out.println(a.add("3", "4"));
+		a = (Adder) dm.getDriver("txt");
+		System.out.println(a.add("3", "4"));
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/DriverManagerMain.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/NumericAdderDriver.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/NumericAdderDriver.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/NumericAdderDriver.java	(revision 4539)
@@ -0,0 +1,24 @@
+package com.hardcode.driverManager.pruebas;
+
+import com.hardcode.driverManager.Driver;
+
+/**
+ * @author Fernando González Cortés
+ */
+public class NumericAdderDriver implements Driver, Adder{
+
+	/**
+	 * @see com.hardcode.driverManager.pruebas.Adder#add(java.lang.String, java.lang.String)
+	 */
+	public String add(String a, String b) {
+		return new Integer(new Integer(a).intValue() + new Integer(b).intValue()).toString();
+	}
+
+	/**
+	 * @see com.hardcode.driverManager.Driver#getName()
+	 */
+	public String getName() {
+		return "drivers para números del Fernan";
+	}
+
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/NumericAdderDriver.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/Adder.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/Adder.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/Adder.java	(revision 4539)
@@ -0,0 +1,10 @@
+package com.hardcode.driverManager.pruebas;
+
+/**
+ * @author Fernando González Cortés
+ */
+public interface Adder {
+
+	public String add(String a, String b);
+
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/Adder.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/TextAdderDriver.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/TextAdderDriver.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/TextAdderDriver.java	(revision 4539)
@@ -0,0 +1,24 @@
+package com.hardcode.driverManager.pruebas;
+
+import com.hardcode.driverManager.Driver;
+
+/**
+ * @author Fernando González Cortés
+ */
+public class TextAdderDriver implements Driver, Adder{
+
+	/**
+	 * @see com.hardcode.driverManager.pruebas.Adder#add(java.lang.String, java.lang.String)
+	 */
+	public String add(String a, String b) {
+		return a+b;
+	}
+
+	/**
+	 * @see com.hardcode.driverManager.Driver#getName()
+	 */
+	public String getName() {
+		return "Driver para texto del Fernan";
+	}
+
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/pruebas/TextAdderDriver.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoaderManager.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoaderManager.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoaderManager.java	(revision 4539)
@@ -0,0 +1,47 @@
+package com.hardcode.driverManager;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+
+/**
+ * Esta clase mantiene la información sobre los classloader de los plugins con
+ * la intención de poder obtener dado el nombre de una clase la lista de
+ * PluginClassLoader que pueden cargarla
+ *
+ * @author Fernando González Cortés
+ */
+public abstract class DriverClassLoaderManager {
+    private static Hashtable nombresLista = new Hashtable();
+
+    /**
+     * Registra un class loader para una clase determinada
+     *
+     * @param className Nombre de la clase
+     * @param cl Classloader que puede cargar la clase
+     */
+    public static void registerClass(String className, ClassLoader cl) {
+        Vector lista = (Vector) nombresLista.get(className);
+
+        if (lista == null) {
+            lista = new Vector();
+            lista.add(cl);
+            nombresLista.put(className, lista);
+        } else {
+            lista.add(cl);
+        }
+    }
+
+    /**
+     * Devuelve la lista de classloader que pueden cargar la clase
+     *
+     * @param className Nombre de la clase de la cual se quiere obtener un
+     *        classloader que la cargue
+     *
+     * @return Vector de classLoaders que pueden cargar una clase con ese
+     *         nombre
+     */
+    public static Vector getClassLoaderList(String className) {
+        return (Vector) nombresLista.get(className);
+    }
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoaderManager.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverManager.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverManager.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverManager.java	(revision 4539)
@@ -0,0 +1,303 @@
+package com.hardcode.driverManager;
+
+import java.io.File;
+import java.io.IOException;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+
+/**
+ * Para el driver manager, el driver viene determinado por un directorio dentro
+ * del cual se encuentran uno o más jar's. La clase Driver ha de implementar
+ * la interfaz Driver y su nombre debe terminar en "Driver" y tener un
+ * constructor sin parámetros.
+ * 
+ * <p>
+ * Esta clase es la encargada de la carga y validación de los drivers y de la
+ * obtención de los mismo apartir de un tipo
+ * </p>
+ *
+ * @author Fernando González Cortés
+ */
+public class DriverManager {
+	private File extDir;
+	private DriverValidation validation;
+	private HashMap nombreDriverClass = new HashMap();
+	private ArrayList failures = new ArrayList();
+
+	/**
+	 * Devuelve un array con los directorios de los plugins
+	 *
+	 * @param dirExt Directorio a partir del que se cuelgan los directorios de
+	 * 		  los drivers
+	 *
+	 * @return Array de los subdirectorios
+	 */
+	private File[] getPluginDirs(File dirExt) {
+		if (!dirExt.exists()) {
+			return new File[0];
+		}
+
+		ArrayList ret = new ArrayList();
+		File[] files = dirExt.listFiles();
+
+		for (int i = 0; i < files.length; i++) {
+			if (files[i].isDirectory()) {
+				ret.add(files[i]);
+			}
+		}
+
+		return (File[]) ret.toArray(new File[0]);
+	}
+
+	/**
+	 * Obtiene los jar's de un directorio y los devuelve en un array
+	 *
+	 * @param dir Directorio del que se quieren obtener los jars
+	 *
+	 * @return Array de jars
+	 */
+	private URL[] getJars(File dir) {
+		ArrayList ret = new ArrayList();
+		File[] dirContent = dir.listFiles();
+
+		for (int i = 0; i < dirContent.length; i++) {
+			if (dirContent[i].getName().toLowerCase().endsWith(".jar")) {
+				try {
+					ret.add(new URL("file:" + dirContent[i].getAbsolutePath()));
+				} catch (MalformedURLException e) {
+					//No se puede dar
+				}
+			}
+		}
+
+		return (URL[]) ret.toArray(new URL[0]);
+	}
+
+	/**
+	 * Carga los drivers y asocia con el tipo del driver.
+	 *
+	 * @param dir Directorio raíz de los drivers
+	 */
+	public void loadDrivers(File dir) {
+		try {
+			if (validation == null) {
+				validation = new DriverValidation() {
+							public boolean validate(Driver d) {
+								return true;
+							}
+						};
+			}
+
+			//Se obtiene la lista de directorios
+			File[] dirs = getPluginDirs(dir);
+
+			//Para cada directorio se obtienen todos sus jars
+			for (int i = 0; i < dirs.length; i++) {
+				URL[] jars = getJars(dirs[i]);
+
+				//Se crea el classloader
+				DriverClassLoader cl = new DriverClassLoader(jars,
+						dirs[i].getAbsolutePath(),
+						this.getClass().getClassLoader());
+
+				//Se obtienen los drivers
+				Class[] drivers = cl.getDrivers();
+
+				//Se asocian los drivers con su tipo si superan la validación
+				for (int j = 0; j < drivers.length; j++) {
+					try {
+						Driver driver = (Driver) drivers[j].newInstance();
+
+						if (validation.validate(driver)) {
+							if (nombreDriverClass.put(driver.getName(),
+										drivers[j]) != null) {
+								throw new IllegalStateException(
+									"Two drivers with the same name");
+							}
+						}
+					} catch (ClassCastException e) {
+						/*
+						 * No todos los que terminan en Driver son drivers
+						 * de los nuestros, los ignoramos
+						 */
+					} catch (Throwable t) {
+						/*
+						 * Aún a riesgo de capturar algo que no debemos, ignoramos cualquier driver que pueda
+						 * dar cualquier tipo de problema, pero continuamos
+						 */
+						failures.add(t);
+					}
+				}
+			}
+		} catch (ClassNotFoundException e) {
+			failures.add((Throwable) e);
+		} catch (IOException e) {
+			failures.add((Throwable) e);
+		}
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public Throwable[] getLoadFailures() {
+		return (Throwable[]) failures.toArray(new Throwable[0]);
+	}
+
+	/**
+	 * Obtiene el Driver asociado al tipo que se le pasa como parámetro
+	 *
+	 * @param name Objeto que devolvió alguno de los drivers en su método
+	 * 		  getType
+	 *
+	 * @return El driver asociado o null si no se encuentra el driver
+	 *
+	 * @throws DriverLoadException if this Class represents an abstract class,
+	 * 		   an interface, an array class, a primitive type, or void; or if
+	 * 		   the class has no nullary constructor; or if the instantiation
+	 * 		   fails for some other reason
+	 */
+	public Driver getDriver(String name) throws DriverLoadException {
+		try {
+			Class driverClass = (Class) nombreDriverClass.get(name);
+			if (driverClass == null) throw new DriverLoadException("No se encontró el driver: " + name);
+			return (Driver) driverClass.newInstance();
+		} catch (InstantiationException e) {
+			throw new DriverLoadException(e);
+		} catch (IllegalAccessException e) {
+			throw new DriverLoadException(e);
+		}
+	}
+
+	/**
+	 * Establece el objeto validador de los drivers. En la carga se comprobará
+	 * si cada driver es válido mediante el método validate del objeto
+	 * validation establecido con este método. Pro defecto se validan todos
+	 * los drivers
+	 *
+	 * @param validation objeto validador
+	 */
+	public void setValidation(DriverValidation validation) {
+		this.validation = validation;
+	}
+
+	/**
+	 * Obtiene los tipos de todos los drivers del sistema
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public String[] getDriverNames() {
+		ArrayList names = new ArrayList(nombreDriverClass.size());
+
+		Iterator iterator = nombreDriverClass.keySet().iterator();
+
+		while (iterator.hasNext()) {
+			names.add((String) iterator.next());
+		}
+
+		return (String[]) names.toArray(new String[0]);
+	}
+
+	/**
+	 * Obtiene la clase del driver relacionado con el tipo que se pasa como
+	 * parámetro
+	 *
+	 * @param driverName DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public Class getDriverClassByName(String driverName) {
+		return (Class) nombreDriverClass.get(driverName);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param driverName DOCUMENT ME!
+	 * @param superClass DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws RuntimeException DOCUMENT ME!
+	 */
+	public boolean isA(String driverName, Class superClass) {
+		Class driverClass = (Class) nombreDriverClass.get(driverName);
+
+		if (driverClass == null) {
+			throw new RuntimeException("No such driver");
+		}
+
+		Class[] interfaces = driverClass.getInterfaces();
+
+		if (interfaces != null) {
+			for (int i = 0; i < interfaces.length; i++) {
+				if (interfaces[i] == superClass) {
+					return true;
+				} else {
+					if (recursiveIsA(interfaces[i], superClass)) {
+						return true;
+					}
+				}
+			}
+		}
+
+		Class class_ = driverClass.getSuperclass();
+
+		if (class_ != null) {
+			if (class_ == superClass) {
+				return true;
+			} else {
+				if (recursiveIsA(class_, superClass)) {
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param interface_ DOCUMENT ME!
+	 * @param superInterface DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	private boolean recursiveIsA(Class interface_, Class superInterface) {
+		Class[] interfaces = interface_.getInterfaces();
+
+		if (interfaces != null) {
+			for (int i = 0; i < interfaces.length; i++) {
+				if (interfaces[i] == superInterface) {
+					return true;
+				} else {
+					if (recursiveIsA(interfaces[i], superInterface)) {
+						return true;
+					}
+				}
+			}
+		}
+
+		Class class_ = interface_.getSuperclass();
+
+		if (class_ != null) {
+			if (class_ == superInterface) {
+				return true;
+			} else {
+				if (recursiveIsA(class_, superInterface)) {
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverManager.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverValidation.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverValidation.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverValidation.java	(revision 4539)
@@ -0,0 +1,18 @@
+package com.hardcode.driverManager;
+
+/**
+ * Interfaz a implementar por los objetos de validación
+ *
+ * @author Fernando González Cortés
+ */
+public interface DriverValidation {
+    /**
+     * El método validate se invocará al crear los drivers, y será el validador
+     * el que indicará qué driver es válido para la aplicación y cual no
+     *
+     * @param d Driver a validar
+     *
+     * @return true o false en caso de que el driver sea o no sea valido
+     */
+    public boolean validate(Driver d);
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverValidation.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/WriterManager.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/WriterManager.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/WriterManager.java	(revision 4539)
@@ -0,0 +1,301 @@
+package com.hardcode.driverManager;
+
+import java.io.File;
+import java.io.IOException;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+
+/**
+ * Para el writer manager, el writer viene determinado por un directorio dentro
+ * del cual se encuentran uno o más jar's. La clase Writer ha de implementar
+ * la interfaz Writer y su nombre debe terminar en "Writer" y tener un
+ * constructor sin parámetros.
+ *
+ * <p>
+ * Esta clase es la encargada de la carga y validación de los writers y de la
+ * obtención de los mismo apartir de un tipo
+ * </p>
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class WriterManager {
+	private DriverValidation validation;
+	private HashMap nombreWriterClass = new HashMap();
+	private ArrayList failures = new ArrayList();
+
+	/**
+	 * Devuelve un array con los directorios de los plugins
+	 *
+	 * @param dirExt Directorio a partir del que se cuelgan los directorios de
+	 * 		  los drivers
+	 *
+	 * @return Array de los subdirectorios
+	 */
+	private File[] getPluginDirs(File dirExt) {
+		if (!dirExt.exists()) {
+			return new File[0];
+		}
+
+		ArrayList ret = new ArrayList();
+		File[] files = dirExt.listFiles();
+
+		for (int i = 0; i < files.length; i++) {
+			if (files[i].isDirectory()) {
+				ret.add(files[i]);
+			}
+		}
+
+		return (File[]) ret.toArray(new File[0]);
+	}
+
+	/**
+	 * Obtiene los jar's de un directorio y los devuelve en un array
+	 *
+	 * @param dir Directorio del que se quieren obtener los jars
+	 *
+	 * @return Array de jars
+	 */
+	private URL[] getJars(File dir) {
+		ArrayList ret = new ArrayList();
+		File[] dirContent = dir.listFiles();
+
+		for (int i = 0; i < dirContent.length; i++) {
+			if (dirContent[i].getName().toLowerCase().endsWith(".jar")) {
+				try {
+					ret.add(new URL("file:" + dirContent[i].getAbsolutePath()));
+				} catch (MalformedURLException e) {
+					//No se puede dar
+				}
+			}
+		}
+
+		return (URL[]) ret.toArray(new URL[0]);
+	}
+
+	/**
+	 * Carga los drivers y asocia con el tipo del driver.
+	 *
+	 * @param dir Directorio raíz de los drivers
+	 */
+	public void loadWriters(File dir) {
+		try {
+			if (validation == null) {
+				validation = new DriverValidation() {
+							public boolean validate(Driver d) {
+								return true;
+							}
+						};
+			}
+
+			//Se obtiene la lista de directorios
+			File[] dirs = getPluginDirs(dir);
+
+			//Para cada directorio se obtienen todos sus jars
+			for (int i = 0; i < dirs.length; i++) {
+				URL[] jars = getJars(dirs[i]);
+
+				//Se crea el classloader
+				DriverClassLoader cl = new DriverClassLoader(jars,
+						dirs[i].getAbsolutePath(),
+						this.getClass().getClassLoader());
+
+				//Se obtienen los drivers
+				Class[] writers = cl.getWriters();
+
+				//Se asocian los drivers con su tipo si superan la validación
+				for (int j = 0; j < writers.length; j++) {
+					try {
+						Driver driver = (Driver) writers[j].newInstance();
+
+						if (validation.validate(driver)) {
+							if (nombreWriterClass.put(driver.getName(),
+										writers[j]) != null) {
+								throw new IllegalStateException(
+									"Two drivers with the same name");
+							}
+						}
+					} catch (ClassCastException e) {
+						/*
+						 * No todos los que terminan en Driver son drivers
+						 * de los nuestros, los ignoramos
+						 */
+					} catch (Throwable t) {
+						/*
+						 * Aún a riesgo de capturar algo que no debemos, ignoramos cualquier driver que pueda
+						 * dar cualquier tipo de problema, pero continuamos
+						 */
+						failures.add(t);
+					}
+				}
+			}
+		} catch (ClassNotFoundException e) {
+			failures.add((Throwable) e);
+		} catch (IOException e) {
+			failures.add((Throwable) e);
+		}
+	}
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public Throwable[] getLoadFailures() {
+		return (Throwable[]) failures.toArray(new Throwable[0]);
+	}
+
+	/**
+	 * Obtiene el Writer asociado al tipo que se le pasa como parámetro
+	 *
+	 * @param name Objeto que devolvió alguno de los writers en su método
+	 * 		  getType
+	 *
+	 * @return El writer asociado o null si no se encuentra el driver
+	 *
+	 * @throws DriverLoadException if this Class represents an abstract class,
+	 * 		   an interface, an array class, a primitive type, or void; or if
+	 * 		   the class has no nullary constructor; or if the instantiation
+	 * 		   fails for some other reason
+	 */
+	public Driver getWriter(String name) throws DriverLoadException {
+		try {
+			Class driverClass = (Class) nombreWriterClass.get(name);
+			if (driverClass == null) throw new DriverLoadException("No se encontró el writer: " + name);
+			return (Driver) driverClass.newInstance();
+		} catch (InstantiationException e) {
+			throw new DriverLoadException(e);
+		} catch (IllegalAccessException e) {
+			throw new DriverLoadException(e);
+		}
+	}
+
+	/**
+	 * Establece el objeto validador de los drivers. En la carga se comprobará
+	 * si cada driver es válido mediante el método validate del objeto
+	 * validation establecido con este método. Pro defecto se validan todos
+	 * los drivers
+	 *
+	 * @param validation objeto validador
+	 */
+	public void setValidation(DriverValidation validation) {
+		this.validation = validation;
+	}
+
+	/**
+	 * Obtiene los tipos de todos los writers del sistema
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public String[] getWriterNames() {
+		ArrayList names = new ArrayList(nombreWriterClass.size());
+
+		Iterator iterator = nombreWriterClass.keySet().iterator();
+
+		while (iterator.hasNext()) {
+			names.add((String) iterator.next());
+		}
+
+		return (String[]) names.toArray(new String[0]);
+	}
+
+	/**
+	 * Obtiene la clase del writer relacionado con el tipo que se pasa como
+	 * parámetro
+	 *
+	 * @param driverName DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public Class getWriterClassByName(String writerName) {
+		return (Class) nombreWriterClass.get(writerName);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param writerName DOCUMENT ME!
+	 * @param superClass DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 *
+	 * @throws RuntimeException DOCUMENT ME!
+	 */
+	public boolean isA(String writerName, Class superClass) {
+		Class writerClass = (Class) nombreWriterClass.get(writerName);
+
+		if (writerClass == null) {
+			throw new RuntimeException("No such driver");
+		}
+
+		Class[] interfaces = writerClass.getInterfaces();
+
+		if (interfaces != null) {
+			for (int i = 0; i < interfaces.length; i++) {
+				if (interfaces[i] == superClass) {
+					return true;
+				} else {
+					if (recursiveIsA(interfaces[i], superClass)) {
+						return true;
+					}
+				}
+			}
+		}
+
+		Class class_ = writerClass.getSuperclass();
+
+		if (class_ != null) {
+			if (class_ == superClass) {
+				return true;
+			} else {
+				if (recursiveIsA(class_, superClass)) {
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param interface_ DOCUMENT ME!
+	 * @param superInterface DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	private boolean recursiveIsA(Class interface_, Class superInterface) {
+		Class[] interfaces = interface_.getInterfaces();
+
+		if (interfaces != null) {
+			for (int i = 0; i < interfaces.length; i++) {
+				if (interfaces[i] == superInterface) {
+					return true;
+				} else {
+					if (recursiveIsA(interfaces[i], superInterface)) {
+						return true;
+					}
+				}
+			}
+		}
+
+		Class class_ = interface_.getSuperclass();
+
+		if (class_ != null) {
+			if (class_ == superInterface) {
+				return true;
+			} else {
+				if (recursiveIsA(class_, superInterface)) {
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/WriterManager.java
___________________________________________________________________
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoader.java
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoader.java	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoader.java	(revision 4539)
@@ -0,0 +1,336 @@
+package com.hardcode.driverManager;
+
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.Vector;
+import java.util.jar.JarException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+
+/**
+ * Class loader que carga las clases pedidas por los plugins de manera que
+ * primero busca en el classpath, luego busca en el directorio del propio
+ * plugin en los jars especificados por el xml y en caso de no encontrar la
+ * clase pide al PluginClassLoaderManager la lista de plugins que pueden
+ * satisfacer la clase e intenta cargarlo con cada un de ellos hasta que lo
+ * consigue con uno.
+ *
+ * @author Fernando González Cortés
+ */
+public class DriverClassLoader extends URLClassLoader {
+    private Hashtable clasesJar = new Hashtable();
+    private String baseDir;
+
+    /**
+     * Creates a new PluginClassLoader object.
+     *
+     * @param jars Array con la ruta de los jars en los que buscará las clases
+     *        el plugin
+     * @param baseDir Directorio base del plugin que se carga. Es en directorio
+     *        donde se buscan los resources en el método getResources
+     * @param cl ClassLoader padre del classLoader, al que se le pedirá
+     *        resolver las clases antes de utilizar el algoritmo propio
+     *
+     * @throws IOException Si no se puede leer alguno de los jars
+     * @throws IllegalArgumentException Si no se especifica un array de jars
+     * @throws JarException Si hay dos clases con el mismo nombre en el plugin
+     */
+    public DriverClassLoader(URL[] jars, String baseDir, ClassLoader cl)
+        throws IOException {
+        super(jars, cl);
+        this.baseDir = baseDir;
+
+        if (jars == null) {
+            throw new IllegalArgumentException("jars cannot be null"); //$NON-NLS-1$
+        }
+
+        //Se itera por las URLS que deben de ser jar's
+        ZipFile[] jarFiles = new ZipFile[jars.length];
+
+        for (int i = 0; i < jars.length; i++) {
+            jarFiles[i] = new ZipFile(jars[i].getPath());
+
+            Enumeration entradas = jarFiles[i].entries();
+
+            //Se itera por todos los .class del jar
+            while (entradas.hasMoreElements()) {
+                //Se obtiene la entrada
+                ZipEntry file = (ZipEntry) entradas.nextElement();
+                String fileName = file.getName();
+
+                //Se obtiene el nombre de la clase
+                if (!fileName.toLowerCase().endsWith(".class")) { //$NON-NLS-1$
+
+                    continue;
+                }
+
+                fileName = fileName.substring(0, fileName.length() - 6).replace('/',
+                        '.');
+
+                //Se cromprueba si ya había una clase con dicho nombre
+                if (clasesJar.get(fileName) != null) {
+                    throw new JarException(
+                        "two or more classes with the same name in the jars: " +
+                        fileName);
+                }
+
+                //Se registra la clase
+                clasesJar.put(fileName, jarFiles[i]);
+                DriverClassLoaderManager.registerClass(fileName, this);
+            }
+        }
+    }
+
+    /**
+     * Carga la clase
+     *
+     * @param name Nombre de la clase
+     * @param resolve SI se ha de resolver la clase o no
+     *
+     * @return Clase cargada
+     *
+     * @throws ClassNotFoundException Si no se pudo encontrar la clase
+     */
+    protected Class loadClass(String name, boolean resolve)
+        throws ClassNotFoundException {
+    	Class c = null;
+
+        try {
+            c = super.loadClass(name, resolve);
+        } catch (ClassNotFoundException e1) {
+            if (c == null) {
+                // Convert class name argument to filename
+                // Convert package names into subdirectories
+                try {
+                    ZipFile jar = (ZipFile) clasesJar.get(name);
+
+                    if (jar == null) {
+                        Vector cls = (Vector) DriverClassLoaderManager.getClassLoaderList(name);
+
+                        if (cls != null) {
+                            for (int i = 0; i < cls.size(); i++) {
+                                c = ((DriverClassLoader) cls.elementAt(i)).loadClass(name,
+                                        resolve);
+
+                                if (c != null) {
+                                    break;
+                                }
+                            }
+                        }
+                    } else {
+                        String fileName = name.replace('.', '/') + ".class"; //$NON-NLS-1$
+                        ZipEntry classFile = jar.getEntry(fileName);
+                        byte[] data = loadClassData(classFile,
+                                jar.getInputStream(classFile));
+
+                        c = defineClass(name, data, 0, data.length);
+                    }
+
+                    if (c == null) {
+                        throw new ClassNotFoundException(name);
+                    }
+                } catch (IOException e) {
+                    throw new ClassNotFoundException("Error_reading_file" +
+                        name); //$NON-NLS-1$
+                }
+            }
+        }
+
+        if (resolve) {
+            resolveClass(c);
+        }
+
+        return c;
+    }
+
+    /**
+     * obtiene el array de bytes de la clase
+     *
+     * @param classFile Entrada dentro del jar contiene los bytecodes de la
+     *        clase (el .class)
+     * @param is InputStream para leer la entrada del jar
+     *
+     * @return Bytes de la clase
+     *
+     * @throws IOException Si no se puede obtener el .class del jar
+     */
+    private byte[] loadClassData(ZipEntry classFile, InputStream is)
+        throws IOException {
+        // Get size of class file
+        int size = (int) classFile.getSize();
+
+        // Reserve space to read
+        byte[] buff = new byte[size];
+
+        // Get stream to read from
+        DataInputStream dis = new DataInputStream(is);
+
+        // Read in data
+        dis.readFully(buff);
+
+        // close stream
+        dis.close();
+
+        // return data
+        return buff;
+    }
+
+    /**
+     * Obtiene los recursos tomando como la raiz el directorio base del plugin.
+     * Si no se encuentra el recurso ahí se invoca a getResource del
+     * classloader padre, que buscará en el jar de la aplicación. Si ahí
+     * tampoco se encuentra nada se devolverá null.
+     *
+     * @param res Nombre del recurso
+     *
+     * @return URL del recurso o null si no se pudo encontrar
+     */
+    public URL getResource(String res) {
+        File dir = new File(baseDir);
+
+        try {
+            ArrayList resource = new ArrayList();
+            StringTokenizer st = new StringTokenizer(res, "\\/");
+
+            while (st.hasMoreTokens()) {
+                String token = st.nextToken();
+                resource.add(token);
+            }
+
+            URL ret = getResource(dir, resource);
+
+            if (ret != null) {
+                return ret;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return super.getResource(res);
+    }
+
+    /**
+     * Busca recursivamente el recurso res en el directorio base. res es una
+     * lista de String's con los directorios del path y base es el directorio
+     * a partir del cual se busca dicho recurso. En cada ejecución del método
+     * se toma el primer elemento de res y se busca dicho directorio en el
+     * directorio base. Si se encuentra, será el directorio base para una
+     * nueva llamada.
+     *
+     * @param base Directorio desde donde parte la búsqueda del recurso.
+     * @param res Lista de strings con el path del recurso que se quiere
+     *        encontrar
+     *
+     * @return URL con el recurso
+     */
+    private URL getResource(File base, List res) {
+        File[] files = base.listFiles();
+
+        String parte = (String) res.get(0);
+
+        for (int i = 0; i < files.length; i++) {
+            if (files[i].getName().compareTo(parte) == 0) {
+                if (res.size() == 1) {
+                    try {
+                        return new URL("file:" + files[i].toString());
+                    } catch (MalformedURLException e) {
+                        return null;
+                    }
+                } else {
+                    return getResource(files[i], res.subList(1, res.size()));
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Devuelve el nombre del directorio del plugin
+     *
+     * @return
+     */
+    public String getPluginName() {
+        String ret = baseDir.substring(baseDir.lastIndexOf(File.separatorChar) +
+                1);
+
+        return ret;
+    }
+
+    /**
+     * @see java.security.SecureClassLoader#getPermissions(java.security.CodeSource)
+     */
+    protected PermissionCollection getPermissions(CodeSource codesource) {
+        Permissions perms = new Permissions();
+        perms.add(new AllPermission());
+
+        return (perms);
+    }
+
+    /**
+     * Devuelve una instancia de cada driver encontrado en los jars del
+     * classloader
+     *
+     * @return array de drivers
+     *
+     * @throws ClassNotFoundException if the class cannot be located by the
+     *         specified class loader
+     */
+    public Class[] getDrivers() throws ClassNotFoundException{
+        ArrayList drivers = new ArrayList();
+        Enumeration e = clasesJar.keys();
+
+        while (e.hasMoreElements()) {
+            String fileName = (String) e.nextElement();
+
+            if (fileName.endsWith("Driver")) {
+                Class driver = (Class) this.loadClass(fileName);
+                drivers.add(driver);
+            }
+        }
+
+        return (Class[]) drivers.toArray(new Class[0]);
+    }
+    /**
+     * Devuelve una instancia de cada writer encontrado en los jars del
+     * classloader
+     *
+     * @return array de drivers
+     *
+     * @throws ClassNotFoundException if the class cannot be located by the
+     *         specified class loader
+     */
+    public Class[] getWriters() throws ClassNotFoundException{
+        ArrayList writers = new ArrayList();
+        Enumeration e = clasesJar.keys();
+
+        while (e.hasMoreElements()) {
+            String fileName = (String) e.nextElement();
+
+            if (fileName.endsWith("Writer")) {
+                Class driver = (Class) this.loadClass(fileName);
+                writers.add(driver);
+            }
+        }
+
+        return (Class[]) writers.toArray(new Class[0]);
+    }
+}

Property changes on: tags/AS_STABLE/libraries/libDriverManager/src/com/hardcode/driverManager/DriverClassLoader.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/.cvsignore
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/.cvsignore	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/.cvsignore	(revision 4539)
@@ -0,0 +1 @@
+bin

Property changes on: tags/AS_STABLE/libraries/libDriverManager/.cvsignore
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/build.xml
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/build.xml	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/build.xml	(revision 4539)
@@ -0,0 +1,16 @@
+<project name="Driver Manager" default="generar-jar" basedir=".">
+	<description>
+        Instala el plugin
+    </description>
+	<!-- set global properties for this build
+	<property name="drivers-dir" location="../Andami/gvSIG/extensiones/com.iver.cit.gvsig/drivers" />-->
+
+	<target name="init">
+		<!-- Create the time stamp -->
+		<tstamp />
+	</target>
+
+	<target name="generar-jar" depends="init" description="Genera los jars del driver manager">
+		<jar jarfile="driver-manager-1.1.jar" basedir="./bin"/>
+	</target>
+</project>
\ No newline at end of file

Property changes on: tags/AS_STABLE/libraries/libDriverManager/build.xml
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libDriverManager/.classpath
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/.classpath	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/.classpath	(revision 4539)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+    <classpathentry kind="src" path="src"/>
+    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+    <classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tags/AS_STABLE/libraries/libDriverManager/.classpath
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libDriverManager/.project
===================================================================
--- tags/AS_STABLE/libraries/libDriverManager/.project	(revision 0)
+++ tags/AS_STABLE/libraries/libDriverManager/.project	(revision 4539)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>libDriverManager</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>de.loskutov.FileSync.FSBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tags/AS_STABLE/libraries/libDriverManager/.project
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision


Property changes on: tags/AS_STABLE/libraries/libDriverManager
___________________________________________________________________
Added: svn:ignore
   + bin


Index: tags/AS_STABLE/libraries/libCorePlugin/text_fr.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_fr.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_fr.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_fr.properties
+__catalan=catalan
+aceptar=Accepter
+cancelar=Annuler
+Cascada=Cascade
+cascada_enable=Au moins une fenêtre doit être ouverte
+cascada_tooltip=Organiser les fenêtres en cascade
+Configurar=Configurer
+configurar_ANDAMI= Fenêtre de configuration d'ANDAMI.
+Consola=Console
+descripcion=Description
+directorio=Répertoire 
+directorio_extensiones= Répertoire des extensions
+errores=Erreurs
+examinar=Examiner
+extension_activada=Extension activée.
+general=Général 
+info=Information
+opciones=Options
+prioridad=Priorité
+Tile=Mosaïque
+tile_tooltip=Organiser les fenêtres en mosaïque 
+titulo_consola=Console d'information
+todos=Tous
+ventana=Fenêtre
+Ver=Afficher
+warnings=Attention
+Window= Fenêtre

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_fr.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/text_eu.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_eu.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_eu.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_eu.properties
+__catalan=valenciano
+aceptar=Ados
+cancelar=Utzi
+Cascada=Kaskadan
+cascada_enable=Leiho bat, gutxienez, irekita egon behar da
+cascada_tooltip=Antolatu leihoak kaskadan
+Configurar=Konfiguratu
+configurar_ANDAMI=ANDAMIren konfigurazio-elkarrizketa. 
+Consola=Kontsola
+descripcion=Deskripzioa
+directorio=Direktorioa
+directorio_extensiones=Luzapenen direktorioa.
+errores=Erroreak
+examinar=Aztertu
+extension_activada=Luzapena gaituta.
+general=Orokorra
+info=Informazioa
+opciones=Aukerak
+prioridad=Lehentasuna
+Tile=Mosaikoan
+tile_tooltip=Antolatu leihoak mosaikoan
+titulo_consola=Informazio-kontsola
+todos=Denak
+ventana=Leihoa
+Ver=Ikusi
+warnings=Oharrak
+Window=Leihoa

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_eu.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/text_it.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_it.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_it.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_it.properties
+__catalan=valenciano
+aceptar=Accetta
+cancelar=Cancella
+Cascada=Cascata
+cascada_enable=Devi aprire almeno una finestra
+cascada_tooltip=Organizza le finestre a cascata
+Configurar=Configura
+configurar_ANDAMI=Dialogo di confogurazione di ANDAMI
+Consola=Console
+descripcion=Descrizione
+directorio=Registro
+directorio_extensiones=Registro delle estensioni
+errores=Errori
+examinar=Esaminare
+extension_activada=Estensione attivata
+general=Generale
+info=Informazione
+opciones=Opzioni
+prioridad=Priorit\u00E1
+Tile=Mosaico
+tile_tooltip=Organizza le finestre a mosaico
+titulo_consola=Console di informazione
+todos=Tutti
+ventana=Finestra
+Ver=Vedi
+warnings=Avisi
+Window=Finestra

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_it.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/.cvsignore
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/.cvsignore	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/.cvsignore	(revision 4539)
@@ -0,0 +1 @@
+bin

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/.cvsignore
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/text.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text.properties	(revision 4539)
@@ -0,0 +1,32 @@
+#text.properties
+__catalan=valenciano
+aceptar=Aceptar
+cancelar=Cancelar
+Cascada=Cascada
+cascada_enable=Debe haber al menos una ventana abierta
+cascada_tooltip=Organiza las ventanas en cascada
+Configurar=Configurar
+configurar_ANDAMI=Di\u00E1logo de configuraci\u00F3n de ANDAMI.
+Consola=Consola
+descripcion=Descripci\u00F3n
+directorio=Directorio
+directorio_extensiones=Directorio de las extensiones.
+errores=Errores
+examinar=Examinar
+extension_activada=Extensi\u00F3n activada.
+general=General
+info=Informacion
+opciones=Opciones
+prioridad=Prioridad
+Tile=Mosaico
+tile_tooltip=Organiza las ventanas en mosaico
+titulo_consola=Consola de informacion
+todos=Todos
+ventana=Ventana
+Ver=Ver
+warnings=Avisos
+Window=Ventana
+debe_estar_activada=debe estar activada
+detalles=detalles
+activa_la_ventana=activa la ventana
+mosaico_tooltip=mosaico tooltip
\ No newline at end of file

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/text_ca.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_ca.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_ca.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_ca.properties
+__catalan=valenci\u00E0
+aceptar=Acceptar
+cancelar=Cancel\u00B7lar
+Cascada=Cascada
+cascada_enable=Ha d'haver-hi almenys una finestra oberta
+cascada_tooltip=Organitzar les finestres en cascada
+Configurar=Configurar
+configurar_ANDAMI=Di\u00E0leg de configuraci\u00F3 d'ANDAMI
+Consola=Consola
+descripcion=Descripci\u00F3
+directorio=Directori
+directorio_extensiones=Directori de les extensions
+errores=Errors
+examinar=Examinar
+extension_activada=Extensi\u00F3 activada
+general=General
+info=Informaci\u00F3
+opciones=Opcions
+prioridad=Prioritat
+Tile=Mosaic
+tile_tooltip=Organitzar les finestres en mosaic
+titulo_consola=Consola d'informaci\u00F3
+todos=Tots
+ventana=Finestra
+Ver=Veure
+warnings=Avisos
+Window=Finestra

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_ca.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/text_pt.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_pt.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_pt.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_pt.properties
+__catalan=valenciano
+aceptar=OK
+cancelar=Cancelar
+Cascada=Cascata
+cascada_enable=Deve existir ao menos um quadro vis\u00EDvel
+cascada_tooltip=Arranjar janelas em cascata
+Configurar=Configurar
+configurar_ANDAMI=Di\u00E1log de configura\u00E7\u00E3o do ANDAMI.
+Consola=Console
+descripcion=Descri\u00E7\u00E3o
+directorio=Diret\u00F3rio
+directorio_extensiones=Diret\u00F3rio de extens\u00F5es
+errores=Erro
+examinar=Examinar
+extension_activada=Extens\u00E3o ativa.  
+general=Geral
+info=Informa\u00E7\u00E3o
+opciones=Op\u00E7\u00F5es
+prioridad=Prioridade
+Tile=Lado a Lado
+tile_tooltip=Arranjar a janela Lado a Lado
+titulo_consola=Informa\u00E7\u00E3o de console
+todos=Todos
+ventana=Janela
+Ver=Ver
+warnings=Aviso
+Window=Janela

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_pt.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

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

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/.project
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConfigExtension.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConfigExtension.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConfigExtension.java	(revision 4539)
@@ -0,0 +1,90 @@
+/* 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.core;
+
+
+/**
+ */
+import com.iver.andami.PluginServices;
+import com.iver.andami.plugins.Extension;
+import com.iver.core.configExtensions.ConfigPlugins;
+
+
+
+/**
+ * Extensión para abrir el diálogo de configuración de ANDAMI.
+ *
+ * @author Vicente Caballero Navarro
+ * 
+ * 
+ */
+public class ConfigExtension implements Extension {
+   
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		ConfigPlugins cp=new ConfigPlugins();
+		PluginServices.getMDIManager().addView(cp);
+	}
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public boolean isVisible() {
+    	return true;
+    }
+
+    /**
+     * @see com.iver.mdiApp.plugins.Extension#isEnabled()
+     */
+    public boolean isEnabled() {
+        return true;
+    }
+
+	/**
+	 * @see com.iver.andami.plugins.Extension#inicializar()
+	 */
+	public void inicializar() {
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConfigExtension.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/SingletonViewSupport.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/SingletonViewSupport.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/SingletonViewSupport.java	(revision 4539)
@@ -0,0 +1,341 @@
+/* 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.core.mdiManager;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.TreeMap;
+
+import javax.swing.JComponent;
+import javax.swing.JInternalFrame;
+
+import com.iver.andami.ui.mdiManager.SingletonDialogAlreadyShownException;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class SingletonViewSupport {
+	private static int singletonViewInfoID = 0;
+	/** Hashtable que asocia contenido con vistas */
+	private HashMap contentViewInfo = new HashMap();
+	private ViewInfoSupport vis;
+	private FrameViewSupport frameViewSupport;
+	private HashMap contentFrame = new HashMap();
+	
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param vis DOCUMENT ME!
+	 * @param fvs
+	 *
+	 * @see com.iver.andami.ui.mdiManager.MDIManager#init(com.iver.andami.ui.mdiFrame.MDIFrame)
+	 */
+	public SingletonViewSupport(ViewInfoSupport vis, FrameViewSupport fvs) {
+		this.vis = vis;
+		this.frameViewSupport = fvs;
+	}
+
+	/**
+	 * Devuelve una referencia a la vista si ya está mostrada o null si la
+	 * vista no ha sido añadida o ya fue cerrada
+	 *
+	 * @param viewClass DOCUMENT ME!
+	 * @param model DOCUMENT ME!
+	 * @param vi DOCUMENT ME!
+	 *
+	 * @return true si la vista existe ya y false si la vista no existe
+	 *
+	 * @throws SingletonDialogAlreadyShownException DOCUMENT ME!
+	 */
+	public boolean registerView(Class viewClass, Object model, ViewInfo vi) {
+		//Se comprueba si la vista está siendo mostrada
+		SingletonViewInfo svi = new SingletonViewInfo(viewClass, model);
+
+		if (contentViewInfo.containsKey(svi)) {
+			if (vi.isModal()) {
+				throw new SingletonDialogAlreadyShownException();
+			}
+
+			vi.setViewInfo((ViewInfo)contentViewInfo.get(svi));
+			
+			return true;
+		} else {
+			//La vista singleton no estaba mostrada
+			//Se asocia el modelo con la vista
+			contentViewInfo.put(svi, vi);
+			return false;
+		}
+	}
+
+	public void openSingletonView(SingletonView sv, JComponent frame){
+		SingletonViewInfo svi = new SingletonViewInfo(sv.getClass(), sv.getViewModel());
+		contentFrame.put(svi, frame);
+	}
+	
+	public boolean contains(SingletonView sv){
+		SingletonViewInfo svi = new SingletonViewInfo(sv.getClass(), sv.getViewModel());
+		return contentFrame.containsKey(svi);
+	}
+	
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param s
+	 */
+	public void closeView(SingletonView s) {
+		SingletonViewInfo svi = new SingletonViewInfo(s.getClass(), s.getViewModel());
+		ViewInfo viewInfo = (ViewInfo) contentViewInfo.get(svi);
+		JInternalFrame c = (JInternalFrame) contentFrame.get(svi); 
+		viewInfo.setWidth(c.getWidth());
+		viewInfo.setHeight(c.getHeight());
+		viewInfo.setX(c.getX());
+		viewInfo.setY(c.getY());
+        
+		contentFrame.remove(svi);
+	}
+	
+	/**
+	 * Representa una vista singleton manteniendo el modelo y la clase de la
+	 * vista que lo muestra
+	 *
+	 * @author Fernando González Cortés
+	 */
+	public class SingletonViewInfo {
+		
+		public int id;
+		
+		/** Clase de la vista */
+		public Class clase;
+
+		/** Modelo que representa la vista */
+		public Object modelo;
+		
+		/**
+		 * Creates a new SingletonView object.
+		 *
+		 * @param clase Clase de la vista
+		 * @param modelo Modelo que representa la vista
+		 */
+		public SingletonViewInfo(Class clase, Object modelo) {
+			this.clase = clase;
+			this.modelo = modelo;
+			this.id = singletonViewInfoID;
+			singletonViewInfoID++;
+		}
+
+		/**
+		 * @see java.lang.Object#equals(java.lang.Object)
+		 */
+		public boolean equals(Object obj) {
+			if (obj.getClass() != SingletonViewInfo.class) {
+				throw new IllegalArgumentException();
+			}
+
+			SingletonViewInfo s = (SingletonViewInfo) obj;
+
+			if ((clase == s.clase) && (modelo == s.modelo)) {
+				return true;
+			} else {
+				return false;
+			}
+		}
+	}
+
+	private JInternalFrame getFrame(SingletonViewInfo svi){
+		ViewInfo vi = (ViewInfo) contentViewInfo.get(svi);
+		return (JInternalFrame) contentFrame.get(svi);
+	}
+	
+	public JInternalFrame getFrame(Class viewClass, Object model){
+		SingletonViewInfo svi = new SingletonViewInfo(viewClass, model);
+		return getFrame(svi);
+	}
+
+	/**
+	 * @param model
+	 * @return
+	 */
+	public JInternalFrame[] getFrames(Object model) {
+		ArrayList ret = new ArrayList();
+		
+		ArrayList keys = contentFrame.getKeys();
+		for (int i = 0; i < keys.size(); i++) {
+			SingletonViewInfo svi = (SingletonViewInfo) keys.get(i);
+			
+			if (svi.modelo == model){
+				ret.add(contentFrame.get(svi));
+			}
+		}
+		
+		return (JInternalFrame[]) ret.toArray(new JInternalFrame[0]);
+	}
+
+	/**
+	 * @param view
+	 * @return
+	 */
+	public JInternalFrame getFrame(SingletonView sv) {
+		SingletonViewInfo svi = new SingletonViewInfo(sv.getClass(), sv.getViewModel());
+		return getFrame(svi);
+	}
+
+	/**
+	 * @param sv
+	 * @param i
+	 */
+	public void setX(SingletonView sv, int x) {
+		JInternalFrame o = (JInternalFrame) contentFrame.get(new SingletonViewInfo(sv.getClass(), sv.getViewModel()));
+
+        if (o == null) return;
+        o.setLocation(x, o.getY());
+	}
+
+	/**
+	 * @param sv
+	 * @param i
+	 */
+	public void setY(SingletonView sv, int y) {
+		JInternalFrame o = (JInternalFrame) contentFrame.get(new SingletonViewInfo(sv.getClass(), sv.getViewModel()));
+
+        if (o == null) return;
+        
+        o.setLocation(o.getX(), y);
+	}
+
+	/**
+	 * @param sv
+	 * @param i
+	 */
+	public void setHeight(SingletonView sv, int height) {
+		JInternalFrame o = (JInternalFrame) contentFrame.get(new SingletonViewInfo(sv.getClass(), sv.getViewModel()));
+
+        if (o == null) return;
+            
+        o.setSize(o.getWidth(), height);
+	}
+
+	/**
+	 * @param sv
+	 * @param i
+	 */
+	public void setWidth(SingletonView sv, int width) {
+		JInternalFrame o = (JInternalFrame) contentFrame.get(new SingletonViewInfo(sv.getClass(), sv.getViewModel()));
+
+        if (o == null) return;
+        o.setSize(width, o.getHeight());
+	}
+
+	/**
+	 * @param sv
+	 * @param string
+	 */
+	public void setTitle(SingletonView sv, String title) {
+		JInternalFrame o = (JInternalFrame) contentFrame.get(new SingletonViewInfo(sv.getClass(), sv.getViewModel()));
+
+        if (o == null) return;
+        o.setTitle(title);
+	}
+	
+	private class HashMap {
+	    private ArrayList keys = new ArrayList();
+	    private ArrayList values = new ArrayList();
+	    
+	    public void put(SingletonViewInfo key, Object value) {
+	        int index = -1;
+	        for (int i = 0; i < keys.size(); i++) {
+	            if (keys.get(i).equals(key)){
+	                index = i;
+	                break;
+	            }
+            }
+	        
+	        if (index != -1){
+	            keys.add(index, key);
+	            values.add(index, value);
+	        }else{
+	            keys.add(key);
+	            values.add(value);
+	        }
+	    }
+	    
+	    public boolean containsKey(SingletonViewInfo key){
+	        for (int i = 0; i < keys.size(); i++) {
+	            if (keys.get(i).equals(key)){
+	                return true;
+	            }
+	        }
+	        
+	        return false;
+	    }
+	    
+	    public Object get(SingletonViewInfo key){
+	        for (int i = 0; i < keys.size(); i++) {
+	            if (keys.get(i).equals(key)){
+	                return values.get(i);
+	            }
+	        }
+	        
+	        return null;
+	    }
+	    
+	    public void remove(SingletonViewInfo key){
+	        for (int i = 0; i < keys.size(); i++) {
+	            if (keys.get(i).equals(key)){
+	                keys.remove(i);
+	                values.remove(i);
+	            }
+	        }
+	    }
+	    
+	    public ArrayList getKeys(){
+	        return keys;
+	    }
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/SingletonViewSupport.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewStackSupport.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewStackSupport.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewStackSupport.java	(revision 4539)
@@ -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.core.mdiManager;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.swing.SwingUtilities;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.persistence.generate.PluginsStatus;
+import com.iver.andami.plugins.config.generate.Menu;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+/**
+ * 
+ */
+public class ViewStackSupport {
+	private Vector vistas = new Vector();
+	
+	private ViewInfoSupport vis;
+	
+	private Hashtable viewMenu = new Hashtable();
+	
+	/**
+	 * @param vis
+	 */
+	public ViewStackSupport(ViewInfoSupport vis) {
+		this.vis = vis;
+	}
+
+	public void add(View v, final ActionListener listener) {
+		vistas.add(v);
+		ViewInfo vi = vis.getViewInfo(v);
+		int id = vi.getId();
+		Menu m = new Menu();
+		m.setActionCommand(""+id);
+		m.setTooltip(PluginServices.getText(this, "activa_la_ventana"));
+		m.setText("ventana/"+vi.getTitle());
+		viewMenu.put(v, m);
+		PluginServices.getMainFrame().addMenu(m, listener, PluginServices.getPluginServices(this).getClassLoader() );
+	}
+	
+	public void remove(View v){
+		Menu m = (Menu) viewMenu.get(v);
+		if (m == null) return;
+		PluginServices.getMainFrame().removeMenu(m);
+		viewMenu.remove(v);
+		vistas.remove(v);
+	}
+	
+	/**
+	 * FJP: No se usa, y no sé para qué estaba pensado. 
+	 */
+	public void ctrltab(){
+		View v = (View) vistas.remove(vistas.size() - 1);
+		vistas.add(0, v);
+	}
+	
+	public View getActiveView(){
+		if (vistas.size() == 0) return null;
+        int index = vistas.size()-1;
+        while (index >= 0)
+        {
+            View aux = (View) vistas.get(index);
+            if (!aux.getViewInfo().isPalette())
+            {
+                System.err.println("getActiveView = " + aux.getViewInfo().getTitle());
+                return aux;
+            }
+            index--;
+        }
+        return null;
+	}
+    /**
+     * Se utiliza cuando ya está abierta la vista para indicar
+     * que la pasamos a activa. De esta forma evitamos que el
+     * getActiveView devuelva algo que no es. 
+     * En realidad lo que haces es mover la vista a la última
+     * posición.
+     * @param v
+     */
+    public void setActive(View v)
+    {
+        View copia = null;
+        boolean bCopiar = false;
+        // Si es de tipo palette, no se pone como activa.
+        // De esta forma, nunca nos la devolverá.... Bueno, 
+        // igual si cerramos la de encima. Voy a ponerle en
+        // getActiveView que si es de tipo Palette, devuelva la
+        // de abajo.
+        if (v.getViewInfo().isPalette()) return;
+        
+        for (int i=0; i < vistas.size(); i++)
+        {
+            View aux = (View) vistas.get(i);
+            if (aux == v)
+            {
+                copia = aux;
+                bCopiar = true;
+            }
+            if (bCopiar)
+            {
+                if (i < vistas.size()-1)
+                {
+                    View siguiente = (View) vistas.get(i+1);
+                    vistas.set(i,siguiente);
+                }
+                else // La última
+                    vistas.set(i,copia);
+            }
+        } // for
+    }
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewStackSupport.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/NewSkin.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/NewSkin.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/NewSkin.java	(revision 4539)
@@ -0,0 +1,656 @@
+/* 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.core.mdiManager;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Stack;
+
+import javax.swing.DefaultDesktopManager;
+import javax.swing.DesktopManager;
+import javax.swing.JDesktopPane;
+import javax.swing.JDialog;
+import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
+import javax.swing.event.InternalFrameEvent;
+import javax.swing.event.InternalFrameListener;
+
+import org.apache.log4j.Logger;
+
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.ui.mdiFrame.GlassPane;
+import com.iver.andami.ui.mdiFrame.MDIFrame;
+import com.iver.andami.ui.mdiManager.MDIManager;
+import com.iver.andami.ui.mdiManager.MDIUtilities;
+import com.iver.andami.ui.mdiManager.SingletonDialogAlreadyShownException;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.andami.ui.mdiManager.ViewListener;
+
+/**
+ *
+ */
+public class NewSkin implements MDIManager, Extension {
+    /**
+     * Variable privada <code>desktopManager</code> para usarlo cuando sale
+     * una ventana que no queremos que nos restaure las que tenemos maximizadas.
+     * Justo antes de usar el setMaximize(false), le pegamos el cambiazo.
+     */
+    private static DesktopManager desktopManager = new DefaultDesktopManager();
+
+    /** log */
+    private static Logger logger = Logger.getLogger(NewSkin.class.getName());
+
+    /** Panel de la MDIFrame */
+    private JDesktopPane panel = new JDesktopPane();
+
+    /** MDIFrame */
+    private MDIFrame mainFrame;
+
+    private GlassPane glassPane = new GlassPane();
+
+    private DialogStackSupport dss;
+
+    private FrameViewSupport fvs;
+
+    private ViewInfoSupport vis;
+
+    private ViewStackSupport vss;
+
+    private SingletonViewSupport svs;
+
+    private Cursor lastCursor = null;
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#init(com.iver.andami.ui.mdiFrame.MDIFrame)
+     */
+    public void init(MDIFrame f) {
+        // Inicializa el Frame y la consola
+        mainFrame = f;
+        mainFrame.setGlassPane(glassPane);
+        panel.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
+
+        mainFrame.getContentPane().add(panel, BorderLayout.CENTER);
+        panel.setDesktopManager(desktopManager);
+
+        fvs = new FrameViewSupport(mainFrame);
+        dss = new DialogStackSupport(mainFrame);
+        svs = new SingletonViewSupport(vis, fvs);
+        vis = new ViewInfoSupport(mainFrame, fvs, svs);
+        fvs.setVis(vis);
+        vss = new ViewStackSupport(vis);
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#addView(com.iver.andami.ui.mdiManager.View)
+     */
+    public View addView(View p) throws SingletonDialogAlreadyShownException {
+        // se obtiene la información de la vista
+        ViewInfo vi = vis.getViewInfo(p);
+
+        // Se comprueban las incompatibilidades que pudieran haber en la vista
+        MDIUtilities.checkViewInfo(vi);
+        if ((p instanceof SingletonView) && (vi.isModal())) {
+            throw new RuntimeException("A modal view cannot be a SingletonView");
+        }
+
+        /*
+         * Se obtiene la referencia a la vista anterior por si es una singleton
+         * y está siendo mostrada. Se obtiene su información si ya fue mostrada
+         */
+        boolean singletonPreviouslyAdded = false;
+
+        if (p instanceof SingletonView) {
+            SingletonView sv = (SingletonView) p;
+            if (svs.registerView(sv.getClass(), sv.getViewModel(), vis
+                    .getViewInfo(sv))) {
+                singletonPreviouslyAdded = true;
+            }
+        }
+
+        if (singletonPreviouslyAdded) {
+            // Si la vista no está actualmente abierta
+            if (!svs.contains((SingletonView) p)) {
+                JInternalFrame frame = fvs.getJInternalFrame(p);
+                svs.openSingletonView((SingletonView) p, frame);
+                addJInternalFrame(frame, vi);
+                vss.add(p, new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        View v = vis.getViewById(Integer.parseInt(e
+                                .getActionCommand()));
+                        JInternalFrame f = fvs.getJInternalFrame(v);
+                        activateJInternalFrame(f);
+                    }
+                });
+                return p;
+            } else {
+                // La vista está actualmente abierta
+                JInternalFrame frame = (JInternalFrame) svs
+                        .getFrame((SingletonView) p);
+                activateJInternalFrame(frame);
+                vss.setActive(p);
+                return fvs.getView((JInternalFrame) frame);
+            }
+        } else {
+            if (vi.isModal()) {
+                addJDialog(p);
+            } else {
+                // Se sitúa la vista en la pila de vistas
+                vss.add(p, new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        View v = vis.getViewById(Integer.parseInt(e
+                                .getActionCommand()));
+                        JInternalFrame f = fvs.getJInternalFrame(v);
+                        activateJInternalFrame(f);
+                    }
+                });
+                addJInternalFrame(p);
+            }
+
+            return p;
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param wnd
+     *            DOCUMENT ME!
+     * @param vi
+     *            DOCUMENT ME!
+     */
+    private void addJInternalFrame(JInternalFrame wnd, ViewInfo vi) {
+        wnd.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
+        wnd.addInternalFrameListener(new FrameListener());
+
+        if (vi.isModeless() || vi.isPalette()) {
+            panel.add(wnd, JDesktopPane.PALETTE_LAYER);
+            if (vi.isPalette())
+                wnd.setFocusable(false);
+        } else {
+            panel.add(wnd);
+        }
+
+        activateJInternalFrame(wnd);
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param p
+     */
+    private void addJInternalFrame(View p) {
+        ViewInfo vi = vis.getViewInfo(p);
+
+        JInternalFrame wnd = fvs.getJInternalFrame(p);
+
+        if (p instanceof SingletonView) {
+            SingletonView sv = (SingletonView) p;
+            svs.openSingletonView(sv, wnd);
+        }
+
+        addJInternalFrame(wnd, vi);
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param wnd
+     */
+    private void activateJInternalFrame(JInternalFrame wnd) {
+        try {
+            wnd.moveToFront();
+            logger.debug("Activando " + wnd.getTitle());
+            wnd.setSelected(true);
+            wnd.setIcon(false);
+        } catch (PropertyVetoException e) {
+            logger.error(e);
+        }
+    }
+
+    /**
+     * Situa un diálogo modal en el centro de la pantalla
+     * 
+     * @param d
+     *            Diálogo que se quiere situar
+     */
+    private void centerDialog(JDialog d) {
+        int offSetX = d.getWidth() / 2;
+        int offSetY = d.getHeight() / 2;
+
+        d.setLocation((mainFrame.getWidth() / 2) - offSetX, (mainFrame
+                .getHeight() / 2)
+                - offSetY);
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param p
+     */
+    private void addJDialog(View p) {
+        JDialog dlg = fvs.getJDialog(p);
+
+        centerDialog(dlg);
+
+        dlg.addWindowListener(new DialogWindowListener());
+        dss.pushDialog(dlg);
+
+        dlg.setVisible(vis.getViewInfo(p).isVisible());
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#getActiveView()
+     */
+    public View getActiveView() {
+        JInternalFrame jif = panel.getSelectedFrame();
+
+        if (jif != null) {
+            View theView = fvs.getView(jif);
+            if (theView == null)
+                return null;
+            if (theView.getViewInfo().isPalette())
+                return vss.getActiveView();
+            else
+                return fvs.getView(jif);
+        }
+        // return vss.getActiveView();
+
+        return null;
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#closeView(com.iver.andami.ui.mdiManager.View)
+     */
+    public void closeView(View p) {
+        // Si es un diálogo modal
+        if (p.getViewInfo().isModal()) {
+            closeJDialog();
+        } else { // Si no es modal se cierra el JInternalFrame
+            closeJInternalFrame(fvs.getJInternalFrame(p));
+        }
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#closeAllViews()
+     */
+    public void closeAllViews() {
+        ArrayList eliminar = new ArrayList();
+        Iterator i = fvs.getViewIterator();
+
+        while (i.hasNext()) {
+            eliminar.add((View) i.next());
+        }
+
+        for (Iterator iter = eliminar.iterator(); iter.hasNext();) {
+            View vista = (View) iter.next();
+            closeView(vista);
+        }
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#getViewInfo(com.iver.andami.ui.mdiManager.View)
+     */
+    public ViewInfo getViewInfo(View v) {
+        return vis.getViewInfo(v);
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param dialog
+     * @throws RuntimeException
+     *             DOCUMENT ME!
+     */
+    private void closeJDialog() {
+        JDialog dlg = dss.popDialog();
+
+        dlg.setVisible(false);
+
+        View s = (View) fvs.getView(dlg);
+
+        callViewClosed(s);
+
+        fvs.closeView(s);
+
+        // Si es singleton se desasocia el modelo con la vista
+        if (s instanceof SingletonView) {
+            svs.closeView((SingletonView) s);
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param view
+     *            DOCUMENT ME!
+     */
+    private void callViewClosed(View view) {
+        if (view instanceof ViewListener) {
+            ((ViewListener) view).viewClosed();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param view
+     *            DOCUMENT ME!
+     */
+    private void callViewActivated(View view) {
+        logger.debug("View " + view.getViewInfo().getTitle()
+                + " activated (callViewActivated)");
+        if (view instanceof ViewListener) {
+            ((ViewListener) view).viewActivated();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     * 
+     * @param frame
+     */
+    private void closeJInternalFrame(JInternalFrame frame) {
+        try {
+            View s = (View) fvs.getView(frame);
+
+            frame.setClosed(true);
+            callViewClosed(s);
+        } catch (PropertyVetoException e) {
+            logger
+                    .error(
+                            "Not compatible with property veto's. Use ViewInfo instead.",
+                            e);
+        }
+    }
+
+    /**
+     * @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) {
+        if (actionCommand.equals("cascada")) {
+        } else if (actionCommand.equals("mosaico")) {
+        }
+    }
+
+    /**
+     * @see com.iver.andami.plugins.Extension#isEnabled()
+     */
+    public boolean isEnabled() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /**
+     * @see com.iver.andami.plugins.Extension#isVisible()
+     */
+    public boolean isVisible() {
+        // TODO Auto-generated method stub
+        return true;
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#setWaitCursor()
+     */
+    public void setWaitCursor() {
+        if (mainFrame != null) {
+            glassPane.setVisible(true);
+            lastCursor = mainFrame.getCursor();
+            dss.setWaitCursor();
+            glassPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+        }
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#restoreCursor()
+     */
+    public void restoreCursor() {
+        if (mainFrame != null) {
+            glassPane.setVisible(false);
+            dss.restoreCursor();
+            glassPane.setCursor(lastCursor);
+        }
+    }
+
+    /**
+     * Listener para los eventos de cerrado de los diálogos. Tiene su razón de
+     * ser en que los diálogos han de devolverse al pool cuando se cierran
+     * 
+     * @author Fernando González Cortés
+     */
+    public class DialogWindowListener extends WindowAdapter {
+        /**
+         * Captura el evento de cerrado de los diálogos con el fin de realizar
+         * tareas de mantenimiento
+         * 
+         * @param e
+         *            evento
+         */
+        public void windowClosing(WindowEvent e) {
+            closeJDialog();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     */
+    public class FrameListener implements InternalFrameListener {
+        /**
+         * @see javax.swing.event.InternalFrameListener#internalFrameActivated(javax.swing.event.InternalFrameEvent)
+         */
+        public void internalFrameActivated(InternalFrameEvent e) {
+            // logger.debug("internalFrameActivated " +
+            // e.getInternalFrame().getTitle());
+
+            // activatedInternalFramesStack.push(e.getInternalFrame());
+
+            View panel = fvs.getView((JInternalFrame) e.getSource());
+
+            ViewInfo vi = vis.getViewInfo(panel);
+            if (vi.isPalette())
+                return;
+
+            vss.setActive(panel);
+
+            JInternalFrame frame = fvs.getJInternalFrame(panel);
+
+            if (!frame.isMaximizable() && frame.isMaximum()) {
+                try {
+                    frame.setMaximum(false);
+                } catch (PropertyVetoException e1) {
+                }
+            }
+            mainFrame.enableControls();
+            if (vi.getSelectedTool() != null)
+                mainFrame.setSelectedTool(vi.getSelectedTool());
+            callViewActivated(panel);
+
+        }
+
+        /**
+         * @see javax.swing.event.InternalFrameListener#internalFrameClosed(javax.swing.event.InternalFrameEvent)
+         */
+        public void internalFrameClosed(InternalFrameEvent e) {
+        }
+
+        /**
+         * @see javax.swing.event.InternalFrameListener#internalFrameClosing(javax.swing.event.InternalFrameEvent)
+         */
+        public void internalFrameClosing(InternalFrameEvent e) {
+            // Se elimina la memoria del JInternalFrame si no es ALWAYS_LIVE
+            // logger.debug("internalFrameClosing " +
+            // e.getInternalFrame().getTitle());
+
+            JInternalFrame c = (JInternalFrame) e.getSource();
+            ViewInfo vi = vis.getViewInfo((View) fvs.getView(c));
+
+            View view = fvs.getView(c);
+
+            boolean alwaysLive;
+            if (view instanceof SingletonView) {
+                svs.closeView((SingletonView) view);
+            }
+
+            fvs.closeView(view);
+
+            panel.remove(c);
+
+            vss.remove(view);
+
+            if (!vi.isPalette())
+                mainFrame.enableControls();
+            panel.repaint();
+
+            // Para activar el JInternalFrame desde la que hemos
+            // abierto la ventana que estamos cerrando
+            View lastView = vss.getActiveView();
+            // La activamos
+            if (lastView != null) {
+                System.err.println("Devuelvo el foco a "
+                        + lastView.getViewInfo().getTitle());
+                JInternalFrame frame = fvs.getJInternalFrame(lastView);
+                try {
+                    frame.setSelected(true);
+                } catch (PropertyVetoException e1) {
+                    // TODO Auto-generated catch block
+                    // e1.printStackTrace();
+                }
+                // addView(lastView);
+            }
+
+        }
+
+        /**
+         * @see javax.swing.event.InternalFrameListener#internalFrameDeactivated(javax.swing.event.InternalFrameEvent)
+         */
+        public void internalFrameDeactivated(InternalFrameEvent e) {
+            // logger.debug("internalDeActivated " +
+            // e.getInternalFrame().getTitle());
+            JInternalFrame c = (JInternalFrame) e.getSource();
+            View andamiView = fvs.getView(c);
+            if (andamiView != null) {
+                ViewInfo vi = vis.getViewInfo(andamiView);
+                if (vi.isPalette())
+                    return;
+                vi.setSelectedTool(mainFrame.getSelectedTool());
+            }
+
+        }
+
+        /**
+         * @see javax.swing.event.InternalFrameListener#internalFrameDeiconified(javax.swing.event.InternalFrameEvent)
+         */
+        public void internalFrameDeiconified(InternalFrameEvent e) {
+            mainFrame.enableControls();
+        }
+
+        /**
+         * @see javax.swing.event.InternalFrameListener#internalFrameIconified(javax.swing.event.InternalFrameEvent)
+         */
+        public void internalFrameIconified(InternalFrameEvent e) {
+            mainFrame.enableControls();
+        }
+
+        /**
+         * @see javax.swing.event.InternalFrameListener#internalFrameOpened(javax.swing.event.InternalFrameEvent)
+         */
+        public void internalFrameOpened(InternalFrameEvent e) {
+            // logger.debug("internalFrameOpened. Source= " +
+            // e.getSource().toString());
+        }
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#closeSingletonView(java.lang.Class,
+     *      java.lang.Object)
+     */
+    public boolean closeSingletonView(Class viewClass, Object model) {
+        JInternalFrame frame = svs.getFrame(viewClass, model);
+        if (frame == null)
+            return false;
+        closeJInternalFrame(frame);
+        return true;
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.MDIManager#closeSingletonView(java.lang.Object)
+     */
+    public boolean closeSingletonView(Object model) {
+        JInternalFrame[] frames = svs.getFrames(model);
+        if (frames.length == 0)
+            return false;
+        for (int i = 0; i < frames.length; i++) {
+            closeJInternalFrame(frames[i]);
+        }
+        return true;
+    }
+
+    public View[] getAllViews() {
+        ArrayList views = new ArrayList();
+        Iterator i = fvs.getViewIterator();
+
+        while (i.hasNext()) {
+            views.add((View) i.next());
+        }
+        return (View[]) views.toArray(new View[0]);
+    }
+    
+    public void setMaximum(View v, boolean bMaximum) throws PropertyVetoException
+    {
+        JInternalFrame f = fvs.getJInternalFrame(v);
+        f.setMaximum(bMaximum);
+    }
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/NewSkin.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/DialogStackSupport.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/DialogStackSupport.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/DialogStackSupport.java	(revision 4539)
@@ -0,0 +1,102 @@
+/* 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.core.mdiManager;
+
+import java.awt.Cursor;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.swing.JDialog;
+
+import org.apache.log4j.Logger;
+
+import com.iver.andami.ui.mdiFrame.MDIFrame;
+
+
+/**
+ *
+ */
+public class DialogStackSupport{
+    /** log */
+    private static Logger logger = Logger.getLogger(DialogStackSupport.class.getName());
+
+    /** Pila de diálogos modales mostrados */
+    private ArrayList dialogStack = new ArrayList(0);
+    
+    private ArrayList dialogCursors = new ArrayList(0);
+
+    public DialogStackSupport(MDIFrame frame){
+    }
+    
+    public void pushDialog(JDialog dlg){
+    	dialogStack.add(dlg);
+    }
+    
+    public JDialog popDialog(){
+    	return (JDialog) dialogStack.remove(dialogStack.size() - 1);
+    }
+
+	/**
+	 * @return
+	 */
+	public void setWaitCursor() {
+        dialogCursors.clear();
+		for (Iterator iter = dialogStack.iterator(); iter.hasNext();) {
+			JDialog dlg = (JDialog) iter.next();
+            dialogCursors.add(dlg.getCursor());
+			dlg.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ 	        dlg.getGlassPane().setVisible(true);
+ 	   }
+	}
+
+	/**
+	 * 
+	 */
+	public void restoreCursor() {
+		for (Iterator iter = dialogStack.iterator(); iter.hasNext();) {
+			JDialog dlg = (JDialog) iter.next();
+            
+            // TODO: RECUPERAR EL CURSOR
+            dlg.setCursor(null);
+		    dlg.getGlassPane().setVisible(false);
+		}
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/DialogStackSupport.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/FrameViewSupport.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/FrameViewSupport.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/FrameViewSupport.java	(revision 4539)
@@ -0,0 +1,280 @@
+/* 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.core.mdiManager;
+
+import java.awt.Component;
+import java.awt.Image;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import javax.swing.ImageIcon;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JPanel;
+
+import com.iver.andami.ui.mdiFrame.MDIFrame;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+
+/**
+ *
+ */
+public class FrameViewSupport {
+    private Hashtable frameView = new Hashtable();
+    private Hashtable viewFrame = new Hashtable();
+    private Image icon;
+    private ViewInfoSupport vis;
+	private JFrame mainFrame;
+
+    /**
+     * Creates a new FrameViewSupport object.
+     *
+     * @param i DOCUMENT ME!
+     */
+    public FrameViewSupport(MDIFrame mainFrame) {
+    	this.mainFrame = mainFrame;
+        icon = mainFrame.getIconImage();
+    }
+
+    public Iterator getViewIterator(){
+    	return viewFrame.keySet().iterator();
+    }
+    
+    public boolean contains(View v){
+    	return viewFrame.containsKey(v);
+    }
+
+	/**
+	 * @param wnd
+	 * @return
+	 */
+	public boolean contains(JInternalFrame wnd) {
+		return frameView.contains(wnd);
+	}
+    
+    /**
+     * DOCUMENT ME!
+     *
+     * @param p DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public JDialog getJDialog(View p) {
+        JDialog dlg = (JDialog) viewFrame.get(p);
+
+        if (dlg == null) {
+            ViewInfo vi = vis.getViewInfo(p);
+            JDialog nuevo = new JDialog(mainFrame);
+
+            nuevo.getContentPane().add((JPanel) p);
+            nuevo.setSize(getWidth(p), getHeight(p) + 30);
+            nuevo.setTitle(vi.getTitle());
+            nuevo.setResizable(vi.isResizable());
+
+            viewFrame.put(p, nuevo);
+            frameView.put(nuevo, p);
+
+            nuevo.setModal(vi.isModal());
+            return nuevo;
+        } else {
+            return dlg;
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param p DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    public JInternalFrame getJInternalFrame(View p) {
+        JInternalFrame frame = (JInternalFrame) viewFrame.get(p);
+
+        if (frame == null) {
+        	ViewInfo vi = vis.getViewInfo(p);
+            JInternalFrame nuevo = createJInternalFrame(p);
+            viewFrame.put(p, nuevo);
+            frameView.put(nuevo, p);
+
+            return nuevo;
+        } else {
+            return frame;
+        }
+    }
+
+    public JInternalFrame createJInternalFrame(View p)
+    {
+        ViewInfo vi = vis.getViewInfo(p);
+        JInternalFrame nuevo = new JInternalFrame();
+        if (icon != null){
+            nuevo.setFrameIcon(new ImageIcon(icon));
+        }
+        nuevo.getContentPane().add((JPanel) p);
+        nuevo.setClosable(true);
+        nuevo.setSize(getWidth(p), getHeight(p));
+        nuevo.setTitle(vi.getTitle());
+        nuevo.setVisible(vi.isVisible());
+        nuevo.setResizable(vi.isResizable());
+        nuevo.setIconifiable(vi.isIconifiable());
+        nuevo.setMaximizable(vi.isMaximizable());
+        nuevo.setLocation(vi.getX(), vi.getY());
+
+        nuevo.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
+        return nuevo;
+    }
+    
+    public View getView(Component dlg){
+    	return (View) frameView.get(dlg);
+    }
+    
+    public void closeView(View v){
+    	Object c = viewFrame.remove(v);
+    	frameView.remove(c);
+    }
+    
+    /**
+     * DOCUMENT ME!
+     *
+     * @param v DOCUMENT ME!
+     * @param x DOCUMENT ME!
+     */
+    public void setX(View v, int x) {
+    	JInternalFrame o = (JInternalFrame) viewFrame.get(v);
+        o.setLocation(x, o.getY());
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param v DOCUMENT ME!
+     * @param y DOCUMENT ME!
+     */
+    public void setY(View v, int y) {
+    	JInternalFrame o = (JInternalFrame) viewFrame.get(v);
+
+        o.setLocation(o.getX(), y);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param v DOCUMENT ME!
+     * @param height DOCUMENT ME!
+     */
+    public void setHeight(View v, int height) {
+    	JInternalFrame o = (JInternalFrame) viewFrame.get(v);
+
+        o.setSize(o.getWidth(), height);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param v DOCUMENT ME!
+     * @param width DOCUMENT ME!
+     */
+    public void setWidth(View v, int width) {
+    	JInternalFrame o = (JInternalFrame) viewFrame.get(v);
+
+    	o.setSize(width, o.getHeight());
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param v DOCUMENT ME!
+     * @param title DOCUMENT ME!
+     */
+    public void setTitle(View v, String title) {
+    	JInternalFrame o = (JInternalFrame) viewFrame.get(v);
+        o.setTitle(title);
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param vis The vis to set.
+     */
+    public void setVis(ViewInfoSupport vis) {
+        this.vis = vis;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param v DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private int getWidth(View v) {
+        ViewInfo vi = vis.getViewInfo(v);
+
+        if (vi.getWidth() == -1) {
+            JPanel p = (JPanel) v;
+
+            return p.getSize().width;
+        } else {
+            return vi.getWidth();
+        }
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param v DOCUMENT ME!
+     *
+     * @return DOCUMENT ME!
+     */
+    private int getHeight(View v) {
+        ViewInfo vi = vis.getViewInfo(v);
+
+        if (vi.getHeight() == -1) {
+            JPanel p = (JPanel) v;
+
+            return p.getSize().height;
+        } else {
+            return vi.getHeight();
+        }
+    }
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/FrameViewSupport.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewInfoSupport.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewInfoSupport.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewInfoSupport.java	(revision 4539)
@@ -0,0 +1,209 @@
+/* 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.core.mdiManager;
+
+import com.iver.andami.plugins.PluginClassLoader;
+import com.iver.andami.ui.mdiFrame.MainFrame;
+import com.iver.andami.ui.mdiFrame.NoSuchMenuException;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+
+/**
+ *
+ */
+public class ViewInfoSupport {
+	private static int serialId = 0;
+	private FrameViewSupport fvs;
+
+	/** Correspondencias entre las vistas y su informacion */
+	private Hashtable viewInfo = new Hashtable();
+	private Hashtable infoView = new Hashtable();
+	private ViewPropertyChangeListener viewInfoListener = new ViewPropertyChangeListener();
+	private SingletonViewSupport svs;
+	private MainFrame mdiFrame;
+
+	/**
+	 * Creates a new ViewInfoSupport object.
+	 *
+	 * @param frame DOCUMENT ME!
+	 * @param fvs DOCUMENT ME!
+	 * @param svs
+	 */
+	public ViewInfoSupport(MainFrame frame, FrameViewSupport fvs,
+		SingletonViewSupport svs) {
+		this.fvs = fvs;
+		this.svs = svs;
+		this.mdiFrame = frame;
+	}
+
+	/**
+	 * Devuelve la vista cuyo identificador es el parametro
+	 *
+	 * @param id Identificador de la vista que se quiere obtener
+	 *
+	 * @return La vista o null si no hay ninguna vista con ese identificador
+	 */
+	public View getViewById(int id) {
+		Enumeration en = infoView.keys();
+
+		while (en.hasMoreElements()) {
+			ViewInfo vi = (ViewInfo) en.nextElement();
+
+			if (vi.getId() == id) {
+				return (View) infoView.get(vi);
+			}
+		}
+
+		return null;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param v DOCUMENT ME!
+	 *
+	 * @return DOCUMENT ME!
+	 */
+	public synchronized ViewInfo getViewInfo(View v) {
+		ViewInfo vi = (ViewInfo) viewInfo.get(v);
+
+		if (vi == null) {
+			vi = v.getViewInfo();
+
+			//Para el título
+			if (vi.getHeight() != -1) {
+				vi.setHeight(vi.getHeight() + 40);
+			}
+
+			vi.addPropertyChangeListener(viewInfoListener);
+			viewInfo.put(v, vi);
+			infoView.put(vi, v);
+			vi.setId(serialId++);
+		}
+
+		return vi;
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param p DOCUMENT ME!
+	 */
+	public void deleteViewInfo(View p) {
+		ViewInfo vi = (ViewInfo) viewInfo.remove(p);
+		infoView.remove(vi);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @author $author$
+	 * @version $Revision$
+	 */
+	public class ViewPropertyChangeListener implements PropertyChangeListener {
+		/**
+		 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+		 */
+		public void propertyChange(PropertyChangeEvent evt) {
+			ViewInfo v = (ViewInfo) evt.getSource();
+			View view = (View) infoView.get(v);
+
+			if (view instanceof SingletonView) {
+				SingletonView sv = (SingletonView) view;
+
+				if (evt.getPropertyName().equals("x")) {
+					svs.setX(sv, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("y")) {
+					svs.setY(sv, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("height")) {
+					svs.setHeight(sv, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("width")) {
+					svs.setWidth(sv, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("title")) {
+					svs.setTitle(sv, (String) evt.getNewValue());
+
+					try {
+						mdiFrame.changeMenuName(new String[] {
+								"ventana", (String) evt.getOldValue()
+							}, (String) evt.getNewValue(),
+							(PluginClassLoader) getClass().getClassLoader());
+					} catch (NoSuchMenuException e) {
+						/*
+						 * No se hace nada porque puede modificarse el título de 
+						 * una ventana antes de ser añadida a Andami
+						 */
+					}                    
+				}
+			} else {
+				if (evt.getPropertyName().equals("x")) {
+					fvs.setX(view, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("y")) {
+					fvs.setY(view, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("height")) {
+					fvs.setHeight(view, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("width")) {
+					fvs.setWidth(view, ((Integer) evt.getNewValue()).intValue());
+				} else if (evt.getPropertyName().equals("title")) {
+					fvs.setTitle(view, (String) evt.getNewValue());
+					try{
+						mdiFrame.changeMenuName(new String[] {
+								"ventana", (String) evt.getOldValue()
+							}, (String) evt.getNewValue(),
+							(PluginClassLoader) getClass().getClassLoader());
+					} catch (NoSuchMenuException e) {
+						/*
+						 * No se hace nada porque puede modificarse el título de 
+						 * una ventana antes de ser añadida a Andami
+						 */
+					}
+				}
+			}
+		}
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ViewInfoSupport.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ComplexDesktopPane.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ComplexDesktopPane.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ComplexDesktopPane.java	(revision 4539)
@@ -0,0 +1,113 @@
+/*
+ * Created on 10-mar-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.core.mdiManager;
+
+import javax.swing.JPanel;
+
+
+import javax.swing.JSplitPane;
+import java.awt.BorderLayout;
+import javax.swing.JDesktopPane;
+import com.iver.utiles.console.JConsole;
+public class ComplexDesktopPane extends JPanel {
+
+	private JSplitPane jSplitPane = null;
+	private JDesktopPane jDesktopPane = null;
+	private JConsole jConsole = null;
+	/**
+	 * This is the default constructor
+	 */
+	public ComplexDesktopPane() {
+		super();
+		initialize();
+	}
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private  void initialize() {
+		this.setLayout(new BorderLayout());
+		this.setSize(300,200);
+		this.add(getJSplitPane(), java.awt.BorderLayout.CENTER);
+	}
+	/**
+	 * 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.setResizeWeight(0.8);
+			jSplitPane.setTopComponent(getDesktopPane());
+			jSplitPane.setBottomComponent(getJConsole());
+		}
+		return jSplitPane;
+	}
+	/**
+	 * This method initializes jDesktopPane	
+	 * 	
+	 * @return javax.swing.JDesktopPane	
+	 */    
+	public JDesktopPane getDesktopPane() {
+		if (jDesktopPane == null) {
+			jDesktopPane = new JDesktopPane();
+		}
+		return jDesktopPane;
+	}
+	/**
+	 * This method initializes jConsole	
+	 * 	
+	 * @return com.iver.utiles.console.JConsole	
+	 */    
+	private JConsole getJConsole() {
+		if (jConsole == null) {
+			jConsole = new JConsole();
+		}
+		return jConsole;
+	}
+   }

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/mdiManager/ComplexDesktopPane.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/configExtensions/ConfigPlugins.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/configExtensions/ConfigPlugins.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/configExtensions/ConfigPlugins.java	(revision 4539)
@@ -0,0 +1,788 @@
+/* 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.core.configExtensions;
+
+import com.iver.andami.Launcher;
+import com.iver.andami.PluginServices;
+import com.iver.andami.plugins.config.generate.Extension;
+import com.iver.andami.plugins.config.generate.Extensions;
+import com.iver.andami.plugins.config.generate.PluginConfig;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import com.iver.utiles.GenericFileFilter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.swing.BoxLayout;
+import javax.swing.ComboBoxModel;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+
+
+import javax.swing.JComboBox;
+/**
+ * Diálogo de Configuración de ANDAMI.
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class ConfigPlugins extends JPanel implements View {
+	private JTree jTree = null;
+	private JPanel jPanel = null; //  @jve:decl-index=0:visual-constraint="113,10"
+	private JPanel jPanel1 = null;
+	private JSplitPane jSplitPane = null;
+	private JCheckBox chbActivar = null;
+	private JTextField jTextField = null;
+	private JPanel pGeneral = null;
+	private JButton jButton = null;
+	private JPanel pOpciones = null;
+	private JTabbedPane jTabbedPane1 = null;
+	private JPanel pDescripcion = null;
+	private JPanel pDirectorio = null;
+	private JPanel jPanel2 = null;
+	private JScrollPane jScrollPane1 = null;
+	private ViewInfo m_viewinfo = null;
+	private JPanel pBotones = null;
+	private JButton bAceptar = null;
+	private JButton bCancelar = null;
+	private HashMap listExt = new HashMap();
+	private HashMap listPlugins = new HashMap();
+	private JTextArea taDescripcion = null;
+	private JScrollPane jScrollPane = null;
+	private Extension ext = null;
+	private JTextField jTextField1 = null;
+	private JLabel jLabel = null;
+	private JPanel jPanel3 = null;
+
+	private JPanel jPanel4 = null;
+	private JLabel jLabel1 = null;
+	private JComboBox cmbIdioma = null;
+	/**
+	 * This is the default constructor
+	 */
+	public ConfigPlugins() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * Añade los nodes al arbol que representa a todos los plugins y extesiones que hay.
+	 *
+	 * @param top 
+	 */
+	private void addNodes(DefaultMutableTreeNode top) {
+		DefaultMutableTreeNode nameExtension = null;
+		DefaultMutableTreeNode namePlugin = null;
+		HashMap pc = Launcher.getPluginConfig();
+		ArrayList array = new ArrayList();
+		Iterator iter = pc.values().iterator();
+
+		while (iter.hasNext()) {
+			array.add(((PluginConfig) iter.next()).getExtensions());
+		}
+
+		Extensions[] exts = (Extensions[]) array.toArray(new Extensions[0]);
+
+		for (int i = 0; i < exts.length; i++) {
+			if (exts[i].getSkinExtension() != null) {
+			}
+
+			for (int j = 0; j < exts[i].getExtensionCount(); j++) {
+				Extension ext = exts[i].getExtension(j);
+				String pn = null;
+				String sExt = ext.getClassName().toString();
+				pn = sExt.substring(0, sExt.lastIndexOf("."));
+				namePlugin = new DefaultMutableTreeNode(pn);
+
+				if (!listPlugins.containsKey(namePlugin.getUserObject()
+														   .toString())) {
+					listPlugins.put(namePlugin.getUserObject().toString(),
+						namePlugin);
+					top.add(namePlugin);
+					nameExtension = new DefaultMutableTreeNode(sExt.substring(sExt.lastIndexOf(
+									".") + 1, sExt.length())); //replaceFirst(namePlugin.getUserObject().toString()+".",""));
+					listExt.put(sExt, ext);
+					namePlugin.add(nameExtension);
+				} else {
+					nameExtension = new DefaultMutableTreeNode(sExt.substring(sExt.lastIndexOf(
+									".") + 1, sExt.length())); //sExt.replaceFirst(namePlugin.getUserObject().toString()+".",""));
+					listExt.put(sExt, ext);
+					((DefaultMutableTreeNode) listPlugins.get(namePlugin.getUserObject()
+																		.toString())).add(nameExtension);
+				}
+			}
+		}
+	}
+
+	/**
+	 * This method initializes jTree
+	 *
+	 * @return javax.swing.JTree
+	 */
+	private JTree getJTree() {
+		if (jTree == null) {
+			DefaultMutableTreeNode root = new DefaultMutableTreeNode("ANDAMI");
+			addNodes(root);
+			jTree = new JTree(root);
+
+			jTree.setName("ANDAMI");
+			jTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
+					public void valueChanged(
+						javax.swing.event.TreeSelectionEvent e) {
+						if (e.getPath().getParentPath() != null) {
+							ext = (Extension) listExt.get(e.getPath()
+														   .getParentPath()
+														   .getLastPathComponent()
+														   .toString() + "." +
+									e.getPath().getLastPathComponent().toString());
+
+							if (ext == null) {
+								getChbActivar().setVisible(false);
+								getTaDescripcion().setText("Plugin : " +
+									e.getNewLeadSelectionPath().toString());
+							} else {
+								try {
+									getChbActivar().setSelected(((Extension) Launcher.getExtension(
+											ext.getClassName())).getActive());
+									getChbActivar().setVisible(true);
+									getTaDescripcion().setText(((Extension) Launcher.getExtension(
+											ext.getClassName())).getDescription());
+									getJTextField1().setText(String.valueOf(
+											ext.getPriority()));
+								} catch (NullPointerException npe) {
+									getChbActivar().setVisible(false);
+									getTaDescripcion().setText("Plugin : " +
+										e.getNewLeadSelectionPath().toString());
+								}
+							}
+						}
+					}
+				});
+		}
+
+		return jTree;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel() {
+		if (jPanel == null) {
+			jPanel = new JPanel();
+			jPanel.setLayout(new BorderLayout());
+			jPanel.setName("jPanel");
+			jPanel.setPreferredSize(new java.awt.Dimension(150, 150));
+			jPanel.setSize(435, 299);
+			jPanel.add(getJSplitPane(), java.awt.BorderLayout.CENTER);
+			jPanel.add(getPBotones(), java.awt.BorderLayout.SOUTH);
+		}
+
+		return jPanel;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel1() {
+		if (jPanel1 == null) {
+			jPanel1 = new JPanel();
+			jPanel1.setLayout(new BoxLayout(jPanel1, BoxLayout.Y_AXIS));
+			jPanel1.setName("jPanel1");
+			jPanel1.setPreferredSize(new java.awt.Dimension(200, 100));
+			jPanel1.add(getJTabbedPane1(), null);
+		}
+
+		return jPanel1;
+	}
+
+	/**
+	 * This method initializes jSplitPane
+	 *
+	 * @return javax.swing.JSplitPane
+	 */
+	private JSplitPane getJSplitPane() {
+		if (jSplitPane == null) {
+			jSplitPane = new JSplitPane();
+			jSplitPane.setRightComponent(getJPanel1());
+			jSplitPane.setLeftComponent(getJPanel2());
+		}
+
+		return jSplitPane;
+	}
+
+	/**
+	 * This method initializes chbActivar
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	private JCheckBox getChbActivar() {
+		if (chbActivar == null) {
+			chbActivar = new JCheckBox();
+			chbActivar.setSelected(true);
+			chbActivar.setVisible(false);
+			chbActivar.setText(PluginServices.getText(this, "extension_activada"));
+			chbActivar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						ext.setActive(chbActivar.isSelected());
+					}
+				});
+		}
+
+		return chbActivar;
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getJTextField() {
+		if (jTextField == null) {
+			jTextField = new JTextField();
+			jTextField.setPreferredSize(new java.awt.Dimension(200, 20));
+			jTextField.setText(Launcher.getAndamiConfig().getPluginsDirectory());
+		}
+
+		return jTextField;
+	}
+
+	/**
+	 * This method initializes pGeneral
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPGeneral() {
+		if (pGeneral == null) {
+			pGeneral = new JPanel();
+			pGeneral.add(getPDirectorio(), null);
+			pGeneral.add(getJPanel4(), null);
+		}
+
+		return pGeneral;
+	}
+
+	/**
+	 * This method initializes jButton
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getJButton() {
+		if (jButton == null) {
+			jButton = new JButton();
+			jButton.setText(PluginServices.getText(this, "examinar"));
+			jButton.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						JFileChooser jfc = new JFileChooser();
+						jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+						jfc.addChoosableFileFilter(new GenericFileFilter("",
+								PluginServices.getText(this,
+									"directorio_extensiones")));
+
+						if (jfc.showOpenDialog(
+									(Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) {
+							getJTextField().setText(jfc.getSelectedFile()
+													   .getAbsolutePath());
+						}
+					}
+				});
+		}
+
+		return jButton;
+	}
+
+	/**
+	 * This method initializes pOpciones
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPOpciones() {
+		if (pOpciones == null) {
+			jLabel = new JLabel();
+			pOpciones = new JPanel();
+			pOpciones.setLayout(new BorderLayout());
+			jLabel.setText(PluginServices.getText(this, "prioridad"));
+			pOpciones.add(getChbActivar(), java.awt.BorderLayout.NORTH);
+			pOpciones.add(getPDescripcion(), java.awt.BorderLayout.CENTER);
+			pOpciones.add(getJPanel3(), java.awt.BorderLayout.SOUTH);
+		}
+
+		return pOpciones;
+	}
+
+	/**
+	 * This method initializes jTabbedPane1
+	 *
+	 * @return javax.swing.JTabbedPane
+	 */
+	private JTabbedPane getJTabbedPane1() {
+		if (jTabbedPane1 == null) {
+			jTabbedPane1 = new JTabbedPane();
+			jTabbedPane1.addTab(PluginServices.getText(this, "opciones"), null,
+				getPOpciones(), null);
+			jTabbedPane1.addTab(PluginServices.getText(this, "general"), null,
+				getPGeneral(), null);
+		}
+
+		return jTabbedPane1;
+	}
+
+	/**
+	 * This method initializes pDescripcion
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPDescripcion() {
+		if (pDescripcion == null) {
+			pDescripcion = new JPanel();
+			pDescripcion.setLayout(new BorderLayout());
+			pDescripcion.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
+			pDescripcion.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "descripcion"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		}
+
+		return pDescripcion;
+	}
+
+	/**
+	 * This method initializes pDirectorio
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPDirectorio() {
+		if (pDirectorio == null) {
+			pDirectorio = new JPanel();
+			pDirectorio.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					null, PluginServices.getText(this, "directorio"),
+					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			pDirectorio.add(getJTextField(), null);
+			pDirectorio.add(getJButton(), null);
+		}
+
+		return pDirectorio;
+	}
+
+	/**
+	 * This method initializes jPanel2
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel2() {
+		if (jPanel2 == null) {
+			jPanel2 = new JPanel();
+			jPanel2.setLayout(new BorderLayout());
+			jPanel2.setPreferredSize(new java.awt.Dimension(120, 200));
+			jPanel2.add(getJScrollPane1(), java.awt.BorderLayout.CENTER);
+		}
+
+		return jPanel2;
+	}
+
+	/**
+	 * This method initializes jScrollPane1
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private JScrollPane getJScrollPane1() {
+		if (jScrollPane1 == null) {
+			jScrollPane1 = new JScrollPane();
+			jScrollPane1.setViewportView(getJTree());
+		}
+
+		return jScrollPane1;
+	}
+
+	/**
+	 * This method initializes pBotones
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPBotones() {
+		if (pBotones == null) {
+			pBotones = new JPanel();
+			pBotones.add(getBAceptar(), null);
+			pBotones.add(getBCancelar(), null);
+		}
+
+		return pBotones;
+	}
+
+	/**
+	 * This method initializes bAceptar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getBAceptar() {
+		if (bAceptar == null) {
+			bAceptar = new JButton();
+			bAceptar.setText(PluginServices.getText(this, "aceptar"));
+			bAceptar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						//Se escribe el config de los plugins
+						marshalPlugins();
+						
+						//Se escribe el directorio de los plugins
+						Launcher.getAndamiConfig().setPluginsDirectory(getJTextField().getText());
+						
+						//Se escribe el idioma
+						LanguageItem sel = (LanguageItem) cmbIdioma.getSelectedItem();
+						Launcher.getAndamiConfig().setLocaleLanguage(sel.locale.getLanguage());
+						Launcher.getAndamiConfig().setLocaleCountry(sel.locale.getCountry());
+						Launcher.getAndamiConfig().setLocaleVariant(sel.locale.getVariant());
+						
+						PluginServices.getMDIManager().closeView(ConfigPlugins.this);
+					}
+				});
+		}
+
+		return bAceptar;
+	}
+
+	/**
+	 * This method initializes bCancelar
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getBCancelar() {
+		if (bCancelar == null) {
+			bCancelar = new JButton();
+			bCancelar.setText(PluginServices.getText(this, "cancelar"));
+			bCancelar.addActionListener(new java.awt.event.ActionListener() {
+					public void actionPerformed(java.awt.event.ActionEvent e) {
+						unmarshalPlugins();
+						PluginServices.getMDIManager().closeView(ConfigPlugins.this);
+					}
+				});
+		}
+
+		return bCancelar;
+	}
+
+	/**
+	 * This method initializes jTextArea1
+	 *
+	 * @return javax.swing.JTextArea
+	 */
+	private JTextArea getTaDescripcion() {
+		if (taDescripcion == null) {
+			taDescripcion = new JTextArea();
+			taDescripcion.setPreferredSize(new java.awt.Dimension(200, 100));
+			taDescripcion.setText("");
+			taDescripcion.setEditable(false);
+			taDescripcion.setEnabled(false);
+			taDescripcion.setLineWrap(true);
+		}
+
+		return taDescripcion;
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new JScrollPane();
+			jScrollPane.setViewportView(getTaDescripcion());
+			jScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+			jScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+		}
+
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes jTextField1
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getJTextField1() {
+		if (jTextField1 == null) {
+			jTextField1 = new JTextField();
+			jTextField1.setPreferredSize(new java.awt.Dimension(20, 20));
+
+			jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
+					public void keyTyped(java.awt.event.KeyEvent e) {
+						ext.setPriority(Integer.parseInt(jTextField1.getText()));
+					}
+				});
+		}
+
+		return jTextField1;
+	}
+
+	/**
+	 * This method initializes jPanel3
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel3() {
+		if (jPanel3 == null) {
+			jPanel3 = new JPanel();
+			jPanel3.add(getJTextField1(), null);
+			jPanel3.add(jLabel, null);
+		}
+
+		return jPanel3;
+	}
+
+	/**
+	 * This method initializes jPanel4	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	private JPanel getJPanel4() {
+		if (jPanel4 == null) {
+			jLabel1 = new JLabel();
+			jPanel4 = new JPanel();
+			jLabel1.setText("Idioma:");
+			jPanel4.add(jLabel1, null);
+			jPanel4.add(getCmbIdioma(), null);
+		}
+		return jPanel4;
+	}
+	/**
+	 * This method initializes cmbIdioma	
+	 * 	
+	 * @return javax.swing.JComboBox	
+	 */    
+	private JComboBox getCmbIdioma() {
+		if (cmbIdioma == null) {
+			cmbIdioma = new JComboBox();
+			cmbIdioma.setPreferredSize(new java.awt.Dimension(195,20));
+			
+			Locale esp = new Locale("es");
+			Locale eng = new Locale("en");
+			Locale fra = new Locale("fr");
+			Locale ita = new Locale("it");
+			Locale val = new Locale("ca");
+            Locale cs = new Locale("cs"); // Checo
+            Locale eu = new Locale("eu"); // euskera
+            Locale brasil = new Locale("pt", "BR");
+            Locale de = new Locale("de"); // Alemán
+            Locale gr = new Locale("el", "GR"); // Griego
+			
+			// Parche para valenciano/catalán valencià/català
+			String strValenciano = PluginServices.getText(this, "__catalan");
+            // Parche para euskera
+            
+            Locale localeActual = Locale.getDefault(); // Se configura en la clase Launcher
+            String strEuskera;
+            if (eu.getDisplayLanguage().compareTo("vascuence") == 0)
+                strEuskera = "Euskera";
+            else
+                strEuskera = eu.getDisplayLanguage(); 
+            
+			
+			LanguageItem[] lenguajes = new LanguageItem[]{
+					new LanguageItem(esp, esp.getDisplayLanguage()),
+					new LanguageItem(eng, eng.getDisplayLanguage()),
+					new LanguageItem(fra, fra.getDisplayLanguage()),
+					new LanguageItem(ita, ita.getDisplayLanguage()),
+                    new LanguageItem(val, strValenciano),
+                    new LanguageItem(cs, cs.getDisplayLanguage()),
+                    new LanguageItem(eu, strEuskera),
+                    new LanguageItem(brasil, brasil.getDisplayLanguage()),
+					new LanguageItem(de, de.getDisplayLanguage()),
+					new LanguageItem(gr, gr.getDisplayLanguage())};
+						
+			DefaultComboBoxModel model = new DefaultComboBoxModel(lenguajes);
+			
+			for (int i = 0; i < lenguajes.length; i++) {
+				if (lenguajes[i].locale.equals(Locale.getDefault())){
+					model.setSelectedItem(lenguajes[i]);
+				}
+			}
+			
+			cmbIdioma.setModel(model);
+		}
+		return cmbIdioma;
+	}
+	
+	private class LanguageItem {
+		public Locale locale;
+		public String description;
+		
+		public LanguageItem(Locale loc, String str){
+			locale = loc;
+			description = str;
+		}
+		
+		public String toString(){
+			return description;
+		}
+	}
+   	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param args DOCUMENT ME!
+	 */
+	public static void main(String[] args) {
+		ConfigPlugins cp = new ConfigPlugins();
+		cp.setVisible(true);
+
+		JDialog dialog = new JDialog();
+		dialog.getContentPane().add(cp);
+		dialog.setSize(400, 300);
+		dialog.show(true);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setLayout(new BorderLayout());
+		this.setSize(443, 299);
+		this.setLocation(1, 1);
+		this.add(getJPanel(), java.awt.BorderLayout.CENTER);
+	}
+
+	/**
+	 * @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_ANDAMI"));
+		}
+
+		return m_viewinfo;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#viewActivated()
+	 */
+	public void viewActivated() {
+	}
+
+	/**
+	 * Escribe sobre el config.xml, la nueva configuración.
+	 */
+	public void marshalPlugins() {
+		HashMap pc = Launcher.getPluginConfig();
+		ArrayList array = new ArrayList();
+		Iterator iter = pc.keySet().iterator();
+
+		while (iter.hasNext()) {
+			Object obj = iter.next();
+			PluginConfig pconfig = (PluginConfig) pc.get(obj);
+			FileWriter writer;
+
+			try {
+				writer = new FileWriter(Launcher.getAndamiConfig().getPluginsDirectory() +
+						File.separator + (String) obj + File.separator +
+						"config.xml");
+
+				try {
+					pconfig.marshal(writer);
+				} catch (MarshalException e1) {
+					e1.printStackTrace();
+				} catch (ValidationException e1) {
+					e1.printStackTrace();
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			//hay que refrescar la aplicación
+			///((App)App.instance).run();
+		}
+	}
+
+	/**
+	 * Lee del config.xml la configuración.
+	 */
+	public void unmarshalPlugins() {
+		HashMap pc = Launcher.getPluginConfig();
+		ArrayList array = new ArrayList();
+		Iterator iter = pc.keySet().iterator();
+
+		while (iter.hasNext()) {
+			Object obj = iter.next();
+			PluginConfig pconfig = (PluginConfig) pc.get(obj);
+
+			try {
+				FileReader reader = new FileReader(Launcher.getAndamiConfig().getPluginsDirectory() +
+						File.separator + (String) obj + File.separator +
+						"config.xml");
+				PluginConfig.unmarshal(reader);
+			} catch (Exception e) {
+				System.out.println("Exception unmarshalPlugin " + e);
+			}
+		}
+
+		//hay que refrescar la aplicación
+		///((App)App.instance).run();
+	}
+} //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/configExtensions/ConfigPlugins.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/NotificationDialog.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/NotificationDialog.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/NotificationDialog.java	(revision 4539)
@@ -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.core;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.MessageEvent;
+import com.iver.andami.messages.NotificationListener;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+
+/**
+ * Graphic interface that appears to show an error.  
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class NotificationDialog extends JPanel implements View, SingletonView,
+    NotificationListener {
+    private JButton bDetails = null;
+    private JPanel pDescription = null;
+    private JTextArea txtDescription = null;
+    private JButton bNoDetails = null;
+    private JButton bAcept = null;
+    private JScrollPane pScrollDescription = null;
+
+    /**
+     * This is the default constructor
+     */
+    public NotificationDialog() {
+        super();
+        initialize();
+    }
+
+    /**
+     * This method initializes this
+     */
+    private void initialize() {
+        Consola.consolaFrame.setSize(new java.awt.Dimension(457, 150));
+        Consola.consolaFrame.setLocation(new java.awt.Point(11, 140));
+        Consola.consolaFrame.setVisible(false);
+        this.setLayout(null);
+        this.setSize(470, 175);
+        this.add(getBDetails(), null);
+        this.add(getPDescription(), null);
+        this.add(Consola.consolaFrame, null);
+        this.add(getDNoDetails(), null);
+        this.add(getBAcept(), null);
+    }
+
+    /**
+     * This method initializes bDetails
+     *
+     * @return javax.swing.JButton
+     */
+    private JButton getBDetails() {
+        if (bDetails == null) {
+            bDetails = new JButton();
+            bDetails.setBounds(new java.awt.Rectangle(315, 110, 129, 24));
+            bDetails.setText(PluginServices.getText(this,"detalles") + "   >>>");
+            bDetails.setVisible(true);
+            bDetails.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        Consola.consolaFrame.setVisible(true);
+                        bDetails.setVisible(false);
+                        getDNoDetails().setVisible(true);
+                        PluginServices.getMDIManager()
+                                      .getViewInfo(NotificationDialog.this)
+                                      .setHeight(325);
+                        setSize(460, 325);
+                    }
+                });
+        }
+
+        return bDetails;
+    }
+
+    /**
+     * This method initializes pDescription
+     *
+     * @return javax.swing.JPanel
+     */
+    private JPanel getPDescription() {
+        if (pDescription == null) {
+            pDescription = new JPanel();
+            pDescription.setBounds(new java.awt.Rectangle(7, 5, 437, 99));
+            pDescription.setBorder(javax.swing.BorderFactory.createTitledBorder(
+                    null, PluginServices.getText(this,"descripcion"),
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+            pDescription.add(getPScrollDescription(), null);
+        }
+
+        return pDescription;
+    }
+
+    /**
+     * This method initializes txtDescription
+     *
+     * @return javax.swing.JTextArea
+     */
+    private JTextArea getTxtDescription() {
+        if (txtDescription == null) {
+            txtDescription = new JTextArea();
+            //txtDescription.setPreferredSize(new java.awt.Dimension(420, 65));
+            txtDescription.setForeground(java.awt.Color.blue);
+            txtDescription.setBackground(java.awt.SystemColor.control);
+            txtDescription.setEditable(false);
+        }
+
+        return txtDescription;
+    }
+
+    /**
+     * @see com.iver.mdiApp.ui.MDIManager.View#getModel()
+     */
+    public Object getViewModel() {
+        return "consola";
+    }
+
+    /**
+     * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
+     */
+    public ViewInfo getViewInfo() {
+        ViewInfo info = new ViewInfo(ViewInfo.MODELESSDIALOG |
+                ViewInfo.ICONIFIABLE);
+        info.setTitle(PluginServices.getText(this, "titulo_consola"));
+
+        return info;
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#errorEvent(java.lang.String)
+     */
+    public void errorEvent(MessageEvent e) {
+        if (e.getMessages() != null) {
+            for (int i = 0; i < e.getMessages().length; i++) {
+                txtDescription.setText(e.getMessages()[i]);
+            }
+        }
+
+        PluginServices.getMDIManager().restoreCursor();
+        if (SwingUtilities.isEventDispatchThread()) {
+            PluginServices.getMDIManager().addView(this);
+        } else {
+            SwingUtilities.invokeLater(new Runnable() {
+                    public void run() {
+                        PluginServices.getMDIManager().addView(NotificationDialog.this);
+                    }
+                });
+        }
+        
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#warningEvent(java.lang.String)
+     */
+    public void warningEvent(MessageEvent e) {
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#infoEvent(java.lang.String)
+     */
+    public void infoEvent(MessageEvent e) {
+    }
+
+    /**
+     * This method initializes dNoDetails
+     *
+     * @return javax.swing.JButton
+     */
+    private JButton getDNoDetails() {
+        if (bNoDetails == null) {
+            bNoDetails = new JButton();
+            bNoDetails.setVisible(false);
+            bNoDetails.setBounds(new java.awt.Rectangle(315, 110, 128, 24));
+            bNoDetails.setText("<<<   " + PluginServices.getText(this,"detalles"));
+            bNoDetails.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        bDetails.setVisible(true);
+                        bNoDetails.setVisible(false);
+                        Consola.consolaFrame.setVisible(false);
+                        PluginServices.getMDIManager()
+                                      .getViewInfo(NotificationDialog.this)
+                                      .setHeight(175);
+                        setSize(460, 175);
+                    }
+                });
+        }
+
+        return bNoDetails;
+    }
+
+    /**
+     * This method initializes bAcept
+     *
+     * @return javax.swing.JButton
+     */
+    private JButton getBAcept() {
+        if (bAcept == null) {
+            bAcept = new JButton();
+            bAcept.setBounds(new java.awt.Rectangle(10, 110, 296, 24));
+            bAcept.setText(PluginServices.getText(this,"aceptar"));
+            bAcept.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent e) {
+                        PluginServices.getMDIManager().closeView(NotificationDialog.this);
+                    }
+                });
+        }
+
+        return bAcept;
+    }
+
+    /**
+     * This method initializes pScrollDescription
+     *
+     * @return javax.swing.JScrollPane
+     */
+    private JScrollPane getPScrollDescription() {
+        if (pScrollDescription == null) {
+            pScrollDescription = new JScrollPane();
+            pScrollDescription.setPreferredSize(new java.awt.Dimension(420,67));
+            pScrollDescription.setAutoscrolls(true);
+            pScrollDescription.setViewportView(getTxtDescription());
+        }
+
+        return pScrollDescription;
+    }
+} //  @jve:decl-index=0:visual-constraint="10,10"

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/NotificationDialog.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/StatusBar.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/StatusBar.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/StatusBar.java	(revision 4539)
@@ -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.core;
+
+import com.iver.andami.messages.MessageEvent;
+import com.iver.andami.messages.NotificationListener;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.messages.ProgressListener;
+import com.iver.andami.plugins.Extension;
+
+
+/**
+ * Plugin que escucha las notificaciones que recive la aplicación y las muestra
+ * en la barra de estado
+ */
+public class StatusBar implements Extension, NotificationListener {
+	private int i;
+	private int pr;
+    /**
+     * @see com.iver.mdiApp.Extension#inicializar()
+     */
+    public void inicializar() {
+        NotificationManager.addNotificationListener(this);
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#errorEvent(java.lang.String)
+     */
+    public void errorEvent(MessageEvent e) {
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#warningEvent(java.lang.String)
+     */
+    public void warningEvent(MessageEvent e) {
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#infoEvent(java.lang.String)
+     */
+    public void infoEvent(MessageEvent e) {
+    }
+
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/StatusBar.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConsolaFrame.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConsolaFrame.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConsolaFrame.java	(revision 4539)
@@ -0,0 +1,290 @@
+/* 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.core;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.MessageEvent;
+import com.iver.andami.messages.NotificationListener;
+import com.iver.andami.ui.mdiManager.SingletonView;
+import com.iver.andami.ui.mdiManager.View;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+
+/**
+ * Frame que escucha los eventos del sistema de mensajes de la aplicación y los
+ * muestra.
+ */
+public class ConsolaFrame extends JPanel implements View, SingletonView,NotificationListener {
+	private StringBuffer info = new StringBuffer();
+	private StringBuffer warn = new StringBuffer();
+	private StringBuffer error = new StringBuffer();
+	private StringBuffer all = new StringBuffer();
+	private JEditorPane textoInfos;
+	private JEditorPane textoWarnings;
+	private JEditorPane textoErrores;
+	private JEditorPane textoAll;
+
+	private final static String marcaInfo ="font size='3' color='#000000'";
+	private final static String marcaWarning ="font size='3' color='#800000'";
+	private final static String marcaError ="font size='3' color='#FF0000'";
+	private JTabbedPane tabs;
+	private JPanel panelErrores;
+
+    /**
+     * Crea la consola con los mensajes producidos hasta el momento de la
+     * creación de este objeto.
+     *
+     * @param todo Array de todos los mensajes
+     * @param infos Array de los mensajes de información
+     * @param warns Array de los mensajes de warning
+     * @param errors Array de los mensajes de error
+     */
+    public ConsolaFrame() {
+
+		this.setSize(400, 325);
+
+        //Las cajas de texto donde van los mensajes
+        textoInfos = new JEditorPane();
+        textoInfos.setEditable(false);
+		textoInfos.setContentType("text/html");
+        textoWarnings = new JEditorPane();
+        textoWarnings.setEditable(false);
+		textoWarnings.setContentType("text/html");
+        textoErrores = new JEditorPane();
+        textoErrores.setEditable(false);
+		textoErrores.setContentType("text/html");
+        textoAll = new JEditorPane();
+        textoAll.setEditable(false);
+		textoAll.setContentType("text/html");
+
+		JScrollPane scroll = new JScrollPane(textoAll);
+		scroll.setVerticalScrollBarPolicy(
+						JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+		scroll.setHorizontalScrollBarPolicy(
+		JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+//		scroll.setPreferredSize(new Dimension(500, 500));
+//		scroll.setMinimumSize(new Dimension(10, 10));
+		JPanel panelAll = new JPanel(new BorderLayout());
+		panelAll.add(scroll, BorderLayout.CENTER);
+		
+		scroll = new JScrollPane(textoInfos);
+		scroll.setVerticalScrollBarPolicy(
+						JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+		scroll.setHorizontalScrollBarPolicy(
+			JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+//		scroll.setPreferredSize(new Dimension(250, 145));
+//		scroll.setMinimumSize(new Dimension(10, 10));
+		JPanel panelInfos = new JPanel(new BorderLayout());
+		panelInfos.add(scroll, BorderLayout.CENTER);
+		
+		scroll = new JScrollPane(textoWarnings);
+		scroll.setVerticalScrollBarPolicy(
+						JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+		scroll.setHorizontalScrollBarPolicy(
+		JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+//		scroll.setPreferredSize(new Dimension(250, 145));
+//		scroll.setMinimumSize(new Dimension(10, 10));
+		JPanel panelWarnings = new JPanel(new BorderLayout());
+		panelWarnings.add(scroll, BorderLayout.CENTER);
+		
+		scroll = new JScrollPane(textoErrores);
+		scroll.setVerticalScrollBarPolicy(
+						JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+		scroll.setHorizontalScrollBarPolicy(
+		JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+//		scroll.setPreferredSize(new Dimension(250, 145));
+//		scroll.setMinimumSize(new Dimension(10, 10));
+		panelErrores = new JPanel(new BorderLayout());
+		panelErrores.add(scroll, BorderLayout.CENTER);
+
+//        rellenar(infos, textoInfos, info, marcaInfo);
+  //      rellenar(warns, textoWarnings, warn, marcaWarning);
+    //    rellenar(errors, textoErrores, error, marcaError);
+      //  rellenarTodo(todo, textoAll);
+
+        //Las pestañas
+        tabs = new JTabbedPane();
+        tabs.addTab(PluginServices.getText( this ,"todos"), panelAll);
+        tabs.addTab(PluginServices.getText( this ,"info"), panelInfos);
+        tabs.addTab(PluginServices.getText( this ,"warnings"), panelWarnings);
+        tabs.addTab(PluginServices.getText( this ,"errores"), panelErrores);
+		this.setLayout(new BorderLayout());
+        this.add(tabs, BorderLayout.CENTER);
+        
+    }
+
+	/**
+	 * Método de utilidad para rellenar los cuadros de texto con un array de
+	 * cadenas
+	 *
+	 * @param contenido array de cadenas que se mostrarán en el cuadro de texto
+	 *        separadas por un retorno de carro
+	 * @param control Control en el que se pondrán las cadenas
+	 */
+	private void rellenar(String[] contenido, JEditorPane control, StringBuffer buffer, String marca) {
+		String content = "";
+		for (int i = 0; i < contenido.length; i++) {
+			content = content + "<"+marca+">"+contenido[i] + "</"+marca+"><br/";
+		}
+			
+		buffer.append(content);
+
+		control.setContentType("text/html");
+		control.setText(content);
+	}
+
+	/*
+	 * Método de utilidad para rellenar los cuadros de texto con un array de
+	 * cadenas
+	 *
+	 * @param contenido array de cadenas que se mostrarán en el cuadro de texto
+	 *        separadas por un retorno de carro
+	 * @param control Control en el que se pondrán las cadenas
+	 *
+	private void rellenarTodo(Message[] contenido, JEditorPane control) {
+		HashMap marcasTipoMsg = new HashMap();
+		marcasTipoMsg.put(new Integer(Message.INFO), marcaInfo);
+		marcasTipoMsg.put(new Integer(Message.WARNING), marcaWarning);
+		marcasTipoMsg.put(new Integer(Message.ERROR), marcaError);
+
+		String content = "";
+		for (int i = 0; i < contenido.length; i++) {
+			String marca = (String) marcasTipoMsg.get(new Integer(contenido[i].tipo));
+			content = content + "<"+marca+">"+contenido[i].texto + "</"+marca+"><br/";
+		}
+
+		all.append(content);
+
+		control.setContentType("text/html");
+		control.setText(content);
+	}*/
+
+
+	/**
+	 * Obtiene un string con la traza de una excepción a la consola
+	 *
+	 * @param t Elemento throwable
+	 */
+	private static String dumpStackTrace(Throwable t) {
+		if ( t == null ) return "";
+		StackTraceElement[] stes = t.getStackTrace();
+		String todo = "<"+marcaWarning+">" + t.getClass().getName() + ": " + t.getLocalizedMessage() +
+			"<"+marcaWarning+">" + "<br/";
+
+		for (int i = 0; i < stes.length; i++) {
+			todo += ("<"+marcaWarning+">&nbsp;&nbsp;&nbsp;&nbsp;" + stes[i].toString() + "<br/");
+		}
+
+		if (t.getCause() != null) {
+			todo = todo + dumpStackTrace(t.getCause());
+		}
+        
+		return todo;
+	}
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#errorEvent(java.lang.String)
+     */
+    public void errorEvent(MessageEvent e) {
+    	for (int i = 0; i < e.getMessages().length; i++){
+    		String traza = dumpStackTrace(e.getExceptions()[i]);
+
+			error.append("<"+marcaError+">" + e.getMessages()[i] + "</"+marcaError+"><br/" + traza);
+			all.append("<"+marcaError+">" + e.getMessages()[i] + "</"+marcaError+"><br/" + traza);
+    	}
+		textoErrores.setText(error.toString());
+		textoAll.setText(all.toString());
+		tabs.setSelectedComponent(panelErrores);
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#warningEvent(java.lang.String)
+     */
+    public void warningEvent(MessageEvent e) {
+		for (int i = 0; i < e.getMessages().length; i++){
+			String traza = dumpStackTrace(e.getExceptions()[i]);
+
+			warn.append("<"+marcaWarning+">" + e.getMessages()[i] + "</"+marcaWarning+"><br/" + traza);
+			all.append("<"+marcaWarning+">" + e.getMessages()[i] + "</"+marcaWarning+"><br/" + traza);
+		}
+		textoWarnings.setText(warn.toString());
+		textoAll.setText(all.toString());
+    }
+
+    /**
+     * @see com.iver.mdiApp.NotificationListener#infoEvent(java.lang.String)
+     */
+    public void infoEvent(MessageEvent e) {
+		for (int i = 0; i < e.getMessages().length; i++){
+			String traza = dumpStackTrace(e.getExceptions()[i]);
+			
+			info.append("<"+marcaInfo+">" + e.getMessages()[i] + "</"+marcaInfo+"><br/" + traza);
+			all.append("<"+marcaInfo+">" + e.getMessages()[i] + "</"+marcaInfo+"><br/" + traza);
+		}
+		textoInfos.setText(info.toString() );
+		textoAll.setText(all.toString());
+
+    }
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.View#getModel()
+	 */
+	public Object getViewModel() {
+		return "consola";
+	}
+
+	/**
+	 * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
+	 */
+	public ViewInfo getViewInfo() {
+		ViewInfo info = new ViewInfo(ViewInfo.MODELESSDIALOG|ViewInfo.RESIZABLE|ViewInfo.MAXIMIZABLE|ViewInfo.ICONIFIABLE);
+		info.setTitle(PluginServices.getText(this, "titulo_consola"));
+		return info;
+	}
+
+	
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/ConsolaFrame.java
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/Consola.java
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/Consola.java	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/Consola.java	(revision 4539)
@@ -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.core;
+
+import com.iver.andami.PluginServices;
+import com.iver.andami.messages.NotificationManager;
+import com.iver.andami.plugins.Extension;
+import com.iver.andami.ui.mdiManager.ViewInfo;
+import com.iver.utiles.XMLEntity;
+
+
+/**
+ * Extensión que registra un frame en la aplicación que recibe los eventos de
+ * la consola de la aplicación y los muestra en el frame
+ */
+public class Consola implements Extension {
+	static PluginServices ps;
+    public static ConsolaFrame consolaFrame;
+    public static NotificationDialog notificationDialog;
+
+    /**
+     * @see com.iver.mdiApp.Extension#inicializar()
+     */
+    public void inicializar() {
+    	ps = PluginServices.getPluginServices(this);
+    	consolaFrame = new ConsolaFrame();
+    	notificationDialog= new NotificationDialog();
+    	NotificationManager.addNotificationListener(consolaFrame);
+    	NotificationManager.addNotificationListener(notificationDialog);
+    }
+
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		consolaFrame.setSize(400, 325);
+		consolaFrame.setVisible(true);
+        PluginServices.getMDIManager().addView(consolaFrame);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.Extension#isEnabled()
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.andami.plugins.Extension#isVisible()
+	 */
+	public boolean isVisible() {
+		return true;
+	}
+}

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/src/com/iver/core/Consola.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/text_de.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_de.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_de.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_de.properties
+__catalan=Valencianisch
+aceptar=OK
+cancelar=Abbrechen
+Cascada=Kaskade
+cascada_enable=Es muss mindestens ein Fenster ge\u00F6ffnet sein.
+cascada_tooltip=Organisiert die Fenster in der Kaskade
+Configurar=Konfigurieren
+configurar_ANDAMI=Konfigurationdialog von ANDAMI
+Consola=Konsole
+descripcion=Beschreibung
+directorio=Verzeichnis
+directorio_extensiones=Verzeichnis der Erweiterungen
+errores=Fehler
+examinar=Untersuchen
+extension_activada=Erweiterung aktiviert
+general=Allgemein
+info=Information
+opciones=Optionen
+prioridad=Priorit\u00E4t
+Tile=Mosaik
+tile_tooltip=Organisiert die Fenster als Mosaik
+titulo_consola=Informationskonsole
+todos=Alle
+ventana=Fenster
+Ver=Sehen
+warnings=Warnung
+Window=Fenster

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_de.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/build.xml
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/build.xml	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/build.xml	(revision 4539)
@@ -0,0 +1,51 @@
+<project name="Core plugin" default="dist" basedir=".">
+    <description>
+        Instala el plugin
+    </description>
+  <!-- set global properties for this build -->
+  <property name="src" location="src"/>
+  <property name="build" location="bin"/>
+  <property name="dist"  location="dist"/>
+  <property name="plugin" value="com.iver.core"/>
+  <property name="targetDir" location="../_fwAndami/gvSIG/extensiones"/>
+
+  <target name="init">
+    <!-- Create the time stamp -->
+    <tstamp/>
+    <!-- Create the build directory structure used by compile -->
+    <mkdir dir="${build}"/>
+  </target>
+
+  <target name="dist" description="generate the distribution" >
+    <!-- Create the distribution directory -->
+    <mkdir dir="${dist}"/>
+
+    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
+    <copy todir="${build}">
+    	<fileset dir="${src}" includes="**"/>
+    </copy>
+    <jar jarfile="${dist}/${plugin}.jar" basedir="${build}"/>
+    <copy file="config.xml" todir="${dist}"/>
+    <copy todir="${dist}">
+    	<fileset dir="." includes="text*.properties"/>
+    </copy>
+    <copy todir="${dist}/images">
+    	<fileset dir="images/" includes="*"/>
+    </copy>
+    <copy todir="${dist}">
+    	<fileset dir="." includes="*.jar"/>
+    </copy>
+
+    <move todir="${targetDir}/${plugin}/">
+    	<fileset dir="${dist}" includes="**/**"/>
+    </move>
+  </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/AS_STABLE/libraries/libCorePlugin/build.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/.classpath
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/.classpath	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/.classpath	(revision 4539)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="/_fwAndami/lib/log4j-1.2.8.jar"/>
+	<classpathentry kind="src" path="/_fwAndami"/>
+	<classpathentry kind="lib" path="/_fwAndami/lib/castor-0.9.5.3-xml.jar"/>
+	<classpathentry kind="lib" path="/_fwAndami/lib/iver-utiles.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/.classpath
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/text_en.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_en.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_en.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_en.properties
+__catalan=valencian
+aceptar=OK
+cancelar=Cancel
+Cascada=Cascade
+cascada_enable=There must be at least one visible window
+cascada_tooltip=Arrange windows in cascade
+Configurar=Configure
+configurar_ANDAMI=ANDAMI configuration dialog.
+Consola=Console
+descripcion=Description
+directorio=Directory
+directorio_extensiones=Extensions directory.
+errores=Errors
+examinar=Examine
+extension_activada=Active extension.  
+general=General
+info=Information
+opciones=Options
+prioridad=Priority
+Tile=Tile
+tile_tooltip=Arrange the windows in tile
+titulo_consola=Information console
+todos=All
+ventana=Window
+Ver=Show
+warnings=Warnings
+Window=Window

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_en.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/config.xml
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/config.xml	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/config.xml	(revision 4539)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+	<libraries library-dir="."/>
+	<resourceBundle name="text"/>
+	<extensions>
+		<extension class-name="com.iver.core.Consola" 
+			description="Extensión encargada de abrir la ventana de la consola."
+			active="true" priority="1">
+			<menu text="Ver/Consola" action-command="unico" key="s"
+				mnemonic="c" icon="images/console.png" 
+				tooltip="titulo_consola"
+				position="0"/>
+			<tool-bar name="core">
+				<action-tool icon="images/console.png"
+					action-command="consola" tooltip="titulo_consola"
+					enable-text="debe_estar_activada" last="true"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="com.iver.core.ConfigExtension" 
+			description="Extensión encargada de abrir la ventana de configuración de ANDAMI."
+			active="true" priority="2">
+			<menu text="ventana/Configurar" action-command="config"
+				mnemonic="p" icon="images/config.png" 
+				tooltip="configurar_ANDAMI"
+				position="2"/>
+			<tool-bar name="core">
+				<action-tool icon="images/config.png"
+					action-command="configuracion" tooltip="configurar_ANDAMI"
+					enable-text="debe_estar_activada"/>
+			</tool-bar>
+		</extension>
+			
+		<extension class-name="com.iver.core.StatusBar" 
+			description="Recoge los mensajes del NotificationManager y los muestra por la StatusBar"
+			active="true">
+		</extension>
+		<skin-extension class-name="com.iver.core.mdiManager.NewSkin">
+			<menu text="ventana/Cascada" action-command="cascada" key="c"
+				mnemonic="c" tooltip="cascada_tooltip"/>
+			<menu text="ventana/Tile" action-command="mosaico" key="m"
+				mnemonic="c" tooltip="mosaico_tooltip"/>
+		</skin-extension>
+	</extensions>
+</plugin-config>
+
+<!--
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE plugin SYSTEM "../../plugin.dtd">
+<plugin>
+	<libraries>
+		<library file="com.iver.core.jar"/>
+		<library file="prulib.jar"/>
+	</libraries>
+	<resourceBundle name="text"/>
+	<labelSet class="com.iver.core.ConsolaFrame">
+		<label text="label1"/>
+		<label text="label2"/>
+	</labelSet>
+	<extension>
+		<class name="com.iver.core.Consola"/>
+		<menu text="Ver/Consola" key="s"/>
+		<toolBar name="Ver">
+			<tool icon="images/console.jpg"
+				actionCommand="CONSOLA"/>
+		</toolBar>
+	</extension>
+	<extension>
+		<class name="com.iver.core.Cascade"/>
+		<menu text="Window/Tile" key="t" mnemonic="t"
+			tooltip="tile_tooltip" 
+			enableText="cascada_enable"
+			actionCommand="TILE"/>
+		<menu text="Window/Cascada" key="c" mnemonic="c" 
+			tooltip="cascada_tooltip" 
+			enableText="cascada_enable"
+			actionCommand="CASCADA"/>
+		<toolBar name="Window">
+			<tool icon="images/cascada.gif" 
+				tooltip="cascada_tooltip" 
+				enableText="cascada_enable"
+				actionCommand="CASCADA"/>
+			<tool icon="images/tile.gif"
+				tooltip="tile_tooltip" 
+				enableText="cascada_enable"
+				actionCommand="TILE"/>
+		</toolBar>
+		<popupMenu name="cascada">
+			<entry text="Cascada" 
+				tooltip="cascada_tooltip" 
+				enableText="cascada_enable" actionCommand="CASCADA"/>
+			<entry text="Tile" 
+				tooltip="tile_tooltip" 
+				enableText="cascada_enable" actionCommand="CASCADA"/>
+		</popupMenu>
+	</extension>
+	<extension>
+		<class name="com.iver.core.StatusBar"/>
+	</extension>
+</plugin>
+-->

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/config.xml
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/text_cs.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_cs.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_cs.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_cs.properties
+__catalan=valencian
+aceptar=Ok
+cancelar=Zru\u0161it
+Cascada=Kask\u00E1da
+cascada_enable=Alespo\u0148 jedno okno mus\u00ED b\u00FDt viditeln\u00E9
+cascada_tooltip=Se\u0159adit okna do kask\u00E1dy
+Configurar=Konfigurovat
+configurar_ANDAMI=ANDAMI konfigura\u010Dn\u00ED dialog.
+Consola=Konzola
+descripcion=Popis
+directorio=Adres\u00E1\u0159
+directorio_extensiones=Adres\u00E1\u0159 extenz\u00ED.
+errores=Chyby
+examinar=Prohl\u00E9dnout
+extension_activada=Aktivn\u00ED extenze.  
+general=Obecn\u00FD
+info=Informace
+opciones=Mo\u017Enosti
+prioridad=Priorita
+Tile=Dla\u017Edice
+tile_tooltip=Dla\u017Edicov\u011B se\u0159adit okna
+titulo_consola=Informa\u010Dn\u00ED konzola
+todos=V\u0161e
+ventana=Okno
+Ver=Pohled
+warnings=Varov\u00E1n\u00ED
+Window=Okno

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_cs.properties
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Author Date Id Revision

Index: tags/AS_STABLE/libraries/libCorePlugin/text_pt_br.properties
===================================================================
--- tags/AS_STABLE/libraries/libCorePlugin/text_pt_br.properties	(revision 0)
+++ tags/AS_STABLE/libraries/libCorePlugin/text_pt_br.properties	(revision 4539)
@@ -0,0 +1,28 @@
+#text_pt_br.properties
+__catalan=valenciano
+aceptar=OK
+cancelar=Cancelar
+Cascada=Cascata
+cascada_enable=Deve existir ao menos um quadro vis\u00EDvel
+cascada_tooltip=Arranjar janelas em cascata
+Configurar=Configurar
+configurar_ANDAMI=Di\u00E1log de configura\u00E7\u00E3o do ANDAMI.
+Consola=Console
+descripcion=Descri\u00E7\u00E3o
+directorio=Diret\u00F3rio
+directorio_extensiones=Diret\u00F3rio de extens\u00F5es
+errores=Erro
+examinar=Examinar
+extension_activada=Extens\u00E3o ativa.  
+general=Geral
+info=Informa\u00E7\u00E3o
+opciones=Op\u00E7\u00F5es
+prioridad=Prioridade
+Tile=Lado a Lado
+tile_tooltip=Arranjar a janela Lado a Lado
+titulo_consola=Informa\u00E7\u00E3o de console
+todos=Todos
+ventana=Janela
+Ver=Vis\u00E3o
+warnings=Aviso
+Window=Janela

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/text_pt_br.properties
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: tags/AS_STABLE/libraries/libCorePlugin/images/console.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/images/console.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/AS_STABLE/libraries/libCorePlugin/images/tile.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/images/tile.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/AS_STABLE/libraries/libCorePlugin/images/cascada.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/images/cascada.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/AS_STABLE/libraries/libCorePlugin/images/config.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/images/config.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/AS_STABLE/libraries/libCorePlugin/images/console.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/images/console.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tags/AS_STABLE/libraries/libCorePlugin/images/config.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/AS_STABLE/libraries/libCorePlugin/images/config.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: tags/AS_STABLE/libraries/libCorePlugin
___________________________________________________________________
Added: svn:ignore
   + bin


