pythagoras, gwt and java.nio.DoubleBuffer

41 views
Skip to first unread message

Jeffrey Elrod

unread,
Apr 16, 2013, 5:04:38 PM4/16/13
to ooo-...@googlegroups.com
I don't know if this is the right group to ask this question, so please let me know where I should forward this question if it's not.

I'm using pythagoras in a gwt application.  In development mode I get an error but the webpage displays correctly.  However when trying to do a GWT Compile it fails because of the reference to java.nio.DoubleBuffer.  How is everyone getting around this?

Thanks for the time
Jeff

Michael Bayne

unread,
Apr 16, 2013, 5:13:37 PM4/16/13
to ooo-...@googlegroups.com

On Tue, Apr 16, 2013 at 2:04 PM, Jeffrey Elrod <jfelr...@gmail.com> wrote:
I'm using pythagoras in a gwt application.  In development mode I get an error but the webpage displays correctly.  However when trying to do a GWT Compile it fails because of the reference to java.nio.DoubleBuffer.  How is everyone getting around this?

The only GWT apps to use pythagoras thus far have been PlayN apps, and PlayN provides an emulation of Java NIO buffers atop JavaScript TypedArrays.

However, I assume you're not actually using the DoubleBuffer stuff, so you can create stub classes for FloatBuffer and DoubleBuffer like so:

package java.nio;

public class DoubleBuffer {
  public void put(double value) {}
  public double get() { return 0; }
}

public class FloatBuffer {
  public void put(float value) {}
  public float get() { return 0; }
}

and then place those into your project under a directory named something like "super" (since you will use the GWT super-source mechanism to apply them):

src/main/java/com/myproject/super/java/nio/FloatBuffer.java
src/main/java/com/myproject/super/java/nio/DoubleBuffer.java

Then add this to your MyProject.gwt.xml class to reference the super source:

  <super-source path="super"/>

This assumes your MyProject.gwt.xml is in src/main/java/com/myproject/MyProject.gwt.xml, put the super directory in whatever directory contains your MyProject.gwt.xml and everything will work.


Jeffrey Elrod

unread,
Apr 16, 2013, 5:18:41 PM4/16/13
to ooo-...@googlegroups.com
Thanks Michael!  You're very kind.  Continued success with your work!


--
You received this message because you are subscribed to the Google Groups "OOO Libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ooo-libs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages