Revision 459
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DPanel.java | ||
---|---|---|
25 | 25 |
package org.gvsig.view3d.swing.impl; |
26 | 26 |
|
27 | 27 |
import java.awt.BorderLayout; |
28 |
import java.awt.event.ComponentEvent; |
|
29 |
import java.awt.event.ComponentListener; |
|
28 | 30 |
|
29 | 31 |
import javax.swing.JComponent; |
30 | 32 |
import javax.swing.JPanel; |
... | ... | |
60 | 62 |
swingManager.createMapControl3D(theMapContext, type); |
61 | 63 |
|
62 | 64 |
this.add(mapControl3D.asJComponent(), BorderLayout.CENTER); |
65 |
|
|
66 |
this.addComponentListener(new ComponentListener() { |
|
67 |
|
|
68 |
public void componentShown(ComponentEvent e) { |
|
69 |
} |
|
70 |
|
|
71 |
public void componentResized(ComponentEvent e) { |
|
72 |
} |
|
73 |
|
|
74 |
public void componentMoved(ComponentEvent e) { |
|
75 |
} |
|
76 |
|
|
77 |
public void componentHidden(ComponentEvent e) { |
|
78 |
getMapControl3D().dispose(); |
|
79 |
} |
|
80 |
}); |
|
63 | 81 |
} |
64 | 82 |
|
65 | 83 |
public JComponent asJComponent() { |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultMapControl3D.java | ||
---|---|---|
62 | 62 |
import org.gvsig.fmap.mapcontext.MapContext; |
63 | 63 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
64 | 64 |
import org.gvsig.fmap.mapcontext.layers.operations.LayersVisitor; |
65 |
import org.gvsig.tools.dispose.Disposable; |
|
65 | 66 |
import org.gvsig.tools.exception.BaseException; |
66 | 67 |
import org.gvsig.tools.visitor.VisitCanceledException; |
67 | 68 |
import org.gvsig.view3d.swing.api.MapControl3D; |
... | ... | |
73 | 74 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
74 | 75 |
* |
75 | 76 |
*/ |
76 |
public class DefaultMapControl3D extends JPanel implements MapControl3D {
|
|
77 |
public class DefaultMapControl3D extends JPanel implements MapControl3D, Disposable{
|
|
77 | 78 |
|
78 | 79 |
private static final long serialVersionUID = 2024899922367896097L; |
79 | 80 |
|
... | ... | |
187 | 188 |
public JComponent asJComponent() { |
188 | 189 |
return this; |
189 | 190 |
} |
191 |
|
|
192 |
public void dispose() { |
|
193 |
|
|
194 |
if(this.wwd != null){ |
|
195 |
this.wwd = null; |
|
196 |
} |
|
197 |
|
|
198 |
WorldWind.shutDown(); |
|
199 |
} |
|
190 | 200 |
|
191 | 201 |
public MapContext getMapContext() { |
192 | 202 |
return this.mapContext; |
... | ... | |
360 | 370 |
// TODO |
361 | 371 |
throw new UnsupportedOperationException(); |
362 | 372 |
} |
363 |
|
|
364 | 373 |
} |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/MapControl3D.java | ||
---|---|---|
25 | 25 |
package org.gvsig.view3d.swing.api; |
26 | 26 |
|
27 | 27 |
import org.gvsig.fmap.mapcontext.MapContext; |
28 |
import org.gvsig.tools.dispose.Disposable; |
|
28 | 29 |
import org.gvsig.tools.swing.api.Component; |
29 | 30 |
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE; |
30 | 31 |
|
... | ... | |
33 | 34 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
34 | 35 |
* |
35 | 36 |
*/ |
36 |
public interface MapControl3D extends Component{ |
|
37 |
public interface MapControl3D extends Component, Disposable{
|
|
37 | 38 |
|
38 | 39 |
/** |
39 | 40 |
* |
Also available in: Unified diff