本文整理汇总了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;
}
}
示例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();
}
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
示例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());
}
示例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());
}
}
示例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();
}
}
示例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));
}
}