Revision 25048

View differences:

tags/tmp_build/extensions/extSextanteGvsigBindings/build.xml
1
<project name="" default="generate-without-source" basedir=".">
2
    <description>
3
    </description>
4

  
5
	<import file="../binaries/ant/utilities.xml"/>
6
  <!-- set global properties for this build -->
7
  <property name="extensions-dir" location="../_fwAndami/gvSIG/extensiones"/>
8
  <property name="gvSIG-lib-dir" location="${extensions-dir}/com.iver.cit.gvsig/lib"/>
9
  <property name="src" location="src"/>
10
  <property name="bin" location="bin"/>
11
  <property name="doc"  location="doc"/>
12
  <property name="dist"  location="dist-tmp"/>
13
  <property name="build" location="bin"/>
14
  <property name="without_src"  location="without_src"/>
15
  <property name="plugin" value="es.unex.sextante"/>
16
  <property name="andami"  location="../_fwAndami/lib"/>
17
  <property name="fmap"  location="../libFMap/lib"/>
18

  
19
  <target name="init">
20
	<mkdir dir="${bin}"/>
21
	<mkdir dir="${dist}" />
22
  </target>
23

  
24
  <target name="generate-without-source"
25
	  		description="generate the distribution without the source file"
26
	  	depends="init,create-jar,copy-data-files,copy-to-andami,clean-dist">
27

  
28
  </target>
29

  
30
  <target name="create-jar">
31
  	<jar jarfile="${dist}/${plugin}.jar" basedir="${bin}"/>
32
  </target>
33

  
34
  <target name="fix-jama">
35
  	<echo> ARREGLAR JAMA!!!!!</echo>
36

  
37
  </target>
38

  
39
  <target name="copy-data-files">
40
    <copy todir="${dist}">
41
    	<fileset dir="config/" includes="*"/>
42
    </copy>
43
    <copy todir="${dist}/images">
44
    	<fileset dir="images" includes="**"/>
45
    </copy>
46
  	<!-- OJO -->
47
  	<copy todir="${dist}" overwrite="true">
48
  	   <fileset dir="./sextante" includes="**" />
49
    </copy>
50

  
51

  
52
  </target>
53

  
54
  <target name="copy-to-andami">
55
    <copy todir="${extensions-dir}/${plugin}/">
56
    	<fileset dir="${dist}" includes="**/**"/>
57
    </copy>
58
  	<!--<copy todir="${gvSIG-lib-dir}" overwrite="true">
59
  	   <fileset dir="./sextante" includes="**" />
60
    </copy>-->
61

  
62
  </target>
63

  
64
  <target name="clean-dist">
65
	<delete dir="${dist}"></delete>
66
  </target>
67

  
68
  <target name="clean" description="clean up" >
69
    <!-- Delete the ${build} and ${dist} directory trees -->
70
	<delete dir="${dist}"/>
71
	<delete dir="${build}"/>
72
  </target>
73

  
74

  
75
	<target name="batch-build"
76
			description="compile the sources, create the jar file"
77
			depends="init,compile,create-jar,copy-data-files,copy-to-andami">
78
	</target>
79

  
80
	<target name="compile" description="compile the source" >
81
		<antcall target="gvSIG-import-build-number"/>
82
		<!-- Compile the Java code from ${src} to ${build} -->
83
		<mkdir dir="${build}" />
84
		<loadEclipseClasspath project="${basedir}"/>
85
		<gvSIG-javac
86
			classpath="${eclipseClasspath}"
87
		/>
88
	</target>
89

  
90
	<target name="run-tests" depends="batch-build,compile-tests">
91
		<antcall target="generic-run-tests">
92
			<param name="TestSuite.Name" value="org.gvsig.remoteClient.AllTests"/>
93
		</antcall>
94
	</target>
95

  
96
	<!-- lo que habia antes -->
97
  <target name="generate-without-source-old"
98
  	description="generate the distribution without the source file">
99
    <!-- Create the distribution directory -->
100
    <mkdir dir="${without_src}"/>
101

  
102
    <jar jarfile="${without_src}/${plugin}.jar" basedir="${bin}"/>
103

  
104
    <delete file="${gvSIG-lib-dir}/jama.jar"/>
105

  
106
    <copy todir="${without_src}">
107
    	<fileset dir="config/" includes="*"/>
108
    </copy>
109
    <copy todir="${without_src}/images">
110
    	<fileset dir="images" includes="**"/>
111
    </copy>
112
    <move todir="${extensions-dir}/${plugin}/">
113
    	<fileset dir="${without_src}" includes="**/**"/>
114
    </move>
115
  	<copy todir="${gvSIG-lib-dir}" overwrite="true">
116
  	   <fileset dir="./sextante" includes="**" />
117
    </copy>
118
  </target>
119

  
120
</project>
tags/tmp_build/extensions/extSextanteGvsigBindings/.classpath
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5
	<classpathentry combineaccessrules="false" kind="src" path="/_fwAndami"/>
6
	<classpathentry combineaccessrules="false" kind="src" path="/appgvSIG"/>
7
	<classpathentry combineaccessrules="false" kind="src" path="/libFMap"/>
8
	<classpathentry kind="lib" path="/libFMap/lib/driver-manager-1.1.jar" sourcepath="/libDriverManager"/>
9
	<classpathentry kind="lib" path="/libFMap/lib/gdbms-0.8-SNAPSHOT.jar" sourcepath="/libGDBMS"/>
10
	<classpathentry kind="lib" path="/_fwAndami/lib/iver-utiles.jar" sourcepath="/libIverUtiles/src"/>
11
	<classpathentry kind="lib" path="lib/jts-1.9.jar"/>
12
	<classpathentry combineaccessrules="false" kind="src" path="/extRasterTools-SE"/>
13
	<classpathentry combineaccessrules="false" kind="src" path="/libRaster"/>
14
	<classpathentry kind="lib" path="/libFMap/lib/org.cresques.cts.jar" sourcepath="/libProjection/src"/>
15
	<classpathentry combineaccessrules="false" kind="src" path="/libExceptions"/>
16
	<classpathentry kind="lib" path="sextante/sextante_gui-0.1.jar" sourcepath="/sextante_gui"/>
17
	<classpathentry kind="lib" path="sextante/sextante-0.1.jar"/>
18
	<classpathentry kind="output" path="bin"/>
19
</classpath>
tags/tmp_build/extensions/extSextanteGvsigBindings/dist/build.xml
1
<project name="instalador-gvSIG" default="distribution" basedir=".">
2

  
3
	  <target name="generate-without-source"
4
	    description="generate the distribution without the source file">
5
	    <mkdir dir="tmp"/>
6
	  	<mkdir dir="tmp/es.unex.sextante"/>
7
	  	<mkdir dir="tmp/es.unex.sextante/images"/>
8
	  	<mkdir dir="tmp/com.iver.cit.gvsig/lib"/>
9

  
10
	    <jar jarfile="tmp/es.unex.sextante/sextante_gvsig-0.1.jar" basedir="../bin"/>
11

  
12
	    <copy todir="tmp/es.unex.sextante">
13
	        <fileset dir="../config/" includes="*"/>
14
	    </copy>
15
	    <copy todir="tmp/es.unex.sextante/images">
16
	        <fileset dir="../images" includes="**"/>
17
	    </copy>
18
        <copy todir="tmp/com.iver.cit.gvsig/lib">
19
            <fileset dir="../../dist/">
20
            	<include name="**"/>
21
            	<exclude name="bsh*.*" />
22
            </fileset>
23
        </copy>
24
	  </target>
25

  
26
	<target name="distribution" depends="generate-without-source">
27
		<zip destfile="sextante_gvsig-0.1.zip"
28
		         update="false">
29
		    	<fileset dir="tmp">
30
				    <include name="**"/>
31
	 			</fileset>
32
		    </zip>
33
		<delete>
34
			   <fileset dir="tmp">
35
			    <include name="**"/>
36
	      </fileset>
37
	      </delete>
38

  
39
		</target>
40

  
41

  
42
</project>
tags/tmp_build/extensions/extSextanteGvsigBindings/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>extSextanteGvsigBindings</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
	</buildSpec>
14
	<natures>
15
		<nature>org.eclipse.jdt.core.javanature</nature>
16
	</natures>
17
</projectDescription>
tags/tmp_build/extensions/extSextanteGvsigBindings/config/about.htm
1
<html>
2
  <head>
3
    <title>Extesi?n del Piloto de Raster</title>
4
    <meta content="">
5
    <style></style>
6
  </head>
7
  <body>
8
<table width="45%" border="0">
9
  <tr>
10
    <td width="44%"><img src="logos.jpg" width="226" height="70"></td>
11
    <td width="56%"> 
12
      <div align="right"><img src="sextante.png" width="298" height="77"></div>
13
    </td>
14
  </tr>
15
  <tr>
16
    <td colspan="2"><font face="Geneva, Arial, Helvetica, san-serif">&copy; Junta 
17
      de Extremadura, 2007</font></td>
18
  </tr>
19
</table>
20
  
21
<h3><font face="Geneva, Arial, Helvetica, san-serif">Extensiones de an&aacute;lisis 
22
  SEXTANTE</font></h3>
23
<p><font face="Geneva, Arial, Helvetica, san-serif">Funcionalidades de an&aacute;lisis 
24
  para gvSIG.</font></p>
25
<p><font face="Geneva, Arial, Helvetica, san-serif">Un desarrollo de Victor Olaya 
26
  (UNEX) para la Junta de Extremadura.</font></p>
27
<p><font face="Geneva, Arial, Helvetica, san-serif">Un proyecto coordinado por 
28
  Juan Carlos Gim&eacute;nez (UNEX)</font></p>
29
<p><font face="Geneva, Arial, Helvetica, san-serif">M&aacute;s informaci&oacute;n 
30
  y actualizaciones en la direccion web</font></p>
31
<p align="left"><font face="Geneva, Arial, Helvetica, san-serif"><a href="http://www.sextantegis.com"> 
32
  http://www.sextantegis.org</a></font></p>
33
<p>&nbsp;</p>
34
<p><br><br><b> Build Number: #build.number#</b></p>
35
</body>
36
</html>
tags/tmp_build/extensions/extSextanteGvsigBindings/config/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
    <depends plugin-name="com.iver.cit.gvsig"/>
4
    <libraries library-dir="."/>
5
	<extensions>
6
		<extension class-name="es.unex.sextante.gvsig.extensions.SextanteToolboxExtension"
7
			description="Herramientas_SEXTANTE"
8
			active="true">
9
			<tool-bar name="SEXTANTE" position="1">
10
				<action-tool icon="images/sextante.gif" tooltip="Herramientas_SEXTANTE" position="1"/>
11
			</tool-bar>
12
		</extension>
13
		 <extension class-name="es.unex.sextante.gvsig.extensions.SextanteModelerExtension"
14
            description="Modelizador"
15
            active="true">
16
            <tool-bar name="SEXTANTE" position="2">
17
                <action-tool icon="images/model.png" tooltip="Modelizador" position="2"/>
18
            </tool-bar>
19
        </extension>
20

  
21
		 <extension class-name="es.unex.sextante.gvsig.extensions.SextanteHistoryExtension"
22
            description="Historial"
23
            active="true">
24
            <tool-bar name="SEXTANTE" position="2">
25
                <action-tool icon="images/history.gif" tooltip="Historial" position="4"/>
26
            </tool-bar>
27
        </extension>
28
         <extension class-name="es.unex.sextante.gvsig.extensions.SextanteCommandLineExtension"
29
            description="Linea_comandos"
30
            active="true">
31
            <tool-bar name="SEXTANTE" position="2">
32
                <action-tool icon="images/terminal.png" tooltip="Linea_comandos" position="3"/>
33
            </tool-bar>
34
        </extension>
35
        <extension class-name="es.unex.sextante.gvsig.extensions.SextanteAdditionalResultsExtension"
36
            description="Resultados"
37
            active="true">
38
            <tool-bar name="SEXTANTE" position="2">
39
                <action-tool icon="images/chart.gif" tooltip="Resultados" position="5"/>
40
            </tool-bar>
41
        </extension>
42
        <extension class-name="es.unex.sextante.gvsig.extensions.SextanteAboutExtension"
43
		   description=""
44
		   active="true">
45
        </extension>
46
	</extensions>
47
</plugin-config>
tags/tmp_build/extensions/extSextanteGvsigBindings/Notas-instalacion
1
Esta extensión es necesaria para hacer de puente entre gvSIG y SEXTANTE. 
2

  
3
Los jar de los algoritmos están incluidos en el directorio sextante y se instalarán en gvSIG 
4
al ejecutar el build. Para acceder a nuevas versiones de SEXTANTE hay que acceder a los fuentes
5
a través de
6

  
7
svn checkout https://svn.forge.osor.eu/svn/sextante
8

  
9
y compilarlos. Una vez obtenidos los nuevos jar hay que dejarlos en la carpeta dist y ejecutar
10
el build de este proyecto.
11

  
12
Notas
13
Es necesario JTS 1.9 por lo que hay que eliminar versiones anteriores
14
La librería Jama está incluida en el jar de libMath por lo que hay que eliminarla si está incluida
15
en gvSIG.
tags/tmp_build/extensions/extSextanteGvsigBindings/build.number
1
#Build Number for ANT. Do not edit!
2
#Mon Nov 03 17:19:48 CET 2008
3
build.number=1216
tags/tmp_build/extensions/extSextanteGvsigBindings/install/resources/leeme.htm
1
<html>
2
  <head>
3
    <title>SEXTANTE</title>
4
    <meta content="">
5
    <style></style>
6
  </head>
7
  <body>
8
<table width="400" border="0" cellspacing="0" cellpadding="0">
9
  <tr>
10
    <td>
11
      <h3><font face="Geneva, Arial, Helvetica, san-serif">Extensiones de an&aacute;lisis
12
        SEXTANTE</font></h3>
13
      <p><font face="Geneva, Arial, Helvetica, san-serif">&copy; Junta de Extremadura,
14
        2008</font></p>
15
      <p><font face="Geneva, Arial, Helvetica, san-serif">Funcionalidades de an&aacute;lisis
16
        raster y vectorial para gvSIG.</font></p>
17
      <p><font face="Geneva, Arial, Helvetica, san-serif">Se requiere gvSIG v1.1
18
         para un correcto funcionamiento de estas extensiones.</font></p>
19
      <p><font face="Geneva, Arial, Helvetica, san-serif">M&aacute;s informaci&oacute;n
20
        y actualizaciones en la direccion web</font></p>
21
      <p align="left"><font face="Geneva, Arial, Helvetica, san-serif"><a href="http://www.sextantegis.com">
22
        http://www.sextantegis.com</a></font></p>
23
</td>
24
  </tr>
25
</table>
26
<h3>&nbsp;</h3>
27
<p>&nbsp;</p>
28
</body>
29
</html>
tags/tmp_build/extensions/extSextanteGvsigBindings/install/resources/gpl.txt
1
	GNU GENERAL PUBLIC LICENSE
2
	Version 2, June 1991
3

  
4
	 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
5

  
6
		Preamble
7

  
8
	The licenses for most software are designed to take away your freedom to share and change it.  By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.  This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it.  (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.)  You can apply it to your programs, too.
9

  
10
	When we speak of free software, we are referring to freedom, not price.  Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
11

  
12
	To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
13

  
14
	For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have.  You must make sure that they, too, receive or can get the source code.  And you must show them these terms so they know their
15
rights.
16

  
17
	We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
18

  
19
	Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software.  If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
20

  
21
	Finally, any free program is threatened constantly by software	patents.  We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary.  To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
22

  
23
	The precise terms and conditions for copying, distribution and modification follow.
24

  
25
				GNU GENERAL PUBLIC LICENSE
26
	TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
27

  
28
	0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License.  The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.  (Hereinafter, translation is included without limitation in the term "modification".)  Each licensee is addressed as "you".
29

  
30
	Activities other than copying, distribution and modification are not covered by this License; they are outside its scope.  The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
