WorldWind Java on a Netbeans Platform TopComponent

懵懂的女人 提交于 2019-12-06 11:57:53

I've set up a demo using NetBeans Platform (7.0.1) with gov.nasa.worldwind.awt.WorldWindowGLCanvas and gov.nasa.worldwindx.examples.LayerPanel

Initialization Code:

private void initComponents() {
    canvas = new WorldWindowGLCanvas();

    Model model = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
    canvas.setModel(model);

    layerPanel = new LayerPanel(canvas);

    setLayout(new BorderLayout());
    add(canvas, BorderLayout.CENTER);
    add(layerPanel, BorderLayout.WEST);
}
private WorldWindowGLCanvas canvas;
private LayerPanel layerPanel;

This works the same as it does running the sample as a stand alone so I would say that the problem does not lie in the NetBeans Platform. Without any code it's hard to say what's going wrong.

Note that the gov.nasa.worldwind.awt.WorldWindowGLCanvas is not a Swing component but a heavy weight component. This is irrelevant to your question but I couldn't help but point it out. The Swing component is gov.nasa.worldwind.awt.WorldWindowGLJPanel

Edit: I realize my answer is not very helpful, so to remedy that I would add a suggestion. You could try to invalidate the TopComponent and call repaint whenever you need it to render the new layer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!