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


Java LayerList.remove方法代码示例

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


在下文中一共展示了LayerList.remove方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeLayerVisible

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
public synchronized void makeLayerVisible(Layer newLayer, boolean ignoreLayer) {
	if (newLayer == null) return;

	if (ignoreLayer)
		layerManager.addIgnoredLayer(newLayer);

	LayerList ll = wwModel.getLayers();

	newLayer.setEnabled(true);
	if (newLayer.getOpacity() < .3)
		newLayer.setOpacity(1);

	ll.remove(newLayer);
	ll.add(ll.size(), newLayer);

	if (!ignoreLayer)
		setLayerManagerVisible(true);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:19,代码来源:WWMapApp.java

示例2: disposeLayer

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
private void disposeLayer(Class<?> c) {
	LayerList ll = wwModel.getLayers();

	for (Layer layer : ll) {
		if (c.isInstance(layer)) {
			ll.remove(layer);
			layer.dispose();
			return;
		}
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:WWMapApp.java

示例3: updateComponent

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void updateComponent(Object component, boolean enable)
{
    if (component instanceof Layer)
    {
        Layer layer = (Layer) component;
        LayerList layers = this.wwd.getModel().getLayers();

        layer.setEnabled(enable);

        if (enable)
        {
            if (!layers.contains(layer))
            {
                ApplicationTemplate.insertBeforePlacenames(this.wwd, layer);
                this.firePropertyChange("LayersPanelUpdated", null, layer);
            }
        }
        else
        {
            layers.remove(layer);
            this.firePropertyChange("LayersPanelUpdated", layer, null);
        }
    }
    else if (component instanceof ElevationModel)
    {
        ElevationModel model = (ElevationModel) component;
        CompoundElevationModel compoundModel =
            (CompoundElevationModel) this.wwd.getModel().getGlobe().getElevationModel();

        if (enable)
        {
            if (!compoundModel.getElevationModels().contains(model))
                compoundModel.addElevationModel(model);
        }
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:37,代码来源:WMSLayersPanel.java

示例4: moveLayer

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void moveLayer(WorldWindow wwd, Layer layer, int direction)
{
    // Moves the layer associated with this instance in the direction indicated relative to the other layers.

    int index = this.findLayerPosition(wwd, layer);
    if (index < 0)
        return; // layer not found

    LayerList layerList = wwd.getModel().getLayers();

    this.upButton.setEnabled(true);
    this.downButton.setEnabled(true);

    if (direction < 0 && index == 0) // can't move lowest layer any lower
    {
        this.upButton.setEnabled(false);
        return;
    }

    if (direction > 0 && index == layerList.size() - 1) // can't move highest layer any higher
    {
        this.downButton.setEnabled(false);
        return;
    }

    // Remove the layer from the layer list and then re-insert it.

    layerList.remove(layer);

    if (direction > 0)
        layerList.add(index + 1, layer);
    else if (direction < 0)
        layerList.add(index - 1, layer);

    // Update WorldWind so the change is visible.
    wwd.redraw();
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:38,代码来源:GeneralLayerPanel.java

示例5: drag

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
@Override
protected void drag(SelectEvent event) {
    if (event.getEventAction().equals(SelectEvent.DRAG)) {
        if ((this.isComponentDragEnabled() && getSelectedIndex() == -1 && this.dragRefIndex == -1)
                || this.draggingComponent) {
            // Dragging the whole list
            if (!this.draggingComponent) {
                this.dragRefCursorPoint = event.getMouseEvent().getPoint();
                this.dragRefPoint = getAnnotation().getScreenPoint();
                this.draggingComponent = true;
            }
            final Point cursorOffset = new Point(event.getMouseEvent().getPoint().x - this.dragRefCursorPoint.x,
                                                 event.getMouseEvent().getPoint().y - this.dragRefCursorPoint.y);
            final Point targetPoint = new Point(this.dragRefPoint.x + cursorOffset.x,
                                                this.dragRefPoint.y - cursorOffset.y);
            this.moveTo(targetPoint);
        } else if (this.isLayerDragEnabled()) {
            // Dragging a layer inside the list
            if (!this.draggingLayer) {
                this.dragRefIndex = getSelectedIndex();
                this.draggingLayer = true;
            }
            if (getSelectedIndex() != -1 && this.dragRefIndex != -1 && this.dragRefIndex != getSelectedIndex()) {
                // Move dragged layer
                final LayerList layers = getValidLayers();
                final int insertIndex = this.dragRefIndex > getSelectedIndex() ?
                        getSelectedIndex() : getSelectedIndex() + 1;
                final int removeIndex = this.dragRefIndex > getSelectedIndex() ?
                        this.dragRefIndex + 1 : this.dragRefIndex;
                layers.add(insertIndex, layers.get(this.dragRefIndex));
                layers.remove(removeIndex);
                this.dragRefIndex = getSelectedIndex();
            }
        }
    } else if (event.getEventAction().equals(SelectEvent.DRAG_END)) {
        this.draggingComponent = false;
        this.draggingLayer = false;
        this.dragRefIndex = -1;
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:41,代码来源:LayerPanelLayer.java

示例6: AppPanel

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的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);
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:40,代码来源:AppPanel.java

示例7: drag

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void drag(SelectEvent event)
{
    if (event.getEventAction().equals(SelectEvent.DRAG))
    {
        if ((this.isComponentDragEnabled() && this.selectedIndex == -1 && this.dragRefIndex == -1)
            || this.draggingComponent)
        {
            // Dragging the whole list
            if (!this.draggingComponent)
            {
                this.dragRefCursorPoint = event.getMouseEvent().getPoint();
                this.dragRefPoint = this.annotation.getScreenPoint();
                this.draggingComponent = true;
            }
            Point cursorOffset = new Point(event.getMouseEvent().getPoint().x - this.dragRefCursorPoint.x,
                event.getMouseEvent().getPoint().y - this.dragRefCursorPoint.y);
            Point targetPoint = new Point(this.dragRefPoint.x + cursorOffset.x,
                this.dragRefPoint.y - cursorOffset.y);
            this.moveTo(targetPoint);
        }
        else if (this.isLayerDragEnabled())
        {
            // Dragging a layer inside the list
            if (!this.draggingLayer)
            {
                this.dragRefIndex = this.selectedIndex;
                this.draggingLayer = true;
            }
            if (this.selectedIndex != -1 && this.dragRefIndex != -1 && this.dragRefIndex != this.selectedIndex)
            {
                // Move dragged layer
                LayerList layers = this.wwd.getModel().getLayers();
                int insertIndex = this.dragRefIndex > this.selectedIndex ?
                    this.selectedIndex : this.selectedIndex + 1;
                int removeIndex = this.dragRefIndex > this.selectedIndex ?
                    this.dragRefIndex + 1 : this.dragRefIndex;
                layers.add(insertIndex, layers.get(this.dragRefIndex));
                layers.remove(removeIndex);
                this.dragRefIndex = this.selectedIndex;
            }
        }
    }
    else if (event.getEventAction().equals(SelectEvent.DRAG_END))
    {
        this.draggingComponent = false;
        this.draggingLayer = false;
        this.dragRefIndex = -1;
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:50,代码来源:TellervoLayerManagerLayer.java

示例8: actionPerformed

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent actionEvent) {
    LayerList layers = wwd.getModel().getLayers();
    layers.remove(layer);
    eventsListener.onLayerRemoved(layer);
    wwd.redraw();
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:7,代码来源:DeleteLayerAction.java

示例9: removeLayer

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
public void removeLayer( Layer layer ) {
    LayerList layers = getWwd().getModel().getLayers();
    layers.remove(layer);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:5,代码来源:NwwPanel.java


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