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


Java SelectEvent类代码示例

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


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

示例1: selected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
public void selected(SelectEvent event) {
	if (event.getEventAction().equals(SelectEvent.LEFT_CLICK)) {
		Object topObject = event.getTopObject();
		int index = 0;
		for (DetailedIcon icon : icons) {
			if (icon == topObject)
				break;
			index++;
		}

		if (index == icons.length)
			return;

		int j = currentRowsIndices.indexOf( index );
		if (j != -1) {
			table.getSelectionModel().setSelectionInterval(j, j);
			table.ensureIndexIsVisible(j);
		}
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:21,代码来源:WWGTable.java

示例2: updateCursor

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
protected void updateCursor(SelectEvent e)
{
    Object topObject = e.getTopObject();
    if (topObject != null && topObject instanceof ButtonAnnotation)
    {
        this.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.HAND_CURSOR));
    }
    else if (topObject != null && topObject instanceof TellervoAnnotation)
    {
        if (((TellervoAnnotation) topObject).isBusy())
        {
            this.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
        }
        else
        {
            this.setCursor(java.awt.Cursor.getDefaultCursor());
        }
    }
    else
    {
        this.setCursor(java.awt.Cursor.getDefaultCursor());
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:24,代码来源:AbstractTridasAnnotationController.java

示例3: showToolTip

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
protected void showToolTip(SelectEvent e, ButtonAnnotation annotation)
{
    if (this.toolTipComponent == annotation)
        return;

    if (this.toolTipComponent != null)
    {
        this.toolTipComponent.setShowToolTip(false);
        this.toolTipComponent.setToolTipPoint(null);
        this.toolTipComponent = null;
    }

    if (annotation != null)
    {
        java.awt.Point point = this.getToolTipPoint(e);
        this.toolTipComponent = annotation;
        this.toolTipComponent.setShowToolTip(true);
        this.toolTipComponent.setToolTipPoint(point);
    }

    this.getWorldWindow().redraw();
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:23,代码来源:AbstractTridasAnnotationController.java

示例4: addTooltipController

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
public static void addTooltipController( WorldWindow wwd ) {
    new ToolTipController(wwd){

        @Override
        public void selected( SelectEvent event ) {
            // Intercept the selected position and assign its display name
            // the position's data value.
            if (event.getTopObject() instanceof BasicMarkerWithInfo) {
                BasicMarkerWithInfo marker = (BasicMarkerWithInfo) event.getTopObject();
                String info = marker.getInfo();
                marker.setValue(AVKey.DISPLAY_NAME, info);
            }
            super.selected(event);
        }
    };
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:17,代码来源:NwwUtilities.java

示例5: selected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
public void selected(SelectEvent event) {
	if (event.getEventAction().equals(SelectEvent.LEFT_CLICK)) {
		Object topObject = event.getTopObject();
		int index = 0;
		for (DetailedIcon icon : icons) {
			if (icon == topObject)
				break;
			index++;
		}

		if (index == icons.size())
		{
			index = 0;
			for (Earthquake eq : all)
			{
				if (eq == topObject)
					break;
					
				index++;
			}
		}

		if (pickedItem != -1) {
			icons.get(pickedItem).setHighlighted(false);
		}

		if (index == icons.size()) 
			pickedItem = -1;
		else {
			pickedItem = index;
			icons.get(pickedItem).setHighlighted(true);
		}
		selectionChanged();
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:36,代码来源:WWFocalMechanismSolutionDB.java

示例6: selected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的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

示例7: selected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
public void selected(SelectEvent event) {
	if (dataSets == null) return;
	for (Object dataset : dataSets) {
		WWUnknownDataSet ud = ((WWUnknownDataSet) dataset);
		if (ud.enabled && ud.plot)
			ud.selected(event);
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:9,代码来源:WWCustomDB.java

示例8: selected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
public void selected(SelectEvent e)
{
    if (e == null)
        return;

    this.onSelected(e);
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:8,代码来源:AbstractTridasAnnotationController.java

示例9: onSelected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
protected void onSelected(SelectEvent e)
{
    // Forward this event to any ButtonAnnotations under the main annotation.
    this.forwardToButtonAnnotations(this.getAnnotation(), e);

    // Change the cursor type if a ButtonAnnotation is beneath the cursor.
    this.updateCursor(e);

    // Show a tool tip if an ButtonAnnotation is beneath the cursor.
    this.updateToolTip(e);
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:12,代码来源:AbstractTridasAnnotationController.java

示例10: forwardToButtonAnnotations

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
protected void forwardToButtonAnnotations(Annotation annotation, SelectEvent e)
{
    if (annotation instanceof ButtonAnnotation)
    {
        ((ButtonAnnotation) annotation).selected(e);
    }

    for (Annotation child : annotation.getChildren())
    {
        this.forwardToButtonAnnotations(child, e);
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:13,代码来源:AbstractTridasAnnotationController.java

示例11: updateToolTip

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
protected void updateToolTip(SelectEvent e)
{
    if (e.getEventAction() != SelectEvent.HOVER)
        return;

    Object topObject = e.getTopObject();
    if (topObject != null && topObject instanceof ButtonAnnotation)
    {
        this.showToolTip(e, (ButtonAnnotation) topObject);
    }
    else
    {
        this.showToolTip(e, null);
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:16,代码来源:AbstractTridasAnnotationController.java

示例12: getToolTipPoint

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
protected java.awt.Point getToolTipPoint(SelectEvent e)
{
    java.awt.Point pickPoint = e.getPickPoint();

    if (e.getSource() instanceof java.awt.Component)
    {
        pickPoint = this.glPointFromAwt((java.awt.Component) e.getSource(), pickPoint);
    }

    return new java.awt.Point(pickPoint.x, pickPoint.y - 40);
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:12,代码来源:AbstractTridasAnnotationController.java

示例13: selected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
/**
	 * This listener is set in set {@link #setupWWSelectionListener(boolean)}
	 * <p>
	 * {@inheritDoc}
	 * 
	 * @see gov.nasa.worldwind.event.SelectListener#selected(gov.nasa.worldwind.event.SelectEvent)
	 */
	@Override
	public void selected(final SelectEvent event) {

//		if (event.getMouseEvent() != null && event.getMouseEvent().isConsumed()) {
//			return;
//		}
//
//		if (Map3Manager.getMap3View().isContextMenuVisible()) {
//
//			// prevent actions when context menu is visible
//
//			return;
//		}

		final String eventAction = event.getEventAction();

		// get hovered object
		final PickedObject pickedObject = event.getTopPickedObject();

		System.out.println((UI.timeStampNano() + " [" + getClass().getSimpleName() + "] ") //$NON-NLS-1$ //$NON-NLS-2$
				+ ("\teventAction: " + eventAction) //$NON-NLS-1$
				+ ("\tpickedObject: " + pickedObject) //$NON-NLS-1$
		//
				);
		// TODO remove SYSTEM.OUT.PRINTLN
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:34,代码来源:TrackSliderLayer.java

示例14: addTooltipController

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
public static void addTooltipController(WorldWindow wwd) {
    new ToolTipController(wwd) {

        @Override
        public void selected(SelectEvent event) {
            if (event.getTopObject() instanceof BasicMarkerWithInfo) {
                BasicMarkerWithInfo marker = (BasicMarkerWithInfo) event.getTopObject();
                String info = marker.getInfo();
                marker.setValue(AVKey.DISPLAY_NAME, info);
            }
            super.selected(event);
        }
    };
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:15,代码来源:ToolTipsUtils.java

示例15: selected

import gov.nasa.worldwind.event.SelectEvent; //导入依赖的package包/类
public void selected( SelectEvent event ) {
    try {
        // Respond to box rollover select events when armed.
        if (event.getEventAction().equals(SelectEvent.BOX_ROLLOVER) && this.armed)
            this.selectObjects(event.getAllTopObjects());
    } catch (Exception e) {
        // Wrap the handler in a try/catch to keep exceptions from bubbling
        // up

        Logger.INSTANCE.insertError("", "ERROR", e);
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:13,代码来源:ScreenSelector.java


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