• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java PickedObjectList类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中gov.nasa.worldwind.pick.PickedObjectList的典型用法代码示例。如果您正苦于以下问题:Java PickedObjectList类的具体用法?Java PickedObjectList怎么用?Java PickedObjectList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

PickedObjectList类属于gov.nasa.worldwind.pick包,在下文中一共展示了PickedObjectList类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: selected

点赞 2

import gov.nasa.worldwind.pick.PickedObjectList; //导入依赖的package包/类
public void selected(SelectEvent evt) {
	if (evt.getEventAction().equals(SelectEvent.LEFT_CLICK))
	{
		PickedObjectList pol = evt.getObjects();
		for (PickedObject po : pol)
		{
			Object obj = po.getObject();
			if (obj instanceof Polyline) {
				int i = cruiseLines.indexOf(
						obj);
				if (i == -1) continue;

				lineList.setSelectedIndex(0);
				lineList.setSelectedItem(currentCruise.getLines()[i]);
				return;
			} else if (obj instanceof FenceDiagram) {
				// Get the associated XMLine
				for (Entry<XMLine, FenceDiagram> entry : fdS.entrySet())
				{
					if (entry.getValue() != obj) continue;
					
					lineList.setSelectedItem(entry.getKey());
					return;
				}
			}
		}
	}
}
 

开发者ID:iedadata,
项目名称:geomapapp,
代码行数:29,
代码来源:WWXMCS.java

示例2: render

点赞 2

import gov.nasa.worldwind.pick.PickedObjectList; //导入依赖的package包/类
@Override
public void render(DrawContext dc) {
    if (dc.isPickingMode() && this.isResizeable())
        return;

    // This is called twice: once during normal rendering, then again during ordered surface rendering. During
    // normal renering we render both the interior and border shapes. During ordered surface rendering, both
    // shapes are already added to the DrawContext and both will be individually processed. Therefore we just
    // call our superclass behavior
    if (dc.isOrderedRenderingMode()) {
        super.render(dc);
        return;
    }

    if (!this.isResizeable()) {
        if (this.hasSelection()) {
            this.doRender(dc);
        }
        return;
    }

    PickedObjectList pos = dc.getPickedObjects();
    PickedObject terrainObject = pos != null ? pos.getTerrainObject() : null;

    if (terrainObject == null)
        return;

    if (this.getStartPosition() != null) {
        Position end = terrainObject.getPosition();
        if (!this.getStartPosition().equals(end)) {
            this.setEndPosition(end);
            this.setSector(Sector.boundingSector(this.getStartPosition(), this.getEndPosition()));
            this.doRender(dc);
        }
    } else {
        this.setStartPosition(pos.getTerrainObject().getPosition());
    }
}
 

开发者ID:TheHortonMachine,
项目名称:hortonmachine,
代码行数:39,
代码来源:SectorSelector.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)