31

  
32
1.	You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
33

  
34
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
35

  
36
2.	You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
37

  
38
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
39

  
40
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
41

  
42
c)	If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.  (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
43

  
44
These requirements apply to the modified work as a whole.  If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works.  But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
45

  
46
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
47

  
48
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
49

  
50
3.	You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
51

  
52
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
53

  
54
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
55

  
56
c)	Accompany it with the information you received as to the offer to distribute corresponding source code.  (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
57

  
58
The source code for a work means the preferred form of the work for making modifications to it.  For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable.  However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
59

  
60
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
61

  
62
4.	You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License.  Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License.
63
However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
64

  
65
5.	You are not required to accept this License, since you have not signed it.  However, nothing else grants you permission to modify or distribute the Program or its derivative works.  These actions are prohibited by law if you do not accept this License.  Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
66

  
67
6.	Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions.  You may not impose any further restrictions on the recipients' exercise of the rights granted herein.
68
You are not responsible for enforcing compliance by third parties to this License.
69

  
70
7.	If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License.  If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all.  For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
71

  
72
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
73

  
74
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices.  Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
75

  
76
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
77

  
78
8.	If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded.  In such case, this License incorporates the limitation as if written in the body of this License.
79

  
80
9.	The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time.  Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
81

  
82
Each version is given a distinguishing version number.  If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation.  If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
83

  
84
10.	If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission.  For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this.  Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
85

  
86
NO WARRANTY
87

  
88
11.	BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
89

  
90
12.	IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
91

  
92
END OF TERMS AND CONDITIONS
93

  
94
How to Apply These Terms to Your New Programs
95

  
96
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
97

  
98
To do so, attach the following notices to the program.  It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
99

  
100
<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year>  <name of author>
101

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

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

  
106
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
107

  
108

  
109
Also add information on how to contact you by electronic and paper mail.
110

  
111
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
112

  
113
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
114
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
115

  
116
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License.  Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
117

  
118
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary.  Here is a sample; alter the names:
119

  
120
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
121

  
122
<signature of Ty Coon>, 1 April 1989
123
Ty Coon, President of Vice
124

  
125
This General Public License does not permit incorporating your program into proprietary programs.  If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library.  If this is what you want to do, use the GNU Library General Public License instead of this License.
tags/tmp_build/extensions/extSextanteGvsigBindings/install/resources/userInputLang.xml_spa
1
<langpack>
2
  <str id="text.label" txt="Ruta a gvSIG:"/>
3
</langpack>
tags/tmp_build/extensions/extSextanteGvsigBindings/install/resources/readme.htm
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html>
3
<head>
4

  
5

  
6

  
7
  <title>SEXTANTE</title>
8
  <meta content="">
9

  
10

  
11
  <style></style>
12
</head>
13

  
14
  <body>
15
<table border="0" cellpadding="0" cellspacing="0" width="400">
16
  <tbody>
17
    <tr>
18
      <td>
19
      <h3><font face="Geneva, Arial, Helvetica, san-serif">SEXTANTE</font></h3>
20

  
21

  
22
      <p><font face="Geneva, Arial, Helvetica, san-serif">&copy; Junta de Extremadura,
23
        2008</font></p>
24

  
25

  
26
      <p><font face="Geneva, Arial, Helvetica, san-serif">Raster and vector analysis capabilities for gvSIG.</font></p>
27

  
28

  
29
      <p><font face="Geneva, Arial, Helvetica, san-serif">gvSIG v1.1
30
         or higher is required&nbsp;</font></p>
31

  
32

  
33
      <p><font face="Geneva, Arial, Helvetica, san-serif">Updates and additional information at</font></p>
34

  
35

  
36
      <p align="left"><font face="Geneva, Arial, Helvetica, san-serif"><a href="http://www.sextantegis.com">
37
        http://www.sextantegis.com</a></font></p>
38

  
39
      </td>
40

  
41
  </tr>
42

  
43
  </tbody>
44
</table>
45

  
46
<h3>&nbsp;</h3>
47

  
48
<p>&nbsp;</p>
49

  
50
</body>
51
</html>
tags/tmp_build/extensions/extSextanteGvsigBindings/install/resources/userInputLang.xml_eng
1
<langpack>
2
  <str id="text.label" txt="Path to gvSIG:"/>
3
  <str id="HTMLInfoPanel.info" src="resources/readme.htm"/>
4
</langpack>
tags/tmp_build/extensions/extSextanteGvsigBindings/install/resources/userInputSpec.xml
1
<userInput>
2
	<panel order="0">
3
		<field 	type="search" 
4
				variable="INSTALL_PATH"
5
				size="45">
6
  			<description align="left" />
7
  			<spec 	txt="Path to gvSIG:" 
8
		  			id="text.label"
9
  					checkfilename="bin/andami.jar"
10
        			type="directory" 
11
        			result="directory">
12
  			<choice value="/usr/local/gvSIG_1.1" os="unix" />
13
  			<choice value="/opt/gvSIG_1.1" os="unix" />
14
  			<choice value="$USER_HOME/gvSIG_1.1" os="unix" />
15
  			<choice value="C:\Archivos de Programa\gvSIG_1.1" os="windows" />
16
  			<choice value="C:\Program Files\gvSIG_1.1" os="windows" />
17
  			</spec>
18
		</field>
19
	</panel>
20
</userInput>
21

  
tags/tmp_build/extensions/extSextanteGvsigBindings/install/build.xml
1
<project name="instalador-gvSIG" default="distribution" basedir=".">
2

  
3
	<property name="base_dir" location="./"/>
4
	<property name="dir_libs" location="/home/volaya/soft/izpack/lib"/>
5
	<property name="vers" location="0.6"/>
6
	<property name="izpack_dir" location="/home/volaya/soft/izpack"/>
7

  
8
	<taskdef name="izpack" classpath="${dir_libs}/compiler.jar" classname="com.izforge.izpack.ant.IzPackTask"/>
9

  
10
	<target name="distribution"
11
		depends="generate-without-source">
12
	</target>
13

  
14
	<target name="generate-without-source">
15
		<izpack input="install.xml"
16
				output="sextante_gvsig_installer-0.1"
17
				installerType="standard"
18
				basedir="${base_dir}"
19
				izPackDir="${izpack_dir}/"/>
20
	</target>
21

  
22
</project>
tags/tmp_build/extensions/extSextanteGvsigBindings/install/install.xml
1
<installation version="1.0">
2
	<info>
3
		<appname>SEXTANTE</appname>
4
		<appversion>0.52</appversion>
5
		<authors>
6
			<author name="Junta de Extremadura. Consejería de Industria, Energía y Medio Ambiente" email="" />
7
		</authors>
8
		<url>http://www.sextantegis.com/</url>
9
		<javaversion>1.5</javaversion>
10
	</info>
11

  
12
	<guiprefs height="430" resizable="no" width="800">
13
		<laf name="liquid">
14
			<os family="unix" />
15
		</laf>
16
		<laf name="liquid">
17
			<os family="windows" />
18
		</laf>
19
	</guiprefs>
20

  
21
	<locale>
22
		<langpack iso3="spa"/>
23
		<langpack iso3="eng"/>
24
	</locale>
25

  
26
	<resources>
27
		<res src="resources/gpl.txt" id="LicencePanel.licence"/>
28
		<res src="resources/readme.htm" id="HTMLInfoPanel.info_eng"/>
29
		<res src="resources/leeme.htm" id="HTMLInfoPanel.info_spa"/>
30
		<res src="resources/images/Logo_sextante.jpg" id="Installer.image"/>
31
		<res src="resources/userInputSpec.xml" id="userInputSpec.xml"/>
32
        <parsable os="linux" targetfile="resources/userInputSpec.xml"/>
33
        <res src="resources/userInputLang.xml_spa" id="userInputLang.xml_spa" />
34
        <res src="resources/userInputLang.xml_eng" id="userInputLang.xml_eng" />
35
	</resources>
36

  
37
	<panels>
38
		<panel classname="HTMLInfoPanel"/>
39
		<panel classname="LicencePanel"/>
40
		<panel classname="UserInputPanel"/>
41
		<panel classname="InstallPanel"/>
42
		<panel classname="SimpleFinishPanel"/>
43
	</panels>
44

  
45
	<packs>
46

  
47
		<pack name="Sextante" required="yes">
48
			<description>Sextante</description>
49
			<file targetdir="$INSTALL_PATH/bin/gvSIG/extensiones/" src="../../_fwAndami/gvSIG/extensiones/es.unex.sextante" override="true"/>
50
			<fileset targetdir="$INSTALL_PATH/bin/gvSIG/extensiones/com.iver.cit.gvsig/lib" dir="../../dist" override="true">
51
                <include name="**"/>
52
                <exclude name="bsh*.*" />
53
            </fileset>
54
		</pack>
55

  
56
	</packs>
57

  
58
</installation>
59

  
tags/tmp_build/extensions/extSextanteGvsigBindings/src/es/unex/sextante/gvsig/core/DataTools.java
1
package es.unex.sextante.gvsig.core;
2

  
3
import java.sql.Types;
4
import java.util.Date;
5

  
6
import com.hardcode.gdbms.engine.values.BooleanValue;
7
import com.hardcode.gdbms.engine.values.DateValue;
8
import com.hardcode.gdbms.engine.values.DoubleValue;
9
import com.hardcode.gdbms.engine.values.FloatValue;
10
import com.hardcode.gdbms.engine.values.IntValue;
11
import com.hardcode.gdbms.engine.values.LongValue;
12
import com.hardcode.gdbms.engine.values.StringValue;
13
import com.hardcode.gdbms.engine.values.Value;
14
import com.hardcode.gdbms.engine.values.ValueFactory;
15

  
16
public class DataTools {
17

  
18
	public static int[] getgvSIGTypes(Class[] types) {
19

  
20
		int iTypes[] = new int[types.length];
21
		for (int i = 0; i < types.length; i++) {
22
			if (types[i].equals(Integer.class)){
23
				iTypes[i] = Types.INTEGER;
24
			}
25
			else if (types[i].equals(Double.class)){
26
				iTypes[i] = Types.DOUBLE;
27
			}
28
			else if (types[i].equals(Long.class)){
29
				iTypes[i] = Types.BIGINT;
30
			}
31
			else if (types[i].equals(Float.class)){
32
				iTypes[i] = Types.FLOAT;
33
			}
34
			else if (types[i].equals(String.class)){
35
				iTypes[i] = Types.CHAR;
36
			}
37
			else if (types[i].equals(Date.class)){
38
				iTypes[i] = Types.DATE;
39
			}
40
			else if (types[i].equals(Boolean.class)){
41
				iTypes[i] = Types.BOOLEAN;
42
			}
43
			else if (types[i].equals(Object.class)){
44
				iTypes[i] = Types.JAVA_OBJECT;
45
			}
46
		}
47

  
48
		return iTypes;
49

  
50
	}
51

  
52
	public static Class getTypeClass(int dataType) {
53

  
54
		switch (dataType) {
55
		case Types.DOUBLE:
56
			return Double.class;
57
		case Types.FLOAT:
58
			return Float.class;
59
		case Types.BIGINT:
60
			return Long.class;
61
		case Types.INTEGER:
62
			return Integer.class;
63
		case Types.CHAR:
64
			return String.class;
65
		case Types.DATE:
66
			return Date.class;
67
		case Types.BOOLEAN:
68
			return Boolean.class;
69
		}
70

  
71
		return String.class;
72

  
73
	}
74

  
75

  
76
	public static Object[] getSextanteValues(Value[] record) {
77

  
78
		Object[] values = new Object[record.length];
79

  
80
		for (int i = 0; i < record.length; i++) {
81
			if (record[i] instanceof IntValue){
82
				values[i] = new Integer(((IntValue)record[i]).getValue());
83
			}
84
			else if (record[i] instanceof DoubleValue){
85
				values[i] = new Double(((DoubleValue)record[i]).getValue());
86
			}
87
			else if (record[i] instanceof FloatValue){
88
				values[i] = new Float(((FloatValue)record[i]).getValue());
89
			}
90
			else if (record[i] instanceof LongValue){
91
				values[i] = new Long(((LongValue)record[i]).getValue());
92
			}
93
			else if (record[i] instanceof DateValue){
94
				values[i] = ((DateValue)record[i]).getValue();
95
			}
96
			else if (record[i] instanceof StringValue){
97
				values[i] = ((StringValue)record[i]).getValue();
98
			}
99
			else if (record[i] instanceof BooleanValue){
100
				values[i] = new Boolean(((BooleanValue)record[i]).getValue());
101
			}
102
		}
103

  
104
		return values;
105

  
106
	}
107

  
108
	public static Value[] getGVSIGValues(Object[] record) {
109

  
110
		Value[] values = new Value[record.length];
111

  
112
		for (int i = 0; i < record.length; i++) {
113
			if (record[i] instanceof Integer){
114
				values[i] = ValueFactory.createValue(((Integer)record[i]).intValue());
115
			}
116
			else if (record[i] instanceof Double){
117
				values[i] = ValueFactory.createValue(((Double)record[i]).doubleValue());
118
			}
119
			else if (record[i] instanceof Float){
120
				values[i] = ValueFactory.createValue(((Float)record[i]).longValue());
121
			}
122
			else if (record[i] instanceof Long){
123
				values[i] = ValueFactory.createValue(((Long)record[i]).longValue());
124
			}
125
			else if (record[i] instanceof Date){
126
				values[i] = ValueFactory.createValue(((Date)record[i]));
127
			}
128
			else if (record[i] instanceof String){
129
				values[i] = ValueFactory.createValue(((String)record[i]));
130
			}
131
			else if (record[i] instanceof Boolean){
132
				values[i] = ValueFactory.createValue(((Boolean)record[i]).booleanValue());
133
			}
134
			else if (record[i] == null){
135
				values[i] = ValueFactory.createNullValue();
136
			}
137
		}
138

  
139
		return values;
140

  
141
	}
142

  
143
}
tags/tmp_build/extensions/extSextanteGvsigBindings/src/es/unex/sextante/gvsig/core/SourceIterator.java
1
package es.unex.sextante.gvsig.core;
2

  
3
import java.util.Iterator;
4

  
5
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
6
import com.hardcode.gdbms.engine.values.Value;
7
import com.iver.cit.gvsig.fmap.core.DefaultFeature;
8
import com.iver.cit.gvsig.fmap.core.IFeature;
9
import com.iver.cit.gvsig.fmap.layers.FBitSet;
10
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
11

  
12
public class SourceIterator implements Iterator{
13

  
14
	private int index;
15
	private long count;
16
	private FBitSet selection = null;
17
	private SelectableDataSource source;
18

  
19
	public SourceIterator(SelectableDataSource source) throws ReadDriverException{
20
		this.source = source;
21
		if (source.getSelection().cardinality()== 0){
22
			this.selection = null;
23
			this.index=0;
24
			this.count = source.getRowCount();
25
		} else{
26
			this.selection = source.getSelection();
27
			this.index=selection.nextSetBit(0);
28
			this.count = selection.cardinality();
29
		}
30

  
31
	}
32

  
33
	public void remove() {
34
		throw new UnsupportedOperationException();
35
	}
36

  
37
	public boolean hasNext() {
38
		if (this.selection == null)
39
			return this.index < this.count;
40
		return this.index >= 0;
41
	}
42

  
43
	public Object next() {
44
		try {
45
			return this.nextFeature();
46
		} catch (ReadDriverException e) {
47
			throw new RuntimeException(e);
48
		}
49
	}
50

  
51
	public IFeature nextFeature() throws ReadDriverException {
52

  
53
		Value[] values = this.source.getRow(this.index);
54
		IFeature feat = new DefaultFeature(null, values, "" + this.index);
55
		if (this.selection == null){
56
			this.index++;
57
		} else {
58
			this.index = this.selection.nextSetBit(this.index + 1);
59
		}
60
		return feat;
61

  
62
	}
63

  
64
	public long count(){
65
		return this.count;
66
	}
67

  
68
}
tags/tmp_build/extensions/extSextanteGvsigBindings/src/es/unex/sextante/gvsig/core/gvRasterLayer.java
1
package es.unex.sextante.gvsig.core;
2

  
3
import java.awt.geom.Rectangle2D;
4

  
5
import org.cresques.cts.IProjection;
6
import org.gvsig.fmap.raster.layers.FLyrRasterSE;
7
import org.gvsig.raster.buffer.RasterBuffer;
8
import org.gvsig.raster.grid.Grid;
9
import org.gvsig.raster.grid.GridException;
10

  
11
import es.unex.sextante.dataObjects.AbstractRasterLayer;
12
import es.unex.sextante.dataObjects.IRasterLayer;
13
import es.unex.sextante.rasterWrappers.GridExtent;
14

  
15
public class gvRasterLayer extends AbstractRasterLayer {
16

  
17
	private String m_sFilename;
18
	private IProjection m_Projection;
19
	private Grid layerGrid = null;
20

  
21
	private double DEFAULT_NO_DATA_VALUE = -99999.;
22

  
23
	public void create(String sName, String sFilename,
24
						GridExtent ge, int iDataType,
25
						int iNumBands, Object crs) {
26

  
27
		RasterMemoryDriver rmd = new RasterMemoryDriver(ge, iDataType, iNumBands);
28
		rmd.setName(sName);
29
		//rmd.setProjection((IProjection) crs);
30
		rmd.setNoDataValue(DEFAULT_NO_DATA_VALUE);
31

  
32
		m_BaseDataObject = rmd;
33

  
34
		m_sFilename = sFilename;
35

  
36
		m_Projection = (IProjection) crs;
37

  
38
	}
39

  
40
	public void create(String sName, String sFilename,
41
			GridExtent ge, int iDataType, Object crs) {
42

  
43
		create(sName, sFilename, ge, iDataType, 1, crs);
44

  
45
	}
46

  
47
	public void create(Object obj) {
48

  
49
		if (obj instanceof FLyrRasterSE){
50
			m_BaseDataObject = obj;
51
			m_Projection = ((FLyrRasterSE)obj).getProjection();
52
		}
53

  
54
	}
55

  
56
	public int getDataType() {
57

  
58
		if (m_BaseDataObject instanceof FLyrRasterSE) {
59
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
60
			return layer.getDataType()[0];
61
		}
62
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
63
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
64
			return layer.getRasterBuf().getDataType();
65
		}
66

  
67
		return 0;
68
	}
69

  
70
	public void assign(double dValue) {
71

  
72
		if (m_BaseDataObject instanceof RasterMemoryDriver) {
73
			super.assign(dValue);
74
		}
75

  
76
	}
77

  
78
	public void assign(IRasterLayer layer) {
79

  
80
		if (m_BaseDataObject instanceof RasterMemoryDriver) {
81
			super.assign(layer);
82
		}
83

  
84
	}
85

  
86
	public void setCellValue(int x, int y, int iBand, double dValue) {
87

  
88
		if (m_BaseDataObject instanceof RasterMemoryDriver) {
89
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
90
			layer.setCellValue(x,y, iBand, dValue);
91
		}
92

  
93
	}
94

  
95
	public void setNoDataValue(double dNoDataValue) {
96

  
97
		if (m_BaseDataObject instanceof RasterMemoryDriver) {
98
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
99
			layer.setNoDataValue(dNoDataValue);
100
		}
101
		else if (m_BaseDataObject instanceof FLyrRasterSE) {
102
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
103
			layer.setNoDataValue(dNoDataValue);
104
		}
105

  
106
	}
107

  
108
	public void setNoData(int x, int y) {
109

  
110
		if (m_BaseDataObject instanceof RasterMemoryDriver) {
111
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
112
			layer.setNoData(x, y);
113
		}
114

  
115
	}
116

  
117
	public double getNoDataValue(){
118

  
119
		if (m_BaseDataObject instanceof RasterMemoryDriver) {
120
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
121
			return layer.getNoDataValue();
122
		}
123
		else if (m_BaseDataObject instanceof FLyrRasterSE) {
124
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
125
			return layer.getNoDataValue();
126
		}
127

  
128
		return 0;
129

  
130
	}
131

  
132
	public double getCellValueInLayerCoords(int x, int y, int band) {
133

  
134
		if (m_BaseDataObject instanceof FLyrRasterSE) {
135
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
136
			int iType = layerGrid.getDataType();
137

  
138
			if (iType == RasterBuffer.TYPE_DOUBLE) {
139
				return  layerGrid.getRasterBuf().getElemDouble(y, x, band);
140
			} else if (iType == RasterBuffer.TYPE_INT) {
141
				return (double)  layerGrid.getRasterBuf().getElemInt(y, x, band);
142
			} else if (iType == RasterBuffer.TYPE_FLOAT) {
143
				return (double)  layerGrid.getRasterBuf().getElemFloat(y, x, band);
144
			} else if (iType == RasterBuffer.TYPE_BYTE) {
145
				return (double) ( layerGrid.getRasterBuf().getElemByte(y, x, band) & 0xff);
146
			} else if ((iType == RasterBuffer.TYPE_SHORT) | (iType == RasterBuffer.TYPE_USHORT)) {
147
				return (double)  layerGrid.getRasterBuf().getElemShort(y, x, band);
148
			}
149

  
150
			return layerGrid.getNoDataValue();
151
		}
152
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
153
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
154
			return layer.getCellValue(x, y, band);
155
		}
156

  
157
		return getNoDataValue();
158

  
159
	}
160

  
161
	public int getBandsCount() {
162

  
163
		if (m_BaseDataObject instanceof FLyrRasterSE) {
164
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
165
			return layer.getBandCount();
166
		}
167
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
168
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
169
			return layer.getRasterBuf().getBandCount();
170
		}
171

  
172
		return 0;
173

  
174
	}
175

  
176
	public void fitToGridExtent(GridExtent ge){
177

  
178
		int iNX, iNY;
179
		int x, y;
180
		int iBand;
181

  
182
		if (ge != null){
183
			if (!ge.equals(getWindowGridExtent()) ){
184
				if (m_BaseDataObject instanceof RasterMemoryDriver) {
185
					RasterMemoryDriver gvSIGDriver = (RasterMemoryDriver) m_BaseDataObject;
186

  
187
					FLyrRasterSE gvSIGLayer = gvSIGDriver.getRasterLayer(Long.toString(System.currentTimeMillis()).toString(),
188
							m_Projection);
189
					gvRasterLayer orgLayer = new gvRasterLayer();
190
					orgLayer.create(gvSIGLayer);
191

  
192
					iNX = ge.getNX();
193
					iNY = ge.getNY();
194

  
195
					m_BaseDataObject = null;
196

  
197
					create(this.getName(), m_sFilename, ge, this.getDataType(), this.getBandsCount());
198
					for (iBand = 0; iBand < this.getBandsCount(); iBand++){
199
						for (y = 0; y < iNY; y++){
200
							for (x = 0; x < iNX; x++){
201
								setCellValue(x, y, iBand, orgLayer.getCellValueAsDouble(x, y, iBand));
202
							}
203
						}
204
					}
205
				}
206
			}
207
		}
208
	}
209

  
210
	public String getName() {
211

  
212
		if (m_BaseDataObject instanceof FLyrRasterSE) {
213
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
214
			return layer.getName();
215
		}
216
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
217
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
218
			return layer.getName();
219
		}
220

  
221
		return null;
222

  
223
	}
224

  
225
	public void postProcess() {
226

  
227
		if (m_BaseDataObject instanceof RasterMemoryDriver) {
228
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
229
			if (layer.export(m_sFilename, m_Projection)){
230
				FLyrRasterSE rasterLayer = (FLyrRasterSE) FileTools.openLayer(m_sFilename,
231
											layer.getName(), null);
232
				create(rasterLayer);
233
				rasterLayer.setNoDataValue(layer.getNoDataValue());
234
				System.gc();
235
			}
236
		}
237

  
238
	}
239

  
240
	public void open() {
241

  
242
		if (m_BaseDataObject instanceof FLyrRasterSE) {
243
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
244
			try {
245
				layerGrid = layer.getFullGrid(false);
246
			} catch (GridException e) {
247
				e.printStackTrace();
248
			} catch (InterruptedException e) {
249
				e.printStackTrace();
250
			}
251
		}
252

  
253
	}
254

  
255
	public void close() {
256

  
257
		if (m_BaseDataObject instanceof FLyrRasterSE) {
258
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
259
			if(layerGrid != null) 
260
				layerGrid.getRasterBuf().free();
261
			layerGrid = null;
262
		}
263

  
264
	}
265

  
266
	public Rectangle2D getFullExtent() {
267

  
268
		if (m_BaseDataObject instanceof FLyrRasterSE) {
269
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
270
			try{
271
				return layer.getFullExtent();
272
			}catch(Exception e){
273
				return null;
274
			}
275
		}
276
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
277
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
278
			return layer.getGridExtent().getAsRectangle2D();
279
		}
280

  
281
		return null;
282

  
283
	}
284

  
285
	public GridExtent getLayerGridExtent() {
286

  
287
		if (m_BaseDataObject instanceof FLyrRasterSE) {
288
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
289
			try{
290
				GridExtent extent = new GridExtent();
291
				extent.setXRange(layer.getMinX(), layer.getMaxX());
292
				extent.setYRange(layer.getMinY(), layer.getMaxY());
293
				extent.setCellSize(layer.getCellSize());
294
				return extent;
295
			}catch(Exception e){
296
				return null;
297
			}
298
		}
299
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
300
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
301
			return layer.getGridExtent();
302
		}
303

  
304
		return null;
305

  
306
	}
307

  
308
	public double getLayerCellSize() {
309

  
310
		if (m_BaseDataObject instanceof FLyrRasterSE) {
311
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
312
			return layer.getCellSize();
313
		}
314
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
315
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
316
			return layer.getGridExtent().getCellSize();
317
		}
318

  
319
		return 0;
320

  
321
	}
322

  
323
	public String getFilename() {
324

  
325
		if (m_BaseDataObject instanceof FLyrRasterSE) {
326
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
327
			return layer.getDataSource().getDataset(0)[0].getFName();
328
		}
329
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
330
			return m_sFilename;
331
		}
332

  
333
		return "";
334

  
335
	}
336

  
337

  
338
	public Object getCRS() {
339

  
340
		return m_Projection;
341

  
342
	}
343

  
344

  
345
	public void setName(String name) {
346

  
347
		if (m_BaseDataObject instanceof FLyrRasterSE) {
348
			FLyrRasterSE layer = (FLyrRasterSE) m_BaseDataObject;
349
			layer.setName(name);
350
		}
351
		else if (m_BaseDataObject instanceof RasterMemoryDriver) {
352
			RasterMemoryDriver layer = (RasterMemoryDriver) m_BaseDataObject;
353
			layer.setName(name);
354
		};
355

  
356
	}
357

  
358
}
tags/tmp_build/extensions/extSextanteGvsigBindings/src/es/unex/sextante/gvsig/core/TableMemoryDriver.java
1
package es.unex.sextante.gvsig.core;
2

  
3
import java.io.IOException;
4

  
5
import javax.swing.table.DefaultTableModel;
6

  
7
import com.hardcode.gdbms.engine.data.DataSourceFactory;
8
import com.hardcode.gdbms.engine.data.driver.ObjectDriver;
9
import com.hardcode.gdbms.engine.data.edition.DataWare;
10
import com.hardcode.gdbms.engine.values.Value;
11

  
12
public class TableMemoryDriver implements ObjectDriver{
13

  
14
	private DefaultTableModel m_TableModel;
15
	private int m_FieldTypes[];
16

  
17
    public TableMemoryDriver(String[] sNames, int[] iTypes) {
18

  
19
    	super();
20

  
21
    	m_TableModel = new DefaultTableModel(sNames, 0);
22
    	m_FieldTypes = iTypes;
23

  
24
    }
25

  
26
	/**
27
	 * Devuelve el modelo de la tabla.
28
	 *
29
	 * @return modelo de la tabla.
30
	 */
31
	public DefaultTableModel getTableModel() {
32

  
33
		return m_TableModel;
34

  
35
	}
36

  
37
	/**
38
	 * A�ade una fila.
39
	 *
40
	 * @param row fila.
41
	 */
42
	public void addRow(Object[] row) {
43

  
44
		m_TableModel.addRow(row);
45

  
46
	}
47

  
48

  
49
	/* (non-Javadoc)
50
	 * @see com.hardcode.driverManager.Driver#getName()
51
	 */
52
	public  String getName(){
53

  
54
		return "Table Memory Driver";
55

  
56
	}
57

  
58
	/**
59
	 * @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldType(int)
60
	 */
61
	public int getFieldType(int i) {
62

  
63
		if (i >= 0 && i < m_FieldTypes.length){
64
			return m_FieldTypes[i];
65
		}
66
		return 0;
67
	}
68

  
69

  
70
	public boolean isWritable() {
71

  
72
		return true;
73

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff