Revision 2003

View differences:

org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/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/maven-v4_0_0.xsd">
3

  
4
    <modelVersion>4.0.0</modelVersion>
5
    <artifactId>org.gvsig.projection.jcrs</artifactId>
6
    <packaging>pom</packaging>
7
    <version>2.1.267</version>
8
    <name>${project.artifactId}</name>
9
    <parent>
10
        <groupId>org.gvsig</groupId>
11
        <artifactId>org.gvsig.desktop</artifactId>
12
        <version>2.0.449</version>
13
    </parent>
14

  
15
    <description>
16
        This project contains the support for CRS based in JCRS, proj4+Geotools, for gvSIG
17
    </description>
18

  
19
    <scm>
20
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267</connection>
21
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267</developerConnection>
22
        <url>scm:svn:https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267</url>
23
    </scm>
24

  
25
    <repositories>
26
        <repository>
27
            <id>gvsig-public-http-repository</id>
28
            <name>gvSIG maven public HTTP repository</name>
29
            <url>http://devel.gvsig.org/m2repo/j2se</url>
30
            <releases>
31
                <enabled>true</enabled>
32
                <updatePolicy>daily</updatePolicy>
33
                <checksumPolicy>warn</checksumPolicy>
34
            </releases>
35
            <snapshots>
36
                <enabled>true</enabled>
37
                <updatePolicy>daily</updatePolicy>
38
                <checksumPolicy>warn</checksumPolicy>
39
            </snapshots>
40
        </repository>
41
        <repository>
42
            <id>osgeo</id>
43
            <name>Open Source Geospatial Foundation</name>
44
            <url>http://download.osgeo.org/webdav/geotools</url>
45
            <releases>
46
                <enabled>true</enabled>
47
                <updatePolicy>never</updatePolicy>
48
                <checksumPolicy>warn</checksumPolicy>
49
            </releases>
50
            <snapshots>
51
                <enabled>false</enabled>
52
            </snapshots>
53
        </repository>
54
    </repositories>
55

  
56
    <distributionManagement>
57
        <site>
58
            <id>gvsig-repository</id>
59
            <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
60
        </site>
61
    </distributionManagement>
62

  
63
    <properties>
64
        <!-- El plugin versions:use-latest-versions falla con scope import -->
65
        <!-- asi que toca usar el versions:update-properties que si que funciona -->
66
        <org.gvsig.gdal.version>1.0.243</org.gvsig.gdal.version>
67
        <!-- General configuration -->
68
        <site-repository>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</site-repository>
69

  
70
        <!-- The property svn.tags.folder is used in external projects to override  -->
71
        <!-- configuraction in maven-release-plugin -->
72
        <svn.tags.folder>https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.projection.jcrs/tags/</svn.tags.folder>
73

  
74
    </properties>
75

  
76
    <dependencyManagement>
77
        <dependencies>
78

  
79
            <dependency>
80
                <groupId>org.gvsig</groupId>
81
                <artifactId>org.gvsig.gdal</artifactId>
82
                <version>${org.gvsig.gdal.version}</version>
83
                <type>pom</type>
84
                <scope>import</scope>
85
            </dependency>
86

  
87
            <dependency>
88
                <groupId>org.gvsig</groupId>
89
                <artifactId>org.gvsig.projection.jcrs.lib</artifactId>
90
                <version>2.1.267</version>
91
            </dependency>
92
            <dependency>
93
                <groupId>org.gvsig</groupId>
94
                <artifactId>org.gvsig.projection.app.jcrs</artifactId>
95
                <version>2.1.267</version>
96
            </dependency>
97
            <dependency>
98
                <groupId>org.gvsig</groupId>
99
                <artifactId>org.gvsig.projection.app.jcrs.common</artifactId>
100
                <version>2.1.267</version>
101
            </dependency>
102
            <dependency>
103
                <groupId>org.gvsig</groupId>
104
                <artifactId>org.gvsig.projection.app.jcrs.common</artifactId>
105
                <version>2.1.267</version>
106
                <type>zip</type>
107
            </dependency>
108
            <dependency>
109
                <groupId>org.gvsig</groupId>
110
                <artifactId>org.gvsig.projection.app.jcrs.lin.x86</artifactId>
111
                <version>2.1.26-SNAPSHOT</version>
112
            </dependency>
113
            <dependency>
114
                <groupId>org.gvsig</groupId>
115
                <artifactId>org.gvsig.projection.app.jcrs.win.x86</artifactId>
116
                <version>2.1.26-SNAPSHOT</version>
117
            </dependency>
118

  
119
            <!-- Non gvSIG projects -->
120
            <dependency>
121
                <groupId>org.opengis</groupId>
122
                <artifactId>geoapi</artifactId>
123
                <version>2.0</version>
124
            </dependency>
125
            <dependency>
126
                <groupId>hsqldb</groupId>
127
                <artifactId>hsqldb</artifactId>
128
                <version>1.8.0.10</version>
129
            </dependency>
130
            <dependency>
131
                <groupId>org.geotools</groupId>
132
                <artifactId>gt2-main</artifactId>
133
                <!--  Override the org.gvsig.desktop value -->
134
                <version>unknown</version>
135
            </dependency>
136
            <dependency>
137
                <groupId>org.geotools</groupId>
138
                <artifactId>gt2-legacy</artifactId>
139
                <!--  Override the org.gvsig.desktop value -->
140
                <version>unknown</version>
141
            </dependency>
142

  
143
        </dependencies>
144
    </dependencyManagement>
145

  
146
    <modules>
147
        <module>org.gvsig.projection.jcrs.lib</module>
148
        <module>org.gvsig.projection.app.jcrs</module>
149
    </modules>
150

  
151
</project>
152

  
153

  
154

  
0 155

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.lin.x86/buildNumber.properties
1
#Fri Oct 09 10:40:29 CEST 2015
2
buildNumber=2085
0 3

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.lin.x86/src/main/assembly/gvsig-plugin-package.xml
1
<!--
2

  
3
    gvSIG. Desktop Geographic Information System.
4

  
5
    Copyright (C) 2007-2013 gvSIG Association.
6

  
7
    This program is free software; you can redistribute it and/or
8
    modify it under the terms of the GNU General Public License
9
    as published by the Free Software Foundation; either version 3
10
    of the License, or (at your option) any later version.
11

  
12
    This program is distributed in the hope that it will be useful,
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
    GNU General Public License for more details.
16

  
17
    You should have received a copy of the GNU General Public License
18
    along with this program; if not, write to the Free Software
19
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
    MA  02110-1301, USA.
21

  
22
    For any additional information, do not hesitate to contact us
23
    at info AT gvsig.com, or visit our website www.gvsig.com.
24

  
25
-->
26
<assembly>
27
  <id>gvsig-plugin-package</id>
28
  <formats>
29
    <format>zip</format>
30
  </formats>
31
  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
32
  <includeBaseDirectory>true</includeBaseDirectory>
33
  <files>
34
    <file>
35
      <source>target/package.info</source>
36
    </file>
37
  </files>
38

  
39
  <fileSets>
40
    <fileSet>
41
      <directory>target/org.gvsig.projection.app.jcrs.common</directory>
42
      <outputDirectory>.</outputDirectory>
43
      <excludes>
44
      	<exclude>package.info</exclude>
45
      </excludes>
46
    </fileSet>
47
    <fileSet>
48
      <directory>target/native/lib</directory>
49
      <outputDirectory>native</outputDirectory>
50
    </fileSet>
51
    <fileSet>
52
      <directory>src/main/resources-plugin</directory>
53
      <outputDirectory>.</outputDirectory>
54
    </fileSet>
55
  </fileSets>
56

  
57

  
58
  <dependencySets>
59
    <dependencySet>
60
      <useProjectArtifact>false</useProjectArtifact>
61
      <useTransitiveDependencies>false</useTransitiveDependencies>
62
      <outputDirectory>lib</outputDirectory>
63
		<includes>
64
            <include>org.gvsig:org.gvsig.jproj:jar</include>
65
		</includes>
66
    </dependencySet>
67
  </dependencySets>
68

  
69
</assembly>
70

  
71

  
72

  
0 73

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.lin.x86/src/main/resources-plugin/autorun.sh
1
#!/bin/sh
2
#
3
# gvSIG. Desktop Geographic Information System.
4
#
5
# Copyright (C) 2007-2013 gvSIG Association.
6
#
7
# This program is free software; you can redistribute it and/or
8
# modify it under the terms of the GNU General Public License
9
# as published by the Free Software Foundation; either version 3
10
# of the License, or (at your option) any later version.
11
#
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
# MA  02110-1301, USA.
21
#
22
# For any additional information, do not hesitate to contact us
23
# at info AT gvsig.com, or visit our website www.gvsig.com.
24
#
25

  
26

  
27
#
28
# Plugin autorun
29
#
30

  
31
PLUGIN_NAME=$(basename "$PLUGIN_FOLDER")
32

  
33
# Proj4 data files
34
export PROJ_LIB="${GVSIG_HOME_FOLDER}/plugins/$PLUGIN_NAME/projlib"
35

  
36
# Temporary fix for number locale related formatting error with proj4.
37
export LC_NUMERIC=C
38

  
39
add_library_path "$PLUGIN_FOLDER/native"
40

  
41
list_shared_library_dependencies "$PLUGIN_FOLDER/native/"libcrsjniproj*
42

  
43

  
44

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.lin.x86/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/maven-v4_0_0.xsd">
3
  <modelVersion>4.0.0</modelVersion>
4
  <artifactId>org.gvsig.projection.app.jcrs.lin.x86</artifactId>
5
  <packaging>jar</packaging>
6
   
7
 	<parent>
8
		<groupId>org.gvsig</groupId>
9
		<artifactId>org.gvsig.projection.app.jcrs</artifactId>
10
		<version>2.1.31-SNAPSHOT</version>
11
	</parent>
12

  
13
  <properties>
14
    <gvsig.package.info.operatingSystem>lin</gvsig.package.info.operatingSystem>
15
    <gvsig.package.info.architecture>x86</gvsig.package.info.architecture>
16
  </properties>
17

  
18
  <dependencyManagement>
19
      <dependencies>
20
        <dependency>
21
            <groupId>org.gvsig</groupId>
22
            <artifactId>org.gvsig.jproj</artifactId>
23
            <version>2.0.1</version>
24
        </dependency>                  
25
        <dependency>
26
            <groupId>org.gvsig</groupId>
27
            <artifactId>org.gvsig.jproj</artifactId>
28
            <version>2.0.1</version>
29
            <classifier>linux-all-gcc4-i386-dynamic</classifier>
30
            <type>tar.gz</type>
31
        </dependency>                  
32
      </dependencies>
33
  </dependencyManagement>
34
 	 
35

  
36
  <dependencies>
37
      <dependency>
38
          <groupId>org.gvsig</groupId>
39
          <artifactId>org.gvsig.projection.app.jcrs.common</artifactId>
40
          <type>zip</type>
41
        </dependency>
42
      <dependency>
43
          <groupId>org.gvsig</groupId>
44
          <artifactId>org.gvsig.jproj</artifactId>
45
      </dependency>                  
46
      <dependency>
47
          <groupId>org.gvsig</groupId>
48
          <artifactId>org.gvsig.jproj</artifactId>
49
          <classifier>linux-all-gcc4-i386-dynamic</classifier>
50
          <type>tar.gz</type>
51
      </dependency> 
52
  </dependencies>
53

  
54
  <build>
55
    <plugins>
56
  
57
      <plugin>
58
        <groupId>org.apache.maven.plugins</groupId>
59
        <artifactId>maven-dependency-plugin</artifactId>
60
        <executions>
61
          <execution>
62
          	<id>unpack</id>
63
	        <phase>process-sources</phase>
