Index: tags/v2_0_0_Build_2047/extensions/extDwg/buildNumber.properties
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/buildNumber.properties	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/buildNumber.properties	(revision 38268)
@@ -0,0 +1,3 @@
+#maven.buildNumber.plugin properties file
+#Tue May 29 16:39:09 CEST 2012
+buildNumber=2047
Index: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG.java	(revision 38268)
@@ -0,0 +1,87 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+
+/*
+* AUTHORS (In addition to CIT):
+* 2008 IVER T.I. S.A.   {{Task}}
+*/
+
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import java.io.File;
+
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.BaseTestFeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+
+public class TestDWG extends BaseTestFeatureStore {
+
+	protected boolean testDXFInitialized = false;
+
+	public static File file_prueba = new File(TestDWG.class.getResource(
+			"data/V2000.dwg").getFile());
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see
+	 * org.gvsig.fmap.dal.feature.BaseTestFeatureStore#getDefaultDataStoreParameters
+	 * ()
+	 */
+	public DataStoreParameters getDefaultDataStoreParameters()
+			throws DataException {
+		DWGStoreParameters dwgParameters = null;
+
+		dwgParameters = (DWGStoreParameters) dataManager
+				.createStoreParameters(DWGStoreProvider.NAME);
+
+		dwgParameters.setFile(file_prueba);
+		dwgParameters.setCRS("EPSG:23030");
+		return dwgParameters;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer()
+	 */
+	public boolean hasExplorer() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean usesResources() {
+		return true;
+	}
+
+
+	public void testLegendAndLabeling() throws Exception {
+		DataStoreParameters params = getDefaultDataStoreParameters();
+		FeatureStore store = (FeatureStore) dataManager.openStore(params
+				.getDataStoreName(), params);
+
+		assertNotNull(store.invokeDynMethod("getLegend", null));
+		assertNotNull(store.invokeDynMethod("getLabeling", null));
+		store.dispose();
+	}
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG2004.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG2004.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG2004.java	(revision 38268)
@@ -0,0 +1,35 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* 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., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import java.io.File;
+
+public class TestDWG2004 extends TestDWG {
+	public static File file_prueba = new File(TestDWG.class.getResource(
+			"data/V2004.dwg").getFile());
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG2004.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/data/V2000.dwg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/data/V2000.dwg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream
Added: svn:executable
   + *

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/data/V2004.dwg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src-test/org/gvsig/dwg/fmap/dal/store/dwg/data/V2004.dwg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream
Added: svn:executable
   + *

Index: tags/v2_0_0_Build_2047/extensions/extDwg/config/config.xml
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/config/config.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/config/config.xml	(revision 38268)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+	<libraries library-dir="lib">
+	</libraries>
+	<depends plugin-name="org.gvsig.app"/>
+		<resourceBundle name="text"/>
+	<extensions>
+		<extension class-name="org.gvsig.dwg.DWGRegisterExtension"
+			description="DWG Driver"
+			active="true">
+		</extension>
+
+	</extensions>
+</plugin-config>
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/config/config.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/DWGRegisterExtension.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/DWGRegisterExtension.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/DWGRegisterExtension.java	(revision 38268)
@@ -0,0 +1,58 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.dwg;
+
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.dwg.fmap.dal.store.dwg.DWGLibrary;
+
+/**
+ * Dummy DWG extension, as all the registration happens in the
+ * {@link DWGLibrary}.
+ * 
+ * @author gvSIG Team
+ */
+public class DWGRegisterExtension extends Extension {
+
+	public void execute(String actionCommand) {
+		// Nothing to do
+	}
+
+	public void initialize() {
+		// Nothing to do
+	}
+
+	public void postInitialize() {
+		super.postInitialize();
+		// Nothing to do
+	}
+
+	public boolean isEnabled() {
+		// Nothing to do
+		return false;
+	}
+
+	public boolean isVisible() {
+		// Nothing to do
+		return false;
+	}
+
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/DWGRegisterExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLabeling.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLabeling.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLabeling.java	(revision 38268)
@@ -0,0 +1,73 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+
+/*
+* AUTHORS (In addition to CIT):
+* 2008 IVER T.I. S.A.   {{Task}}
+*/
+
+package org.gvsig.dwg.fmap.dal.store.dwg.legend;
+
+import org.gvsig.dwg.fmap.dal.store.dwg.DWGStoreProvider;
+import org.gvsig.dwg.fmap.dal.store.dwg.LegendBuilder;
+import org.gvsig.fmap.dal.exception.OpenException;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynMethod;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.exception.DynMethodException;
+import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
+
+public class DWGGetLabeling implements DynMethod {
+	private static Integer code = null;
+
+	static void register(DynClass dwgLegendDynClass) {
+		if (code != null) {
+			return;
+		}
+		code = new Integer(ToolsLocator.getDynObjectManager()
+				.registerDynMethod(dwgLegendDynClass, new DWGGetLabeling()));
+
+	}
+	public int getCode() throws DynMethodNotSupportedException {
+		return code.intValue();
+	}
+
+	public String getDescription() {
+		return "DWG Labeling";
+	}
+
+	public String getName() {
+		return LegendBuilder.DYNMETHOD_GETLABELING_NAME;
+	}
+
+	public Object invoke(Object self, DynObject context)
+			throws DynMethodException {
+		try {
+			return ((DWGStoreProvider) self).getLabeling();
+		} catch (OpenException e) {
+			//FIXME
+			throw new RuntimeException(e);
+		}
+	}
+
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLabeling.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegend.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegend.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegend.java	(revision 38268)
@@ -0,0 +1,73 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+
+/*
+* AUTHORS (In addition to CIT):
+* 2008 IVER T.I. S.A.   {{Task}}
+*/
+
+package org.gvsig.dwg.fmap.dal.store.dwg.legend;
+
+import org.gvsig.dwg.fmap.dal.store.dwg.DWGStoreProvider;
+import org.gvsig.dwg.fmap.dal.store.dwg.LegendBuilder;
+import org.gvsig.fmap.dal.exception.OpenException;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynMethod;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.exception.DynMethodException;
+import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
+
+public class DWGGetLegend implements DynMethod {
+	private static Integer code = null;
+
+	static void register(DynClass dwgLegendDynClass) {
+		if (code != null) {
+			return;
+		}
+		code = new Integer(ToolsLocator.getDynObjectManager()
+				.registerDynMethod(dwgLegendDynClass, new DWGGetLegend()));
+
+	}
+	public int getCode() throws DynMethodNotSupportedException {
+		return code.intValue();
+	}
+
+	public String getDescription() {
+		return "DWG Legend";
+	}
+
+	public String getName() {
+		return LegendBuilder.DYNMETHOD_GETLEGEND_NAME;
+	}
+
+	public Object invoke(Object self, DynObject context)
+			throws DynMethodException {
+		try {
+			return ((DWGStoreProvider) self).getLegend();
+		} catch (OpenException e) {
+			//FIXME
+			throw new RuntimeException(e);
+		}
+	}
+
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegend.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendLibrary.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendLibrary.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendLibrary.java	(revision 38268)
@@ -0,0 +1,69 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+
+/*
+* AUTHORS (In addition to CIT):
+* 2008 IVER T.I. S.A.   {{Task}}
+*/
+
+/**
+ *
+ */
+package org.gvsig.dwg.fmap.dal.store.dwg.legend;
+
+import org.gvsig.dwg.fmap.dal.store.dwg.DWGLibrary;
+import org.gvsig.dwg.fmap.dal.store.dwg.DWGStoreProvider;
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.metadata.MetadataLibrary;
+import org.gvsig.metadata.MetadataLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * @author jmvivo
+ *
+ */
+public class DWGLegendLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsImplementationOf(DWGLegendLibrary.class);
+        require(MetadataLibrary.class);
+        require(DWGLibrary.class);
+        require(DALLibrary.class);
+    }
+
+	@Override
+	protected void doInitialize() throws LibraryException {
+	}
+
+	@Override
+	protected void doPostInitialize() throws LibraryException {
+		DynClass dynClass = (DynClass) MetadataLocator.getMetadataManager()
+				.getDefinition(DWGStoreProvider.METADATA_DEFINITION_NAME);
+
+		DWGGetLegendBuilder.register(dynClass);
+		DWGGetLegend.register(dynClass);
+		DWGGetLabeling.register(dynClass);
+	}
+}
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegendBuilder.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegendBuilder.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegendBuilder.java	(revision 38268)
@@ -0,0 +1,67 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+
+/*
+* AUTHORS (In addition to CIT):
+* 2008 IVER T.I. S.A.   {{Task}}
+*/
+
+package org.gvsig.dwg.fmap.dal.store.dwg.legend;
+
+import org.gvsig.dwg.fmap.dal.store.dwg.LegendBuilder;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynMethod;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.exception.DynMethodException;
+import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
+
+public class DWGGetLegendBuilder implements DynMethod {
+	private static Integer code = null;
+
+	static void register(DynClass dwgLegendDynClass) {
+		if (code != null) {
+			return;
+		}
+		code = new Integer(ToolsLocator.getDynObjectManager()
+				.registerDynMethod(
+						dwgLegendDynClass, new DWGGetLegendBuilder()));
+
+	}
+	public int getCode() throws DynMethodNotSupportedException {
+		return code.intValue();
+	}
+
+	public String getDescription() {
+		return "DWG LegendBuilder creator";
+	}
+
+	public String getName() {
+		return LegendBuilder.DYNMETHOD_BUILDER_NAME;
+	}
+
+	public Object invoke(Object self, DynObject context)
+			throws DynMethodException {
+		return new DWGLegendBuilder();
+	}
+
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGGetLegendBuilder.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendBuilder.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendBuilder.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendBuilder.java	(revision 38268)
@@ -0,0 +1,134 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+
+/*
+* AUTHORS (In addition to CIT):
+* 2008 IVER T.I. S.A.   {{Task}}
+*/
+
+package org.gvsig.dwg.fmap.dal.store.dwg.legend;
+
+import java.awt.Color;
+
+import org.gvsig.dwg.fmap.dal.store.dwg.DWGStoreProvider;
+import org.gvsig.dwg.fmap.dal.store.dwg.LegendBuilder;
+import org.gvsig.dxf.px.dxf.AcadColor;
+import org.gvsig.fmap.dal.DataTypes;
+import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
+import org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.rendering.legend.IVectorialUniqueValueLegend;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.SymbologyLocator;
+import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.IAttrInTableLabelingStrategy;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
+
+public class DWGLegendBuilder implements LegendBuilder {
+
+
+	private IVectorialUniqueValueLegend defaultLegend = null;
+    private IAttrInTableLabelingStrategy labelingStragegy = null;
+
+	public void begin() {
+		// Nothing to do
+	}
+
+	public void end() {
+		// Nothing to do
+	}
+
+	public Object getLegend() {
+		return defaultLegend;
+	}
+
+	public LegendBuilder initialize(FeatureStoreProvider store) {
+		defaultLegend = (IVectorialUniqueValueLegend) MapContextLocator
+				.getMapContextManager().createLegend(
+						IVectorialUniqueValueLegend.LEGEND_NAME);
+		defaultLegend.setShapeType(Geometry.TYPES.GEOMETRY);
+		defaultLegend
+				.setClassifyingFieldNames(new String[] { DWGStoreProvider.NAME_FIELD_COLOR });
+		defaultLegend.setClassifyingFieldTypes(new int[] { DataTypes.INT });
+
+		ISymbol myDefaultSymbol =
+				MapContextLocator.getSymbolManager()
+				.createSymbol(Geometry.TYPES.GEOMETRY, Color.BLACK);
+
+		defaultLegend.setDefaultSymbol(myDefaultSymbol);
+
+
+        labelingStragegy =
+            SymbologyLocator.getSymbologyManager()
+                .createAttrInTableLabelingStrategy();
+		labelingStragegy.setTextField(DWGStoreProvider.NAME_FIELD_TEXT);
+		labelingStragegy
+				.setRotationField(DWGStoreProvider.NAME_FIELD_ROTATIONTEXT);
+		labelingStragegy.setHeightField(DWGStoreProvider.NAME_FIELD_HEIGHTTEXT);
+		labelingStragegy.setUnit(1); // MapContext.NAMES[1] (meters)
+		return this;
+	}
+
+	public void process(FeatureProvider feature) {
+		Integer clave = (Integer) feature.get("Color");
+		if (clave == null) {
+			return;
+		}
+		if (defaultLegend.getSymbolByValue(clave) == null) {
+			ISymbol theSymbol;
+			Color color = null;
+			try {
+				color = AcadColor.getColor(clave.intValue());
+			} catch (ArrayIndexOutOfBoundsException e) {
+				color = AcadColor.getColor(255);
+			}
+			// jaume, moved to ISymbol
+			theSymbol =
+					MapContextLocator.getSymbolManager().createSymbol(
+					Geometry.TYPES.GEOMETRY, color);
+			
+			theSymbol.setDescription(clave.toString());
+			// Asigna los colores de Autocad a los
+			// bordes de los polígonos y pone el relleno transparente.
+			if (theSymbol instanceof IFillSymbol) {
+				((IFillSymbol) theSymbol).getOutline().setLineColor(color);
+				Color fillColor = new Color(color.getRed(), color.getGreen(), color.getBlue(), 0);
+				((IFillSymbol) theSymbol).setFillColor(fillColor);
+			}
+			// Asigna los colores de Autocad a las líneas
+			if (theSymbol instanceof ILineSymbol) {
+				((ILineSymbol) theSymbol).setLineColor(color);
+			}
+			if (theSymbol != null) {
+				defaultLegend.addSymbol(clave, theSymbol);
+			}
+		}
+
+	}
+
+	public Object getLabeling() {
+		return labelingStragegy;
+	}
+
+
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/legend/DWGLegendBuilder.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/UnsupportedDWGVersionException.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/UnsupportedDWGVersionException.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/UnsupportedDWGVersionException.java	(revision 38268)
@@ -0,0 +1,23 @@
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import org.gvsig.dwg.lib.DwgVersionNotSupportedException;
+import org.gvsig.fmap.dal.exception.DataException;
+
+public class UnsupportedDWGVersionException extends DataException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -7335241420683266251L;
+	private final static String MESSAGE_FORMAT = "Unssuported version of DWG of file '%(file)'. Try to convert using Autodesk convertor from '%(autodeskurl)'";
+	private final static String MESSAGE_KEY = "_UnsupportedDWGVersionException";
+
+	public final static String AUTODESK_URL = "http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=7024151";
+
+	public UnsupportedDWGVersionException(String file,
+			DwgVersionNotSupportedException cause) {
+		super(MESSAGE_FORMAT, cause, MESSAGE_KEY, serialVersionUID);
+		setValue("file", file);
+		setValue("autodeskurl", AUTODESK_URL);
+	}
+}
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/UnsupportedDWGVersionException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreParameters.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreParameters.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreParameters.java	(revision 38268)
@@ -0,0 +1,103 @@
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import java.io.File;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.FileHelper;
+import org.gvsig.fmap.dal.feature.EditableFeatureType;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.AbstractDataParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+
+public class DWGStoreParameters extends AbstractDataParameters implements
+		DataStoreParameters, FilesystemStoreParameters,
+		NewFeatureStoreParameters {
+
+	public static final String PARAMETERS_DEFINITION_NAME = "DWGStoreParameters";
+
+	private static final String FIELD_FILE = "file";
+	private static final String FIELD_CRS = "CRS";
+
+	private DelegatedDynObject parameters;
+
+	public DWGStoreParameters() {
+		this(PARAMETERS_DEFINITION_NAME);
+	}
+
+	protected DWGStoreParameters(String parametersDefinitionName) {
+		this(parametersDefinitionName, DWGStoreProvider.NAME);
+	}
+
+	public DWGStoreParameters(String parametersDefinitionName, String name) {
+		super();
+		this.parameters = (DelegatedDynObject) FileHelper
+				.newParameters(parametersDefinitionName);
+		this
+				.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME,
+						name);
+	}
+
+	protected DelegatedDynObject getDelegatedDynObject() {
+		return parameters;
+	}
+
+	public String getDataStoreName() {
+		return (String) this
+				.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME);
+	}
+
+	public String getDescription() {
+		return this.getDynClass().getDescription();
+	}
+
+	public void setCRS(IProjection crs) {
+		setDynValue(FIELD_CRS, crs);
+	}
+
+	public void setCRS(String crs) {
+		setDynValue(FIELD_CRS, crs);
+	}
+
+	public IProjection getCRS() {
+		return (IProjection) getDynValue(FIELD_CRS);
+	}
+
+	public String getFileName() {
+		return this.getFile().getPath();
+	}
+
+	public void setFileName(String file) {
+		setDynValue(FIELD_FILE, file);
+	}
+
+	public boolean isValid() {
+		if (getCRS() == null) {
+			return false;
+		}
+		if (getFile() == null) {
+			return false;
+		}
+		return true;
+	}
+
+	public File getFile() {
+		return (File) this.getDynValue(FIELD_FILE);
+	}
+
+	public void setFile(File file) {
+		this.setDynValue(FIELD_FILE, file);
+	}
+
+	public EditableFeatureType getDefaultFeatureType() {
+		return null; //TODO ????
+	}
+
+	public void setDefaultFeatureType(FeatureType defaultFeatureType) {
+		throw new UnsupportedOperationException();
+	}
+
+}
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/LegendBuilder.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/LegendBuilder.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/LegendBuilder.java	(revision 38268)
@@ -0,0 +1,24 @@
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
+import org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider;
+
+
+public interface LegendBuilder {
+
+	final public static String DYNMETHOD_BUILDER_NAME = "getLegendBuilder";
+	final public static String DYNMETHOD_GETLEGEND_NAME = "getLegend";
+	final public static String DYNMETHOD_GETLABELING_NAME = "getLabeling";
+
+	public LegendBuilder initialize(FeatureStoreProvider store);
+
+	public void begin();
+
+	public void process(FeatureProvider feature);
+
+	public void end();
+
+	public Object getLegend();
+	public Object getLabeling();
+
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/LegendBuilder.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGLibrary.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGLibrary.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGLibrary.java	(revision 38268)
@@ -0,0 +1,98 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+
+/*
+* AUTHORS (In addition to CIT):
+* 2008 IVER T.I. S.A.   {{Task}}
+*/
+
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import org.gvsig.fmap.dal.DALFileLibrary;
+import org.gvsig.fmap.dal.DALFileLocator;
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.FileHelper;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.metadata.MetadataLibrary;
+import org.gvsig.metadata.exceptions.MetadataException;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynField;
+import org.gvsig.tools.dynobject.DynObjectManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+public class DWGLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsImplementationOf(DWGLibrary.class);
+        require(DALLibrary.class);
+        require(DALFileLibrary.class);
+        require(MetadataLibrary.class);
+    }
+
+	@Override
+	protected void doInitialize() throws LibraryException {
+	}
+
+	@Override
+	protected void doPostInitialize() throws LibraryException {
+		FileHelper.registerParametersDefinition(
+				DWGStoreParameters.PARAMETERS_DEFINITION_NAME, 
+				DWGStoreParameters.class,
+				"DWGParameters.xml"
+		);
+		try {
+			FileHelper.registerMetadataDefinition(
+					DWGStoreProvider.METADATA_DEFINITION_NAME, 
+					DWGStoreProvider.class,
+					"DWGMetadata.xml"
+			);
+		} catch (MetadataException e) {
+			throw new LibraryException(getClass(), e);
+		}
+
+        DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator
+				.getDataManager();
+
+		if (!dataman.getStoreProviders().contains(DWGStoreProvider.NAME)) {
+			dataman.registerStoreProvider(DWGStoreProvider.NAME,
+					DWGStoreProvider.class, DWGStoreParameters.class);
+		}
+
+		DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
+				DWGStoreProvider.NAME, DWGStoreProvider.DESCRIPTION,
+				DWGFilesystemServerProvider.class);
+
+		DynObjectManager dynMan = ToolsLocator.getDynObjectManager();
+		DynClass dynClass = dynMan.get(
+				DWGStoreProvider.METADATA_DEFINITION_NAME);
+		DynField field;
+		if (dynClass == null) {
+			dynClass = dynMan.add(
+					DWGStoreProvider.METADATA_DEFINITION_NAME);
+
+		}
+	}
+}
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGFilesystemServerProvider.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGFilesystemServerProvider.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGFilesystemServerProvider.java	(revision 38268)
@@ -0,0 +1,120 @@
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import java.io.File;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.NewDataStoreParameters;
+import org.gvsig.fmap.dal.exception.CreateException;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.FileNotFoundException;
+import org.gvsig.fmap.dal.exception.RemoveException;
+import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
+import org.gvsig.fmap.dal.resource.spi.ResourceConsumer;
+import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices;
+
+public class DWGFilesystemServerProvider extends AbstractFilesystemServerExplorerProvider 
+	implements FilesystemServerExplorerProvider, ResourceConsumer {
+
+	//private FilesystemServerExplorerProviderServices serverExplorer;
+
+	public String getDataStoreProviderName() {
+		return DWGStoreProvider.NAME;
+	}
+
+	public int getMode() {
+		return DataServerExplorer.MODE_FEATURE | DataServerExplorer.MODE_GEOMETRY;
+	}
+
+	public boolean accept(File pathname) {
+		return (pathname.getName().toLowerCase().endsWith(".dwg"));
+	}
+
+	public String getDescription() {
+		return DWGStoreProvider.DESCRIPTION;
+	}
+
+	public DataStoreParameters getParameters(File file) throws DataException {
+		DataManager manager = DALLocator.getDataManager();
+		DWGStoreParameters params = (DWGStoreParameters) manager
+				.createStoreParameters(this
+				.getDataStoreProviderName());
+		params.setFileName(file.getPath());
+		return params;
+	}
+
+	public boolean canCreate() {
+		return true;
+	}
+
+	public boolean canCreate(NewDataStoreParameters parameters) {
+		if (!(parameters instanceof DWGStoreParameters)) {
+			throw new IllegalArgumentException(); // FIXME ???
+		}
+		DWGStoreParameters dwgParams = (DWGStoreParameters) parameters;
+		// TODO comporbar si el ftype es correcto (para este formato es fijo)
+		File file = new File(dwgParams.getFileName());
+
+		if (dwgParams.getCRS() == null) {
+			return false;
+		}
+		// TODO comprobamos extension del fichero ??
+		if (file.exists()) {
+			return file.canWrite();
+		} else {
+			return file.getParentFile().canWrite();
+		}
+	}
+
+	public void create(NewDataStoreParameters parameters, boolean overwrite)
+			throws CreateException {
+		// FIXME Exception
+		throw new UnsupportedOperationException();
+	}
+
+	public NewDataStoreParameters getCreateParameters() throws DataException {
+		return (NewFeatureStoreParameters) DALLocator.getDataManager()
+				.createStoreParameters(this.getDataStoreProviderName());
+	}
+
+	public void initialize(
+			FilesystemServerExplorerProviderServices serverExplorer) {
+		//this.serverExplorer = serverExplorer;
+	}
+
+	public void remove(DataStoreParameters parameters) throws RemoveException {
+		File file = new File(((DWGStoreParameters) parameters).getFileName());
+		if (!file.exists()) {
+			throw new RemoveException(this.getDataStoreProviderName(),
+					new FileNotFoundException(file));
+		}
+		if (!file.delete()) {
+			// FIXME throws ???
+		}
+
+	}
+
+	public boolean closeResourceRequested(ResourceProvider resource) {
+		// while it is using a resource anyone can't close it
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see
+	 * org.gvsig.fmap.dal.resource.spi.ResourceConsumer#resourceChanged(org.
+	 * gvsig.fmap.dal.resource.spi.ResourceProvider)
+	 */
+	public void resourceChanged(ResourceProvider resource) {
+		//Do nothing
+
+	}
+
+
+}

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGFilesystemServerProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreProvider.java
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreProvider.java	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreProvider.java	(revision 38268)
@@ -0,0 +1,690 @@
+package org.gvsig.dwg.fmap.dal.store.dwg;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.dwg.lib.DwgFile;
+import org.gvsig.dwg.lib.DwgObject;
+import org.gvsig.dwg.lib.DwgVersionNotSupportedException;
+import org.gvsig.dwg.lib.IDwg2FMap;
+import org.gvsig.dwg.lib.IDwg3DTestable;
+import org.gvsig.dwg.lib.objects.DwgMText;
+import org.gvsig.dwg.lib.objects.DwgText;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataStoreNotification;
+import org.gvsig.fmap.dal.DataTypes;
+import org.gvsig.fmap.dal.FileHelper;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.OpenException;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.EditableFeatureType;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.dal.feature.exception.CreateGeometryException;
+import org.gvsig.fmap.dal.feature.exception.PerformEditingException;
+import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
+import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices;
+import org.gvsig.fmap.dal.feature.spi.memory.AbstractMemoryStoreProvider;
+import org.gvsig.fmap.dal.resource.ResourceAction;
+import org.gvsig.fmap.dal.resource.exception.AccessResourceException;
+import org.gvsig.fmap.dal.resource.file.FileResource;
+import org.gvsig.fmap.dal.resource.spi.ResourceConsumer;
+import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.dynobject.exception.DynMethodException;
+import org.gvsig.tools.exception.NotYetImplemented;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DWGStoreProvider extends AbstractMemoryStoreProvider implements
+		ResourceConsumer {
+	private static final Logger logger = LoggerFactory.getLogger(DWGStoreProvider.class);
+
+	public static final String NAME = "DWG";
+	public static final String DESCRIPTION = "DWG file";
+	public static final String METADATA_DEFINITION_NAME = NAME;
+
+	public static final String NAME_FIELD_ID = "ID";
+	public static final String NAME_FIELD_GEOMETRY = "Geometry";
+	public static final String NAME_FIELD_ENTITY = "Entity";
+	public static final String NAME_FIELD_LAYER = "Layer";
+	public static final String NAME_FIELD_COLOR = "Color";
+	public static final String NAME_FIELD_ELEVATION = "Elevation";
+	public static final String NAME_FIELD_THICKNESS = "Thickness";
+	public static final String NAME_FIELD_TEXT = "Text";
+	public static final String NAME_FIELD_HEIGHTTEXT = "HeightText";
+	public static final String NAME_FIELD_ROTATIONTEXT = "Rotation";
+
+	private int ID_FIELD_ID = 0;
+	private int ID_FIELD_GEOMETRY = 1;
+	private int ID_FIELD_ENTITY = 2;
+	private int ID_FIELD_LAYER = 3;
+	private int ID_FIELD_COLOR = 4;
+	private int ID_FIELD_ELEVATION = 5;
+	private int ID_FIELD_THICKNESS = 6;
+	private int ID_FIELD_TEXT = 7;
+	private int ID_FIELD_HEIGHTTEXT = 8;
+	private int ID_FIELD_ROTATIONTEXT = 9;
+
+	private IProjection projection;
+	private ResourceProvider resource;
+	private LegendBuilder legendBuilder;
+
+	private long counterNewsOIDs = 0;
+	protected GeometryManager geomManager = GeometryLocator.getGeometryManager();
+
+	public DWGStoreProvider(DWGStoreParameters parameters,
+			DataStoreProviderServices storeServices) throws InitializeException {
+		super(parameters, storeServices, FileHelper
+				.newMetadataContainer(METADATA_DEFINITION_NAME));
+
+		counterNewsOIDs = 0;
+		//		projection = CRSFactory.getCRS(getParameters().getSRSID());
+
+		File file = getDWGParameters().getFile();
+		resource = this.createResource(
+				FileResource.NAME,
+				new Object[] { file.getAbsolutePath() }
+			);
+
+		resource.addConsumer(this);
+
+		this.projection = this.getDWGParameters().getCRS();
+
+
+		try {
+			legendBuilder = (LegendBuilder) this.invokeDynMethod(
+					LegendBuilder.DYNMETHOD_BUILDER_NAME, null);
+		} catch (DynMethodException e) {
+			legendBuilder = null;
+		} catch (Exception e) {
+			throw new InitializeException(e);
+		}
+
+		this.initializeFeatureTypes();
+	}
+
+	private DWGStoreParameters getDWGParameters() {
+		return (DWGStoreParameters) this.getParameters();
+	}
+
+
+	public String getProviderName() {
+		return NAME;
+	}
+
+	public boolean allowWrite() {
+		return false;
+	}
+
+	public Object getLegend() throws OpenException {
+		this.open();
+		if (legendBuilder == null) {
+			return null;
+		}
+		return legendBuilder.getLegend();
+	}
+
+	public Object getLabeling() throws OpenException {
+		this.open();
+		if (legendBuilder == null) {
+			return null;
+		}
+		return legendBuilder.getLabeling();
+	}
+
+	private class DWGData {
+		public ArrayList data = null;
+		public FeatureType defaultFType = null;
+		public List fTypes = null;
+		public Envelope envelope = null;
+		public IProjection projection;
+		public LegendBuilder legendBuilder = null;
+		public Envelope getEnvelopeCopy() throws CreateEnvelopeException {
+			if (envelope == null) {
+				return null;
+			}
+			Envelope newEnvelope;
+			if (envelope.getDimension() == 2) {
+				newEnvelope = geomManager.createEnvelope(SUBTYPES.GEOM2D);
+			} else {
+				newEnvelope = geomManager.createEnvelope(SUBTYPES.GEOM3D);
+
+			}
+			newEnvelope.setLowerCorner(envelope.getLowerCorner());
+			newEnvelope.setUpperCorner(envelope.getUpperCorner());
+			return newEnvelope;
+		}
+	}
+
+	private AbstractMemoryStoreProvider getStoreProvider() {
+		return this;
+	}
+
+	public void open() throws OpenException {
+		if (this.data != null) {
+			return;
+		}
+		// try {
+		// this.resource.begin();
+		// } catch (ResourceExecuteException e2) {
+		// try {
+		// throw new OpenException(resource.getName(), e2);
+		// } catch (AccessResourceException e1) {
+		// throw new OpenException(this.getName(), e2);
+		// }
+		//
+		// }
+		try {
+			getResource().execute(new ResourceAction() {
+				public Object run() throws Exception {
+					ResourceProvider resource = getResource();
+					DWGData dwgData = null;
+					FeatureStoreProviderServices store = getStoreServices();
+					if (resource.getData() != null) {
+						dwgData =
+								(DWGData) ((Map) resource.getData()).get(projection.getAbrev());
+						// OJO no es del todo correcto (puede llevar
+						// reproyeccion)
+					} else {
+						resource.setData(new HashMap());
+					}
+					if (dwgData == null) {
+						dwgData = new DWGData();
+						dwgData.data = new ArrayList();
+						data = dwgData.data;
+						counterNewsOIDs = 0;
+						Reader reader =
+								new Reader().initialice(getStoreProvider(),
+										(File)resource.get(),
+										projection, legendBuilder);
+						reader.begin(store);
+						dwgData.defaultFType =
+								reader.getDefaultType().getNotEditableCopy();
+						ArrayList types = new ArrayList();
+						Iterator it = reader.getTypes().iterator();
+						EditableFeatureType fType;
+						while (it.hasNext()) {
+							fType = (EditableFeatureType) it.next();
+							if (fType.getId().equals(
+									dwgData.defaultFType.getId())) {
+								types.add(dwgData.defaultFType);
+							} else {
+								types.add(fType.getNotEditableCopy());
+							}
+						}
+						dwgData.fTypes = types;
+						dwgData.legendBuilder = legendBuilder;
+
+						resource.notifyOpen();
+						store.setFeatureTypes(dwgData.fTypes,
+								dwgData.defaultFType);
+						reader.load();
+						// this.envelope = reader.getEnvelope();
+
+						dwgData.envelope = reader.getEnvelope();
+
+
+						dwgData.projection = projection;
+
+						reader.end();
+						resource.notifyClose();
+						((Map) resource.getData()).put(projection.getAbrev(),
+								dwgData); // OJO la reproyeccion
+					}
+
+					data = dwgData.data;
+					store.setFeatureTypes(dwgData.fTypes, dwgData.defaultFType);
+					legendBuilder = dwgData.legendBuilder;
+					setDynValue("Envelope", dwgData.getEnvelopeCopy());
+					setDynValue("CRS", projection);
+					counterNewsOIDs = data.size();
+					return null;
+				}
+			});
+		} catch (Exception e) {
+			this.data = null;
+			try {
+				throw new OpenException(resource.getName(), e);
+			} catch (AccessResourceException e1) {
+				throw new OpenException(this.getProviderName(), e);
+			}
+			// } finally {
+			// this.resource.end();
+		}
+	}
+
+
+	public DataServerExplorer getExplorer() throws ReadException {
+		DataManager manager = DALLocator.getDataManager();
+		FilesystemServerExplorerParameters params;
+		try {
+			params = (FilesystemServerExplorerParameters) manager
+				.createServerExplorerParameters(FilesystemServerExplorer.NAME);
+			params.setRoot(this.getDWGParameters().getFile().getParent());
+			return manager.createServerExplorer(params);
+		} catch (DataException e) {
+			throw new ReadException(this.getProviderName(), e);
+		} catch (ValidateDataParametersException e) {
+			throw new ReadException(this.getProviderName(), e);
+		}
+
+	}
+
+
+
+	public void performChanges(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator originalFeatureTypesUpdated) throws PerformEditingException {
+		// FIXME Exception
+		throw new UnsupportedOperationException();
+	}
+
+	public class Reader {
+		private File file;
+		private String fileName;
+		private IProjection projection;
+		private List types;
+		private LegendBuilder leyendBuilder;
+		private AbstractMemoryStoreProvider store;
+		private Envelope envelope;
+		private DwgFile dwgFeatureFile;
+
+		public Reader initialice(AbstractMemoryStoreProvider store, File file,
+				IProjection projection,
+				LegendBuilder leyendBuilder) {
+			this.store = store;
+			this.file = file;
+			this.fileName = file.getAbsolutePath();
+			this.projection = projection;
+			this.leyendBuilder = leyendBuilder;
+			if (leyendBuilder != null) {
+				leyendBuilder.initialize(store);
+			}
+			return this;
+		}
+
+		public Envelope getEnvelope() {
+			return this.envelope;
+		}
+
+		public void begin(FeatureStoreProviderServices store) throws UnsupportedDWGVersionException, ReadException {
+		    dwgFeatureFile = new DwgFile(file.getAbsolutePath());
+
+            try {
+                dwgFeatureFile.read();
+            } catch (DwgVersionNotSupportedException e1) {
+                throw new UnsupportedDWGVersionException(file.getName(), e1);
+            } catch (IOException e) {
+                throw new ReadException(NAME, e);
+            }
+
+			EditableFeatureType featureType = store.createFeatureType();
+
+			featureType.setHasOID(true);
+
+			ID_FIELD_ID = featureType.add(NAME_FIELD_ID, DataTypes.INT)
+					.setDefaultValue(Integer.valueOf(0))
+				.getIndex();
+
+			EditableFeatureAttributeDescriptor attr = featureType.add(
+					NAME_FIELD_GEOMETRY, DataTypes.GEOMETRY);
+			attr.setSRS(this.projection);
+			attr.setGeometryType(Geometry.TYPES.GEOMETRY);
+			boolean is3dFile = dwgFeatureFile.isDwg3DFile();
+			if (is3dFile){
+			    attr.setGeometrySubType(Geometry.SUBTYPES.GEOM3D);
+			}else{
+			    attr.setGeometrySubType(Geometry.SUBTYPES.GEOM2D);
+			}
+			ID_FIELD_GEOMETRY = attr.getIndex();
+
+			featureType.setDefaultGeometryAttributeName(NAME_FIELD_GEOMETRY);
+
+			// FIXME: Cual es el size y el valor por defecto para Entity ?
+			ID_FIELD_ENTITY = featureType.add(NAME_FIELD_ENTITY,
+					DataTypes.STRING, 100)
+					.setDefaultValue("")
+					.getIndex();
+
+			// FIXME: Cual es el size de Layer ?
+			ID_FIELD_LAYER = featureType.add(NAME_FIELD_LAYER,
+					DataTypes.STRING, 100)
+					.setDefaultValue(
+					"default").getIndex();
+
+			ID_FIELD_COLOR = featureType.add(NAME_FIELD_COLOR,
+					DataTypes.INT)
+					.setDefaultValue(
+					Integer.valueOf(0)).getIndex();
+
+			ID_FIELD_ELEVATION = featureType.add(NAME_FIELD_ELEVATION,
+					DataTypes.DOUBLE)
+					.setDefaultValue(
+					Double.valueOf(0)).getIndex();
+
+			ID_FIELD_THICKNESS = featureType.add(NAME_FIELD_THICKNESS,
+					DataTypes.DOUBLE)
+					.setDefaultValue(
+					Double.valueOf(0)).getIndex();
+
+			// FIXME: Cual es el size de Text ?
+			ID_FIELD_TEXT = featureType.add(NAME_FIELD_TEXT,
+					DataTypes.STRING, 100)
+					.setDefaultValue("")
+					.getIndex();
+
+			ID_FIELD_HEIGHTTEXT = featureType.add(NAME_FIELD_HEIGHTTEXT,
+					DataTypes.DOUBLE).setDefaultValue(
+					Double.valueOf(10)).getIndex();
+
+			ID_FIELD_ROTATIONTEXT = featureType.add(NAME_FIELD_ROTATIONTEXT,
+					DataTypes.DOUBLE).setDefaultValue(
+					Double.valueOf(0)).getIndex();
+
+
+
+			// FIXME: Parece que el DXF puede tener mas atributos opcionales.
+			// Habria que ver de pillarlos ?
+
+			types = new ArrayList();
+			types.add(featureType);
+
+			if (leyendBuilder != null) {
+				leyendBuilder.begin();
+			}
+
+		}
+
+		public void end() {
+			if (leyendBuilder != null) {
+				leyendBuilder.end();
+			}
+		}
+
+		public List getTypes() {
+			return types;
+		}
+
+		public EditableFeatureType getDefaultType() {
+			return (EditableFeatureType) types.get(0);
+		}
+
+		private Double toDouble(String value) {
+			if (value == null) {
+				return Double.valueOf(0);
+			}
+			return Double.valueOf(value);
+		}
+
+		public void load() throws DataException {
+
+			this.envelope = null;
+
+			
+			dwgFeatureFile.calculateGisModelDwgPolylines();
+			dwgFeatureFile.blockManagement2();
+			List entities = dwgFeatureFile.getDwgObjects();
+
+			int id = -1;
+			try{
+				int envelopeSubType = Geometry.SUBTYPES.GEOM2D;
+				boolean is3dFile = dwgFeatureFile.isDwg3DFile();
+
+				this.envelope = geomManager.createEnvelope(envelopeSubType);
+
+				boolean updateEnvelope = true;
+
+				double[] extMin = (double[]) dwgFeatureFile
+						.getHeader("MSPACE_EXTMIN");
+				double[] extMax = (double[]) dwgFeatureFile
+						.getHeader("MSPACE_EXTMAX");
+				if (extMin != null && extMax != null) {
+					updateEnvelope = false;
+					Point point = (Point) geomManager.create(
+							Geometry.TYPES.POINT, envelopeSubType);
+					point.setCoordinates(extMin);
+					this.envelope.setLowerCorner(point);
+					point = (Point) geomManager.create(Geometry.TYPES.POINT,
+							envelopeSubType);
+					point.setCoordinates(extMax);
+					this.envelope.setUpperCorner(point);
+				}
+
+
+				Iterator iter = entities.iterator();
+
+				FeatureProvider featureProvider;
+				Envelope gEnvelope;
+
+				while (iter.hasNext()) {
+					id++;
+					DwgObject entity = (DwgObject) iter.next();
+
+					if (!(entity instanceof IDwg2FMap)) {
+						logger
+								.warn(
+								"load: entity type {}(id:{}) not loadded",
+														new Object[] { entity
+																.getType() },
+														id);
+
+						continue;
+					}
+
+					IDwg2FMap dwgEnt = (IDwg2FMap) entity;
+					Geometry geometry = dwgEnt.toFMapGeometry(is3dFile);
+					if (geometry == null) { // || geometry.getGeneralPath() ==
+						// null) {
+						logger
+								.warn(
+								"load: entity {}(id:{}) with null geometry",
+														new Object[] {
+																entity
+																		.getType(),
+																id });
+
+						continue;
+					}
+					// FIXME: Estas 6 lineas es por si la geometrí­a no se ha
+					// creado correctamente
+					gEnvelope = null;
+					try {
+						gEnvelope = geometry.getEnvelope();
+					} catch (Exception e) {
+						gEnvelope = null;
+					}
+					if (gEnvelope == null) {
+						logger
+								.warn(
+								"load: entity {}(id:{}) with null envelope",
+								new Object[] { entity.getType(), id });
+
+						continue;
+					}
+					// we check for Region of Interest of the CAD file
+					if (!this.envelope.intersects(geometry.getEnvelope())) {
+						logger
+								.warn(
+								"load: entity {}(id:{}) out of envelope",
+								new Object[] { entity.getType(), id });
+						continue;
+					}
+					featureProvider = store.createFeatureProvider(store
+							.getStoreServices().getDefaultFeatureType());
+
+					featureProvider.set(ID_FIELD_ID, id);
+
+					featureProvider.set(ID_FIELD_ENTITY, dwgEnt.toString());
+
+					featureProvider.set(ID_FIELD_LAYER, dwgFeatureFile
+							.getLayerName(entity));
+
+					int colorByLayer = dwgFeatureFile.getColorByLayer(entity);
+					int color = entity.getColor();
+					if (color < 0) {
+						color = Math.abs(color);
+					}
+					if (color > 255) {
+						color = colorByLayer;
+					}
+
+					featureProvider.set(ID_FIELD_COLOR, color);
+
+					if (entity instanceof IDwg3DTestable) {
+						featureProvider.set(ID_FIELD_ELEVATION,
+								((IDwg3DTestable) entity).getZ());
+					}
+
+					featureProvider.set(ID_FIELD_THICKNESS, 0.0);
+					featureProvider.set(ID_FIELD_HEIGHTTEXT, 0.0);
+					featureProvider.set(ID_FIELD_ROTATIONTEXT, 0.0);
+					featureProvider.set(ID_FIELD_TEXT, "");
+
+					if (entity instanceof DwgMText) {
+						DwgMText mtext = (DwgMText) entity;
+						featureProvider.set(ID_FIELD_HEIGHTTEXT, mtext.getHeight());
+						featureProvider.set(ID_FIELD_TEXT, mtext.getText());
+					} else if (entity instanceof DwgText) {
+						DwgText text = (DwgText) entity;
+						featureProvider
+								.set(ID_FIELD_THICKNESS, text.getThickness());
+						featureProvider.set(ID_FIELD_HEIGHTTEXT, text.getHeight());
+						featureProvider.set(ID_FIELD_ROTATIONTEXT, text
+								.getRotationAngle());
+						featureProvider.set(ID_FIELD_TEXT, text.getText());
+					}// if-else
+
+					featureProvider.setDefaultGeometry(geometry);
+
+					store.addFeatureProvider(featureProvider);
+					if (this.leyendBuilder != null) {
+						this.leyendBuilder.process(featureProvider);
+					}
+
+				}
+
+			} catch (org.gvsig.fmap.geom.exception.CreateGeometryException e) {
+				throw new CreateGeometryException(e);
+			} catch (org.gvsig.fmap.geom.exception.CreateEnvelopeException e) {
+				throw new CreateGeometryException(e);
+			}
+
+		}
+
+	}
+
+
+	public boolean closeResourceRequested(ResourceProvider resource) {
+		return true;
+	}
+
+	public int getOIDType() {
+		return DataTypes.LONG;
+	}
+
+	public boolean supportsAppendMode() {
+		return false;
+	}
+
+	public void append(FeatureProvider featureProvider) {
+		// FIXME Exception
+		throw new UnsupportedOperationException();
+	}
+
+	public void beginAppend() {
+		// FIXME Exception
+		throw new UnsupportedOperationException();
+
+	}
+
+	public void endAppend() {
+		// FIXME Exception
+		throw new UnsupportedOperationException();
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		// TODO Auto-generated method stub
+		throw new NotYetImplemented();
+	}
+
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		// TODO Auto-generated method stub
+		throw new NotYetImplemented();
+	}
+
+	public Object createNewOID() {
+		return new Long(counterNewsOIDs++);
+	}
+
+	protected void initializeFeatureTypes() throws InitializeException {
+		try {
+			this.open();
+		} catch (OpenException e) {
+			throw new InitializeException(this.getProviderName(), e);
+		}
+	}
+
+	public Envelope getEnvelope() throws DataException {
+		this.open();
+		return (Envelope) this.getDynValue("Envelope");
+	}
+
+
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see
+	 * org.gvsig.fmap.dal.resource.spi.ResourceConsumer#resourceChanged(org.
+	 * gvsig.fmap.dal.resource.spi.ResourceProvider)
+	 */
+	public void resourceChanged(ResourceProvider resource) {
+		this.getStoreServices().notifyChange(
+				DataStoreNotification.RESOURCE_CHANGED,
+				resource);
+	}
+
+	public Object getSourceId() {
+		return this.getDWGParameters().getFile();
+	}
+
+
+	public String getName() {
+		String name = this.getDWGParameters().getFile().getName();
+		int n = name.lastIndexOf(".");
+		if( n<1 ) {
+			return name;
+		}
+		return name.substring(0, n);
+	}
+	
+	public String getFullName() {
+		return this.getDWGParameters().getFile().getAbsolutePath();
+	}
+	
+
+	
+	public ResourceProvider getResource() {
+		return resource;
+	}
+
+}
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/pom.xml
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/pom.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/pom.xml	(revision 38268)
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
+                      
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.dwg.extension</artifactId>
+	<packaging>jar</packaging>
+	<version>2.0-SNAPSHOT</version>
+	<name>Formats: DWG file format support</name>
+	<description>Read support for DWG format.</description>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>gvsig-base-extension-pom</artifactId>
+		<version>2.0-SNAPSHOT</version>
+	</parent>	
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal</artifactId>
+			<classifier>spi</classifier>
+            <scope>compile</scope>
+		</dependency>				
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.file</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.symbology.lib.api</artifactId>
+            <scope>compile</scope>
+		</dependency>		
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.dwg</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	    <dependency>
+	      <groupId>org.gvsig</groupId>
+	      <artifactId>org.gvsig.app</artifactId>
+	      <version>2.0-SNAPSHOT</version>
+            <scope>compile</scope>
+	    </dependency>
+	    <dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.timesupport.lib.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	    <!-- Test scope -->
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal</artifactId>
+			<classifier>impl</classifier>
+			<scope>test</scope>
+		</dependency>	
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal</artifactId>
+			<classifier>tests</classifier>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId>
+			<classifier>jts</classifier>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.geometry</artifactId>
+			<classifier>impl</classifier>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.projection</artifactId>
+			<classifier>cresques-impl</classifier>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.mapcontext</artifactId>
+			<classifier>operation</classifier>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.tools.lib</artifactId>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+	<properties>
+		<build-dir>${basedir}/../build</build-dir>
+        <eclipse.project.name>extDwg</eclipse.project.name>
+        <package.info.state>alpha5</package.info.state>
+        <package.info.categories>Formats,Vector</package.info.categories>
+	</properties>
+	<build>
+		<sourceDirectory>src</sourceDirectory>
+		<testSourceDirectory>src-test</testSourceDirectory>
+        <testResources>
+                <testResource>
+                        <directory>src-test</directory>
+                </testResource>
+        </testResources>
+        <resources>
+            <resource>
+                <directory>resources</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>       
+        </plugins>
+	</build>
+</project>

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/extensions/extDwg/resources/org/gvsig/dwg/fmap/dal/store/dwg/DWGMetadata.xml
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/resources/org/gvsig/dwg/fmap/dal/store/dwg/DWGMetadata.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/resources/org/gvsig/dwg/fmap/dal/store/dwg/DWGMetadata.xml	(revision 38268)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!--
+Definitions of metadata fields of a DWG file.  
+ -->
+<definitions>
+  <version>1.0.0</version>
+  <classes>
+    
+    <class name="DWG" namespace="Metadata">
+      <extends>
+      	<class namespace="Metadata" name="SpatialProvider"/>
+      </extends>
+      <description>Metadata of a DWG store</description>
+      <fields>
+      </fields>
+    </class>
+
+  </classes>
+</definitions>  
Index: tags/v2_0_0_Build_2047/extensions/extDwg/resources/org/gvsig/dwg/fmap/dal/store/dwg/DWGParameters.xml
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/resources/org/gvsig/dwg/fmap/dal/store/dwg/DWGParameters.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/resources/org/gvsig/dwg/fmap/dal/store/dwg/DWGParameters.xml	(revision 38268)
@@ -0,0 +1,20 @@
+<?xml version= "1.0 "?>
+<definitions>
+  <version>1.0.0</version>
+  <classes>
+    <class name="DWGStoreParameters">
+      <extends>
+      	<class namespace="dal" name="ProviderParameters"/>
+      </extends>
+      <description>Store the parameters need to open a dwg file</description>
+      <fields>
+        <field name="file" type="file" mandatory="true" group="Basic">
+          <description>dwg file</description>
+        </field>
+        <field name="CRS" type="crs" mandatory="true" group="Basic">
+          <description>The coordinate reference system used in this dwg file</description>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</definitions>  
Index: tags/v2_0_0_Build_2047/extensions/extDwg/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 38268)
@@ -0,0 +1,2 @@
+org.gvsig.dwg.fmap.dal.store.dwg.DWGLibrary
+org.gvsig.dwg.fmap.dal.store.dwg.legend.DWGLegendLibrary
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/extensions/extDwg/distribution/distribution.xml
===================================================================
--- tags/v2_0_0_Build_2047/extensions/extDwg/distribution/distribution.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/extensions/extDwg/distribution/distribution.xml	(revision 38268)
@@ -0,0 +1,43 @@
+<assembly>
+	<id>distribution</id>
+	<formats>
+		<format>dir</format>
+	</formats>
+	<fileSets>
+	<!-- Extructure for the extension -->
+		<fileSet>
+			<directory>config</directory>
+			<outputDirectory>${extension.install.dir.name}
+			</outputDirectory>
+		</fileSet>
+		<fileSet>
+			<directory>images</directory>
+			<outputDirectory>/${extension.install.dir.name}/images
+			</outputDirectory>
+		</fileSet>
+	</fileSets>
+    <files>
+        <file>
+            <source>package.info</source>
+            <outputDirectory>${extension.install.dir.name}
+            </outputDirectory>
+        </file>
+    </files>
+	<!--
+		***********************************************************************
+	-->
+  <!-- *													   *-->
+	<!--
+		***********************************************************************
+	-->
+	<dependencySets>
+		<dependencySet>
+			<outputDirectory>${extension.install.dir.name}/${library-dir}
+			</outputDirectory>
+			<includes>
+				<include>org.gvsig:org.gvsig.dwg</include>
+				<include>org.gvsig:org.gvsig.dwg.extension</include>
+			</includes>
+		</dependencySet>
+	</dependencySets>
+</assembly>
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg/distribution/distribution.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: tags/v2_0_0_Build_2047/extensions/extDwg
___________________________________________________________________
Added: svn:ignore
   + .classpath 
.project 
.settings 
maven-eclipse.xml
target
bin
hs_err_pid*
.externalToolBuilders
.settings
.classpath
.project
package.info


