Revision 1111
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.122/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.122/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.122/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.122/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.122/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/buildNumber.properties | ||
---|---|---|
1 |
#Sat May 09 13:54:33 CEST 2020 |
|
2 |
buildNumber=2182 |
|
0 | 3 |
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.122/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.122/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.122/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.122/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.122/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.122/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.122/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.122/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.122/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.122/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.122/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.122/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.122/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.122/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/java/org/gvsig/crs/InitialWarningExtension.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
|
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id: InitialWarningExtension.java 8765 2006-11-15 00:08:29Z jjdelcerro $ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.3.4.1 2006-11-15 00:08:08 jjdelcerro |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.4 2006/10/02 13:52:34 jaume |
|
50 |
* organize impots |
|
51 |
* |
|
52 |
* Revision 1.3 2006/08/29 07:56:27 cesar |
|
53 |
* Rename the *View* family of classes to *Window* (ie: SingletonView to SingletonWindow, ViewInfo to WindowInfo, etc) |
|
54 |
* |
|
55 |
* Revision 1.2 2006/08/29 07:13:53 cesar |
|
56 |
* Rename class com.iver.andami.ui.mdiManager.View to com.iver.andami.ui.mdiManager.IWindow |
|
57 |
* |
|
58 |
* Revision 1.1 2006/05/25 16:27:21 jaume |
|
59 |
* *** empty log message *** |
|
60 |
* |
|
61 |
* |
|
62 |
*/ |
|
63 |
package org.gvsig.crs; |
|
64 |
|
|
65 |
import java.awt.Color; |
|
66 |
import java.awt.Window; |
|
67 |
|
|
68 |
import javax.swing.JButton; |
|
69 |
import javax.swing.JCheckBox; |
|
70 |
import javax.swing.JLabel; |
|
71 |
import javax.swing.JPanel; |
|
72 |
import javax.swing.JWindow; |
|
73 |
import javax.swing.border.TitledBorder; |
|
74 |
|
|
75 |
import org.gvsig.andami.PluginServices; |
|
76 |
import org.gvsig.andami.plugins.Extension; |
|
77 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
|
78 |
|
|
79 |
|
|
80 |
public class InitialWarningExtension extends Extension { |
|
81 |
// public static Preferences fPrefs = Preferences.userRoot().node( "gvsig.initial_warkning" ); |
|
82 |
// private boolean show = fPrefs.getBoolean( "show_panel", true); |
|
83 |
private DlgWaring dlgWarning; |
|
84 |
/** |
|
85 |
* @see org.gvsig.andami.plugins.IExtension#isEnabled() |
|
86 |
*/ |
|
87 |
public boolean isEnabled() { |
|
88 |
return true; |
|
89 |
} |
|
90 |
|
|
91 |
/** |
|
92 |
* @see com.iver.mdiApp.plugins.IExtension#isVisible() |
|
93 |
*/ |
|
94 |
public boolean isVisible() { |
|
95 |
return true; |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* @see org.gvsig.andami.plugins.IExtension#initialize() |
|
100 |
*/ |
|
101 |
public void initialize() { |
|
102 |
dlgWarning = new DlgWaring(); |
|
103 |
dlgWarning.setText(PluginServices.getText(this, "initial_jcrs_warning")); |
|
104 |
dlgWarning.setVisible(true); |
|
105 |
} |
|
106 |
|
|
107 |
/** |
|
108 |
* @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String) |
|
109 |
*/ |
|
110 |
public void execute(String actionCommand) { |
|
111 |
} |
|
112 |
|
|
113 |
private class DlgWaring extends JWindow{ |
|
114 |
|
|
115 |
private JButton btnOk = null; |
|
116 |
private JCheckBox chkBoxShowAgain = null; |
|
117 |
private JLabel lblText = null; |
|
118 |
private JPanel panel=null; |
|
119 |
private JPanel panel2; |
|
120 |
/** |
|
121 |
* This is the default constructor |
|
122 |
*/ |
|
123 |
public DlgWaring() { |
|
124 |
super((Window)PluginServices.getMainFrame()); |
|
125 |
Window window=(Window)PluginServices.getMainFrame(); |
|
126 |
setLocation(window.getWidth()/2+window.getX()-150,window.getHeight()/2+window.getY()-150); |
|
127 |
initialize(); |
|
128 |
this.setAlwaysOnTop(true); |
|
129 |
} |
|
130 |
|
|
131 |
public void setText(String string) { |
|
132 |
lblText.setText(string); |
|
133 |
} |
|
134 |
|
|
135 |
/** |
|
136 |
* This method initializes this |
|
137 |
* |
|
138 |
* @return void |
|
139 |
*/ |
|
140 |
private void initialize() { |
|
141 |
panel=new JPanel(); |
|
142 |
panel.setBackground(Color.black); |
|
143 |
panel.setLayout(null); |
|
144 |
panel.setBounds(0,0,300,300); |
|
145 |
panel2=new JPanel(); |
|
146 |
panel2.setLayout(null); |
|
147 |
panel2.setBounds(2,2,298,298); |
|
148 |
lblText = new JLabel(); |
|
149 |
lblText.setBounds(15, 15, 271, 200); |
|
150 |
lblText.setText("JLabel"); |
|
151 |
lblText.setBorder(new TitledBorder(PluginServices.getText(this, "warning"))); |
|
152 |
panel2.add(lblText); |
|
153 |
panel2.setSize((int)(panel.getSize().getWidth()-4),(int)(panel.getSize().getHeight()-4)); |
|
154 |
panel.add(panel2); |
|
155 |
this.setLayout(null); |
|
156 |
this.setSize(300, 300); |
|
157 |
this.add(getBtnOk(), null); |
|
158 |
// this.add(getChkBoxShowAgain(), null); |
|
159 |
this.add(panel, null); |
|
160 |
} |
|
161 |
|
|
162 |
/** |
|
163 |
* This method initializes btnOk |
|
164 |
* |
|
165 |
* @return javax.swing.JButton |
|
166 |
*/ |
|
167 |
private JButton getBtnOk() { |
|
168 |
if (btnOk == null) { |
|
169 |
btnOk = new JButton(); |
|
170 |
btnOk.setBounds(100, 250, 100, 20); |
|
171 |
btnOk.setText(PluginServices.getText(this, "aceptar")); |
|
172 |
btnOk.addActionListener(new java.awt.event.ActionListener() { |
|
173 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
174 |
dlgWarning.setVisible(false); |
|
175 |
dlgWarning.dispose(); |
|
176 |
// PluginServices.getMDIManager().closeWindow(dlgWarning); |
|
177 |
} |
|
178 |
}); |
|
179 |
} |
|
180 |
return btnOk; |
|
181 |
} |
|
182 |
|
|
183 |
/** |
|
184 |
* This method initializes chkBoxShowAgain |
|
185 |
* |
|
186 |
* @return javax.swing.JCheckBox |
|
187 |
*/ |
|
188 |
// private JCheckBox getChkBoxShowAgain() { |
|
189 |
// if (chkBoxShowAgain == null) { |
|
190 |
// chkBoxShowAgain = new JCheckBox(); |
|
191 |
// chkBoxShowAgain.setBounds(44, 116, 241, 21); |
|
192 |
// chkBoxShowAgain.setSelected(true); |
|
193 |
// chkBoxShowAgain.setText(PluginServices.getText(this, "show_this_dialog_next_startup")); |
|
194 |
// } |
|
195 |
// return chkBoxShowAgain; |
|
196 |
// } |
|
197 |
|
|
198 |
public WindowInfo getWindowInfo() { |
|
199 |
WindowInfo vi = new WindowInfo(WindowInfo.MODALDIALOG); |
|
200 |
vi.setWidth(300+8); |
|
201 |
vi.setHeight(250); |
|
202 |
vi.setTitle(PluginServices.getText(this, "warning")); |
|
203 |
return vi; |
|
204 |
} |
|
205 |
|
|
206 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
207 |
|
|
208 |
} |
|
0 | 209 |
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.122/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/java/org/gvsig/crs/installer/EPSGDatabaseInstaller.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.crs.installer; |
|
25 |
|
|
26 |
import java.io.File; |
|
27 |
import java.io.FileOutputStream; |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStream; |
|
30 |
import java.net.MalformedURLException; |
|
31 |
import java.util.zip.ZipEntry; |
|
32 |
import java.util.zip.ZipException; |
|
33 |
import java.util.zip.ZipInputStream; |
|
34 |
import org.apache.commons.io.FileUtils; |
|
35 |
import org.apache.commons.io.FilenameUtils; |
|
36 |
import org.gvsig.andami.LocaleManager; |
|
37 |
import org.gvsig.andami.PluginServices; |
|
38 |
import org.gvsig.andami.PluginsLocator; |
|
39 |
import org.gvsig.andami.PluginsManager; |
|
40 |
import org.gvsig.crs.CrsFactory; |
|
41 |
import org.gvsig.crs.JCrsExtension; |
|
42 |
import org.gvsig.installer.lib.api.PackageInfo; |
|
43 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
44 |
import org.gvsig.installer.lib.spi.InstallerInfoFileException; |
|
45 |
import org.gvsig.installer.lib.spi.execution.InstallPackageProvider; |
|
46 |
import org.gvsig.tools.ToolsLocator; |
|
47 |
import org.gvsig.tools.dynobject.DynObject; |
|
48 |
import org.gvsig.tools.service.spi.AbstractProvider; |
|
49 |
import org.gvsig.tools.service.spi.ProviderServices; |
|
50 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
51 |
import org.gvsig.tools.task.TaskStatusManager; |
|
52 |
import org.slf4j.Logger; |
|
53 |
import org.slf4j.LoggerFactory; |
|
54 |
|
|
55 |
public class EPSGDatabaseInstaller extends AbstractProvider implements InstallPackageProvider { |
|
56 |
|
|
57 |
private static Logger logger = LoggerFactory.getLogger(EPSGDatabaseInstaller.class); |
|
58 |
|
|
59 |
private int BUFFER = 2048; |
|
60 |
|
|
61 |
public EPSGDatabaseInstaller(ProviderServices providerServices) { |
|
62 |
super(providerServices); |
|
63 |
} |
|
64 |
|
|
65 |
public void install(File applicationFolder, InputStream inputStream, PackageInfo packageInfo) throws InstallPackageServiceException { |
|
66 |
PluginsManager pluginsManager = PluginsLocator.getManager(); |
|
67 |
File i18nFolder = pluginsManager.getApplicationI18nFolder(); |
|
68 |
|
|
69 |
File epsgDatabaseFolder = new File(CrsFactory.getDataBaseFolder(),"EPSG"); |
|
70 |
|
|
71 |
logger.info("Installing package '" + packageInfo.getCode() + "' in '" + epsgDatabaseFolder.getAbsolutePath() + "'."); |
|
72 |
try { |
|
73 |
FileUtils.forceMkdir(epsgDatabaseFolder); |
|
74 |
decompress(inputStream, epsgDatabaseFolder); |
|
75 |
activateThisDataBase(packageInfo); |
|
76 |
} catch (Exception e) { |
|
77 |
try { |
|
78 |
logger.warn("Can install package '" + packageInfo.getCode() + "'.", e); |
|
79 |
// if there is an exception, installLater is called |
|
80 |
installLater(applicationFolder, inputStream, packageInfo); |
|
81 |
} catch (IOException e1) { |
|
82 |
logger.warn("Can install package '" + packageInfo.getCode() + "'.", e1); |
|
83 |
throw new InstallPackageServiceException(e1); |
|
84 |
} |
|
85 |
} |
|
86 |
|
|
87 |
} |
|
88 |
|
|
89 |
private void activateThisDataBase(PackageInfo packageInfo) { |
|
90 |
String dbentry = "EPSG/" + packageInfo.getCode() + "/EPSG.sql"; |
|
91 |
File f = new File(CrsFactory.getDataBaseFolder(),dbentry); |
|
92 |
if( !f.exists() ) { |
|
93 |
logger.warn("Can't activate EPSG database, problems locating in '"+f.getAbsolutePath()+"'."); |
|
94 |
return; |
|
95 |
} |
|
96 |
PluginsManager pluginManager = PluginsLocator.getManager(); |
|
97 |
PluginServices plugin = pluginManager.getPlugin(this); |
|
98 |
DynObject pluginProperties = plugin.getPluginProperties(); |
|
99 |
|
|
100 |
pluginProperties.setDynValue("epsgDatabase", dbentry); |
|
101 |
plugin.savePluginProperties(); |
|
102 |
} |
|
103 |
|
|
104 |
private void decompress(InputStream inputStream, File folder) |
|
105 |
throws ZipException, IOException, InstallerInfoFileException { |
|
106 |
|
|
107 |
ZipInputStream zis = null; |
|
108 |
ZipEntry entry = null; |
|
109 |
byte data[] = new byte[BUFFER]; |
|
110 |
int count = 0; |
|
111 |
|
|
112 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
113 |
SimpleTaskStatus taskStatus = manager.createDefaultSimpleTaskStatus("Uncompressing..."); |
|
114 |
|
|
115 |
manager.add(taskStatus); |
|
116 |
String entryName = "(header)"; |
|
117 |
try { |
|
118 |
long readed = 0; |
|
119 |
zis = new ZipInputStream(inputStream); |
|
120 |
while ( (entry = zis.getNextEntry()) != null ) { |
|
121 |
entryName = FilenameUtils.separatorsToSystem(entry.getName()); |
|
122 |
taskStatus.message(entryName); |
|
123 |
|
|
124 |
File file = new File(folder, entryName); |
|
125 |
if ( entry.isDirectory() ) { |
|
126 |
file.mkdirs(); |
|
127 |
} else { |
|
128 |
if ( file.exists() ) { |
|
129 |
FileUtils.forceDelete(file); |
|
130 |
} |
|
131 |
if ( !file.getParentFile().exists() ) { |
|
132 |
FileUtils.forceMkdir(file.getParentFile()); |
|
133 |
} |
|
134 |
logger.debug("extracting " + file.getAbsolutePath()); |
|
135 |
FileOutputStream fos = new FileOutputStream(file); |
|
136 |
while ( (count = zis.read(data, 0, BUFFER)) != -1 ) { |
|
137 |
fos.write(data, 0, count); |
|
138 |
readed += count; |
|
139 |
taskStatus.setCurValue(readed); |
|
140 |
} |
|
141 |
fos.flush(); |
|
142 |
fos.close(); |
|
143 |
} |
|
144 |
} |
|
145 |
zis.close(); |
|
146 |
} catch (IOException ex) { |
|
147 |
logger.warn("Problems uncompresing 'EPSG database' (last entry '" + entryName + "'.", ex); |
|
148 |
throw ex; |
|
149 |
|
|
150 |
} catch (RuntimeException ex) { |
|
151 |
logger.warn("Problems uncompresing 'EPSG database' (last entry '" + entryName + "'.", ex); |
|
152 |
throw ex; |
|
153 |
|
|
154 |
} finally { |
|
155 |
taskStatus.remove(); |
|
156 |
|
|
157 |
} |
|
158 |
} |
|
159 |
|
|
160 |
public void installLater(File applicationDirectory, InputStream inputStream, PackageInfo packageInfo) throws InstallPackageServiceException, IOException { |
|
161 |
logger.warn("installLater is not implementes."); |
|
162 |
} |
|
163 |
} |
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.122/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/java/org/gvsig/crs/installer/EPSGDatabaseInstallerFactory.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.crs.installer; |
|
25 |
|
|
26 |
import java.io.File; |
|
27 |
import java.io.IOException; |
|
28 |
import org.apache.commons.io.FileUtils; |
|
29 |
import org.gvsig.andami.PluginServices; |
|
30 |
import org.gvsig.andami.PluginsLocator; |
|
31 |
import org.gvsig.andami.PluginsManager; |
|
32 |
import org.gvsig.crs.CrsFactory; |
|
33 |
import org.gvsig.crs.JCrsExtension; |
|
34 |
import org.gvsig.installer.lib.api.InstallerLocator; |
|
35 |
import org.gvsig.installer.lib.api.InstallerManager; |
|
36 |
import org.gvsig.installer.lib.spi.InstallerProviderLocator; |
|
37 |
import org.gvsig.tools.ToolsLocator; |
|
38 |
import org.gvsig.tools.dynobject.DynClass; |
|
39 |
import org.gvsig.tools.dynobject.DynObject; |
|
40 |
import org.gvsig.tools.dynobject.DynObjectManager; |
|
41 |
import org.gvsig.tools.service.spi.AbstractProviderFactory; |
|
42 |
import org.gvsig.tools.service.spi.Provider; |
|
43 |
import org.gvsig.tools.service.spi.ProviderManager; |
|
44 |
import org.gvsig.tools.service.spi.ProviderServices; |
|
45 |
import org.slf4j.Logger; |
|
46 |
import org.slf4j.LoggerFactory; |
|
47 |
|
|
48 |
public class EPSGDatabaseInstallerFactory extends |
|
49 |
AbstractProviderFactory { |
|
50 |
|
|
51 |
private static final Logger logger = LoggerFactory.getLogger(EPSGDatabaseInstallerFactory.class); |
|
52 |
|
|
53 |
public static final String PROVIDER_NAME = "jCRS_EPSG"; |
|
54 |
public static final String PROVIDER_DESCRIPTION = "EPSG database installer for jCRS"; |
|
55 |
|
|
56 |
private DynClass dynclass; |
|
57 |
|
|
58 |
@Override |
|
59 |
protected DynClass createParametersDynClass() { |
|
60 |
if ( dynclass == null ) { |
|
61 |
initialize(); |
|
62 |
} |
|
63 |
return dynclass; |
|
64 |
} |
|
65 |
|
|
66 |
@Override |
|
67 |
protected Provider doCreate(DynObject parameters, ProviderServices services) { |
|
68 |
return new EPSGDatabaseInstaller(services); |
|
69 |
} |
|
70 |
|
|
71 |
public void initialize() { |
|
72 |
if ( dynclass == null ) { |
|
73 |
DynObjectManager dynObjectManager = ToolsLocator |
|
74 |
.getDynObjectManager(); |
|
75 |
dynclass = dynObjectManager.createDynClass(PROVIDER_NAME, |
|
76 |
PROVIDER_DESCRIPTION); |
|
77 |
dynObjectManager.add(dynclass); |
|
78 |
} |
|
79 |
} |
|
80 |
|
|
81 |
|
|
82 |
public static void registerEPSGDatabaseInstaller() { |
|
83 |
|
|
84 |
InstallerManager installerManager = InstallerLocator.getInstallerManager(); |
|
85 |
ProviderManager providerManager = InstallerProviderLocator.getProviderManager(); |
|
86 |
PluginsManager pluginsManager = PluginsLocator.getManager(); |
|
87 |
|
|
88 |
providerManager.addProviderFactory(new EPSGDatabaseInstallerFactory()); |
|
89 |
|
|
90 |
File epsgDatabaseFolder = new File(CrsFactory.getDataBaseFolder(),"EPSG"); |
|
91 |
|
|
92 |
try { |
|
93 |
FileUtils.forceMkdir(epsgDatabaseFolder); |
|
94 |
} catch (IOException ex) { |
|
95 |
logger.warn("Can't create EPSG databases folder in '"+epsgDatabaseFolder.getAbsolutePath()+"'.",ex); |
|
96 |
} |
|
97 |
installerManager.setDefaultLocalAddonRepository(epsgDatabaseFolder, PROVIDER_NAME); |
|
98 |
} |
|
99 |
} |
org.gvsig.projection.jcrs/tags/org.gvsig.projection.jcrs-2.1.122/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/java/org/gvsig/crs/JCrsExtension.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Información Geográfica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ibáñez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha |
|
34 |
* Campus Universitario s/n |
|
35 |
* 02071 Alabacete |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 967 599 200 |
|
39 |
*/ |
|
40 |
|
|
41 |
|
|
42 |
package org.gvsig.crs; |
|
43 |
|
|
44 |
import org.gvsig.andami.IconThemeHelper; |
|
45 |
import org.gvsig.andami.plugins.Extension; |
|
46 |
import org.gvsig.app.gui.panels.CRSSelectPanelFactory; |
|
47 |
import org.gvsig.crs.gui.panels.CrsUIFactory; |
|
48 |
import org.gvsig.crs.gui.panels.ProjChooserPanel; |
|
49 |
import org.gvsig.crs.preferences.JCRSPreferencesPage; |
|
50 |
import org.gvsig.tools.ToolsLocator; |
|
51 |
import org.gvsig.tools.dynobject.DynObject; |
|
52 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
53 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
54 |
|
|
55 |
public class JCrsExtension extends Extension { |
|
56 |
//private final static Logger logger = LoggerFactory.getLogger(JCrsExtension.class); |
|
57 |
|
|
58 |
@Override |
|
59 |
public void initialize() { |
|
60 |
|
|
61 |
CRSSelectPanelFactory.registerPanelClass(ProjChooserPanel.class); |
|
62 |
CRSSelectPanelFactory.registerUIFactory(CrsUIFactory.class); |
|
63 |
|
|
64 |
IconThemeHelper.registerIcon("preferences", "jcrs-preferences", this); |
|
65 |
|
|
66 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
|
67 |
ExtensionPoint ep = extensionPoints.add("AplicationPreferences", ""); |
|
68 |
ep.append("jCRS", "", new JCRSPreferencesPage()); |
|
69 |
|
|
70 |
} |
|
71 |
|
|
72 |
|
|
73 |
@Override |
|
74 |
public void execute(String actionCommand) { |
|
75 |
|
|
76 |
} |
Also available in: Unified diff