64
	        <goals>
65
	          <goal>unpack</goal>
66
	        </goals>
67
	        <configuration>
68
	          <artifactItems>
69
	            <artifactItem>
70
		            <groupId>org.gvsig</groupId>
71
		            <artifactId>org.gvsig.projection.app.jcrs.common</artifactId>
72
		            <type>zip</type>
73
					      <overWrite>true</overWrite>
74
					      <outputDirectory>target</outputDirectory>
75
	            </artifactItem>
76
	            <artifactItem>
77
		            <groupId>org.gvsig</groupId>
78
		            <artifactId>org.gvsig.jproj</artifactId>
79
		            <classifier>linux-all-gcc4-i386-dynamic</classifier>
80
		            <type>tar.gz</type>
81
					      <overWrite>true</overWrite>
82
					      <outputDirectory>target/native</outputDirectory>
83
	            </artifactItem>
84
	          </artifactItems>
85
	        </configuration>
86
          </execution>
87
        </executions>
88
	  </plugin>
89
  
90
  
91
    </plugins>
92
  </build>
93

  
94
  <profiles>
95
  
96
    <profile>
97
      <id>gvsig-plugin-install-jcrs-linux-x86</id>
98
      <activation>
99
         <os>
100
             <family>unix</family>
101
             <name>linux</name>
102
             <arch>x86</arch>
103
         </os>
104
      </activation>
105
	    <properties>
106
	      <gvsig.install.plugin>true</gvsig.install.plugin>
107
	    </properties>
108
    </profile>
109
    <profile>
110
      <!-- Some platforms report i386 instead of x86 -->
111
      <id>gvsig-plugin-install-jcrs-linux-i386</id>
112
      <activation>
113
         <os>
114
             <family>unix</family>
115
             <name>linux</name>
116
             <arch>i386</arch>
117
         </os>
118
      </activation>
119
      <properties>
120
         <gvsig.install.plugin>true</gvsig.install.plugin>
121
      </properties>
122
    </profile>
123
  </profiles>
124
  
125
</project>
126

  
0 127

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/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/maven-v4_0_0.xsd">
3
    <modelVersion>4.0.0</modelVersion>
4
    <artifactId>org.gvsig.projection.app.jcrs.common</artifactId>
5
    <packaging>jar</packaging>
6
    <name>${project.artifactId}</name>
7
    <description>
8
        CRS management:
9
        - Set the reference system (CRS) by default, in views, in layers (CRS on the fly).
10
        - Selection from recent CRS, from EPSG, ESRI, IAU2000 data bases and user's defined CRS.
11
        - Create, edit and delete new CRS defined by the user (from an existing CRS, from a wkt string, or from scratch).
12
        - Consult CRS information (datum, projection, proj4 string...)
13
        - Convertion of coordinates (no datum changing)
14
        - Transformation of coordinates (datum changing) from EPSG, manual, recent, compound and grid (.gsb extension)
15
    </description>
16

  
17
    <parent>
18
        <groupId>org.gvsig</groupId>
19
        <artifactId>org.gvsig.projection.app.jcrs</artifactId>
20
        <version>2.1.267</version>
21
    </parent>
22

  
23
    <properties>
24
        <gvsig.package.info.name>CRS: CRS management (Proj4/Geotools based, Native)</gvsig.package.info.name>
25
        <gvsig.package.info.state>testing</gvsig.package.info.state>
26
        <gvsig.package.info.official>true</gvsig.package.info.official>
27
        <gvsig.package.info.operatingSystem>all</gvsig.package.info.operatingSystem>
28
        <gvsig.package.info.architecture>all</gvsig.package.info.architecture>
29
        <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0-A</gvsig.package.info.dependencies>
30
        <gvsig.package.info.categories />
31
        <gvsig.package.info.poolURL>http://devel.gvsig.org/download/projects/gvsig-jcrs/pool</gvsig.package.info.poolURL>
32
        <gvsig.install.plugin>false</gvsig.install.plugin>
33
        <gvsig.install.plugin.package>false</gvsig.install.plugin.package>
34
    </properties>
35

  
36
    <dependencies>
37

  
38
        <dependency>
39
            <groupId>org.gvsig</groupId>
40
            <artifactId>org.gvsig.tools.lib</artifactId>
41
            <scope>compile</scope>
42
        </dependency>
43
        <dependency>
44
            <groupId>org.gvsig</groupId>
45
            <artifactId>org.gvsig.andami</artifactId>
46
            <scope>compile</scope>
47
        </dependency>
48
        <dependency>
49
            <groupId>org.gvsig</groupId>
50
            <artifactId>org.gvsig.ui</artifactId>
51
            <scope>compile</scope>
52
        </dependency>
53
        <dependency>
54
            <groupId>net.sf</groupId>
55
            <artifactId>jgridshiftapi</artifactId>
56
            <scope>compile</scope>
57
        </dependency>
58
        <dependency>
59
            <groupId>org.gvsig</groupId>
60
            <artifactId>org.gvsig.projection.cresques.ui</artifactId>
61
            <scope>compile</scope>
62
        </dependency>
63
        <dependency>
64
            <groupId>org.gvsig</groupId>
65
            <artifactId>org.gvsig.projection.api</artifactId>
66
            <scope>compile</scope>
67
        </dependency>
68
        <dependency>
69
            <groupId>org.gvsig</groupId>
70
            <artifactId>org.gvsig.projection.jcrs.lib</artifactId>
71
            <scope>compile</scope>
72
        </dependency>
73
        <dependency>
74
            <groupId>javax.units</groupId>
75
            <artifactId>jsr108</artifactId>
76
            <scope>compile</scope>
77
        </dependency>
78

  
79

  
80
        <dependency>
81
            <groupId>org.geotools</groupId>
82
            <artifactId>gt2-main</artifactId>
83
            <!-- Don't remove version from here, this override version  -->
84
            <!-- in org.gvsig.desktop -->
85
            <version>unknown</version>
