NASA WorldWind on JRuby
I am preparing a few demos for our local 'JavaOne AfterGlow'. Here is a quick one that need JRuby (I took NB6 M9 preview) and the WorldWind Java SDK. Note that it is also my first JRuby attempt! Make sure the WorldWind jars (worldwind.jar, jogl.jar & gluegen-rt.jar) are in the classpath.
#WorldWind.rb
include Java
import javax.swing.JFrame
require 'worldwind.jar'
include_class 'gov.nasa.worldwind.BasicModel'
include_class 'gov.nasa.worldwind.awt.WorldWindowGLCanvas'
frame = JFrame.new("WorldWind on JRuby")
frame.set_size(800, 600)
wwind = WorldWindowGLCanvas.new
wwind.setModel(BasicModel.new)
frame.add(wwind)
frame.show

( mai 15 2007, 09:12:15 AM PDT ) Permalink




