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


Java MouseUpEvent类代码示例

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


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

示例1: onMouseDown

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

	Icon dragIcon = (Icon) event.getSource();
	this.selectedRow = (TableRow<T>) dragIcon.getParent().getParent();
	this.body = (TableEditorBody<T>) this.selectedRow.getParent();

	this.overRegistration = new HandlerRegistrationCollection();
	this.upRegistration = RootPanel.get().addDomHandler(this, MouseUpEvent.getType());
	this.rows = Lists.newArrayList(this.body.getRows());
	for (TableRow<T> row : this.rows) {
		this.overRegistration.add(row.addDomHandler(this, MouseOverEvent.getType()));
	}
	TableOrder.this.disableTextSelection(true);
	RootPanel.get().getElement().getStyle().setCursor(Style.Cursor.MOVE);
	StyleUtils.addStyle(this.selectedRow, TableOrder.STYLE_ROW_DRAGING);
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:19,代码来源:TableOrder.java

示例2: 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

示例3: 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

示例4: registerHandlers

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
private void registerHandlers() {
	if(BrowserUtils.isMobile) {
		registerHandler(this.addDomHandler(this, TouchStartEvent.getType()));
		registerHandler(this.addDomHandler(this, TouchEndEvent.getType()));
	} else {
		registerHandler(this.addDomHandler(this, MouseDownEvent.getType()));
		registerHandler(this.addDomHandler(this, MouseUpEvent.getType()));
		registerHandler(this.addDomHandler(this, MouseOutEvent.getType()));
	}
	registerHandler(this.addHandler(this, DragStartEvent.getType()));
	registerHandler(this.addHandler(this, DragMoveEvent.getType()));
	registerHandler(this.addHandler(this, DragEndEvent.getType()));
	registerHandler(this.addHandler(this, DragCancelEvent.getType()));
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:15,代码来源:ListPanelComponent.java

示例5: createSystemTabItem

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
private TabBarItemComponent createSystemTabItem(EnumSystemTabItemType itemType) {
	TabBarItem tabBarItem = null;
	TabBarItemComponent component = null;
	AutoBean<TabBarItem> TabBarItemBean = AutoBeanService.getInstance().getFactory().tabBarItem();
	tabBarItem = TabBarItemBean.as();
	switch (itemType) {
		case PREVIOUS:
			tabBarItem.setName("<");
			break;
		case NEXT:
			tabBarItem.setName(">");
			break;
	}
	component = new TabBarItemComponent(tabBarItem, itemType);
	// Add handlers as not created by usual mechanism
	if(BrowserUtils.isMobile) {
		systemTabHandlers.add(component.addDomHandler(this, TouchStartEvent.getType()));
		systemTabHandlers.add(component.addDomHandler(this, TouchEndEvent.getType()));
	} else {
		systemTabHandlers.add(component.addDomHandler(this, MouseDownEvent.getType()));
		systemTabHandlers.add(component.addDomHandler(this, MouseUpEvent.getType()));
		systemTabHandlers.add(component.addDomHandler(this, MouseOutEvent.getType()));
	}
	systemTabHandlers.add(component.addHandler(component, TapEvent.getType()));
	return component;
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:27,代码来源:TabBarComponent.java

示例6: endDragging

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
@Override
protected void endDragging(MouseUpEvent event) {
	if (this.dragMode >= 0 && this.resizable) {
		DOM.releaseCapture(getElement());

	    this.dragX = event.getClientX() - this.dragX;
	    this.dragY = event.getClientY() - this.dragY;
	    
	    this.dragMode = -1;
	    this.updateCursor(this.dragMode);
	    RootPanel.get().getElement().getStyle().setCursor(Cursor.AUTO);
	}
	else {
		super.endDragging(event);
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:17,代码来源:WindowBox.java

示例7: setupDelegatingMouseUpHandler

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
protected void setupDelegatingMouseUpHandler() {
    widgetContainer.addDomHandler(new MouseUpHandler() {
                                      @Override
                                      public void onMouseUp(final MouseUpEvent event) {
                                          gridLayer.onNodeMouseUp(new NodeMouseUpEvent(event) {

                                              @Override
                                              public int getX() {
                                                  //Adjust the x-coordinate (relative to the DOM Element) to be relative to the GridCanvas.
                                                  return super.getX() + widgetContainer.getElement().getOffsetLeft();
                                              }

                                              @Override
                                              public int getY() {
                                                  //Adjust the y-coordinate (relative to the DOM Element) to be relative to the GridCanvas.
                                                  return super.getY() + widgetContainer.getElement().getOffsetTop();
                                              }
                                          });
                                      }
                                  },
                                  MouseUpEvent.getType());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:BaseDOMElement.java

示例8: testMouseUpEvent

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
@Test
public void testMouseUpEvent() {
    final MouseDownEvent md0 = mock(MouseDownEvent.class);
    when(md0.getRelativeX(any(Element.class))).thenReturn(0);
    when(md0.getRelativeY(any(Element.class))).thenReturn(0);
    final NodeMouseDownEvent nmd0 = new NodeMouseDownEvent(md0);

    final MouseUpEvent mu0 = mock(MouseUpEvent.class);
    final NodeMouseUpEvent nmu0 = new NodeMouseUpEvent(mu0);

    mediator.handleEvent(nmd0);
    mediator.handleEvent(nmu0);

    verify(vpStyle,
           times(1)).setCursor(eq(Style.Cursor.MOVE));
    verify(vpStyle,
           times(1)).setCursor(eq(Style.Cursor.DEFAULT));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:BoundaryMousePanMediatorTest.java

示例9: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
@Override
public void onMouseUp( MouseUpEvent event )
{
	DOM.releaseCapture( getElement() );
	RootPanel.get().remove( this );

	if( fDragging )
	{
		RootPanel.get().remove( ghost );

		event.preventDefault();
		event.stopPropagation();

		Element target = DOM.eventGetTarget( DOM.eventGetCurrentEvent() );
		ghost.signalFinish( target );
	}
	else
	{

	}
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:22,代码来源:DragDrop.java

示例10: onMouseUp

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

	if (isDownPosition(event)) {

		Geometry point = new Geometry(Geometry.POINT, 0, -1);
		Coordinate coordinate = getLocation(event, RenderSpace.WORLD);
		point.setCoordinates(new Coordinate[] { coordinate });

		GeomajasServerExtension
				.getInstance()
				.getServerFeatureService()
				.search(mapPresenter, point, calculateBufferFromPixelTolerance(),
						ServerFeatureService.QueryType.INTERSECTS,
						ServerFeatureService.SearchLayerType.SEARCH_ALL_LAYERS, -1, new SelectionCallback()
				);

	}

}
 
开发者ID:geomajas,项目名称:geomajas-gwt2-quickstart-application,代码行数:21,代码来源:FeatureClickedListener.java

示例11: 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

示例12: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
@Override
public void onMouseUp(MouseUpEvent event) {
	final int x = event.getX();
	final int y = event.getY();
	// System.out.println("onMouseUp(" + x + "," + y + ")");

	if (lastStroke == null) {
		return;
	}

	addPointToLastStroke(x, y);
	if (lastStroke.size() >= 2) {
		strokes.add(lastStroke);
		strokeCanvasListener.onStrokeFinished();
	}

	lastStroke = null;

	updateCanvas();
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:21,代码来源:StrokeCanvas.java

示例13: 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

示例14: onMouseUp

import com.google.gwt.event.dom.client.MouseUpEvent; //导入依赖的package包/类
/**
 * First mouse button: publish a toggle event on the selection topic for the referenced MapWidget. Second mouse
 * button opens a menu.
 * 
 * @param event
 *            event
 */
@Override
public void onMouseUp(MouseUpEvent event) {
	// handle click if any?
	if (dragging) {
		// shift or CTRL is used when depressed either at beginning or end:
		shiftOrCtrl = (event.isShiftKeyDown() || event.isControlKeyDown());

		if (timestamp + clickTimeout > new Date().getTime()
				&& (bounds.getWidth() < pixelTolerance || bounds.getHeight() < pixelTolerance)) {
			stopDragging();
			// click behavior instead of drag
			ToggleSelectionAction action = new ToggleSelectionAction(mapWidget, priorityToSelectedLayer,
					pixelTolerance);
			action.toggle(getScreenPosition(event), !shiftOrCtrl);
			return;
		}
	}
	// normal "rectangle" handling
	super.onMouseUp(event);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:28,代码来源:SelectionController.java

示例15: 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


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