WWJava Dev FAQ

From World Wind Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:51, 12 May 2007 (edit)
Mkpl (Talk | contribs)
(Redirecting to WWJava FAQ)
← Previous diff
Revision as of 20:54, 23 March 2008 (edit) (undo)
Mkpl (Talk | contribs)

Next diff →
Line 1: Line 1:
-#REDIRECT [[WWJava FAQ]]+==General questions==
 +See [[WWJava FAQ]]
 + 
 +==Problems==
 + 
 +===Help! All I get is the compass, and a black globe with an atmosphere layer===
 +This is usually the first sign of a graphics card issue. First try updating your video drivers. Under Linux if you see the message that DXTn compressed textures are not supported is spammed to the console, you can try downloading (many distributions also offer a package for it) the [http://dri.freedesktop.org/wiki/DriConf driconf] utility and enabling "Force S3 texture compression"
 + 
 +===How do I set the position of the globe directly?===
 +View handling is on the current list of things being improved for the next version. It is currently something of a black art that may or may not work reliably, and may cause seemingly unexplainable input behaviour occasionally.
 + 
 +Just know that you're not along with some weird behaviour there.
 + 
 +The easiest method that works reliably is to use View.applyStateIterator. Several factory methods are available, such as ''FlyToOrbitViewStateIterator.createPanToIterator(...)''. Trying to directly modify the View state isn't reliable.
 + 
 +See also:
 +*http://forum.worldwindcentral.com/showthread.php?t=13403
 +*http://forum.worldwindcentral.com/showthread.php?t=13296
 +*http://forum.worldwindcentral.com/showthread.php?t=13329
 + 
 +===I can resize the window bigger, but never make it smaller===
 +The jogl GLCanvas class seems to set it's minimum size to the new size every time it is resized. This doesn't matter for the default demo, because it uses a border layout which ignores component's minimum sizes!
 + 
 +However, if you add the WorldWindowGLCanvas to a component that uses a different layout, you will need to workaround that. One way is to extend the GLAutoDrawable class and add a reshape method that looks something like the following (make sure to set the AVKey.WORLD_WINDOW_CLASS_NAME property so that your new class is used instead of the default):
 + 
 +<pre>
 +@Override
 + public void reshape(GLAutoDrawable glAutoDrawable, int x, int y, int w, int h) {
 + // Workaround jogl resizing bug, it sets the minimum size to the new size every time the canvas is resized
 + // which prevents it from ever shrinking
 + ((Component) glAutoDrawable).setMinimumSize(new Dimension(0, 0));
 + }
 +</pre>
 + 
 +===How do I force the screen to redraw from my code?===
 +You have two options:
 +#The WorldWindow class offers a couple of redraw methods, you can keep a copy of it (perhaps passed in a constructor method) and call them as needed.
 +#The slightly preferable way from Layers is to fire a property change event such as: <pre>this.firePropertyChange(AVKey.LAYER, null, this);</pre>
 + 
 +===The globe window draws over my application's menus and popups===
 +The jogl lightweight component (WorldWindowGLJPanel) is not reliable at the moment, so the recommended component is WorldWindowGLCanvas which is unfortunately heavyweight (not drawn by swing). You can workaround many issues by calling ''JPopupMenu.setDefaultLightWeightPopupEnabled(false)'' early in your application, however there are some kinds of interactions between lightweight and heavyweights that aren't possible (such as drawing a transparent swing component on top of the globe).
 + 
 +==WWJ Java future==
 + 
 +===What is the status of the SDK? Is it a pre-alpha, an alpha, a beta or a release... or something else? Is it safe to start coding an application around it?===
 +The WWJ release as of May 11, 2007 is an early-access release.
 +The code and the API will continue to evolve, although the architecture will remain the same.
 +When a stable release is established, the APIs will follow the convention of backwards
 +compatibility among "dot" releases.
 +No date for a stable release has been established yet.
 +The components of WWJ are designed to be replaceable.
 +The architecture is largely defined by pure interfaces.
 +To replace a component, just implement the relevant interface(s).
 + 
 +===Is there a roadmap that describes all of the features expected for the final version?===
 +There is no feature roadmap written down.
 + 
 +===Where do I report bugs or request new features?===
 +You can ask questions on the [http://forum.worldwindcentral.com/forumdisplay.php?f=37 World Wind Java forums], or report specific issues using the [http://issues.worldwind.arc.nasa.gov/browse/WWJ NASA issue tracker].
 + 
 +[[Category:WWJ Dev Documentation]]

Revision as of 20:54, 23 March 2008

Contents

General questions

See WWJava FAQ

Problems

Help! All I get is the compass, and a black globe with an atmosphere layer

This is usually the first sign of a graphics card issue. First try updating your video drivers. Under Linux if you see the message that DXTn compressed textures are not supported is spammed to the console, you can try downloading (many distributions also offer a package for it) the driconf utility and enabling "Force S3 texture compression"

How do I set the position of the globe directly?

View handling is on the current list of things being improved for the next version. It is currently something of a black art that may or may not work reliably, and may cause seemingly unexplainable input behaviour occasionally.

Just know that you're not along with some weird behaviour there.

The easiest method that works reliably is to use View.applyStateIterator. Several factory methods are available, such as FlyToOrbitViewStateIterator.createPanToIterator(...). Trying to directly modify the View state isn't reliable.

See also:

I can resize the window bigger, but never make it smaller

The jogl GLCanvas class seems to set it's minimum size to the new size every time it is resized. This doesn't matter for the default demo, because it uses a border layout which ignores component's minimum sizes!

However, if you add the WorldWindowGLCanvas to a component that uses a different layout, you will need to workaround that. One way is to extend the GLAutoDrawable class and add a reshape method that looks something like the following (make sure to set the AVKey.WORLD_WINDOW_CLASS_NAME property so that your new class is used instead of the default):

@Override
    public void reshape(GLAutoDrawable glAutoDrawable, int x, int y, int w, int h) {
        // Workaround jogl resizing bug, it sets the minimum size to the new size every time the canvas is resized
        // which prevents it from ever shrinking
        ((Component) glAutoDrawable).setMinimumSize(new Dimension(0, 0));
    }

How do I force the screen to redraw from my code?

You have two options:

  1. The WorldWindow class offers a couple of redraw methods, you can keep a copy of it (perhaps passed in a constructor method) and call them as needed.
  2. The slightly preferable way from Layers is to fire a property change event such as:
    this.firePropertyChange(AVKey.LAYER, null, this);

The globe window draws over my application's menus and popups

The jogl lightweight component (WorldWindowGLJPanel) is not reliable at the moment, so the recommended component is WorldWindowGLCanvas which is unfortunately heavyweight (not drawn by swing). You can workaround many issues by calling JPopupMenu.setDefaultLightWeightPopupEnabled(false) early in your application, however there are some kinds of interactions between lightweight and heavyweights that aren't possible (such as drawing a transparent swing component on top of the globe).

WWJ Java future

What is the status of the SDK? Is it a pre-alpha, an alpha, a beta or a release... or something else? Is it safe to start coding an application around it?

The WWJ release as of May 11, 2007 is an early-access release. The code and the API will continue to evolve, although the architecture will remain the same. When a stable release is established, the APIs will follow the convention of backwards compatibility among "dot" releases. No date for a stable release has been established yet. The components of WWJ are designed to be replaceable. The architecture is largely defined by pure interfaces. To replace a component, just implement the relevant interface(s).

Is there a roadmap that describes all of the features expected for the final version?

There is no feature roadmap written down.

Where do I report bugs or request new features?

You can ask questions on the World Wind Java forums, or report specific issues using the NASA issue tracker.

Personal tools