本文整理汇总了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;
}
}
示例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);
}
示例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();
}
}
}
示例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);
}
示例5: onMouseUp
@Override
public void onMouseUp(MouseUpEvent event) {
if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
event.stopPropagation();
event.preventDefault();
controller.showMenu(this);
this.setFocus();
}
}