<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [Gvsig_english] Eclipse RCP with gvSIG</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hello, the code that creates that message is:<BR>
<BR>
...<BR>
if (shapeType==SHP.NULL || shapeType &gt; 28){<BR>
&nbsp; logger.info(&quot;El shape =&quot;+index+ &quot; de la capa =&quot;+toString()+&quot; es null&quot;);<BR>
&nbsp; return null;<BR>
}<BR>
...<BR>
<BR>
<BR>
Have you added the source code of gvSIG or only the JAR files to your workspace?<BR>
Can you find out the value of shapeType?<BR>
Maybe you are using a rare shapefile?<BR>
Try another one or try this one:<BR>
<BR>
<A HREF="http://www.prodevelop.es/files/fm/public/downloads/jldominguez/ger.zip">http://www.prodevelop.es/files/fm/public/downloads/jldominguez/ger.zip</A><BR>
<BR>
<BR>
Are you using gvSIG 1.1 or gvSIG 1.10 ?<BR>
<BR>
<BR>
<BR>
Regards,<BR>
Juan Lucas Domínguez Rubio<BR>
---<BR>
Prodevelop SL, Valencia (España)<BR>
Tlf.: 96.351.06.12 -- Fax: 96.351.09.68<BR>
<A HREF="http://www.prodevelop.es">http://www.prodevelop.es</A><BR>
---<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: gvsig_internacional-bounces@listserv.gva.es on behalf of Neumann, Tobias<BR>
Sent: Fri 08/04/2011 15:41<BR>
To: Users and Developers mailing list<BR>
Subject: RE: [Gvsig_english] Eclipse RCP with gvSIG<BR>
<BR>
Hi Juan,<BR>
<BR>
nearly... when I load the layer the IndexedShapeDriver says that each polygon in the file is null... why? :-( Does someone know where the failure could be? (INFO [Thread-6] (IndexedShapeDriver .java:220) - El shape =219 de la capa&nbsp; &lt;<A HREF="mailto:...IndexedShapeDriver@11ed166">mailto:...IndexedShapeDriver@11ed166</A>&gt; ...IndexedShapeDriver@11ed166 es null)<BR>
<BR>
Regards,<BR>
Tobias<BR>
<BR>
&nbsp; _____&nbsp;<BR>
<BR>
From: gvsig_internacional-bounces@listserv.gva.es on behalf of Juan Lucas Dominguez Rubio<BR>
Sent: Fri 08.04.2011 15:10<BR>
To: Users and Developers mailing list; Users and Developers mailing list<BR>
Subject: Re: [Gvsig_english] Eclipse RCP with gvSIG<BR>
<BR>
<BR>
Hello,<BR>
Very interesting, thanks.<BR>
So you are very close to having a gvSIG layer in Eclipse, aren't you?<BR>
You can instantiate a layer by code and add it: map_control.getMapContext().getLayers().add(...)<BR>
Have you done that?<BR>
<BR>
<BR>
Regards,<BR>
Juan Lucas Domínguez Rubio<BR>
---<BR>
Prodevelop SL, Valencia (España)<BR>
Tlf.: 96.351.06.12 -- Fax: 96.351.09.68<BR>
&nbsp;&lt;<A HREF="http://www.prodevelop.es/">http://www.prodevelop.es/</A>&gt; <A HREF="http://www.prodevelop.es">http://www.prodevelop.es</A><BR>
---<BR>
<BR>
&nbsp; _____&nbsp;<BR>
<BR>
De: gvsig_internacional-bounces@listserv.gva.es en nombre de Neumann, Tobias<BR>
Enviado el: vie 08/04/2011 14:41<BR>
Para: Users and Developers mailing list<BR>
Asunto: RE: [Gvsig_english] Eclipse RCP with gvSIG<BR>
<BR>
<BR>
Dear Juan,<BR>
<BR>
I think we have found a really easy way to use the AWT-components in SWT and Eclipse. The solution is the &quot;albireo&quot;-project. It provides a SwingControl which enables you to use the AWT-components very easy. Here is my implementation which seems to work fine:<BR>
<BR>
public class View extends ViewPart{<BR>
<BR>
private MapControl mapControl = null;<BR>
<BR>
private SwingControl swingControl = null;<BR>
<BR>
public void createPartControl(final Composite parent){<BR>
&nbsp;&nbsp;&nbsp; swingControl = new SwingControl(parent, SWT.NONE){<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @Override<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected JComponent createSwingControl(){<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; View.this.mapControl = new MapControl();<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return View.this.mapControl;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @Override<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Composite getLayoutAncestor(){<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return parent;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp; }<BR>
<BR>
&nbsp;&nbsp;&nbsp; @Override<BR>
&nbsp;&nbsp;&nbsp; public void dispose(){<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(View.this.swingControl != null){<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swingControl.dispose();<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
&nbsp;&nbsp;&nbsp; {<BR>
}<BR>
<BR>
Maybe this could be the solution :-)<BR>
<BR>
Cheers<BR>
Tobias<BR>
<BR>
&nbsp; _____&nbsp;<BR>
<BR>
From: gvsig_internacional-bounces@listserv.gva.es on behalf of Juan Lucas Dominguez Rubio<BR>
Sent: Fri 08.04.2011 13:58<BR>
To: Users and Developers mailing list; Users and Developers mailing list<BR>
Subject: Re: [Gvsig_english] Eclipse RCP with gvSIG<BR>
<BR>
<BR>
Hello, Tobias.<BR>
I have realized that there is a big difference between the JVM I used in the mobile devices and the JVM you are going to use: in my case, the AWT classes simply were not available, but in your case the classes will be available but will not integrate easily in the Eclipse SWT context.<BR>
<BR>
So one possible way to integrate gvSIG in the Eclipse RCP application is drawing the map in a AWT image (for example BufferedImage) and then convert the image into a SWT image (I'm sure this is easy and fast) and paste it in you Eclipse SWT canvas. In this way you will probably be able to re-use the gvSIG libraries easily.<BR>
<BR>
Just an idea...<BR>
<BR>
<BR>
Regards,<BR>
Juan Lucas Domínguez Rubio<BR>
---<BR>
Prodevelop SL, Valencia (España)<BR>
Tlf.: 96.351.06.12 -- Fax: 96.351.09.68<BR>
&nbsp;&lt;<A HREF="http://www.prodevelop.es/">http://www.prodevelop.es/</A>&gt; <A HREF="http://www.prodevelop.es">http://www.prodevelop.es</A><BR>
---<BR>
<BR>
&nbsp; _____&nbsp;<BR>
<BR>
De: gvsig_internacional-bounces@listserv.gva.es en nombre de Neumann, Tobias<BR>
Enviado el: jue 07/04/2011 12:53<BR>
Para: Users and Developers mailing list<BR>
Asunto: AW: [Gvsig_english] Eclipse RCP with gvSIG<BR>
<BR>
<BR>
<BR>
Hola César y Juan! :-)<BR>
<BR>
Thanks a lot for your thoughts and experiences. I believe the combination of gvSIG and RCP will matter a couple of hours of work for me :o)<BR>
<BR>
I am just starting up with gvSIG and will investigate what will be necessary to satisfy our needs. Unfortunately we do not have the choice to match our requirements without Eclipse RCP. I will tell you about my improvements.<BR>
<BR>
With best regards<BR>
Tobias<BR>
<BR>
<BR>
<BR>
-----Ursprüngliche Nachricht-----<BR>
Von: gvsig_internacional-bounces@listserv.gva.es im Auftrag von Juan Lucas Domínguez Rubio<BR>
Gesendet: Do 07.04.2011 12:01<BR>
An: Users and Developers mailing list<BR>
Betreff: Re: [Gvsig_english] Eclipse RCP with gvSIG<BR>
&nbsp;<BR>
Hello, Tobias:<BR>
<BR>
I don't have much experience in 'improper' integration between gvSIG and Eclipse SWT (I mean, things like embedding AWT controls in a SWT context or using some kind of library wrapping), but I have done some tests regarding gvSIG libraries in a SWT context.<BR>
<BR>
As you perhaps know, the application gvSIG Mobile is using a simplified version of gvSIG 1.X mapping libraries.<BR>
<BR>
I wrote a little 'unofficial' version of gvSIG Mobile for Linux devices (such as the Openmoko phone or the Nokia N810 tablet) with less functionalities than the 'official' gvSIG Mobile but including some other new features.<BR>
<BR>
At that time, I found no JVM for those devices that could use the AWT classes (used by gvSIG and gvSIG Mobile). Instead, the Eclipse SWT library was working fine on them, so I changed the gvSIG mapping libraries to make them graphic context independent, and then reimplemented the needed classes to use Eclipse SWT classes. Essentially, I did this:<BR>
<BR>
- Take the mapping library of gvSIG 1.X (libFMap) and replace all the occurrences of the classes Graphics2D and Image (this includes all the BufferedImage), with some Java interfaces created by you. So, for ecample in the FLyrVect class, instead of:<BR>
<BR>
public void draw(Graphics g, ViewPort vp) throws FMapDriverException { ... }<BR>
<BR>
you will have:<BR>
<BR>
public void draw(IGraphics g, ViewPort vp) throws FMapDriverException { ... }<BR>
(IGraphics is a new Java interface)<BR>
<BR>
Before doing this, I removed a lot of drivers from libFMap which were not interesting. I also applied this transformation to the WMS driver and added it to my workspace.<BR>
<BR>
- create a new Java project with those Java interfaces (the new libFMap will depend on this project)<BR>
<BR>
- create another Java project containing an implementation of those Java interfaces. Here is where you would use the SWT library to implement all the needed methods (such as drawing a line, creating an image, pasting an image on a graphic context, etc.)<BR>
<BR>
- then, at the beginning of the application, you create a SWT-based factory that is able to instantiate all those SWT-based graphic resources and methods, and use it across the application.<BR>
<BR>
There are a lot of other important things I had to do from scratch, for example the table of contents (TOC) and of course all the GUI (dialogs). I also split the libFMap project in different parts (libGeom, libRender, etc). This was the resulting workspace:<BR>
<BR>
<A HREF="https://svn.prodevelop.es/public/labs/gvsigmobileonopenmoko/trunk/">https://svn.prodevelop.es/public/labs/gvsigmobileonopenmoko/trunk/</A><BR>
<BR>
and these are a couple screenshots of the aplication:<BR>
<BR>
<A HREF="http://gvsigmobileonopenmoko.files.wordpress.com/2009/04/carta_2007.jpg">http://gvsigmobileonopenmoko.files.wordpress.com/2009/04/carta_2007.jpg</A><BR>
(WMS layer + 2 little shapefiles)<BR>
<BR>
<A HREF="http://gvsigmobileonopenmoko.files.wordpress.com/2009/07/nokia_31468.jpg">http://gvsigmobileonopenmoko.files.wordpress.com/2009/07/nokia_31468.jpg</A><BR>
(ArcIMS layer)<BR>
<BR>
I have never done it myself, but I presume in the Eclipse RCP-based applications you eventually will have to use the SWT graphic classes I used, especially:<BR>
<BR>
org.eclipse.swt.graphics.GC<BR>
org.eclipse.swt.graphics.Image<BR>
<BR>
So that would be one way to properly integrate gvSIG in the Eclipse RCP platform.<BR>
<BR>
After my little experience, I think that the Eclipse SWT graphic context is less powerful and slower than the AWT Graphics2D class. I did not investigate it deeply but I think AWT has better access to the device's graphic hardware capabilities and therefore drawing is faster and more flexible.<BR>
<BR>
<BR>
Regards,<BR>
<BR>
Juan Lucas Domínguez Rubio<BR>
<A HREF="http://gvsigmobileonopenmoko.wordpress.com">http://gvsigmobileonopenmoko.wordpress.com</A> &lt;<A HREF="http://gvsigmobileonopenmoko.wordpress.com/">http://gvsigmobileonopenmoko.wordpress.com/</A>&gt;&nbsp;<BR>
<A HREF="http://foss4gis.blogspot.com">http://foss4gis.blogspot.com</A> &lt;<A HREF="http://foss4gis.blogspot.com/">http://foss4gis.blogspot.com/</A>&gt;&nbsp;<BR>
<BR>
--- On Wed, 4/6/11, Neumann, Tobias &lt;tobias.neumann@berner-mattner.com&gt; wrote:<BR>
<BR>
From: Neumann, Tobias &lt;tobias.neumann@berner-mattner.com&gt;<BR>
Subject: [Gvsig_english] Eclipse RCP with gvSIG<BR>
To: gvsig_internacional@listserv.gva.es<BR>
Date: Wednesday, April 6, 2011, 7:35 AM<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
&nbsp;<BR>
Eclipse RCP with gvSIG<BR>
Hello,<BR>
<BR>
<BR>
<BR>
I am interested in your experiences with the gvSIG software embedded in Eclipse RCP. I want to start up a project using these technologies. Anyone did this before? Are there some points I have to focus on?<BR>
<BR>
<BR>
<BR>
Thank you very much!<BR>
<BR>
<BR>
<BR>
Best regards,<BR>
<BR>
Tobias<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
Tobias Neumann, M.Sc. in Geogr.<BR>
<BR>
Softwareingenieur<BR>
<BR>
<BR>
<BR>
Tel: +49 89 608090-276<BR>
<BR>
Fax: +49 89 6098182<BR>
<BR>
E-Mail: Tobias.Neumann@berner-mattner.com<BR>
<BR>
Web: www.berner-mattner.com<BR>
<BR>
<BR>
<BR>
Berner &amp; Mattner Systemtechnik GmbH<BR>
<BR>
Erwin-von-Kreibig-Str. 3<BR>
<BR>
D-80807 München<BR>
<BR>
<BR>
<BR>
Geschäftsführer: Hans Berner, Dr. Klaus Eder, Dr. Jan-Oliver Wenzel<BR>
<BR>
Registernummer: HR B 83252 beim Amtsgericht München<BR>
<BR>
Sitz der Gesellschaft: München<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
-----Inline Attachment Follows-----<BR>
<BR>
_______________________________________________<BR>
Gvsig_internacional mailing list<BR>
Gvsig_internacional@listserv.gva.es<BR>
<A HREF="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</A><BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>