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