當前位置: 首頁>>代碼示例>>Java>>正文


Java MouseDownEvent.getNativeButton方法代碼示例

本文整理匯總了Java中com.google.gwt.event.dom.client.MouseDownEvent.getNativeButton方法的典型用法代碼示例。如果您正苦於以下問題:Java MouseDownEvent.getNativeButton方法的具體用法?Java MouseDownEvent.getNativeButton怎麽用?Java MouseDownEvent.getNativeButton使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.event.dom.client.MouseDownEvent的用法示例。


在下文中一共展示了MouseDownEvent.getNativeButton方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public void onMouseDown(MouseDownEvent event) {
    GWT.log("onMouseDown(MouseDownEvent)");
    if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) {
        GanttWidget.this.onTouchOrMouseDown(event.getNativeEvent());
    } else {
        secondaryClickOnNextMouseUp = true;
        new Timer() {

            @Override
            public void run() {
                secondaryClickOnNextMouseUp = false;
            }
        }.schedule(CLICK_INTERVAL);
        event.stopPropagation();
    }
}
 
開發者ID:tltv,項目名稱:gantt,代碼行數:18,代碼來源:GanttWidget.java

示例2: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
public void onMouseDown(MouseDownEvent event) {
	FeatureTransaction featureTransaction = getFeatureTransaction();
	if (featureTransaction != null && parent.getEditMode() == EditMode.DRAG_MODE
			&& event.getNativeButton() != Event.BUTTON_RIGHT) {
		String targetId = getTargetId(event);
		if (TransactionGeomIndexUtil.isVertex(targetId)) {
			dragTargetId = targetId;
			if (dragTransaction == null) {
				dragTransaction = (FeatureTransaction) featureTransaction.clone();
			}
			mapWidget.render(featureTransaction, RenderGroup.VECTOR, RenderStatus.DELETE);
			mapWidget.render(dragTransaction, RenderGroup.VECTOR, RenderStatus.ALL);
			createTempLine(featureTransaction, event);
		}
	}
}
 
開發者ID:geomajas,項目名稱:geomajas-project-client-gwt,代碼行數:17,代碼來源:LineStringEditController.java

示例3: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
public void onMouseDown(MouseDownEvent event) {
	FeatureTransaction featureTransaction = getFeatureTransaction();
	if (featureTransaction != null && parent.getEditMode() == EditMode.DRAG_MODE
			&& event.getNativeButton() != Event.BUTTON_RIGHT) {
		String targetId = getTargetId(event);
		if (TransactionGeomIndexUtil.isVertex(targetId)) {
			dragTargetId = targetId;
			if (dragTransaction == null) {
				dragTransaction = (FeatureTransaction) featureTransaction.clone();
			}
			mapWidget.render(featureTransaction, RenderGroup.VECTOR, RenderStatus.DELETE);
			mapWidget.render(dragTransaction, RenderGroup.VECTOR, RenderStatus.ALL);
			createTempLines(featureTransaction, event);
		}
	}
}
 
開發者ID:geomajas,項目名稱:geomajas-project-client-gwt,代碼行數:17,代碼來源:PolygonEditController.java

示例4: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
/**
 * 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,代碼行數:55,代碼來源:DiagramController.java

示例5: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public boolean onMouseDown(MouseDownEvent event, Element context) {
  if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
    return false;
  }

  ReplyBoxView indicatorView = panel.asReplyBox(context);
  ThreadView threadView = indicatorView.getParent();
  ConversationThread thread = modelAsViewProvider.getThread(threadView);
  actions.addBlipToThread(thread);
  event.preventDefault();
  return true;
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:14,代碼來源:ReplyIndicatorController.java

示例6: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public boolean onMouseDown(MouseDownEvent event, Element source) {
  if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
    return false;
  }
  BlipView blipView = panel.asBlip(source);
  ConversationBlip blip = modelAsViewProvider.getBlip(blipView);
  focus.focus(blip);    
  return true;
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:11,代碼來源:FocusFrameController.java

示例7: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public boolean onMouseDown(MouseDownEvent event, Element source) {
  if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
    return false;
  }
  handleClick(panel.fromToggle(source));
  return false;
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:9,代碼來源:CollapseController.java

示例8: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public void onMouseDown(MouseDownEvent event) {
    if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) {
        GWT.log("Starting point Clicked!");

        handleDownEvent(event.getNativeEvent());
    }
}
 
開發者ID:tltv,項目名稱:gantt,代碼行數:9,代碼來源:SvgArrowWidget.java

示例9: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
/**
 * Register center point for the circle, and start dragging and rendering.
 * 
 * @param event
 *            event
 */
public void onMouseDown(MouseDownEvent event) {
	if (event.getNativeButton() != NativeEvent.BUTTON_RIGHT) {
		dragging = true;
		center = getScreenPosition(event);

		LineString radiusLine = mapWidget.getMapModel().getGeometryFactory().createLineString(
				new Coordinate[] { center, center });
		mapWidget.getVectorContext().drawGroup(mapWidget.getGroup(RenderGroup.SCREEN), circleGroup);
		mapWidget.getVectorContext().drawCircle(circleGroup, "outer", center, 1.0f, circleStyle);
		mapWidget.getVectorContext().drawCircle(circleGroup, "center", center, 2.0f, circleStyle);
		mapWidget.getVectorContext().drawLine(circleGroup, "radius", radiusLine, circleStyle);
	}
}
 
開發者ID:geomajas,項目名稱:geomajas-project-client-gwt,代碼行數:20,代碼來源:AbstractCircleController.java

示例10: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public void onMouseDown(MouseDownEvent event) {
	if (event.getNativeButton() != NativeEvent.BUTTON_RIGHT) {
		dragging = true;
		oldPosition = getWorldPosition(event);
		previous = getScreenPosition(event);
		mapWidget.setCursor(Cursor.POINTER);
	}
}
 
開發者ID:geomajas,項目名稱:geomajas-project-client-gwt,代碼行數:10,代碼來源:OverviewMapController.java

示例11: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
public void onMouseDown(MouseDownEvent event) {
	FeatureTransaction featureTransaction = getFeatureTransaction();
	if (featureTransaction != null && parent.getEditMode() == EditMode.DRAG_MODE
			&& event.getNativeButton() != Event.BUTTON_RIGHT) {
		String targetId = getTargetId(event);
		if (TransactionGeomIndexUtil.isDraggable(targetId)) {
			dragTargetId = targetId;
			if (dragTransaction == null) {
				dragTransaction = (FeatureTransaction) featureTransaction.clone();
			}
			mapWidget.render(featureTransaction, RenderGroup.VECTOR, RenderStatus.DELETE);
			mapWidget.render(dragTransaction, RenderGroup.VECTOR, RenderStatus.ALL);
		}
	}
}
 
開發者ID:geomajas,項目名稱:geomajas-project-client-gwt,代碼行數:16,代碼來源:PointEditController.java

示例12: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public boolean onMouseDown(MouseDownEvent event, Element source) {
  if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
    return false;
  }
  focus.focusWithoutScroll(panel.asBlip(source));
  // Cancel bubbling, so that other blips do not grab focus.
  return true;
}
 
開發者ID:apache,項目名稱:incubator-wave,代碼行數:10,代碼來源:FocusFrameController.java

示例13: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public boolean onMouseDown(MouseDownEvent event, Element context) {
  if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
    return false;
  }
  BlipMenuItemView item = panel.asBlipMenuItem(context);
  switch (item.getOption()) {
    case EDIT:
      actions.startEditing(item.getParent().getParent());
      break;
    case EDIT_DONE:
      actions.stopEditing();
      break;
    case REPLY:
      actions.reply(item.getParent().getParent());
      break;
    case DELETE:
      // We delete the blip without confirmation if shift key is pressed
      if (event.getNativeEvent().getShiftKey() || Window.confirm(messages.confirmDeletion())) {
        actions.delete(item.getParent().getParent());
      }
      break;
    case LINK:
      actions.popupLink(item.getParent().getParent());
      break;
    default:
      throw new AssertionError();
  }
  event.preventDefault();
  return true;
}
 
開發者ID:apache,項目名稱:incubator-wave,代碼行數:32,代碼來源:MenuController.java

示例14: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
public void onMouseDown(MouseDownEvent event) {
  ChartState chartInfo = getChartState(event);
  Chart chart = chartInfo.chart;
  int x = getLocalX(event);
  int y = getLocalY(event);

  if (y > (chart.getView().getHeight() - chart.getPlot().getOverviewAxisPanel().getBounds().height)) {
    int overviewX = (int)chart.getPlot().getBounds().x;
    Bounds highlightBounds = chart.getPlot().getOverviewAxisPanel().getHighlightBounds();
    if ( highlightBounds != null) {
      int hiliteX = (int) highlightBounds.x;
      System.out.println("   MOUSEDOWN    x:"+x+" overviewX:"+overviewX+" hiliteX:"+hiliteX);
      OverviewAxisMouseMoveHandler.setHiliteRelativeGrabX((double)((x - overviewX) - hiliteX));
    }
  }
  boolean handled;

  if (event.getNativeButton() == Event.BUTTON_RIGHT) {
    // Ignore mouse right-click -- let browser handle event.
    handled = false;
  } else {
    // Set the UI component that initiated the drag or select
    CompoundUIAction uiAction = chartInfo.getCompoundUIAction();
    uiAction.setSource(getComponent(x, y, chart.getPlot()));
    if (event.isShiftKeyDown()) {
      chart.setCursor(Cursor.SELECTING);
      uiAction.setSelectAction(true);
    } else {
      chart.setCursor(Cursor.DRAGGING);
      uiAction.setSelectAction(false);
    }
    uiAction.setStartX(x);
    if (uiAction.getSource() instanceof Overlay) {
    
      handled = true;
    } else {
      chart.setPlotFocus(x, y);
      handled = true;
    }
  }

  chartInfo.setHandled(handled);
}
 
開發者ID:codeaudit,項目名稱:gwt-chronoscope,代碼行數:44,代碼來源:ChartMouseDownHandler.java

示例15: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
public void onMouseDown(MouseDownEvent e) {
	if (e.getNativeButton()==NativeEvent.BUTTON_LEFT || e.getNativeButton()==NativeEvent.BUTTON_MIDDLE)
		close(true);
	else
		close(false);
}
 
開發者ID:sharpie7,項目名稱:circuitjs1,代碼行數:7,代碼來源:ScrollValuePopup.java


注:本文中的com.google.gwt.event.dom.client.MouseDownEvent.getNativeButton方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。