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


Java MouseUpEvent.getNativeButton方法代码示例

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


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

示例1: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
/**
 * 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,代码行数:37,代码来源:DiagramController.java

示例2: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
@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,代码行数:15,代码来源:MonitorController.java

示例3: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent event) {
    GWT.log("onMouseUp(MouseUpEvent)");
    if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) {
        GanttWidget.this.onTouchOrMouseUp(event.getNativeEvent());

    } else {
        if (secondaryClickOnNextMouseUp) {
            Element bar = getBar(event.getNativeEvent());
            if (bar != null && isEnabled()) {
                getRpc().stepClicked(getStepUid(bar), event.getNativeEvent(), bar);
            }
        }
        secondaryClickOnNextMouseUp = true;
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:17,代码来源:GanttWidget.java

示例4: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
/** Set a new point on the distance-line. */
public void onMouseUp(MouseUpEvent event) {
	if (event.getNativeButton() != NativeEvent.BUTTON_RIGHT) {
		Coordinate coordinate = getWorldPosition(event);
		if (distanceLine.getOriginalLocation() == null) {
			distanceLine.setGeometry(getFactory().createLineString(new Coordinate[] { coordinate }));
			mapWidget.registerWorldPaintable(distanceLine);
			mapWidget.registerWorldPaintable(lineSegment);
			dispatchState(State.START);
		} else {
			Geometry geometry = (Geometry) distanceLine.getOriginalLocation();
			InsertCoordinateOperation op = new InsertCoordinateOperation(geometry.getNumPoints(), coordinate);
			geometry = op.execute(geometry);
			distanceLine.setGeometry(geometry);
			tempLength = (float) geometry.getLength();
			updateMeasure(event, true);
			dispatchState(State.CLICK);
		}
		mapWidget.render(mapWidget.getMapModel(), RenderGroup.VECTOR, RenderStatus.UPDATE);
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:22,代码来源:MeasureDistanceController.java

示例5: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent event) {
	if (controller != null) {
		controller.onMouseUp(event);
		if (!controller.isBusy()) {
			panController.onMouseUp(event);
		}
	} else {
		if (event.getNativeButton() != Event.BUTTON_RIGHT) {
			boolean moving = panController.isMoving();
			panController.onMouseUp(event);
			if (!moving) {
				// Check if we can toggle selection on a feature:
				ToggleSelectionAction action = new ToggleSelectionAction(mapWidget, pixelTolerance);
				action.toggle(getScreenPosition(event), true);
			}
		}
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:20,代码来源:ParentEditController.java

示例6: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
public void onMouseUp(MouseUpEvent event) {
  ChartState chartInfo = getChartState(event);
  Chart chart = chartInfo.chart;
  XYPlot plot = chart.getPlot();
  int x = getLocalX(event);
  int y = getLocalY(event);
  OverviewAxisMouseMoveHandler.setHiliteRelativeGrabX(Double.NaN);

  CompoundUIAction uiAction = chartInfo.getCompoundUIAction();
  if (uiAction.isSelecting()) {
    chart.setAnimating(false);
    chart.zoomToHighlight();
  } else if (uiAction.getSource() != null && uiAction.isDragging(uiAction.getSource()) && x != uiAction.getDragStartX()) {
    if (uiAction.getSource() instanceof Overlay) {
      ((Overlay) uiAction.getSource()).fire(new ChartDragEndEvent(plot, x));
    } else {
      HistoryManager.pushHistory();
    }
    chart.setAnimating(false);
    
    // FIXME: this produces several unneeded redraws, if we remove this, dragging does not 
    // redraw correctly, so algorithm  in mouse move should be reviewd
    ((DefaultXYPlot) chart.getPlot()).redraw(true);
  }

  chartInfo.getCompoundUIAction().cancel();
  chart.setCursor(Cursor.DEFAULT);

  if (event.getNativeButton() == Event.BUTTON_RIGHT) {
    ((DefaultXYPlot) chart.getPlot()).fireContextMenuEvent(x, y);
  } else {
    // fire click, in mouse up events this fixes click on flash view.
    chart.click(x, y);
  }

  chartInfo.setHandled(true);
}
 
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:38,代码来源:ChartMouseUpHandler.java

示例7: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent p_event)
{
  p_event.preventDefault();
  UserAction userAction = UserAction.Primary;
  if (p_event.isControlKeyDown() || p_event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
    userAction = UserAction.Secondary;
  }
  onUp(userAction, p_event.getX(), p_event.getY());
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:11,代码来源:WgtBoardBase.java

示例8: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
public void onMouseUp(MouseUpEvent event) {
	if (event.getNativeButton() != Event.BUTTON_RIGHT) {
		removeTempPoint();
		createTempPoint();
		handler.onDraw(getGeometry());
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:8,代码来源:PointDrawController.java

示例9: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent event) {

	if (NativeEvent.BUTTON_LEFT == event.getNativeButton()) {
		Bbox currView = mapWidget.getMapModel().getMapView().getBounds();
		double w = currView.getWidth() / 3;
		double h = currView.getHeight() / 3;

		mapWidget.getMapModel().getMapView().translate(direction.getX() * w, direction.getY() * h);
		event.stopPropagation();
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:13,代码来源:PanArrowController.java

示例10: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入方法依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent event) {
	if (event.getNativeButton() != Event.BUTTON_RIGHT) {
		addCoordinateToGeometry(getWorldPosition(event));
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:7,代码来源:LineStringDrawController.java


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