Hi all,
I have changed to the new domain: http://acuriousanimal.orggeo.net. I hope to have some time to move some post to the new site.
Thursday, April 09, 2009
Saturday, January 24, 2009
SwingAnnotations on WWJ
Thanks to Arnaud Saval, who helps me with the problems commented in my previous post, here is the new version of AnnotationWindow which I called more rightly SwingAnnotation.
There are two important requirements you need to know before start using SwingAnnotation:
The JPanel of the SwingAnnotations share the same container as the WWJ canvas. This is the reason you need to set the layout to null, to allow place the panels at any location.
You can get the source code here.
There are two important requirements you need to know before start using SwingAnnotation:
- You need JDK6u12 (which currently is in early access). JDK6u12 solves the problem between heavyweight and lighweight component, this way we can put JPanel on top of a Canvas component without problems.
- The container on which the WWJ Canvas resides must use a null layout:
...
wwd = new WorldWindowGLCanvas();
wwd.setSize(new java.awt.Dimension(600, 500));
this.getContentPane().setLayout(null);
this.getContentPane().add(wwd);
...
The JPanel of the SwingAnnotations share the same container as the WWJ canvas. This is the reason you need to set the layout to null, to allow place the panels at any location.
You can get the source code here.
Subscribe to:
Posts (Atom)