当前位置: 首页>>代码示例>>Java>>正文


Java RenderableLayer.setName方法代码示例

本文整理汇总了Java中gov.nasa.worldwind.layers.RenderableLayer.setName方法的典型用法代码示例。如果您正苦于以下问题:Java RenderableLayer.setName方法的具体用法?Java RenderableLayer.setName怎么用?Java RenderableLayer.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nasa.worldwind.layers.RenderableLayer的用法示例。


在下文中一共展示了RenderableLayer.setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:24,代码来源:ImportFenceDiagram.java

示例2: 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();
                    }
                });
            }
        }
    });*/
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:55,代码来源:WWJPanel.java

示例3: 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();
                    }
                });
            }
        }
    });*/
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:55,代码来源:GISFrame.java


注:本文中的gov.nasa.worldwind.layers.RenderableLayer.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。