本文整理汇总了Java中gov.nasa.worldwind.awt.WorldWindowGLCanvas类的典型用法代码示例。如果您正苦于以下问题:Java WorldWindowGLCanvas类的具体用法?Java WorldWindowGLCanvas怎么用?Java WorldWindowGLCanvas使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorldWindowGLCanvas类属于gov.nasa.worldwind.awt包,在下文中一共展示了WorldWindowGLCanvas类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlace
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
@Override
protected MapPlace createPlace(MapPlace root, String text, double x,
double y, double zoom) {
WorldWindowGLCanvas wwd = ((WWMap) map).wwd;
OrbitView view = (OrbitView) wwd.getView();
zoom = ((WWMap) map).getGMAZoom();
Position pos = view.getCenterPosition();
double pitch = view.getPitch().degrees;
double heading = view.getHeading().degrees;
double zoom2 = view.getZoom();
double ve = wwd.getSceneController().getVerticalExaggeration();
return new WWMapPlace(
root,
text,
pos.getLongitude().degrees,
pos.getLatitude().degrees,
zoom,
pitch,
heading,
zoom2,
ve);
}
示例2: DialogTerrainProfileConfig
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public DialogTerrainProfileConfig( final WorldWindowGLCanvas wwcanvas,
final TerrainProfileLayer profileLayer,
final IDialogSettings state) {
_wwcanvas = wwcanvas;
_profileLayer = profileLayer;
_state = state;
_toolProvider = new TerrainToolProvider();
_selectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
if (_isUpdateUI) {
return;
}
onModify();
}
};
}
示例3: addProduct
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public void addProduct(final Product product, WorldWindowGLCanvas wwd) {
theWWD = wwd;
final String name = getUniqueName(product);
if (this.outlineTable.get(name) != null)
return;
final GeoCoding geoCoding = product.getSceneGeoCoding();
if (geoCoding == null) {
final String productType = product.getProductType();
if (productType.equals("ASA_WVW_2P") || productType.equals("ASA_WVS_1P") || productType.equals("ASA_WVI_1P")) {
addWaveProduct(product);
}
} else {
if (enableSurfaceImages) {
final InputProductValidator validator = new InputProductValidator(product);
if (validator.isMapProjected() && product.getSceneGeoCoding() != null) {
addSurfaceImage(product);
}
}
// add outline
addOutline(product);
}
}
示例4: getControlPanel
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public JPanel getControlPanel(final WorldWindowGLCanvas wwd) {
final JSlider opacitySlider = new JSlider();
opacitySlider.setMaximum(100);
opacitySlider.setValue((int) (getOpacity() * 100));
opacitySlider.setEnabled(true);
opacitySlider.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
int value = opacitySlider.getValue();
setOpacity(value / 100d);
wwd.repaint();
}
});
//theSelectedObjectLabel = new JLabel("Selected: ");
final JPanel opacityPanel = new JPanel(new BorderLayout(5, 5));
opacityPanel.add(new JLabel("Opacity"), BorderLayout.WEST);
opacityPanel.add(opacitySlider, BorderLayout.CENTER);
return opacityPanel;
}
示例5: initWorldWindLayerModel
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
private void initWorldWindLayerModel()
{
Model model = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
model.setShowWireframeExterior(false);
model.setShowWireframeInterior(false);
model.setShowTessellationBoundingVolumes(false);
if (is3DGlobe) {
model.setGlobe(new Earth());
} else {
model.setGlobe(new EarthFlat());
}
world = new WorldWindowGLCanvas();
world.setModel(model);
}
示例6: WWMap
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public WWMap(MapApp app, WorldWindowGLCanvas wwd) {
super(app, new ConstrainedIdentityProjection(), 1, 1);
this.wwd = wwd;
visibleSector = Sector.FULL_SPHERE;
wwd.getSceneController().addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(AVKey.VIEW)) {
checkVisibleSector();
}
}
});
}
示例7: WWMapTools
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public WWMapTools(MapApp app, XMap map, WorldWindowGLCanvas wwCanvas) {
super(app, map);
this.wwCanvas = wwCanvas;
wwCanvas.getInputHandler().addMouseMotionListener(
new MouseInputAdapter() {
@Override
public void mouseMoved(MouseEvent e) {
lastPoint = e.getPoint();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
updateInfo();
}
});
}
});
wwCanvas.addRenderingListener(new RenderingListener() {
public void stageChanged(RenderingEvent event) {
if (event.getStage().equals(RenderingEvent.AFTER_BUFFER_SWAP)) {
alt = WWMapTools.this.wwCanvas.getView().getEyePosition().getElevation()/1000;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
updateInfo();
}
});
}
}
});
}
示例8: findWorldWindView
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
protected WorldWindowGLCanvas findWorldWindView() {
final WWWorldViewToolView window = (WWWorldViewToolView)
WindowManager.getDefault().findTopComponent("WWWorldMapToolView");
if(window != null) {
return window.getWwd();
}
return null;
}
示例9: setProducts
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public void setProducts(final Product[] products) {
WorldWindowGLCanvas wwd = getWwd();
final LayerList layerList = getWwd().getModel().getLayers();
layerList.stream().filter(layer -> layer instanceof WWLayer).forEach(layer -> {
final WWLayer wwLayer = (WWLayer) layer;
for (Product prod : products) {
try {
wwLayer.addProduct(prod, wwd);
} catch (Exception e) {
SnapApp.getDefault().handleError("WorldWind unable to add product " + prod.getName(), e);
}
}
});
}
示例10: AppPanel
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public AppPanel(final WorldWindowGLCanvas shareWith, final boolean includeStatusBar, final boolean flatWorld,
final boolean removeExtraLayers) {
super(new BorderLayout());
this.wwd = new WorldWindowGLCanvas(shareWith);
// Create the default model as described in the current worldwind properties.
final Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
this.wwd.setModel(m);
if (flatWorld) {
m.setGlobe(new EarthFlat());
this.wwd.setView(new FlatOrbitView());
} else {
m.setGlobe(new Earth());
this.wwd.setView(new BasicOrbitView());
}
if (removeExtraLayers) {
final LayerList layerList = m.getLayers();
for (Layer layer : layerList) {
if (layer instanceof CompassLayer || layer instanceof WorldMapLayer || layer instanceof StarsLayer ||
layer instanceof LandsatI3WMSLayer || layer instanceof SkyGradientLayer)
layerList.remove(layer);
}
}
// Setup a select listener for the worldmap click-and-go feature
this.wwd.addSelectListener(new ClickAndGoSelectListener(wwd, WorldMapLayer.class));
this.wwd.getSceneController().setClutterFilter(new PlacemarkClutterFilter());
this.add(this.wwd, BorderLayout.CENTER);
if (includeStatusBar) {
this.statusBar = new MinimalStatusBar();
this.add(statusBar, BorderLayout.PAGE_END);
this.statusBar.setEventSource(wwd);
}
}
示例11: ZoomEvents
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public ZoomEvents()
{
WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
wwd.setPreferredSize(new java.awt.Dimension(1000, 800));
this.getContentPane().add(wwd, java.awt.BorderLayout.CENTER);
wwd.setModel(new BasicModel());
final Observable<Double> viewEvents = ViewObservables.fromWorldWindViewZooms((OrbitView) wwd.getView());
viewEvents.subscribe(new Observer<Double>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(Double propertyChangeEvent) {
System.out.println("VIEW CHANGE");
}
});
// mouseEventObservable.subscribe(EventConsumer.createMouseEventConsumer());
}
示例12: SimpleShapeDraggingRx
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public SimpleShapeDraggingRx(){
final WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
wwd.setPreferredSize(new java.awt.Dimension(1000, 800));
this.getContentPane().add(wwd, java.awt.BorderLayout.CENTER);
wwd.setModel(new BasicModel());
// Add a layer containing an image
SurfaceImage si = new SurfaceImage("images/400x230-splash-nww.png", Sector.fromDegrees(35, 45, -115, -95));
RenderableLayer layer = new RenderableLayer();
layer.addRenderable(si);
insertBeforePlacenames(wwd, layer);
final BasicDraggerRx draggableSurfaceImage = BasicDraggerRx.makeDraggable(wwd, si);
final Observable<Observable<Position>> dragStreams = draggableSurfaceImage.observePositions();
dragStreams.subscribe(new Action1<Observable<Position>>() {
@Override
public void call(Observable<Position> positionObservable) {
System.out.println("BEGINNING DRAG");
positionObservable.subscribe(new rx.Observer<Position>() {
@Override
public void onCompleted() {
System.out.println("DRAGGING COMPLETED");
}
@Override
public void onError(Throwable e) {}
@Override
public void onNext(Position position) {
//dragging object
}
});
}
});
}
示例13: ConsumeZoomEvents
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
public ConsumeZoomEvents()
{
WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
wwd.setPreferredSize(new java.awt.Dimension(1000, 800));
this.getContentPane().add(wwd, java.awt.BorderLayout.CENTER);
wwd.setModel(new BasicModel());
final Observable<MouseWheelEvent> mouseWheelObservable =
MouseObservables.fromWorldWindMouseWheelEvents(wwd.getInputHandler());
mouseWheelObservable.subscribe(EventConsumer.createMouseEventConsumer());
}
示例14: setupGui
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
private void setupGui(Dimension canvasSize, boolean includeStatusBar)
{
this.wwd = new WorldWindowGLCanvas();
((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);
// Setup a select listener for the worldmap click-and-go feature
this.wwd.addSelectListener(new ClickAndGoSelectListener(this.getWwd(), WorldMapLayer.class));
this.wwd.addRenderingExceptionListener(new RenderingExceptionListener()
{
public void exceptionThrown(Throwable t)
{
GISPanel.this.remove((Component) wwd);
GISPanel.this.failedReq();
return;
}
});
this.add((Component) this.wwd, BorderLayout.CENTER);
if (includeStatusBar)
{
this.statusBar = new StatusBar();
this.add(statusBar, BorderLayout.PAGE_END);
this.statusBar.setEventSource(wwd);
}
// Add the layer manager layer to the model layer list
if(isMiniMap)
{
TellervoLayerManagerLayer layermanager = new TellervoLayerManagerLayer(getWwd(), getWwd().getModel().getLayers());
layermanager.setName("Show/hide layer list");
layermanager.setMinimized(true);
layermanager.setPosition(AVKey.NORTHWEST);
getWwd().getModel().getLayers().add(layermanager);
}
this.validate();
}
示例15: createWorldWindow
import gov.nasa.worldwind.awt.WorldWindowGLCanvas; //导入依赖的package包/类
protected WorldWindow createWorldWindow()
{
return new WorldWindowGLCanvas();
}