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