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


Java NativeEvent.BUTTON_RIGHT属性代码示例

本文整理汇总了Java中com.google.gwt.dom.client.NativeEvent.BUTTON_RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java NativeEvent.BUTTON_RIGHT属性的具体用法?Java NativeEvent.BUTTON_RIGHT怎么用?Java NativeEvent.BUTTON_RIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.gwt.dom.client.NativeEvent的用法示例。


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

示例1: onMouseUp

/**
 * Trigger action when mouse up event fired
 * 
 * @param event
 */
protected void onMouseUp(MouseUpEvent event) {
	// Test if Right Click
	if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
		logger.info( "Handle NativeEvent.BUTTON_RIGHT begin >");
		event.stopPropagation();
		event.preventDefault();
		logger.info("Handle NativeEvent.BUTTON_RIGHT end <");
		return;
	}

	if ( !lockDrawConnection && inDragBuildConnection ) {
		logger.info( "draw connection lock: " +  lockDrawConnection );
		NodeShape shape = (NodeShape) getShapeUnderMouse();
		if (shape != null && shape instanceof InNodeShape) {
			Connection c = connfactory.buildConnection(this, startShape, shape);
			if (c == null) {
				Window.alert("Connection can't be build");
			} else {
				c.draw();
				connDrawSet.add(c);
				((NodeShape) startShape).onConnectionEnd(c);
				shape.onConnectionEnd(c);
			}
		}else {
			((NodeShape) startShape).onConnectionCancel();
		}
		deleteConnection(buildConnection);
		inDragBuildConnection = false;
		buildConnection = null;
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:36,代码来源:DiagramController.java

示例2: onMouseDown

/**
 * Trigger action when mouse down event fired
 * 
 * @param event
 */
public void onMouseDown(MouseDownEvent event) {
	logger.info("diagram left mouse down");
	this.getWidgetPanel().getElement().focus();
	if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
		NodeShape shape = (NodeShape) getShapeUnderMouse();
		if (shape instanceof OutNodeShape) {
			OutNodeShape outShape = (OutNodeShape)shape;
			int x = outShape.getOffsetLeft() + 2*outShape.getRadius();
			int y = outShape.getOffsetTop() + 2*outShape.getRadius();
			outShape.getContextMenu().setPopupPosition(x,y);
			outShape.getContextMenu().show();
		}
		if(isvacancy){
			event.stopPropagation();
			event.preventDefault();
			//Popup connection menu
			if( !this.inShapeArea ){
				final Connection c = getConnectionNearMouse();
				if (c != null) {
					showMenu(c);
				}else{
					showContextualMenu(event);
				}
			}

		}

		return;
	}

	if (!lockDrawConnection && inEditionToDrawConnection) {
		logger.info( "draw connection lock: " +  lockDrawConnection );
		inDragBuildConnection = true;
		inEditionToDrawConnection = false;
		((NodeShape) startShape).onConnectionStart();
		drawBuildArrow(startShape, getMousePoint());
	}
	if(!isvacancy){
		event.stopPropagation();
		event.preventDefault();
		focusTimer.scheduleRepeating(50);
	}
	else {
		this.clearSelectedWidgets();
		selectedWidget = null;
		focusTimer.scheduleRepeating(50);
	}
	this.setIsVacancy(true);
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:54,代码来源:DiagramController.java

示例3: onMouseUp

@Override
public void onMouseUp(MouseUpEvent event) {
	super.onMouseUp(event);
	if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
		NodeShape shape = (NodeShape) getShapeUnderMouse();
		if (shape instanceof OutNodeShape) {
			OutNodeShape outShape = (OutNodeShape)shape;
			int x = outShape.getOffsetLeft() + 2*outShape.getRadius();
			int y = outShape.getOffsetTop() + 2*outShape.getRadius();
			outShape.getContextMenu().setPopupPosition(x,y);
			outShape.getContextMenu().show();
		}
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:14,代码来源:MonitorController.java

示例4: onMouseDown

@Override
public void onMouseDown(MouseDownEvent event) {

	super.onMouseDown(event);
	if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
		event.stopPropagation();
		event.preventDefault();
	}

	DiagramController con =this.getController();
	con.setPropTable(ptable);
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:12,代码来源:DatasetWidget.java

示例5: onMouseUp

@Override
public void onMouseUp(MouseUpEvent event) {
	if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
		event.stopPropagation();
		event.preventDefault();
		controller.showMenu(this);
		this.setFocus();
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:9,代码来源:BaseWidget.java


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