本文整理汇总了Java中gov.nasa.worldwind.layers.RenderableLayer.addRenderable方法的典型用法代码示例。如果您正苦于以下问题:Java RenderableLayer.addRenderable方法的具体用法?Java RenderableLayer.addRenderable怎么用?Java RenderableLayer.addRenderable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.layers.RenderableLayer
的用法示例。
在下文中一共展示了RenderableLayer.addRenderable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importFenceDiagram
import gov.nasa.worldwind.layers.RenderableLayer; //导入方法依赖的package包/类
public static void importFenceDiagram(JFrame frame, WorldWindow ww, WWMapApp mapApp) {
ImportFenceDiagramDialog dialog = new ImportFenceDiagramDialog(frame);
if (dialog.image == null || dialog.nav == null) return;
int baseElev;
try {
baseElev = NumberFormat.getIntegerInstance().parse(dialog.baseElevation.getText()).intValue();
} catch (ParseException e) {
e.printStackTrace();
return;
}
FenceDiagram fd = new FenceDiagram(ww,
dialog.nav,
baseElev * 1000,
1,
dialog.image);
RenderableLayer rl = new RenderableLayer();
rl.setName(dialog.name.getText());
rl.addRenderable(fd);
mapApp.makeLayerVisible(rl);
}
示例2: attach
import gov.nasa.worldwind.layers.RenderableLayer; //导入方法依赖的package包/类
public void attach()
{
this.getController().setEnabled(true);
RenderableLayer layer = this.mapPanel.getAnnotationLayer();
layer.removeRenderable(this.getAnnotation());
layer.addRenderable(this.getAnnotation());
}
示例3: SimpleShapeDraggingRx
import gov.nasa.worldwind.layers.RenderableLayer; //导入方法依赖的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
}
});
}
});
}
示例4: addKMLLayer
import gov.nasa.worldwind.layers.RenderableLayer; //导入方法依赖的package包/类
/**
* Adds the specified <code>kmlRoot</code> to this app frame's <code>WorldWindow</code> as a new
* <code>Layer</code>, and adds a new <code>KMLLayerTreeNode</code> for the <code>kmlRoot</code> to this app
* frame's on-screen layer tree.
* <p/>
* This expects the <code>kmlRoot</code>'s <code>AVKey.DISPLAY_NAME</code> field to contain a display name
* suitable for use as a layer name.
*
* @param kmlRoot the KMLRoot to add a new layer for.
*/
public void addKMLLayer(KMLRoot kmlRoot)
{
// Create a KMLController to adapt the KMLRoot to the World Wind renderable interface.
KMLController kmlController = new KMLController(kmlRoot);
// Adds a new layer containing the KMLRoot to the end of the WorldWindow's layer list. This
// retrieves the layer name from the KMLRoot's DISPLAY_NAME field.
RenderableLayer layer = new RenderableLayer();
layer.setName((String) kmlRoot.getField(AVKey.DISPLAY_NAME));
layer.addRenderable(kmlController);
this.getWwd().getModel().getLayers().add(layer);
// Adds a new layer tree node for the KMLRoot to the on-screen layer tree, and makes the new node visible
// in the tree. This also expands any tree paths that represent open KML containers or open KML network
// links.
// KMLLayerTreeNode layerNode = new KMLLayerTreeNode(layer, kmlRoot);
//wwd.getModel().getLayers().addLayer(layerNode);
//this.layerTree.makeVisible(layerNode.getPath());
//layerNode.expandOpenContainers(this.layerTree);
// Listens to refresh property change events from KML network link nodes. Upon receiving such an event this
// expands any tree paths that represent open KML containers. When a KML network link refreshes, its tree
// node replaces its children with new nodes created from the refreshed content, then sends a refresh
// property change event through the layer tree. By expanding open containers after a network link refresh,
// we ensure that the network link tree view appearance is consistent with the KML specification.
/* layerNode.addPropertyChangeListener(AVKey.RETRIEVAL_STATE_SUCCESSFUL, new PropertyChangeListener()
{
public void propertyChange(final PropertyChangeEvent event)
{
if (event.getSource() instanceof KMLNetworkLinkTreeNode)
{
// Manipulate the tree on the EDT.
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
// ((KMLNetworkLinkTreeNode) event.getSource()).expandOpenContainers(layerTree);
getWwd().redraw();
}
});
}
}
});*/
}
示例5: addKMLLayer
import gov.nasa.worldwind.layers.RenderableLayer; //导入方法依赖的package包/类
/**
* Adds the specified <code>kmlRoot</code> to this app frame's <code>WorldWindow</code> as a new
* <code>Layer</code>, and adds a new <code>KMLLayerTreeNode</code> for the <code>kmlRoot</code> to this app
* frame's on-screen layer tree.
* <p/>
* This expects the <code>kmlRoot</code>'s <code>AVKey.DISPLAY_NAME</code> field to contain a display name
* suitable for use as a layer name.
*
* @param kmlRoot the KMLRoot to add a new layer for.
*/
protected void addKMLLayer(KMLRoot kmlRoot)
{
// Create a KMLController to adapt the KMLRoot to the World Wind renderable interface.
KMLController kmlController = new KMLController(kmlRoot);
// Adds a new layer containing the KMLRoot to the end of the WorldWindow's layer list. This
// retrieves the layer name from the KMLRoot's DISPLAY_NAME field.
RenderableLayer layer = new RenderableLayer();
layer.setName((String) kmlRoot.getField(AVKey.DISPLAY_NAME));
layer.addRenderable(kmlController);
wwMapPanel.getWwd().getModel().getLayers().add(layer);
// Adds a new layer tree node for the KMLRoot to the on-screen layer tree, and makes the new node visible
// in the tree. This also expands any tree paths that represent open KML containers or open KML network
// links.
/*KMLLayerTreeNode layerNode = new KMLLayerTreeNode(layer, kmlRoot);
this.layerTree.getModel().addLayer(layerNode);
this.layerTree.makeVisible(layerNode.getPath());
layerNode.expandOpenContainers(this.layerTree);*/
// Listens to refresh property change events from KML network link nodes. Upon receiving such an event this
// expands any tree paths that represent open KML containers. When a KML network link refreshes, its tree
// node replaces its children with new nodes created form the refreshed content, then sends a refresh
// property change event through the layer tree. By expanding open containers after a network link refresh,
// we ensure that the network link tree view appearance is consistent with the KML specification.
/*layerNode.addPropertyChangeListener(AVKey.RETRIEVAL_STATE_SUCCESSFUL, new PropertyChangeListener()
{
public void propertyChange(final PropertyChangeEvent event)
{
if (event.getSource() instanceof KMLNetworkLinkTreeNode)
{
// Manipulate the tree on the EDT.
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
((KMLNetworkLinkTreeNode) event.getSource()).expandOpenContainers(layerTree);
getWwd().redraw();
}
});
}
}
});*/
}