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


Java LayerList.get方法代码示例

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


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

示例1: updateCreditButtonState

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void updateCreditButtonState() {
	LayerList ll = wwModel.getLayers();
	for (int i = ll.size() - 1; i >= 0; i--) {
		Layer l = ll.get(i);
		if (l.isEnabled() && (l.getOpacity() > .2)) {
			for (Class<?> c : l.getClass().getInterfaces())
				if (c.equals( InfoSupplier.class )) {
					((WWMapTools)tools).creditB.setEnabled(true);
					return;
				}
			((WWMapTools)tools).creditB.setEnabled(false);
			return;
		}
	}
	((WWMapTools)tools).creditB.setEnabled(false);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:WWMapApp.java

示例2: isUpToDate

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected boolean isUpToDate(WorldWindow wwd)
{
    // Determines whether this layer manager's layer list is consistent with the specified WorldWindow's. Knowing
    // this prevents redundant updates.

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

    if (this.layerPanels.size() != layerList.size())
        return false;

    for (int i = 0; i < layerList.size(); i++)
    {
        if (layerList.get(i) != this.layerPanels.get(i).getLayer())
            return false;
    }

    return true;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:LayerManagerPanel.java

示例3: updateSunAngleProvider

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void updateSunAngleProvider() {
	LayerList ll = wwModel.getLayers();
	for (int i = ll.size() - 1; i >= 0; i--) {
		Layer l = ll.get(i);
		if (l.isEnabled() && (l.getOpacity() > .4) &&
				true)
			for (Class<?> c : l.getClass().getInterfaces())
				if (c.equals( SunAngle.class ) && ((SunAngle) l).isSunValid()) {
					compassLayer.setAngleSupplier((SunAngle) l);
					return;
				}
	}
	compassLayer.setAngleSupplier(null);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:WWMapApp.java

示例4: updateColorScaleProvider

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void updateColorScaleProvider() {
	LayerList ll = wwModel.getLayers();
	for (int i = ll.size() - 1; i >= 0; i--) {
		Layer l = ll.get(i);
		if (l.isEnabled() && (l.getOpacity() > .2)) {
			for (Class<?> c : l.getClass().getInterfaces())
				if (c.equals( ColorScale.class ) && ((ColorScale) l).isColorScaleValid()) {
					colorScaleLayer.setScaleSupplier((ColorScale) l);
					return;
				}
		}
	}
	colorScaleLayer.setScaleSupplier(null);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:WWMapApp.java

示例5: showCredit

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
public void showCredit() {
	LayerList ll = wwModel.getLayers();
	for (int i = ll.size() - 1; i >= 0; i--) {
		Layer l = ll.get(i);
		if (l.isEnabled() && (l.getOpacity() > .2)) {
			for (Class<?> c : l.getClass().getInterfaces())
				if (c.equals( InfoSupplier.class )) {
					String url = ((InfoSupplier) l).getInfoURL();
					BrowseURL.browseURL(url);
				}
			return;
		}
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:WWMapApp.java

示例6: updateInfo

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void updateInfo() {
	if (lastPoint != null) {
		Position position = WWMapTools.this.wwCanvas.getView().computePositionFromScreenPoint(lastPoint.x, lastPoint.y);
		if (position != null) {
			elev = WWMapTools.this.wwCanvas.getModel().getGlobe().getElevation(position.getLatitude(), position.getLongitude());
			lat = position.getLatitude().getDegrees();
			lon = position.getLongitude().getDegrees();

			gridValue = Double.NaN;

			LayerList ll = WWMapTools.this.wwCanvas.getModel().getLayers();
			outer: for (int i = ll.size() - 1; i >= 0; i--) {
				Layer l = ll.get(i);
				if (l.isEnabled() && (l.getOpacity() > .4))
					for (Class<?> c : l.getClass().getInterfaces())
						if (c.equals( QueryableGridLayer.class )) {
							QueryableGridLayer grid = (QueryableGridLayer) l;
							if (grid.getValueUnits() == null) continue;
							gridUnits = grid.getValueUnits().replaceAll("%", "%%");
							gridValue = grid.getValueAt(lat, lon);
							break outer;
						}
			}
		}
	}
	updateInfoLabel();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:28,代码来源:WWMapTools.java

示例7: makeAnnotationText

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
/**
 * Compose the annotation text from the given <code>LayerList</code>.
 *
 * @param layers the <code>LayerList</code> to draw names from.
 * @return the annotation text to be displayed.
 */
protected String makeAnnotationText(LayerList layers)
{
    // Compose html text
    StringBuilder text = new StringBuilder();

    Color color;
    
    for(int i = layers.size()-1; i>0; i = i-1 )
    {
    	Layer layer = layers.get(i);

        if (!this.isMinimized() || layer == this)
        {           	
        	if(this.visibleLayerNames.contains(layer.getName()) )
        	{
             color = (i == this.selectedIndex) ? this.highlightColor : this.color;
             color = (i == this.dragRefIndex) ? dragColor : color;
             text.append("<a href=\"");
             text.append(i);
             text.append("\"><font color=\"");
             text.append(encodeHTMLColor(color));
             text.append("\">");
             text.append((layer.isEnabled() ? layerEnabledSymbol : layerDisabledSymbol));
             text.append(" ");
             text.append((layer.isEnabled() ? "<b>" : "<i>"));
             text.append(layer.getName());
             text.append((layer.isEnabled() ? "</b>" : "</i>"));
             text .append("</a><br />");
        	}
        	else if (layer == this)
        	{
             color = (i == this.selectedIndex) ? this.highlightColor : this.color;
             color = (i == this.dragRefIndex) ? dragColor : color;
             text.append("<a href=\"");
             text.append(i);
             text.append("\"><font color=\"");
             text.append(encodeHTMLColor(color));
             text.append("\">");
             text.append("<b>Layer List</b>");
             text .append("</a><br />");
        	}
        }

    }
    return text.toString();
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:53,代码来源:TellervoLayerManagerLayer.java

示例8: selected

import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
/**
 * <code>SelectListener</code> implementation.
 *
 * @param event the current <code>SelectEvent</code>
 */
@Override
public void selected(SelectEvent event) {
    //System.out.println("event.getEventAction(): " + event.getEventAction());

    final ScreenAnnotation annotation = getAnnotation();
    if (event.hasObjects() && event.getTopObject() == annotation) {
        boolean update = false;
        if (event.getEventAction().equals(SelectEvent.ROLLOVER)
                || event.getEventAction().equals(SelectEvent.LEFT_CLICK)) {
            // Highlight annotation
            if (!annotation.getAttributes().isHighlighted()) {
                annotation.getAttributes().setHighlighted(true);
                update = true;
            }
            // Check for text or url
            final PickedObject po = event.getTopPickedObject();
            if (po.getValue(AVKey.URL) != null) {
                // Set cursor hand on hyperlinks
                ((Component) this.wwd).setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                int i = Integer.parseInt((String) po.getValue(AVKey.URL));
                // Select current hyperlink
                if (getSelectedIndex() != i) {
                    setSelectedIndex(i);
                    update = true;
                }
                // Enable/disable layer on left click
                if (event.getEventAction().equals(SelectEvent.LEFT_CLICK)) {
                    final LayerList layers = getValidLayers();
                    if (i >= 0 && i < layers.size()) {
                        final Layer layer = layers.get(i);
                        final boolean enable = !layer.isEnabled();
                        layer.setEnabled(enable);
                        updateVirtualEarthLayers(layer, enable);
                        update = true;
                    }
                }
            } else {
                // Unselect if not on an hyperlink
                if (getSelectedIndex() != -1) {
                    setSelectedIndex(-1);
                    update = true;
                }
                // Set cursor
                if (this.isComponentDragEnabled())
                    ((Component) this.wwd).setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
                else
                    ((Component) this.wwd).setCursor(Cursor.getDefaultCursor());
            }
        }
        if (event.getEventAction().equals(SelectEvent.DRAG)
                || event.getEventAction().equals(SelectEvent.DRAG_END)) {
            // Handle dragging
            if (this.isComponentDragEnabled() || this.isLayerDragEnabled()) {
                final boolean wasDraggingLayer = this.draggingLayer;
                this.drag(event);
                // Update list if dragging a layer, otherwise just redraw the world window
                if (this.draggingLayer || wasDraggingLayer)
                    update = true;
                else
                    this.wwd.redraw();
            }
        }
        // Redraw annotation if needed
        if (update)
            this.update();
    } else if (event.getEventAction().equals(SelectEvent.ROLLOVER) && annotation.getAttributes().isHighlighted()) {
        // de-highlight annotation
        annotation.getAttributes().setHighlighted(false);
        ((Component) this.wwd).setCursor(Cursor.getDefaultCursor());
        this.update();
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:78,代码来源:LayerPanelLayer.java


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