gvsig-3d / 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 @ 448
History | View | Annotate | Download (2.47 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright ? 2007-2015 gvSIG Association
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
|
25 |
package org.gvsig.view3d.swing.impl; |
26 |
|
27 |
import java.awt.BorderLayout; |
28 |
|
29 |
import javax.swing.JComponent; |
30 |
import javax.swing.JPanel; |
31 |
|
32 |
import org.gvsig.fmap.mapcontext.MapContext; |
33 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
34 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
35 |
import org.gvsig.view3d.swing.api.MapControl3D; |
36 |
import org.gvsig.view3d.swing.api.View3DPanel; |
37 |
import org.gvsig.view3d.swing.api.View3DSwingLocator; |
38 |
import org.gvsig.view3d.swing.api.View3DSwingManager; |
39 |
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE; |
40 |
|
41 |
/**
|
42 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
|
43 |
*
|
44 |
*/
|
45 |
public class DefaultView3DPanel extends JPanel implements View3DPanel { |
46 |
|
47 |
private static final long serialVersionUID = -87105248886531868L; |
48 |
|
49 |
private MapControl3D mapControl3D;
|
50 |
|
51 |
/**
|
52 |
* @param theMapContext
|
53 |
* @param type
|
54 |
*/
|
55 |
public DefaultView3DPanel(MapContext theMapContext, TYPE type) {
|
56 |
super(new BorderLayout()); |
57 |
|
58 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
59 |
this.mapControl3D =
|
60 |
swingManager.createMapControl3D(theMapContext, type); |
61 |
|
62 |
this.add(mapControl3D.asJComponent(), BorderLayout.CENTER); |
63 |
} |
64 |
|
65 |
public JComponent asJComponent() { |
66 |
return this; |
67 |
} |
68 |
|
69 |
public MapControl3D getMapControl3D() {
|
70 |
return this.mapControl3D; |
71 |
} |
72 |
|
73 |
public void show() { |
74 |
WindowManager wm = ToolsSwingLocator.getWindowManager(); |
75 |
wm.showWindow(this, "_View3D_window", |
76 |
WindowManager.MODE.WINDOW); |
77 |
} |
78 |
|
79 |
} |