Revision 428
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.app/org.gvsig.view3d.app.common/src/main/java/org/gvsig/view3d/app/mainplugin/View3DExtension.java | ||
---|---|---|
28 | 28 |
import org.gvsig.view3d.swing.api.View3DLocator; |
29 | 29 |
import org.gvsig.view3d.swing.api.View3DManager; |
30 | 30 |
import org.gvsig.view3d.swing.api.View3DPanel; |
31 |
import org.gvsig.view3d.swing.api.View3DPanel.TYPE; |
|
31 | 32 |
|
32 | 33 |
|
33 | 34 |
/** |
... | ... | |
41 | 42 |
|
42 | 43 |
public void execute(String actionCommand) { |
43 | 44 |
View3DManager manager = View3DLocator.getManager(); |
44 |
View3DPanel createView3DPanel = manager.createView3DPanel(null, View3DPanel.SPHERE);
|
|
45 |
View3DPanel createView3DPanel = manager.createView3DPanel(null, TYPE.SPHERE);
|
|
45 | 46 |
createView3DPanel.show(); |
46 | 47 |
} |
47 | 48 |
|
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.main/src/main/java/org/gvsig/view3d/main/PaletteActions.java | ||
---|---|---|
55 | 55 |
import org.gvsig.view3d.swing.api.View3DLocator; |
56 | 56 |
import org.gvsig.view3d.swing.api.View3DManager; |
57 | 57 |
import org.gvsig.view3d.swing.api.View3DPanel; |
58 |
import org.gvsig.view3d.swing.api.View3DPanel.TYPE; |
|
58 | 59 |
|
59 | 60 |
/** |
60 | 61 |
* @author llmarques |
... | ... | |
244 | 245 |
public void actionPerformed(ActionEvent e) { |
245 | 246 |
View3DManager manager = View3DLocator.getManager(); |
246 | 247 |
View3DPanel view3dPanel = |
247 |
manager.createView3DPanel(main.getMapContext(), View3DPanel.SPHERE);
|
|
248 |
manager.createView3DPanel(main.getMapContext(), TYPE.SPHERE);
|
|
248 | 249 |
// Change value for constant key |
249 | 250 |
view3dPanel.show(); |
250 | 251 |
} |
... | ... | |
290 | 291 |
public void actionPerformed(ActionEvent e) { |
291 | 292 |
View3DManager manager = View3DLocator.getManager(); |
292 | 293 |
View3DPanel view3dPanel = |
293 |
manager.createView3DPanel(main.getMapContext(), View3DPanel.FLAT);
|
|
294 |
manager.createView3DPanel(main.getMapContext(), TYPE.FLAT);
|
|
294 | 295 |
// Change value for constant key |
295 | 296 |
view3dPanel.show(); |
296 | 297 |
} |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/pom.xml | ||
---|---|---|
34 | 34 |
<groupId>org.jogamp.jogl</groupId> |
35 | 35 |
<artifactId>jogl-all</artifactId> |
36 | 36 |
</dependency> |
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
40 |
</dependency> |
|
37 | 41 |
</dependencies> |
38 | 42 |
</project> |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/View3DManager.java | ||
---|---|---|
25 | 25 |
package org.gvsig.view3d.swing.api; |
26 | 26 |
|
27 | 27 |
import org.gvsig.fmap.mapcontext.MapContext; |
28 |
import org.gvsig.view3d.swing.api.View3DPanel.TYPE; |
|
28 | 29 |
|
29 | 30 |
/** |
30 | 31 |
* @author llmarques |
31 | 32 |
* |
32 | 33 |
*/ |
33 | 34 |
public interface View3DManager { |
34 |
|
|
35 |
|
|
35 | 36 |
/** |
36 | 37 |
* |
37 | 38 |
* @param theMapContext |
38 | 39 |
* @param mode |
39 | 40 |
* @return |
40 | 41 |
*/ |
41 |
public View3DPanel createView3DPanel(MapContext theMapContext, int mode);
|
|
42 |
public View3DPanel createView3DPanel(MapContext theMapContext, TYPE mode);
|
|
42 | 43 |
|
43 | 44 |
} |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/View3DPanel.java | ||
---|---|---|
27 | 27 |
import org.gvsig.fmap.mapcontext.MapContext; |
28 | 28 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
29 | 29 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
30 |
import org.gvsig.tools.swing.api.Component; |
|
30 | 31 |
|
31 | 32 |
/** |
32 | 33 |
* @author llmarques |
33 | 34 |
* |
34 | 35 |
*/ |
35 |
public interface View3DPanel { |
|
36 |
public interface View3DPanel extends Component {
|
|
36 | 37 |
|
37 |
public static final int SPHERE = 0; |
|
38 |
public static final int FLAT = 1; |
|
38 |
public enum TYPE{ SPHERE,FLAT } |
|
39 | 39 |
|
40 | 40 |
/** |
41 | 41 |
* |
... | ... | |
54 | 54 |
* @return |
55 | 55 |
*/ |
56 | 56 |
public MapContext getMapContext(); |
57 |
|
|
58 |
/** |
|
59 |
* |
|
60 |
* @return |
|
61 |
*/ |
|
62 |
public TYPE getType(); |
|
57 | 63 |
|
58 | 64 |
/** |
59 | 65 |
* |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/AbstractView3DPanel.java | ||
---|---|---|
33 | 33 |
import gov.nasa.worldwind.globes.EarthFlat; |
34 | 34 |
import gov.nasa.worldwind.layers.ViewControlsLayer; |
35 | 35 |
import gov.nasa.worldwind.layers.ViewControlsSelectListener; |
36 |
import gov.nasa.worldwind.terrain.ZeroElevationModel; |
|
36 | 37 |
import gov.nasa.worldwind.util.StatusBar; |
37 | 38 |
import gov.nasa.worldwind.view.orbit.BasicOrbitView; |
38 | 39 |
import gov.nasa.worldwind.view.orbit.FlatOrbitView; |
... | ... | |
57 | 58 |
/** |
58 | 59 |
* @param borderLayout |
59 | 60 |
*/ |
60 |
public AbstractView3DPanel(BorderLayout borderLayout, int mode) {
|
|
61 |
public AbstractView3DPanel(BorderLayout borderLayout, TYPE type) {
|
|
61 | 62 |
super(borderLayout); |
62 | 63 |
|
63 | 64 |
// Load configuration file |
... | ... | |
69 | 70 |
} |
70 | 71 |
|
71 | 72 |
// Set mode before instantiation |
72 |
if (mode == SPHERE) {
|
|
73 |
if (type == TYPE.SPHERE) {
|
|
73 | 74 |
setSpherePanelConfiguration(); |
74 |
} else if (mode == FLAT) {
|
|
75 |
} else if (type == TYPE.SPHERE) {
|
|
75 | 76 |
setFlatPanelConfiguration(); |
76 | 77 |
} |
77 | 78 |
|
78 | 79 |
this.add(getWwd(), BorderLayout.CENTER); |
79 |
|
|
80 |
|
|
80 | 81 |
this.add(getStatusBar(), BorderLayout.SOUTH); |
81 | 82 |
} |
82 | 83 |
|
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 | ||
---|---|---|
41 | 41 |
import java.lang.reflect.InvocationTargetException; |
42 | 42 |
import java.util.List; |
43 | 43 |
|
44 |
import javax.swing.JComponent; |
|
45 |
|
|
44 | 46 |
import org.slf4j.Logger; |
45 | 47 |
import org.slf4j.LoggerFactory; |
46 | 48 |
|
... | ... | |
63 | 65 |
private static final long serialVersionUID = -87105248886531868L; |
64 | 66 |
|
65 | 67 |
private MapContext mapContext; |
68 |
|
|
69 |
private TYPE type; |
|
66 | 70 |
|
67 |
public DefaultView3DPanel(MapContext theMapContext, int mode) {
|
|
71 |
public DefaultView3DPanel(MapContext theMapContext, TYPE type) {
|
|
68 | 72 |
|
69 |
super(new BorderLayout(), mode);
|
|
73 |
super(new BorderLayout(), type);
|
|
70 | 74 |
|
71 | 75 |
this.mapContext = theMapContext; |
76 |
this.type = type; |
|
72 | 77 |
|
73 | 78 |
// add(this.mapContext.getLayers()); |
74 | 79 |
|
... | ... | |
87 | 92 |
public MapContext getMapContext() { |
88 | 93 |
return this.mapContext; |
89 | 94 |
} |
95 |
|
|
96 |
public TYPE getType() { |
|
97 |
// TODO Auto-generated method stub |
|
98 |
return this.type; |
|
99 |
} |
|
90 | 100 |
|
91 | 101 |
public double getVerticalExaggeration() { |
92 | 102 |
return getWwd().getSceneController().getVerticalExaggeration(); |
... | ... | |
231 | 241 |
} |
232 | 242 |
} |
233 | 243 |
} |
244 |
|
|
245 |
public JComponent asJComponent() { |
|
246 |
return this; |
|
247 |
} |
|
248 |
|
|
234 | 249 |
} |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DManager.java | ||
---|---|---|
27 | 27 |
import org.gvsig.fmap.mapcontext.MapContext; |
28 | 28 |
import org.gvsig.view3d.swing.api.View3DManager; |
29 | 29 |
import org.gvsig.view3d.swing.api.View3DPanel; |
30 |
import org.gvsig.view3d.swing.api.View3DPanel.TYPE; |
|
30 | 31 |
|
31 | 32 |
|
32 | 33 |
/** |
... | ... | |
35 | 36 |
*/ |
36 | 37 |
public class DefaultView3DManager implements View3DManager { |
37 | 38 |
|
38 |
public View3DPanel createView3DPanel(MapContext theMapContext, int mode) {
|
|
39 |
return new DefaultView3DPanel(theMapContext, mode);
|
|
39 |
public View3DPanel createView3DPanel(MapContext theMapContext, TYPE type) {
|
|
40 |
return new DefaultView3DPanel(theMapContext, type);
|
|
40 | 41 |
} |
41 | 42 |
} |
Also available in: Unified diff