forked from NASAWorldWind/WorldWindJava
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAppPanel.java
More file actions
58 lines (46 loc) · 1.84 KB
/
AppPanel.java
File metadata and controls
58 lines (46 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (C) 2012 United States Government as represented by the Administrator of the
* National Aeronautics and Space Administration.
* All Rights Reserved.
*/
package gov.nasa.cms;
import gov.nasa.cms.util.HighlightController;
import gov.nasa.cms.util.ToolTipController;
import gov.nasa.worldwind.Model;
import gov.nasa.worldwind.WorldWind;
import gov.nasa.worldwind.WorldWindow;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.awt.WorldWindowGLCanvas;
import gov.nasa.worldwind.event.SelectEvent;
import gov.nasa.worldwind.util.StatusBar;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.JPanel;
public class AppPanel extends JPanel {
private WorldWindow wwd;
protected StatusBar statusBar;
protected ToolTipController toolTipController;
protected HighlightController highlightController;
public AppPanel(Dimension canvasSize) { //, boolean includeStatusBar) {
super(new BorderLayout());
this.wwd = this.createWorldWindow();
((Component) this.wwd).setPreferredSize(canvasSize);
// Create the default model as described in the current worldwind properties.
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
this.wwd.setModel(m);
this.add((Component) this.wwd, BorderLayout.CENTER);
// Add controllers to manage highlighting and tool tips.
this.toolTipController = new ToolTipController(this.getWwd(), AVKey.DISPLAY_NAME, null);
this.highlightController = new HighlightController(this.getWwd(), SelectEvent.ROLLOVER);
}
protected WorldWindow createWorldWindow() {
return new WorldWindowGLCanvas();
}
public WorldWindow getWwd() {
return wwd;
}
public StatusBar getStatusBar() {
return statusBar;
}
}