Revision 80

View differences:

org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<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">
4

  
5
  <modelVersion>4.0.0</modelVersion>
6
  <artifactId>org.gvsig.dgn</artifactId>
7
  <packaging>pom</packaging>
8
  <name>${project.artifactId}</name>
9
  <version>2.0.23</version>
10
  <description>DGN support fort DAL and gvSIG</description>
11
  <parent>
12
      <groupId>org.gvsig</groupId>
13
      <artifactId>org.gvsig.desktop</artifactId>
14
      <version>2.0.40</version>
15
  </parent>
16
  <url>https://devel.gvsig.org/redmine/projects/gvsig-dgn</url>
17

  
18
  <scm>
19
      <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-dgn/org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23</connection>
20
      <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-dgn/org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23</developerConnection>
21
      <url>https://devel.gvsig.org/redmine/projects/gvsig-dgn/repository/show/org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23</url>
22
  </scm>
23
    <repositories>
24
      <repository>
25
        <id>gvsig-public-http-repository</id>
26
        <name>gvSIG maven public HTTP repository</name>
27
        <url>http://devel.gvsig.org/m2repo/j2se</url>
28
        <releases>
29
          <enabled>true</enabled>
30
          <updatePolicy>daily</updatePolicy>
31
          <checksumPolicy>warn</checksumPolicy>
32
        </releases>
33
        <snapshots>
34
          <enabled>true</enabled>
35
          <updatePolicy>daily</updatePolicy>
36
          <checksumPolicy>warn</checksumPolicy>
37
        </snapshots>
38
      </repository>
39
    </repositories>
40
      
41
	<build>
42
		<plugins>
43
			<plugin>
44
				<groupId>org.apache.maven.plugins</groupId>
45
				<artifactId>maven-release-plugin</artifactId>
46
				<configuration>
47
					<tagBase>https://devel.gvsig.org/svn/gvsig-dgn/org.gvsig.dgn/tags</tagBase>
48
				</configuration>
49
			</plugin>
50
		</plugins>
51
	</build>
52

  
53
  <dependencyManagement>
54
      <dependencies>
55
          <dependency>
56
            <groupId>org.gvsig</groupId>
57
            <artifactId>org.gvsig.dgn.provider</artifactId>
58
            <version>2.0.23</version>
59
          </dependency>
60
          <dependency>
61
            <groupId>org.gvsig</groupId>
62
            <artifactId>org.gvsig.dgn.provider.legend</artifactId>
63
            <version>2.0.23</version>
64
          </dependency>
65
          <dependency>
66
            <groupId>org.gvsig</groupId>
67
            <artifactId>org.gvsig.dgn.app.mainplugin</artifactId>
68
            <version>2.0.23</version>
69
          </dependency>
70
      </dependencies>
71
  </dependencyManagement>
72

  
73
  <dependencies>
74
        <dependency>
75
            <groupId>org.slf4j</groupId>
76
            <artifactId>slf4j-api</artifactId>
77
            <scope>compile</scope>
78
        </dependency>
79
  </dependencies>
80

  
81
  <modules>
82
    <module>org.gvsig.dgn.app</module>
83
    <module>org.gvsig.dgn.provider</module>
84
    <module>org.gvsig.dgn.provider.legend</module>
85
  </modules>
86

  
87

  
88
</project>
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.app/org.gvsig.dgn.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${project.artifactId}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>src/main/resources-plugin</directory>
21
      <outputDirectory>.</outputDirectory>
22
    </fileSet>
23
  </fileSets>
24

  
25
  <dependencySets>
26
    <dependencySet>
27
      <useProjectArtifact>false</useProjectArtifact>
28
      <useTransitiveDependencies>false</useTransitiveDependencies>
29
      <outputDirectory>lib</outputDirectory>
30
      <includes>
31
        <include>org.gvsig:org.gvsig.dgn.provider.legend</include>
32
        <include>org.gvsig:org.gvsig.dgn.provider</include>
33
      </includes>
34
    </dependencySet>
35
  </dependencySets>
36

  
37
</assembly>
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.app/org.gvsig.dgn.app.mainplugin/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
  <libraries library-dir="lib/"/>
4
  <depends plugin-name="org.gvsig.app"/>
5
  <resourceBundle name="text"/>
6
  <extensions>
7
     <extension class-name="org.gvsig.andami.LibraryExtension" active="false"/>
8
  </extensions>    
9
</plugin-config>
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.app/org.gvsig.dgn.app.mainplugin/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<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">
3
  <modelVersion>4.0.0</modelVersion>
4
  <artifactId>org.gvsig.dgn.app.mainplugin</artifactId>
5
  <packaging>jar</packaging>
6
  <name>Formats: DGN file format support</name>
7
  <description>DGN file format support</description>
8
  <parent>
9
      <groupId>org.gvsig</groupId>
10
      <artifactId>org.gvsig.dgn.app</artifactId>
11
      <version>2.0.23</version>
12
  </parent>
13

  
14
  <dependencies>
15
    <dependency>
16
        <groupId>org.gvsig</groupId>
17
        <artifactId>org.gvsig.tools.lib</artifactId>
18
        <scope>compile</scope>
19
    </dependency>
20
    <dependency>
21
        <groupId>org.gvsig</groupId>
22
        <artifactId>org.gvsig.andami</artifactId>
23
        <scope>compile</scope>
24
    </dependency>
25
    <dependency>
26
        <groupId>org.gvsig</groupId>
27
        <artifactId>org.gvsig.dgn.provider</artifactId>
28
        <scope>compile</scope>
29
    </dependency>
30
    <dependency>
31
        <groupId>org.gvsig</groupId>
32
        <artifactId>org.gvsig.dgn.provider.legend</artifactId>
33
        <scope>compile</scope>
34
    </dependency>
35

  
36
  </dependencies>
37
  
38
    <properties>