86
            <scope>compile</scope>
87
        </dependency>
88

  
89
        <dependency>
90
            <groupId>org.opengis</groupId>
91
            <artifactId>geoapi</artifactId>
92
            <scope>compile</scope>
93
        </dependency>
94
        <dependency>
95
            <groupId>hsqldb</groupId>
96
            <artifactId>hsqldb</artifactId>
97
            <scope>compile</scope>
98
        </dependency>
99

  
100
        <!--  Runtime dependencies -->
101
        <!--  Need to include in the assembly -->
102
        <dependency>
103
            <groupId>org.gvsig</groupId>
104
            <artifactId>org.gvsig.projection.cresques.impl</artifactId>
105
            <scope>runtime</scope>
106
        </dependency>
107
        <!--
108
        <dependency>
109
          <groupId>org.gvsig</groupId>
110
          <artifactId>gt2-epsg-esri</artifactId>
111
          <scope>runtime</scope>
112
        </dependency>
113
        <dependency>
114
          <groupId>org.gvsig</groupId>
115
          <artifactId>gt2-epsg-hsql</artifactId>
116
          <scope>runtime</scope>
117
        </dependency>
118
        <dependency>
119
          <groupId>org.gvsig</groupId>
120
          <artifactId>gt2-epsg-iau2000</artifactId>
121
          <scope>runtime</scope>
122
        </dependency>
123
        <dependency>
124
          <groupId>org.gvsig</groupId>
125
          <artifactId>gt2-epsg-usr</artifactId>
126
          <scope>runtime</scope>
127
        </dependency>
128
        -->
129
        <dependency>
130
            <groupId>java3d</groupId>
131
            <artifactId>vecmath</artifactId>
132
            <scope>runtime</scope>
133
        </dependency>
134

  
135
<!--         <dependency> -->
136
<!--            <groupId>org.gdal</groupId> -->
137
<!--            <artifactId>gdal</artifactId> -->
138
<!--         </dependency> -->
139

  
140
    </dependencies>
141

  
142
    <build>
143
        <plugins>
144
            <!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION -->
145
            <plugin>
146
                <groupId>org.apache.maven.plugins</groupId>
147
                <artifactId>maven-surefire-plugin</artifactId>
148
                <configuration>
149
                    <skipTests>true</skipTests>
150
                </configuration>
151
            </plugin>
152
        </plugins>
153
    </build>
154

  
155
</project>
156

  
0 157

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/buildNumber.properties
1
#Fri Jun 14 07:23:44 CEST 2024
2
buildNumber=2328
0 3

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/wizard/FrameSistemaCoordenadas.java
1
package org.gvsig.crs.gui.wizard;
2

  
3

  
4
import java.awt.event.WindowAdapter;
5
import java.awt.event.WindowEvent;
6

  
7
import javax.swing.JFrame;
8
import org.gvsig.crs.gui.panels.wizard.DefSistCoordenadas;
9

  
10
/**
11
 * Test para el interfaz del wizard de elecci?n del sistema de coordenadas
12
 * @author Luisa Marina Fern?ndez Ruiz (luisam.fernandez@uclm.es)
13
 *
14
 */
15
public class FrameSistemaCoordenadas {
16

  
17
	public static void main(String[] args) {
18
		
19
	         JFrame frame = new JFrame("Definicion del Sistema de Coordenadas");
20
	 	
21
	         //cerrar el formulario
22
	         frame.addWindowListener(new WindowAdapter() {
23
	             public void windowClosing(WindowEvent e) {System.exit(0);}
24
	         });
25
	 
26
	         frame.getContentPane().add(new DefSistCoordenadas());
27
	         frame.setSize(300,500);
28
	         //colocar en la pantalla
29
	         frame.setLocation(300,300);
30
	         frame.pack();
31
	         frame.setVisible(true);
32
	    
33
	}
34

  
35
}
0 36

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/wizard/FrameDefinicionCRS.java
1
package org.gvsig.crs.gui.wizard;
2

  
3

  
4
import java.awt.event.WindowAdapter;
5
import java.awt.event.WindowEvent;
6

  
7
import javax.swing.JFrame;
8
import javax.swing.JPanel;
9
import javax.swing.UIManager;
10
import javax.swing.UnsupportedLookAndFeelException;
11

  
12
import org.gvsig.crs.gui.panels.wizard.DefCrsUsr;
13

  
14
public class FrameDefinicionCRS {
15

  
16

  
17
	/**
18
	 * @param args
19
	 * @throws UnsupportedLookAndFeelException 
20
	 * @throws IllegalAccessException 
21
	 * @throws InstantiationException 
22
	 * @throws ClassNotFoundException 
23
	 */
24
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
25
		
26
			/*
27
			 com.sun.java.swing.plaf.motif.MotifLookAndFeel
28
			 com.sun.java.swing.plaf.windows.WindowsLookAndFeel
29
			 javax.swing.plaf.metal.MetalLookAndFeel
30
			 */
31
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
32
	         JFrame frame = new JFrame("Definicin de CRS por el usuario");
33
	         //cerrar el formulario
34
	         frame.addWindowListener(new WindowAdapter() {
35
	             public void windowClosing(WindowEvent e) {System.exit(0);}
36
	         });
37
	         
38
	         frame.getContentPane().add(new DefCrsUsr(null));
39
	         frame.setSize(300,500);
40
	         //colocar en la pantalla
41
	         frame.setLocation(300,300);
42
	         frame.pack();
43
	         frame.setVisible(true);
44
	    
45
	}
46

  
47
}
0 48

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/wizard/FrameMain.java
1
package org.gvsig.crs.gui.wizard;
2

  
3

  
4
import java.awt.event.WindowAdapter;
5
import java.awt.event.WindowEvent;
6

  
7
import javax.swing.ImageIcon;
8
import javax.swing.JFrame;
9
import javax.swing.JPanel;
10
import javax.swing.UIManager;
11
import javax.swing.UnsupportedLookAndFeelException;
12

  
13
import org.gvsig.crs.gui.panels.wizard.DefCrsUsr;
14
import org.gvsig.crs.gui.panels.wizard.MainPanel;
15

  
16
public class FrameMain {
17

  
18

  
19
	/**
20
	 * @param args
21
	 * @throws UnsupportedLookAndFeelException 
22
	 * @throws IllegalAccessException 
23
	 * @throws InstantiationException 
24
	 * @throws ClassNotFoundException 
25
	 */
26
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
27
		
28
			/*
29
			 com.sun.java.swing.plaf.motif.MotifLookAndFeel
30
			 com.sun.java.swing.plaf.windows.WindowsLookAndFeel
31
			 javax.swing.plaf.metal.MetalLookAndFeel
32
			 */
33
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
34
	         JFrame frame = new JFrame("Asistente de Definicin de Crs");
35
	         //cerrar el formulario
36
	         frame.addWindowListener(new WindowAdapter() {
37
	             public void windowClosing(WindowEvent e) {System.exit(0);}
38
	         });
39
	         frame.getContentPane().add(new MainPanel(null));
40
	         frame.setSize(300,500);
41
	         //colocar en la pantalla
42
	         frame.setLocation(300,0);
43
	         frame.pack();
44
	         frame.setVisible(true);
45
	    
46
	}
47

  
48
}
0 49

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/wizard/FramDefinirDatum.java
1
package org.gvsig.crs.gui.wizard;
2

  
3

  
4
import java.awt.event.WindowAdapter;
5
import java.awt.event.WindowEvent;
6

  
7
import javax.swing.JFrame;
8
import javax.swing.UIManager;
9
import javax.swing.UnsupportedLookAndFeelException;
10

  
11
import org.gvsig.crs.gui.panels.wizard.DefinirDatum;
12

  
13
public class FramDefinirDatum {
14

  
15

  
16
	/**
17
	 * @param args
18
	 */
19
	public static void main(String[] args) {
20
		
21
		 JFrame frame = new JFrame("Definicin del Datum");
22
				/*
23
			 com.sun.java.swing.plaf.motif.MotifLookAndFeel
24
			 com.sun.java.swing.plaf.windows.WindowsLookAndFeel
25
			 javax.swing.plaf.metal.MetalLookAndFeel
26
			 */
27
			try {
28
				UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
29
			} catch (ClassNotFoundException e1) {
30
				// TODO Auto-generated catch block
31
				e1.printStackTrace();
32
			} catch (InstantiationException e1) {
33
				// TODO Auto-generated catch block
34
				e1.printStackTrace();
35
			} catch (IllegalAccessException e1) {
36
				// TODO Auto-generated catch block
37
				e1.printStackTrace();
38
			} catch (UnsupportedLookAndFeelException e1) {
39
				// TODO Auto-generated catch block
40
				e1.printStackTrace();
41
			}
42
	         //cerrar el formulario
43
	         frame.addWindowListener(new WindowAdapter() {
44
	             public void windowClosing(WindowEvent e) {System.exit(0);}
45
	         });
46
	 
47
	         frame.getContentPane().add(new DefinirDatum());
48
	         frame.setSize(300,500);
49
	         //colocar en la pantalla
50
	         frame.setLocation(300,0);
51
	         frame.pack();
52
	         frame.setVisible(true);
53
	    
54
	}
55

  
56
}
0 57

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/panels/CrsRecentsPanelTest.java
1
package org.gvsig.crs.gui.panels;
2

  
3
import java.awt.event.WindowAdapter;
4
import java.awt.event.WindowEvent;
5

  
6
import javax.swing.JFrame;
7

  
8

  
9
/**
10
 * Test para el interfaz de CRSs Recientes
11
 * @author Luisa Marina Fern?ndez Ruiz (luisam.fernandez@uclm.es)
12
 *
13
 */
14
public class CrsRecentsPanelTest {
15

  
16
	public static void main(String[] args) {
17
        JFrame frame = new JFrame("CrsRecents Test");
18
        //cerrar el formulario
19
        frame.addWindowListener(new WindowAdapter() {
20
            public void windowClosing(WindowEvent e) {System.exit(0);}
21
        });
22
        frame.getContentPane().add(new CrsRecentsPanel());
23
        frame.setLocation(300,0);
24
        frame.pack();
25
        frame.setVisible(true);
26
   
27
}
28
}
29

  
30

  
0 31

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/panels/TransformationCapaPanelTest.java
1
package org.gvsig.crs.gui.panels;
2

  
3

  
4
import java.awt.event.WindowAdapter;
5
import java.awt.event.WindowEvent;
6

  
7
import javax.swing.JFrame;
8
/**
9
 * Test para el interfaz de Transformaci?n de la capa dentro de la transformacion compuesta
10
 * @author Luisa Marina Fern?ndez Ruiz (luisam.fernandez@uclm.es)
11
 *
12
 */
13

  
14
public class TransformationCapaPanelTest {
15

  
16
	
17
	public static void main(String[] args) {
18
		
19
		 JFrame frame = new JFrame("Transformaci?n de la Capa");
20
	         //cerrar el formulario
21
	         frame.addWindowListener(new WindowAdapter() {
22
	             public void windowClosing(WindowEvent e) {System.exit(0);}
23
	         });
24
	 
25
	         frame.getContentPane().add(new TransformationCapaPanel("",null));
26
	         frame.setSize(300,500);
27
	         //colocar en la pantalla
28
	         frame.setLocation(300,0);
29
	         frame.pack();
30
	         frame.setVisible(true);
31
	    
32
	}
33
}
0 34

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/panels/TransformationVistaPanelTest.java
1
package org.gvsig.crs.gui.panels;
2

  
3
import java.awt.event.WindowAdapter;
4
import java.awt.event.WindowEvent;
5

  
6
import javax.swing.JFrame;
7

  
8
/**
9
 *  Test para el interfaz de transformaci?n de la vista dentro de la transformacion compuesta
10
 * @author Luisa Marina Fern?ndez Ruiz (luisam.fernandez@uclm.es)
11
 *
12
 */
13
public class TransformationVistaPanelTest {
14
	
15
	public static void main(String[] args) {
16
		 JFrame frame = new JFrame("Transformaci?n de la Capa");
17
		
18
//	         //cerrar el formulario
19
	         frame.addWindowListener(new WindowAdapter() {
20
	             public void windowClosing(WindowEvent e) {System.exit(0);}
21
	         });
22
	 
23
	         frame.getContentPane().add(new TransformationVistaPanel("",null));
24
	         frame.setSize(300,500);
25
	         //colocar en la pantalla
26
	         frame.setLocation(300,0);
27
	         frame.pack();
28
	         frame.setVisible(true);
29
	    
30
	}
31
}
0 32

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/panels/EPSGPanelTest.java
1
package org.gvsig.crs.gui.panels;
2

  
3
import java.awt.event.WindowAdapter;
4
import java.awt.event.WindowEvent;
5

  
6
import javax.swing.JFrame;
7

  
8
/**
9
 * Test para el interfaz de EPSGPanel
10
 * @author Luisa Marina Fern?ndez Ruiz (luisam.fernandez@uclm.es)
11
 *
12
 */
13
public class EPSGPanelTest {
14

  
15
	public static void main(String[] args){
16
        JFrame frame = new JFrame("UAU200 Panel Test");
17
        frame.addWindowListener(new WindowAdapter() {
18
            public void windowClosing(WindowEvent e) {System.exit(0);}
19
        });
20
        frame.getContentPane().add(new EPSGpanel());
21
        frame.setLocation(300,0);
22
        frame.pack();
23
        frame.setVisible(true);
24
   
25
}
26

  
27
}
0 28

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/panels/IAU2000PanelTest.java
1
package org.gvsig.crs.gui.panels;
2

  
3
import java.awt.event.WindowAdapter;
4
import java.awt.event.WindowEvent;
5

  
6
import javax.swing.JFrame;
7
/**
8
 * Test para el interfaz de IAU200Panel
9
 * @author Luisa Marina Fern?ndez Ruiz (luisam.fernandez@uclm.es)
10
 *
11
 */
12
public class IAU2000PanelTest {
13

  
14
	public static void main(String[] args) {
15

  
16
        JFrame frame = new JFrame("UAU200 Panel Test");
17
        //cerrar el formulario
18
        frame.addWindowListener(new WindowAdapter() {
19
            public void windowClosing(WindowEvent e) {System.exit(0);}
20
        });
21
        frame.getContentPane().add(new IAU2000panel());
22
        frame.setLocation(300,0);
23
        frame.pack();
24
        frame.setVisible(true);
25
   
26
}
27

  
28
}
0 29

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/gui/panels/ESRIPanelTest.java
1
package org.gvsig.crs.gui.panels;
2

  
3
import java.awt.event.WindowAdapter;
4
import java.awt.event.WindowEvent;
5

  
6
import javax.swing.JFrame;
7

  
8

  
9
/**
10
 * Test para el interfaz de ESRIPanel
11
 * @author Luisa Marina Fern?ndez Ruiz (luisam.fernandez@uclm.es)
12
 *
13
 */
14
public class ESRIPanelTest {
15

  
16

  
17
	public static void main(String[] args){
18
		
19
			JFrame frame = new JFrame("ESRI Panel Test");
20
	         //cerrar el formulario
21
	         frame.addWindowListener(new WindowAdapter() {
22
	             public void windowClosing(WindowEvent e) {System.exit(0);}
23
	         });
24
	         frame.getContentPane().add(new ESRIpanel());
25
	         frame.setLocation(300,0);
26
	         frame.pack();
27
	         frame.setVisible(true);
28
	    
29
	}
30

  
31
}
0 32

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/test/java/org/gvsig/crs/jgridshift/JGridShiftTest.java
1
package org.gvsig.crs.jgridshift;
2

  
3
import java.io.FileNotFoundException;
4
import java.io.IOException;
5
import java.io.RandomAccessFile;
6

  
7
import au.com.objectix.jgridshift.GridShift;
8
import au.com.objectix.jgridshift.GridShiftFile;
9
import au.com.objectix.jgridshift.SubGrid;
10

  
11
public class JGridShiftTest {
12
	
13
	public static void main(String[] args){
14
		//InputStream fis = null;
15
		RandomAccessFile raf = null;
16
		try {
17
			raf = new RandomAccessFile("/home/dguerrero/Desarrollo-gvSIG/crs/workspace/extJCRS/data/sped2et.gsb","r");
18
			//fis = new FileInputStream("/home/dguerrero/Desarrollo-gvSIG/crs/workspace/extJCRS/data/sped2et.gsb");
19
		} catch (FileNotFoundException e) {
20
			// TODO Auto-generated catch block
21
			e.printStackTrace();
22
		}
23
		GridShiftFile gsf = new GridShiftFile();
24
		try {
25
			gsf.loadGridShiftFile(raf);
26
		} catch (IOException e) {
27
			// TODO Auto-generated catch block
28
			e.printStackTrace();
29
		}
30
		
31
		SubGrid subGrid[] = gsf.getSubGridTree(); 
32
		System.out.println(subGrid.length);
33
		System.out.println(subGrid[0].getMaxLat());
34
		System.out.println(subGrid[0].getMinLat());
35
		System.out.println(subGrid[0].getMaxLon());
36
		System.out.println(subGrid[0].getMinLon());
37
		GridShift gridShift = new GridShift();
38
	}
39

  
40
}
0 41

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.crs.JCRSPluginLibrary
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/assembly/gvsig-plugin-package.xml
1
<!--
2

  
3
    gvSIG. Desktop Geographic Information System.
4

  
5
    Copyright (C) 2007-2013 gvSIG Association.
6

  
7
    This program is free software; you can redistribute it and/or
8
    modify it under the terms of the GNU General Public License
9
    as published by the Free Software Foundation; either version 3
10
    of the License, or (at your option) any later version.
11

  
12
    This program is distributed in the hope that it will be useful,
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
    GNU General Public License for more details.
16

  
17
    You should have received a copy of the GNU General Public License
18
    along with this program; if not, write to the Free Software
19
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
    MA  02110-1301, USA.
21

  
22
    For any additional information, do not hesitate to contact us
23
    at info AT gvsig.com, or visit our website www.gvsig.com.
24

  
25
-->
26
<assembly>
27
  <id>gvsig-plugin-package</id>
28
  <formats>
29
    <format>zip</format>
30
  </formats>
31
  <baseDirectory>${project.artifactId}</baseDirectory>
32
  <includeBaseDirectory>true</includeBaseDirectory>
33
  <files>
34
    <file>
35
      <source>target/${project.artifactId}-${project.version}.jar</source>
36
      <outputDirectory>lib</outputDirectory>
37
    </file>
38
    <file>
39
      <source>target/package.info</source>
40
    </file>
41
  </files>
42

  
43
  <fileSets>
44
    <fileSet>
45
      <directory>src/main/resources-plugin</directory>
46
      <outputDirectory>.</outputDirectory>
47
    </fileSet>
48
  </fileSets>
49

  
50

  
51
  <dependencySets>
52
    <dependencySet>
53
      <useProjectArtifact>false</useProjectArtifact>
54
      <useTransitiveDependencies>false</useTransitiveDependencies>
55
      <outputDirectory>lib</outputDirectory>
56
		<includes>
57
            <include>org.gvsig:org.gvsig.projection.jcrs.lib</include>
58
            <include>net.sf:jgridshiftapi</include>
59
            <include>org.geotools:gt2-main:jar:unknown</include>
60
            <include>hsqldb:hsqldb</include>
61
            <include>javax.units:jsr108</include>
62
            <include>java3d:vecmath</include>
63
            <include>org.opengis:geoapi</include>
64
<!--             <include>org.gdal:gdal</include> -->
65
            <include>org.gvsig:org.gvsig.projection.api</include>
66
            <include>org.gvsig:org.gvsig.projection.cresques.ui</include>
67
            <include>org.gvsig:org.gvsig.projection.cresques.impl</include>
68
		</includes>
69
    </dependencySet>
70
  </dependencySets>
71

  
72
</assembly>
73

  
74

  
75

  
0 76

  
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.267/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/java/org/gvsig/crs/preferences/JCRSPreferencesPage.java
1
/*
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
package org.gvsig.crs.preferences;
7

  
8
import java.awt.BorderLayout;
9
import java.io.File;
10
import java.util.Collection;
11
import java.util.Iterator;
12
import javax.swing.ComboBoxModel;
13
import javax.swing.DefaultComboBoxModel;
14
import javax.swing.DefaultListModel;
15
import javax.swing.ImageIcon;
16
import javax.swing.JPanel;
17
import org.apache.commons.io.FileUtils;
18
import org.apache.commons.io.FilenameUtils;
19
import org.apache.commons.lang3.BooleanUtils;
20
import org.apache.commons.lang3.StringUtils;
21
import org.gvsig.andami.IconThemeHelper;
22
import org.gvsig.andami.PluginServices;
23
import org.gvsig.andami.PluginsLocator;
24
import org.gvsig.andami.PluginsManager;
25
import org.gvsig.andami.preferences.AbstractPreferencePage;
26
import org.gvsig.andami.preferences.StoreException;
27
import org.gvsig.crs.CrsFactory;
28
import org.gvsig.tools.ToolsLocator;
29
import org.gvsig.tools.dynobject.DynObject;
30
import org.gvsig.tools.exception.BaseException;
31
import org.gvsig.tools.i18n.I18nManager;
32
import org.gvsig.tools.packageutils.PackageInfo;
33
import org.gvsig.tools.packageutils.PackageManager;
34
import org.slf4j.Logger;
35
import org.slf4j.LoggerFactory;
36

  
37
/**
38
 *
39
 * @author usuario
40
 */
41
public class JCRSPreferencesPage extends AbstractPreferencePage {
42

  
43
    private static final Logger logger = LoggerFactory.getLogger(JCRSPreferencesPage.class);
44
    private static final long serialVersionUID = -7838901334080793221L;
45
            
46
    private JCRSPreferencesPageView preferences;
47
    private DynObject pluginProperties;
48
    private PluginServices plugin;
49

  
50
    private class ListItem {
51

  
52
        private PackageInfo pkg;
53
        private File epsgFile;
54

  
55
        ListItem(PackageInfo pkg, File epsgFile) {
56
            this.pkg = pkg;
57
            this.epsgFile = epsgFile;
58
        }
59

  
60
        public File getEPSGFile() {
61
            return this.epsgFile;
62
        }
63
        
64
        public PackageInfo getPackageInfo() {
65
            return this.pkg;
66
        }
67

  
68
        public String toString() {
69
            return this.pkg.getName();
70
        }
71

  
72
    }
73

  
74
    public JCRSPreferencesPage() {
75
        initComponents();
76
    }
77

  
78
    private void initComponents() {
79
        I18nManager i18n = ToolsLocator.getI18nManager();
80
        PluginsManager pluginManager = PluginsLocator.getManager();
81
        this.plugin = pluginManager.getPlugin(this);
82
        this.pluginProperties = this.plugin.getPluginProperties();
83
        
84
        this.preferences = new JCRSPreferencesPageView();
85
        this.preferences.lblHeader.setText( 
86
                i18n.getTranslation("_Select_the_EPSG_data_base_to_use")
87
        );
88
        this.preferences.chkUseMomoryChacheForCRSs.setText(
89
       		i18n.getTranslation("_Use_cache_for_CRSs")
90
        );        
91
        this.setLayout(new BorderLayout());
92
        this.add(this.preferences, BorderLayout.NORTH);
93
        
94
        this.preferences.lblDatabaseInitializationMode.setText( 
95
                i18n.getTranslation("_When_initializing_the_EPSG_database")
96
        );
97
        DefaultComboBoxModel modelCombo = new DefaultComboBoxModel();
98
        modelCombo.addElement(i18n.getTranslation("_On_start_in_background"));
99
        modelCombo.addElement(i18n.getTranslation("_On_start_in_foreground"));
100
        modelCombo.addElement(i18n.getTranslation("_On_first_use"));
101
        this.preferences.cboDatabaseInitializationMode.setModel(modelCombo);
102

  
103
        initializeValues();
104
    }
105

  
106
    public void storeValues() throws StoreException {
107
        ListItem item = (ListItem) this.preferences.lstBBDD.getSelectedValue();
108
        if( item == null ) {
109
            return;
110
        }
111
        this.pluginProperties.setDynValue("epsgDatabase", item.getEPSGFile());
112
        this.pluginProperties.setDynValue("useMemoryCacheForCRSs", 
113
                this.preferences.chkUseMomoryChacheForCRSs.isSelected()
114
        );
115
        this.pluginProperties.setDynValue(
116
            "databaseInitializationMode", 
117
            this.preferences.cboDatabaseInitializationMode.getSelectedIndex()
118
        );
119
        this.plugin.savePluginProperties();
120
    }
121

  
122
    public void setChangesApplied() {
123
        // ????
124
    }
125

  
126
    public String getID() {
127
        return getClass().getName();
128
    }
129

  
130
    public String getTitle() {
131
        I18nManager i18nManager = ToolsLocator.getI18nManager();
132
        return i18nManager.getTranslation("jCRS_preferences");
133

  
134
    }
135

  
136
    public JPanel getPanel() {
137
        return this;
138
    }
139

  
140
    @Override
141
    public void initializeValues() {
142
        PackageManager pkgManager = ToolsLocator.getPackageManager();
143
        
144
        File dbfolder = CrsFactory.getDataBaseFolder();
145
        File epsgFolders = new File(dbfolder,"EPSG");
146
        Collection<File> files = FileUtils.listFiles(epsgFolders, new String[]{"info"}, true);
147
        DefaultListModel model = new DefaultListModel();
148
        
149
        File currentEPSG = getCurrentEPSG();
150

  
151
        int selectedOption = 0;
152
        int n = 0;
153
        Iterator<File> it = files.iterator();
154
        while( it.hasNext() ) {
155
            File f = it.next();
156
            if( f.getName().equals("package.info") ) {
157
                try {
158
                    PackageInfo pkginfo = pkgManager.createPackageInfo(f);
159
                    File epsgdb = new File(f.getParentFile(),"EPSG.sql");
160
                    epsgdb = makeRelative(dbfolder, epsgdb);
161
                    model.addElement(new ListItem(pkginfo, epsgdb));
162
                    if( epsgdb.equals(currentEPSG) ) {
163
                        selectedOption = n;
164
                    }
165
                    n++;
166
                } catch (BaseException ex) {
167
                    logger.warn("Can't load package information from '"+f.getAbsolutePath()+"'.",ex);
168
                }
169
            }
170
        }
171
        this.preferences.lstBBDD.setModel(model);
172
        this.preferences.lstBBDD.setSelectedIndex(selectedOption);
173
        
174
        boolean currentUseChacheForCRSs = BooleanUtils.isTrue(
175
                (Boolean) this.pluginProperties.getDynValue("useMemoryCacheForCRSs")
176
        );
177
        this.preferences.chkUseMomoryChacheForCRSs.setSelected(currentUseChacheForCRSs);
178
        
179
        this.preferences.cboDatabaseInitializationMode.setSelectedIndex( 
180
            (Integer)this.pluginProperties.getDynValue("databaseInitializationMode")
181
        );
182
    }
183
    
184
    private File makeRelative(File parent, File file) {
185
        String parent_path = parent.getAbsolutePath();
186
        if( !parent_path.endsWith(File.separator) ) {
187
            parent_path += File.separator;
188
        }
189
        if( file.getAbsolutePath().startsWith(parent_path) ) {
190
            file = new File(file.getAbsolutePath().substring(parent_path.length()));
191
        }
192
        return file;
193
    }
194

  
195
    private File getCurrentEPSG() {
196
        File dbfolder = CrsFactory.getDataBaseFolder();
197
        File currentEPSG = null;
198
        String s = StringUtils.defaultIfBlank((String) this.pluginProperties.getDynValue("epsgDatabase"),null);
199
        if( s!=null ) {
200
            currentEPSG = new File(s);    
201
            if( !currentEPSG.isAbsolute() ) {
202
                currentEPSG = new File(dbfolder,s);    
203
            }
204
            currentEPSG = makeRelative(dbfolder,currentEPSG);
205
        }
206
        return currentEPSG;
207
    }
208
    
209
    public void initializeDefaults() {
210

  
211
    }
212

  
213
    public ImageIcon getIcon() {
214
        return IconThemeHelper.getImageIcon("jcrs-preferences");
215
    }
216

  
217
    public boolean isValueChanged() {
218
        File currentEPSG = this.getCurrentEPSG();
219
        ListItem item = (ListItem) this.preferences.lstBBDD.getSelectedValue();
220
        if( item == null && currentEPSG == null) {
221
            return false;
222
        }
223
        if( item == null || currentEPSG == null) {
224
            return true;
225
        }
226
        boolean changed = ! currentEPSG.equals(item.getEPSGFile());
227
        if( !changed ) {
228
            boolean currentUseChacheForCRSs = BooleanUtils.isTrue(
229
                (Boolean) this.pluginProperties.getDynValue("useMemoryCacheForCRSs")
230
            );
231
            if( this.preferences.chkUseMomoryChacheForCRSs.isSelected()!=currentUseChacheForCRSs ) {
232
                changed = true;
233
            }
234
        }
235
        if( !changed ) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff