GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

Compilation failure in swt module under linux #125

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

edu.umd.cs.piccolox.swt.SWTGraphics2D uses FontData.height but according to
its javadoc
http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/reference/api
/org/eclipse/swt/graphics/FontData.html#height
it's type is platform dependent and it's float under Linux. 
FontData.getHeight method should be used instead.
Attached patch fixes compilation

Original issue reported on code.google.com by akurta...@gmail.com on 17 Sep 2009 at 6:31

Attachments:

GoogleCodeExporter commented 9 years ago
I'm not clear on the compilation failure -- svn trunk compiles fine for me on 
64-bit
gentoo with sun-jdk 1.6.  I haven't tried running the SWT examples though, so 
there
may be problems at runtime.

Original comment by heue...@gmail.com on 18 Sep 2009 at 3:44

GoogleCodeExporter commented 9 years ago
That's because you're using swt:swt-win32:3.0m8 as a dependency in the pom.
Just try changing it to org.eclipse.swt.gtk.linux:x86:3.3.0-v3346 and you'll 
see the
difference. Note that locally I'm compiling with swt 3.5 which gives the same 
error.
From the swt javadoc:
float   height
          The height of the font data in points (Warning: This field is platform
dependent) IMPORTANT: This field is not part of the SWT public API.

Error log I'm seeing:
[loading org/eclipse/swt/graphics/RGB.class(org/eclipse/swt/graphics:RGB.class)]
/home/akurtakov/tmp/piccolo2d.java/swt/src/main/java/edu/umd/cs/piccolox/swt/SWT
Graphics2D.java:276:
cannot find symbol
symbol  : constructor Font(java.lang.String,int,float)
location: class java.awt.Font
                return new Font(fd[0].getName(), style, fd[0].height);

Original comment by akurta...@gmail.com on 18 Sep 2009 at 5:58

GoogleCodeExporter commented 9 years ago
Great, thanks, I see this too.

What would be the motivation be to move to version 3.3.0-v3346 of the SWT 
dependency,
or to any later version?  Is there any reason not to jump right to the most 
recent one?

Original comment by heue...@gmail.com on 18 Sep 2009 at 6:30

GoogleCodeExporter commented 9 years ago
I will apply the patch to fix this issue, and opened a new Issue 126 with 
regards to
the SWT dependency version.

Original comment by heue...@gmail.com on 18 Sep 2009 at 6:33

GoogleCodeExporter commented 9 years ago
$ svn commit -m "Issue 125 ; fix for compilation error with more recent 
versions of
SWT dependency on linux, thanks to akurtakov for the patch" .
  Sending        ...
  Transmitting file data ...
  Committed revision 671.

Original comment by heue...@gmail.com on 18 Sep 2009 at 6:40

GoogleCodeExporter commented 9 years ago
I find the problem while trying to compile piccolo2d-swt for use in latest 
eclipse
(pydev). 

Original comment by akurta...@gmail.com on 18 Sep 2009 at 7:44

GoogleCodeExporter commented 9 years ago
Re-applied in commit r889 since it'd been removed by me when applying an 
upgrade to
PSWTText.

Original comment by allain.lalonde on 5 Nov 2009 at 2:57