本文整理匯總了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();
}
}