39
        <!-- Package info property values -->
40
        <!-- Default values in org.gvsig.desktop -->
41
        <gvsig.package.info.state>testing</gvsig.package.info.state>
42
        <gvsig.package.info.official>true</gvsig.package.info.official>
43
        <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0-A</gvsig.package.info.dependencies>
44
        <gvsig.package.info.categories>Formats,Vector</gvsig.package.info.categories>
45
        <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-dgn/pool/</gvsig.package.info.poolURL>
46
    </properties>
47
  
48
</project>
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.app/org.gvsig.dgn.app.mainplugin/buildNumber.properties
1
#Thu Jun 12 14:51:39 EDT 2014
2
buildNumber=2081
0 3

  
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.app/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<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">
3
  <modelVersion>4.0.0</modelVersion>
4
  <artifactId>org.gvsig.dgn.app</artifactId>
5
  <packaging>pom</packaging>
6
  <name>${project.artifactId}</name>
7
  <parent>
8
      <groupId>org.gvsig</groupId>
9
      <artifactId>org.gvsig.dgn</artifactId>
10
      <version>2.0.23</version>
11
  </parent>
12

  
13
  <modules>
14
    <module>org.gvsig.dgn.app.mainplugin</module>
15
  </modules>
16

  
17

  
18
</project>
0 19

  
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider.legend/src/main/java/org/gvsig/fmap/dal/store/dgn/legend/DGNGetLabeling.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

  
28
package org.gvsig.fmap.dal.store.dgn.legend;
29

  
30
import org.gvsig.fmap.dal.exception.OpenException;
31
import org.gvsig.fmap.dal.store.dgn.DGNStoreProvider;
32
import org.gvsig.fmap.dal.store.dgn.LegendBuilder;
33
import org.gvsig.tools.ToolsLocator;
34
import org.gvsig.tools.dynobject.DynClass;
35
import org.gvsig.tools.dynobject.DynMethod;
36
import org.gvsig.tools.dynobject.DynObject;
37
import org.gvsig.tools.dynobject.DynObjectManager;
38
import org.gvsig.tools.dynobject.exception.DynMethodException;
39
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
40

  
41
public class DGNGetLabeling implements DynMethod {
42
	private static int code = DynObjectManager.NULLCODE;
43

  
44
	static void register(DynClass DGNDynClass) {
45
		if (code != DynObjectManager.NULLCODE) {
46
			return;
47
		}
48
		code = ToolsLocator.getDynObjectManager().registerDynMethod(
49
			DGNDynClass, 
50
			new DGNGetLabeling()
51
		);
52

  
53
	}
54
	public int getCode() throws DynMethodNotSupportedException {
55
		return code;
56
	}
57

  
58
	public String getDescription() {
59
		return "DGN Labeling";
60
	}
61

  
62
	public String getName() {
63
		return LegendBuilder.DYNMETHOD_GETLABELING_NAME;
64
	}
65

  
66
	public Object invoke(Object self, DynObject context)
67
			throws DynMethodException {
68
		try {
69
			return ((DGNStoreProvider) self).getLabeling();
70
		} catch (OpenException e) {
71
			//FIXME
72
			throw new RuntimeException(e);
73
		}
74
	}
75

  
76
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider.legend/src/main/java/org/gvsig/fmap/dal/store/dgn/legend/DGNGetLegend.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

  
28
package org.gvsig.fmap.dal.store.dgn.legend;
29

  
30
import org.gvsig.fmap.dal.exception.OpenException;
31
import org.gvsig.fmap.dal.store.dgn.DGNStoreProvider;
32
import org.gvsig.fmap.dal.store.dgn.LegendBuilder;
33
import org.gvsig.tools.ToolsLocator;
34
import org.gvsig.tools.dynobject.DynClass;
35
import org.gvsig.tools.dynobject.DynMethod;
36
import org.gvsig.tools.dynobject.DynObject;
37
import org.gvsig.tools.dynobject.DynObjectManager;
38
import org.gvsig.tools.dynobject.exception.DynMethodException;
39
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
40

  
41
public class DGNGetLegend implements DynMethod {
42
	private static int code = DynObjectManager.NULLCODE;
43

  
44
	static void register(DynClass DGNDynClass) {
45
		if (code != DynObjectManager.NULLCODE) {
46
			return;
47
		}
48
		code = ToolsLocator.getDynObjectManager().registerDynMethod(
49
			DGNDynClass, 
50
			new DGNGetLegend()
51
		);
52

  
53
	}
54
	public int getCode() throws DynMethodNotSupportedException {
55
		return code;
56
	}
57

  
58
	public String getDescription() {
59
		return "DGN Legend";
60
	}
61

  
62
	public String getName() {
63
		return LegendBuilder.DYNMETHOD_GETLEGEND_NAME;
64
	}
65

  
66
	public Object invoke(Object self, DynObject context)
67
			throws DynMethodException {
68
		try {
69
			return ((DGNStoreProvider) self).getLegend();
70
		} catch (OpenException e) {
71
			throw new RuntimeException(e);
72
		}
73
	}
74

  
75
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider.legend/src/main/java/org/gvsig/fmap/dal/store/dgn/legend/DGNLegendLibrary.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

  
28
/**
29
 *
30
 */
31
package org.gvsig.fmap.dal.store.dgn.legend;
32

  
33
import org.gvsig.fmap.dal.DALLibrary;
34
import org.gvsig.fmap.dal.store.dgn.DGNLibrary;
35
import org.gvsig.fmap.dal.store.dgn.DGNStoreProvider;
36
import org.gvsig.metadata.MetadataLibrary;
37
import org.gvsig.metadata.MetadataLocator;
38
import org.gvsig.tools.dynobject.DynClass;
39
import org.gvsig.tools.library.AbstractLibrary;
40
import org.gvsig.tools.library.LibraryException;
41

  
42
/**
43
 * @author jmvivo
44
 *
45
 */
46
public class DGNLegendLibrary extends AbstractLibrary {
47

  
48
    @Override
49
    public void doRegistration() {
50
        registerAsServiceOf(DALLibrary.class);
51
        require(DGNLibrary.class);
52
        require(MetadataLibrary.class);
53
    }
54

  
55
	@Override
56
	protected void doInitialize() throws LibraryException {
57
	}
58

  
59
	@Override
60
	protected void doPostInitialize() throws LibraryException {
61
		DynClass metadataDefinition = (DynClass) MetadataLocator.getMetadataManager()
62
			.getDefinition(DGNStoreProvider.METADATA_DEFINITION_NAME);
63
		DGNGetLegendBuilder.register(metadataDefinition);
64
		DGNGetLegend.register(metadataDefinition);
65
		DGNGetLabeling.register(metadataDefinition);
66
	}
67
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider.legend/src/main/java/org/gvsig/fmap/dal/store/dgn/legend/DGNGetLegendBuilder.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

  
28
package org.gvsig.fmap.dal.store.dgn.legend;
29

  
30
import org.gvsig.fmap.dal.store.dgn.LegendBuilder;
31
import org.gvsig.tools.ToolsLocator;
32
import org.gvsig.tools.dynobject.DynClass;
33
import org.gvsig.tools.dynobject.DynMethod;
34
import org.gvsig.tools.dynobject.DynObject;
35
import org.gvsig.tools.dynobject.DynObjectManager;
36
import org.gvsig.tools.dynobject.exception.DynMethodException;
37
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
38

  
39
public class DGNGetLegendBuilder implements DynMethod {
40
	private static int code = DynObjectManager.NULLCODE;
41

  
42
	static void register(DynClass DGNDynClass) {
43
		if (code != DynObjectManager.NULLCODE) {
44
			return;
45
		}
46
		code = ToolsLocator.getDynObjectManager().registerDynMethod(
47
			DGNDynClass, 
48
			new DGNGetLegendBuilder()
49
		);
50

  
51
	}
52
	
53
	public int getCode() throws DynMethodNotSupportedException {
54
		return code;
55
	}
56

  
57
	public String getDescription() {
58
		return "DGN LegendBuilder creator";
59
	}
60

  
61
	public String getName() {
62
		return LegendBuilder.DYNMETHOD_BUILDER_NAME;
63
	}
64

  
65
	public Object invoke(Object self, DynObject context)
66
			throws DynMethodException {
67
		return new DGNLegendBuilder();
68
	}
69

  
70
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider.legend/src/main/java/org/gvsig/fmap/dal/store/dgn/legend/DGNLegendBuilder.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

  
28
package org.gvsig.fmap.dal.store.dgn.legend;
29

  
30
import java.awt.Color;
31

  
32
import org.gvsig.fmap.dal.DataTypes;
33
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
34
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider;
35
import org.gvsig.fmap.dal.store.dgn.DGNStoreProvider;
36
import org.gvsig.fmap.dal.store.dgn.LegendBuilder;
37
import org.gvsig.fmap.dal.store.dgn.lib.DGNReader;
38
import org.gvsig.fmap.geom.Geometry;
39
import org.gvsig.fmap.mapcontext.MapContextLocator;
40
import org.gvsig.fmap.mapcontext.MapContextManager;
41
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorialUniqueValueLegend;
42
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
43
import org.gvsig.symbology.SymbologyLocator;
44
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.IAttrInTableLabelingStrategy;
45
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol;
46
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
47
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol;
48

  
49
public class DGNLegendBuilder implements LegendBuilder {
50

  
51
	private MapContextManager mapContextManager = MapContextLocator
52
			.getMapContextManager();
53

  
54
	private IVectorialUniqueValueLegend defaultLegend = null;
55
	private IAttrInTableLabelingStrategy labelingStragegy = null;
56

  
57
	public void begin() {
58
		// Nothing to do
59
	}
60

  
61
	public void end() {
62
		// Nothing to do
63
	}
64

  
65
	public Object getLegend() {
66
		return defaultLegend;
67
	}
68

  
69
	public LegendBuilder initialize(FeatureStoreProvider store) {
70
		defaultLegend = (IVectorialUniqueValueLegend) mapContextManager.createLegend(
71
						IVectorialUniqueValueLegend.LEGEND_NAME);
72
		defaultLegend.setShapeType(Geometry.TYPES.GEOMETRY);
73
		defaultLegend
74
				.setClassifyingFieldNames(new String[] { DGNStoreProvider.NAME_FIELD_COLOR });
75
		defaultLegend.setClassifyingFieldTypes(new int[] { DataTypes.INT });
76

  
77
		ISymbol myDefaultSymbol =
78
				mapContextManager.getSymbolManager()
79
				.createSymbol(Geometry.TYPES.GEOMETRY); 
80

  
81
		defaultLegend.setDefaultSymbol(myDefaultSymbol);
82
		defaultLegend.useDefaultSymbol(true);
83

  
84
		labelingStragegy = SymbologyLocator.getSymbologyManager().createAttrInTableLabelingStrategy();
85
		labelingStragegy.setTextField(DGNStoreProvider.NAME_FIELD_TEXT);
86
		labelingStragegy
87
				.setRotationField(DGNStoreProvider.NAME_FIELD_ROTATIONTEXT);
88
		labelingStragegy.setHeightField(DGNStoreProvider.NAME_FIELD_HEIGHTTEXT);
89
		labelingStragegy.setUnit(1); // MapContext.NAMES[1] (meters)
90
		return this;
91
	}
92

  
93
	public void process(FeatureProvider feature, DGNReader dgnReader) {
94
		Integer clave = (Integer) feature.get("Color");
95
		if (clave == null) {
96
			return;
97
		}
98

  
99
		defaultLegend.useDefaultSymbol(false);
100
		if (defaultLegend.getSymbolByValue(clave) == null) {
101
			ISymbol theSymbol;
102
			Color color = dgnReader.DGNLookupColor(clave.intValue());
103
			theSymbol =
104
					mapContextManager.getSymbolManager().createSymbol(
105
					Geometry.TYPES.GEOMETRY, color); 
106

  
107
			theSymbol.setDescription(clave.toString());
108

  
109
			if (theSymbol instanceof IMarkerSymbol) {
110
				((IMarkerSymbol) theSymbol).setSize(1);
111
			}
112

  
113
			if (theSymbol instanceof ILineSymbol) {
114
				ILineSymbol lineSymbol = (ILineSymbol) theSymbol;
115
				lineSymbol.setLineWidth(1);
116
				lineSymbol.setLineColor(color);
117
			}
118

  
119
			if (theSymbol instanceof IFillSymbol) {
120
				IFillSymbol fillSymbol = (IFillSymbol) theSymbol;
121
				fillSymbol.getOutline().setLineColor(color);
122
				fillSymbol.getOutline().setLineWidth(1);
123
				fillSymbol.setFillColor(null);
124
			}
125
			if (theSymbol != null) {
126
				defaultLegend.addSymbol(clave, theSymbol);
127
			}
128
		}
129
	}
130

  
131
	public Object getLabeling() {
132
		return labelingStragegy;
133
	}
134

  
135

  
136
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider.legend/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<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">
3
  <modelVersion>4.0.0</modelVersion>
4
  <artifactId>org.gvsig.dgn.provider.legend</artifactId>
5
  <packaging>jar</packaging>
6
  <name>${project.artifactId}</name>
7
  <description>DAL provider for DGN files</description>
8
  <parent>
9
      <groupId>org.gvsig</groupId>
10
      <artifactId>org.gvsig.dgn</artifactId>
11
      <version>2.0.23</version>
12
  </parent>
13

  
14
  <dependencies>
15

  
16
    <dependency>
17
      <groupId>org.gvsig</groupId>
18
      <artifactId>org.gvsig.dgn.provider</artifactId>
19
      <scope>compile</scope>
20
    </dependency>
21

  
22
    <dependency>
23
      <groupId>commons-io</groupId>
24
      <artifactId>commons-io</artifactId>
25
      <scope>compile</scope>
26
    </dependency>
27

  
28
    <dependency>
29
        <groupId>org.gvsig</groupId>
30
        <artifactId>org.gvsig.tools.lib</artifactId>
31
        <scope>compile</scope>
32
    </dependency>
33
    <dependency>
34
        <groupId>org.gvsig</groupId>
35
        <artifactId>org.gvsig.projection.api</artifactId>
36
        <scope>compile</scope>
37
    </dependency>
38
    <dependency>
39
        <groupId>org.gvsig</groupId>
40
        <artifactId>org.gvsig.fmap.dal.api</artifactId>
41
        <scope>compile</scope>
42
    </dependency>
43
    <dependency>
44
        <groupId>org.gvsig</groupId>
45
        <artifactId>org.gvsig.fmap.dal.spi</artifactId>
46
        <scope>compile</scope>
47
    </dependency>
48
    <dependency>
49
        <groupId>org.gvsig</groupId>
50
        <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
51
        <scope>compile</scope>
52
    </dependency>
53
    <dependency>
54
        <groupId>org.gvsig</groupId>
55
        <artifactId>org.gvsig.fmap.geometry.api</artifactId>
56
        <scope>compile</scope>
57
    </dependency>
58
    <dependency>
59
        <groupId>org.gvsig</groupId>
60
        <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
61
        <scope>compile</scope>
62
    </dependency>
63

  
64
    <dependency>
65
        <groupId>org.gvsig</groupId>
66
        <artifactId>org.gvsig.symbology.lib.api</artifactId>
67
        <scope>compile</scope>
68
    </dependency>
69
    <dependency>
70
        <groupId>org.gvsig</groupId>
71
        <artifactId>org.gvsig.timesupport.lib.api</artifactId>
72
        <scope>compile</scope>
73
    </dependency>  
74
    <dependency>
75
      <groupId>org.gvsig</groupId>
76
      <artifactId>org.gvsig.utils</artifactId>
77
      <scope>compile</scope>
78
    </dependency>
79

  
80

  
81
    <!-- TESTS -->
82
    <dependency>
83
      <groupId>org.gvsig</groupId>
84
      <artifactId>org.gvsig.tools.lib</artifactId>
85
      <type>test-jar</type>
86
      <scope>test</scope>
87
    </dependency>
88
    <dependency>
89
      <groupId>org.gvsig</groupId>
90
      <artifactId>org.gvsig.compat.se</artifactId>
91
      <scope>test</scope>
92
    </dependency>
93
    <dependency>
94
      <groupId>org.gvsig</groupId>
95
      <artifactId>org.gvsig.fmap.dal.impl</artifactId>
96
      <scope>test</scope>
97
    </dependency>
98
    <dependency>
99
      <groupId>org.gvsig</groupId>
100
      <artifactId>org.gvsig.fmap.geometry.impl</artifactId>
101
      <scope>test</scope>
102
    </dependency>
103
    <dependency>
104
      <groupId>org.gvsig</groupId>
105
      <artifactId>org.gvsig.projection.cresques.impl</artifactId>
106
      <scope>test</scope>
107
    </dependency>
108
    <dependency>
109
      <groupId>org.gvsig</groupId>
110
      <artifactId>org.gvsig.timesupport.lib.impl</artifactId>
111
      <scope>test</scope>
112
    </dependency>   
113

  
114

  
115
  </dependencies>
116

  
117
</project>
0 118

  
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider/src/test/java/org/gvsig/fmap/dal/store/dgn/TestDGN.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

  
28
package org.gvsig.fmap.dal.store.dgn;
29

  
30
import java.io.File;
31

  
32
import org.gvsig.fmap.dal.DataStoreParameters;
33
import org.gvsig.fmap.dal.exception.DataException;
34
import org.gvsig.fmap.dal.feature.BaseTestFeatureStore;
35
import org.gvsig.fmap.dal.feature.FeatureStore;
36

  
37
public class TestDGN extends BaseTestFeatureStore {
38

  
39
	public static final File file_prueba = new File(TestDGN.class.getResource(
40
			"data/prueba.dgn").getFile());
41
	
42
	/*
43
	 * (non-Javadoc)
44
	 *
45
	 * @see
46
	 * org.gvsig.fmap.dal.feature.BaseTestFeatureStore#getDefaultDataStoreParameters
47
	 * ()
48
	 */
49
	public DataStoreParameters getDefaultDataStoreParameters()
50
			throws DataException {
51
		DGNStoreParameters dgnParameters = null;
52

  
53
		dgnParameters = (DGNStoreParameters) dataManager
54
				.createStoreParameters(DGNStoreProvider.NAME);
55

  
56
		dgnParameters.setFile(file_prueba.getAbsolutePath());
57
		dgnParameters.setCRS("EPSG:23030");
58
		return dgnParameters;
59
	}
60

  
61
	/*
62
	 * (non-Javadoc)
63
	 *
64
	 * @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer()
65
	 */
66
	public boolean hasExplorer() {
67
		// TODO Auto-generated method stub
68
		return false;
69
	}
70

  
71
	public boolean usesResources() {
72
		return true;
73
	}
74

  
75

  
76
	public void testLegendAndLabeling() throws Exception {
77
		FeatureStore store = (FeatureStore) dataManager
78
				.createStore(getDefaultDataStoreParameters());
79

  
80
		assertNotNull(store.invokeDynMethod("getLegend", null));
81
		assertNotNull(store.invokeDynMethod("getLabeling", null));
82
		store.dispose();
83
	}
84
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider/src/main/resources/org/gvsig/fmap/dal/store/dgn/DGNMetadata.xml
1
<?xml version="1.0"?>
2
<!--
3
Definitions of metadata fields of a shp file.  
4
 -->
5
<definitions>
6
  <version>1.0.0</version>
7
  <classes>
8
    
9
    <class name="DGN" namespace="Metadata">
10
      <extends>
11
      	<class namespace="Metadata" name="SpatialProvider"/>
12
      </extends>
13
      <description>Metadata of a DGN store</description>
14
      <fields>
15
      </fields>
16
    </class>
17

  
18
  </classes>
19
</definitions>  
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider/src/main/resources/org/gvsig/fmap/dal/store/dgn/DGNParameters.xml
1
<?xml version= "1.0 "?>
2
<definitions>
3
  <version>1.0.0</version>
4
  <classes>
5
    <class name="DGN">
6
      <extends>
7
      	<class namespace="dal" name="ProviderParameters"/>
8
      </extends>
9
      <description>Store the parameters need to open a dgn file</description>
10
      <fields>
11
        
12
        <!-- General -->
13
        <field name="file" type="file" mandatory="true">
14
          <description>dgn file</description>
15
        </field>
16
        <field name="CRS" type="crs" mandatory="true">
17
          <description>The coordinate reference system used in this dgn file</description>
18
        </field>
19
        <field name="LoadMode" label="Load mode" defaultValue="0" type="integer" mandatory="false">
20
          <description>Set the strategy to use for loading DGN elements</description>
21
     	  <availableValues>
22
            <value label="Plain">0</value>
23
            <value label="Group elements (1)">1</value>
24
     	  </availableValues>
25
        </field>
26
        <field name="sortByGeometryType" label="Sort by geometry type" type="Boolean" defaultValue="true" mandatory="false">
27
          <description>If checked sort the rows of table by the geometry type (none,suface,curve,point)</description>
28
        </field>
29
        <field name="ignoreZ" label="Ignore Z" type="Boolean" defaultValue="false" mandatory="false">
30
          <description>If checked and DGN has Z dimension, set all Zs to 0.</description>
31
        </field>
32
        <field name="Reload" label="Reload" type="Boolean" defaultValue="false" mandatory="false">
33
          <description>Reload an already loaded DGN as a new layer</description>
34
        </field>
35
        <field name="groupby" label="Field for group" type="String" defaultValue="" mandatory="false">
36
          <description>The field name to use for grouping rows</description>
37
        </field>
38
        <field name="applyConvexHull" label="Apply convex hull" type="boolean" defaultValue="false" mandatory="false">
39
          <description>Apply convex hull to the grouped geometries.Don't take effect if do not group.</description>
40
        </field>
41

  
42
        <!-- Advanced -->
43
        <field name="useZAsElevation" label="Use Z as elevation" type="Boolean" defaultValue="false" mandatory="false" group="Advanced">
44
          <description>If set, use the Z value to fill the field elevation.</description>
45
        </field>
46
        <field name="elevationFactor" label="Elevation factor" type="Double" defaultValue="1" mandatory="false" group="Advanced">
47
          <description>Factor to apply to elevation when is retrived from the Z coordinate.</description>
48
        </field>
49
        <field name="roundElevation" label="Round elevation" type="Boolean" defaultValue="false" mandatory="false" group="Advanced">
50
          <description>If set, round the elevation to a integer value. This only apply when get elevation from the coordinete Z.</description>
51
        </field>
52

  
53

  
54
        <!-- Filter -->
55
        <field name="levelFilter" label="Level" group="Filter" type="String" defaultValue="" mandatory="false">
56
          <description>If specified load only elements with this level. Can use regular expresion to specify the filter.</description>
57
        </field>
58
        <field name="colorFilter" label="Color" group="Filter" type="String" defaultValue="" mandatory="false">
59
          <description>If specified load only elements with this color. Can use regular expresion to specify the filter.</description>
60
        </field>
61
        <field name="styleFilter" label="Style" group="Filter" type="String" defaultValue="" mandatory="false">
62
          <description>If specified load only elements with this style. Can use regular expresion to specify the filter.</description>
63
        </field>
64
        <field name="weightFilter" label="Weight" group="Filter" type="String" defaultValue="" mandatory="false">
65
          <description>If specified load only elements with this weight. Can use regular expresion to specify the filter.</description>
66
        </field>
67
        <field name="typeFilter" label="Type" group="Filter" type="String" defaultValue="" mandatory="false">
68
          <description>If specified load only elements with this type</description>
69
        </field>
70
        <field name="stypeFilter" label="SType" group="Filter" type="String" defaultValue="" mandatory="false">
71
          <description>If specified load only elements with this stype</description>
72
        </field>
73
        <field name="groupFilter" label="Group" group="Filter" type="String" defaultValue="" mandatory="false">
74
          <description>If specified load only elements with this group</description>
75
        </field>
76
        <field name="idFilter" label="Id" group="Filter" type="String" defaultValue="" mandatory="false">
77
          <description>If specified load only elements with this id</description>
78
        </field>
79
        <field name="textFilter" label="Text" group="Filter" type="String" defaultValue="" mandatory="false">
80
          <description>If specified load only elements that match this text</description>
81
        </field>
82
        <field name="geomtypeFilter" label="Geometry type" group="Filter" defaultValue="0" type="Integer" mandatory="false">
83
          <description>If specified load only elements with this type of geometry</description>
84
     	  <availableValues>
85
            <value label="All">0</value>
86
            <value label="Points">1</value>
87
            <value label="Lines">2</value>
88
            <value label="Poligons">3</value>
89
     	  </availableValues>
90
        </field>
91
        <field name="skipCorruptGeometries" label="Skip corrupt geometries" group="Filter" type="Boolean" defaultValue="false" mandatory="false">
92
          <description>If specified skip corrupt geometries</description>
93
        </field>
94
        <field name="cropOperationFilter" label="Crop operation" group="Filter" defaultValue="1" type="Integer" mandatory="false">
95
          <description>If specified load only elements with this type of geometry</description>
96
     	  <availableValues>
97
            <value label="None">0</value>
98
            <value label="Contains">1</value>
99
            <value label="Covered by">2</value>
100
            <value label="Covers">3</value>
101
            <value label="Crosses">4</value>
102
            <value label="Disjoint">5</value>
103
            <value label="Intersect">6</value>
104
            <value label="Overlaps">7</value>
105
            <value label="Touches">8</value>
106
            <value label="With in">9</value>
107
     	  </availableValues>
108
        </field>
109
        <field name="cropFilter" label="Crop to" group="Filter" type="Geometry" defaultValue="" mandatory="false">
110
          <description>Crop the result to this value</description>
111
        </field>
112
        
113
                        
114
        <!-- Debug -->
115
        <field name="XMLFile" label="Output XML file" type="file" group="Debug" mandatory="false">
116
          <description>Generate XML file with DGN dump in this file</description>
117
        </field>
118
        <!--
119
        <field name="debugOptions" label="Debug options" type="String" group="Debug" mandatory="false">
120
          <description></description>
121
        </field>
122
        -->
123
        <field name="logErrors" label="log errors" group="Debug" type="Boolean" defaultValue="false" mandatory="false">
124
          <description>If checked the log of errors are enabled</description>
125
        </field>
126

  
127
      </fields>
128
    </class>
129
  </classes>
130
</definitions>  
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.fmap.dal.store.dgn.DGNLibrary
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/DGNStoreParameters.java
1
package org.gvsig.fmap.dal.store.dgn;
2

  
3
import java.io.File;
4

  
5
import org.cresques.cts.IProjection;
6
import org.gvsig.fmap.dal.DataStoreParameters;
7
import org.gvsig.fmap.dal.FileHelper;
8
import org.gvsig.fmap.dal.feature.EditableFeatureType;
9
import org.gvsig.fmap.dal.feature.FeatureType;
10
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
11
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
12
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
13
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
14
import org.gvsig.fmap.geom.Geometry;
15
import org.gvsig.tools.dynobject.DelegatedDynObject;
16

  
17
public class DGNStoreParameters extends AbstractDataParameters implements
18
        DataStoreParameters, FilesystemStoreParameters,
19
        NewFeatureStoreParameters {
20

  
21
    public static final String PARAMETERS_DEFINITION_NAME = "DGN";
22

  
23
    private static final String FIELD_FILE = "file";
24
    private static final String FIELD_CRS = "CRS";
25
    private static final String FIELD_XMLFILE = "XMLFile";
26
    private static final String FIELD_DEBUG_OPTIONS = "debugOptions";
27
    private static final String FIELD_LOAD_MODE = "LoadMode";
28
    private static final String FIELD_RELOAD = "Reload";
29
    private static final String FIELD_GEOMTYPE_FILTER = "geomtypeFilter";
30
    private static final String FIELD_LEVEL_FILTER = "levelFilter";
31
    private static final String FIELD_TEXT_FILTER = "textFilter";
32
    private static final String FIELD_COLOR_FILTER = "colorFilter";
33
    private static final String FIELD_STYLE_FILTER = "styleFilter";
34
    private static final String FIELD_WEIGHT_FILTER = "weightFilter";
35
    private static final String FIELD_TYPE_FILTER = "typeFilter";
36
    private static final String FIELD_STYPE_FILTER = "stypeFilter";
37
    private static final String FIELD_GROUP_FILTER = "groupFilter";
38
    private static final String FIELD_ID_FILTER = "idFilter";
39
    private static final String FIELD_CROP_FILTER = "cropFilter";
40
    private static final String FIELD_CROPOPERATION_FILTER = "cropOperationFilter";
41
    private static final String FIELD_SKYPCORRUPTGEOMETRIES_FILTER = "skipCorruptGeometries";
42
    private static final String FIELD_SORT_BY_GEOMETRY_TYPE = "sortByGeometryType";
43
    private static final String FIELD_LOGS_ERRORS = "logErrors";
44
    private static final String FIELD_IGNORE_Z = "ignoreZ";
45
    private static final String FIELD_GROUPBY = "groupby";
46
    private static final String FIELD_APPLYCONVEXHULL = "applyConvexHull";
47
    private static final String FIELD_USE_Z_AS_ELEVATION = "useZAsElevation";
48
    private static final String FIELD_ELEVATION_FACTOR = "elevationFactor";
49
    private static final String FIELD_ROUND_ELEVATION = "roundElevation";
50
    
51
    private DelegatedDynObject parameters;
52

  
53
    public DGNStoreParameters() {
54
        this(PARAMETERS_DEFINITION_NAME);
55
    }
56

  
57
    protected DGNStoreParameters(String parametersDefinitionName) {
58
        this(parametersDefinitionName, DGNStoreProvider.NAME);
59
    }
60

  
61
    public DGNStoreParameters(String parametersDefinitionName, String name) {
62
        super();
63
        this.parameters = (DelegatedDynObject) FileHelper.newParameters(parametersDefinitionName);
64
        this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, name);
65
    }
66

  
67
    public String getDataStoreName() {
68
        return (String) this.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME);
69
    }
70

  
71
    public String getDescription() {
72
        return this.getDynClass().getDescription();
73
    }
74

  
75
    public void setCRS(IProjection srs) {
76
        setDynValue(FIELD_CRS, srs);
77
    }
78

  
79
    public void setCRS(String srs) {
80
        setDynValue(FIELD_CRS, srs);
81
    }
82

  
83
    public IProjection getCRS() {
84
        return (IProjection) getDynValue(FIELD_CRS);
85
    }
86

  
87
    public String getFileName() {
88
        return this.getFile().getPath();
89
    }
90

  
91
    public boolean isValid() {
92
        if (getCRS() == null) {
93
            return false;
94
        }
95
        if (getFile() == null) {
96
            return false;
97
        }
98
        return true;
99
    }
100

  
101
    public File getFile() {
102
        return (File) this.getDynValue(FIELD_FILE);
103
    }
104

  
105
    public File getXMLFile() {
106
        return (File) this.getDynValue(FIELD_XMLFILE);
107
    }
108

  
109
    public int getGeometryTypeFilter() {
110
        Integer x = (Integer) this.getDynValue(FIELD_GEOMTYPE_FILTER);
111
        if (x == null) {
112
            return Geometry.TYPES.GEOMETRY;
113
        }
114
        return x.intValue();
115
    }
116

  
117
    public int getLoadMode() {
118
        Integer x = (Integer) this.getDynValue(FIELD_LOAD_MODE);
119
        if (x == null) {
120
            return DGNStoreProvider.LOAD_MODE_PLAIN;
121
        }
122
        return x.intValue();
123
    }
124
    
125
    public double geElevationFactor() {
126
        Double x = (Double) this.getDynValue(FIELD_ELEVATION_FACTOR);
127
        if (x == null) {
128
            return 1;
129
        }
130
        return x.doubleValue();
131
    }
132
    
133
    public int getCropOperationFilter() {
134
        Integer x = (Integer) this.getDynValue(FIELD_CROPOPERATION_FILTER);
135
        if (x == null) {
136
            return DGNStoreProvider.CROP_OPERATION_NONE;
137
        }
138
        return x.intValue();
139
    }
140

  
141
    public Geometry getCropFilter() {
142
        Geometry x = (Geometry) this.getDynValue(FIELD_CROP_FILTER);
143
        return x;
144
    }
145

  
146
    public String getGroupBy() {
147
        return (String) this.getDynValue(FIELD_GROUPBY);
148
    }
149

  
150
    public String getLevelFilter() {
151
        return (String) this.getDynValue(FIELD_LEVEL_FILTER);
152
    }
153

  
154
    public String getGroupFilter() {
155
        return (String) this.getDynValue(FIELD_GROUP_FILTER);
156
    }
157

  
158
    public String getTextFilter() {
159
        return (String) this.getDynValue(FIELD_TEXT_FILTER);
160
    }
161

  
162
    public String getIDFilter() {
163
        return (String) this.getDynValue(FIELD_ID_FILTER);
164
    }
165

  
166
    public String getTypeFilter() {
167
        return (String) this.getDynValue(FIELD_TYPE_FILTER);
168
    }
169

  
170
    public String getSTypeFilter() {
171
        return (String) this.getDynValue(FIELD_STYPE_FILTER);
172
    }
173

  
174
    public String getColorFilter() {
175
        return (String) this.getDynValue(FIELD_COLOR_FILTER);
176
    }
177

  
178
    public String getStyleFilter() {
179
        return (String) this.getDynValue(FIELD_STYLE_FILTER);
180
    }
181

  
182
    public String getWeightFilter() {
183
        return (String) this.getDynValue(FIELD_WEIGHT_FILTER);
184
    }
185

  
186
    public boolean useReload() {
187
        Boolean x = (Boolean) this.getDynValue(FIELD_RELOAD);
188
        if (x == null) {
189
            return Boolean.FALSE;
190
        }
191
        return x.booleanValue();
192
    }
193

  
194
    public boolean getApplyConvexHull() {
195
        Boolean x = (Boolean) this.getDynValue(FIELD_APPLYCONVEXHULL);
196
        if (x == null) {
197
            return Boolean.FALSE;
198
        }
199
        return x.booleanValue();
200
    }
201

  
202
    public boolean getApplyRoundToElevation() {
203
        Boolean x = (Boolean) this.getDynValue(FIELD_ROUND_ELEVATION);
204
        if (x == null) {
205
            return Boolean.FALSE;
206
        }
207
        return x.booleanValue();
208
    }
209

  
210
    public boolean ignoreZs() {
211
        Boolean x = (Boolean) this.getDynValue(FIELD_IGNORE_Z);
212
        if (x == null) {
213
            return Boolean.FALSE;
214
        }
215
        return x.booleanValue();
216
    }
217

  
218
    public boolean logErrors() {
219
        Boolean x = (Boolean) this.getDynValue(FIELD_LOGS_ERRORS);
220
        if (x == null) {
221
            return Boolean.FALSE;
222
        }
223
        return x.booleanValue();
224
    }
225

  
226
    public boolean skipCorruptGeometries() {
227
        Boolean x = (Boolean) this.getDynValue(FIELD_SKYPCORRUPTGEOMETRIES_FILTER);
228
        if (x == null) {
229
            return Boolean.FALSE;
230
        }
231
        return x.booleanValue();
232
    }
233

  
234
    boolean useZAsElevation() {
235
        Boolean x = (Boolean) this.getDynValue(FIELD_USE_Z_AS_ELEVATION);
236
        if (x == null) {
237
            return Boolean.FALSE;
238
        }
239
        return x.booleanValue();
240
    }
241
    public boolean sortByGeometryType() {
242
        Boolean x = (Boolean) this.getDynValue(FIELD_SORT_BY_GEOMETRY_TYPE);
243
        if (x == null) {
244
            return Boolean.TRUE;
245
        }
246
        return x.booleanValue();
247
    }
248

  
249
    public String getDebugOptions() {
250
        return (String) this.getDynValue(FIELD_DEBUG_OPTIONS);
251
    }
252

  
253
    public void setFile(File file) {
254
        this.setDynValue(FIELD_FILE, file);
255
    }
256

  
257
    public void setFile(String file) {
258
        this.setDynValue(FIELD_FILE, file);
259
    }
260

  
261
    public EditableFeatureType getDefaultFeatureType() {
262
        return null; //TODO ????
263
    }
264

  
265
    public void setDefaultFeatureType(FeatureType defaultFeatureType) {
266
        throw new UnsupportedOperationException();
267
    }
268

  
269
    protected DelegatedDynObject getDelegatedDynObject() {
270
        return parameters;
271
    }
272

  
273

  
274
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/DGNLibrary.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

  
28
package org.gvsig.fmap.dal.store.dgn;
29

  
30
import java.util.ArrayList;
31
import java.util.List;
32

  
33
import org.gvsig.fmap.dal.DALFileLibrary;
34
import org.gvsig.fmap.dal.DALFileLocator;
35
import org.gvsig.fmap.dal.DALLibrary;
36
import org.gvsig.fmap.dal.DALLocator;
37
import org.gvsig.fmap.dal.FileHelper;
38
import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
39
import org.gvsig.metadata.MetadataLibrary;
40
import org.gvsig.metadata.exceptions.MetadataException;
41
import org.gvsig.tools.library.AbstractLibrary;
42
import org.gvsig.tools.library.LibraryException;
43

  
44
public class DGNLibrary extends AbstractLibrary {
45

  
46
    @Override
47
    public void doRegistration() {
48
        registerAsServiceOf(DALLibrary.class);
49
        require(DALFileLibrary.class);
50
        require(MetadataLibrary.class);
51
    }
52

  
53
	@Override
54
	protected void doInitialize() throws LibraryException {
55
	}
56

  
57
	@Override
58
	protected void doPostInitialize() throws LibraryException {
59
		List<Throwable> exs = new ArrayList<Throwable>();
60
				
61
		FileHelper.registerParametersDefinition(
62
				DGNStoreParameters.PARAMETERS_DEFINITION_NAME, 
63
				DGNStoreParameters.class,
64
				"DGNParameters.xml"
65
		);
66
		try {
67
			FileHelper.registerMetadataDefinition(
68
					DGNStoreProvider.METADATA_DEFINITION_NAME, 
69
					DGNStoreProvider.class,
70
					"DGNMetadata.xml"
71
			);
72
		} catch (MetadataException e) {
73
			exs.add(e);
74
		}
75

  
76
        DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator
77
				.getDataManager();
78

  
79
		try {
80
			if (!dataman.getStoreProviders().contains(DGNStoreProvider.NAME)) {
81
				dataman.registerStoreProviderFactory(new DGNStoreProviderFactory(DGNStoreProvider.NAME, DGNStoreProvider.DESCRIPTION));
82
			}
83
		} catch (RuntimeException e) {
84
			exs.add(e);
85
		}
86

  
87
		try {
88
			DALFileLocator.getFilesystemServerExplorerManager()
89
					.registerProvider(DGNStoreProvider.NAME,
90
							DGNStoreProvider.DESCRIPTION,
91
							DGNFilesystemServerProvider.class);
92
		} catch (RuntimeException e) {
93
			exs.add(e);
94
		}
95

  
96
		if( exs.size()>0 ) {
97
			throw new LibraryException(this.getClass(), exs);
98
		}
99
	}
100
}
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.23/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/DGNFilesystemServerProvider.java
1
package org.gvsig.fmap.dal.store.dgn;
2

  
3
import java.io.File;
4

  
5
import org.gvsig.fmap.dal.DALLocator;
6
import org.gvsig.fmap.dal.DataManager;
7
import org.gvsig.fmap.dal.DataServerExplorer;
8
import org.gvsig.fmap.dal.DataStoreParameters;
9
import org.gvsig.fmap.dal.NewDataStoreParameters;
10
import org.gvsig.fmap.dal.exception.CreateException;
11
import org.gvsig.fmap.dal.exception.DataException;
12
import org.gvsig.fmap.dal.exception.FileNotFoundException;
13
import org.gvsig.fmap.dal.exception.RemoveException;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff