本文整理汇总了Java中com.google.gwt.event.dom.client.MouseMoveEvent类的典型用法代码示例。如果您正苦于以下问题:Java MouseMoveEvent类的具体用法?Java MouseMoveEvent怎么用?Java MouseMoveEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MouseMoveEvent类属于com.google.gwt.event.dom.client包,在下文中一共展示了MouseMoveEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: continueDragging
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@Override
protected void continueDragging(MouseMoveEvent event) {
if (this.dragMode >= 0 && this.resizable) {
this.updateCursor(this.dragMode);
int dx = event.getClientX() - this.dragX;
int dy = event.getClientY() - this.dragY;
this.dragX = event.getClientX();
this.dragY = event.getClientY();
dragResizeWidget(this, dx, dy);
} else {
// this updates the cursor when dragging is NOT activated
if (!this.minimized) {
int dm = calcDragMode(event.getClientX(),event.getClientY());
this.updateCursor(dm);
}
super.continueDragging(event);
}
}
示例2: ConsoleDisplay
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
public ConsoleDisplay() {
super(new AbsolutePanel(), CLASS_NAME);
getElement().setId("consoleDisplayWrapper");
// Create display panel where screen is actually loaded
display = new AbsolutePanel();
display.addStyleName("portrait");
display.getElement().setId("consoleDisplay");
// Add display to the wrapper
((AbsolutePanel)getWidget()).add(display, 0, 0);
// Add move handlers which are only used on this display component
if(BrowserUtils.isMobile) {
this.addDomHandler(this, TouchMoveEvent.getType());
} else {
this.addDomHandler(this, MouseMoveEvent.getType());
this.addDomHandler(this, MouseOutEvent.getType());
}
}
示例3: onMouseMove
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent event) {
event.preventDefault();
event.stopPropagation();
lastMoveEvent = new PressMoveEvent(event);
ConsoleUnitEventManager.getInstance().getEventBus().fireEvent(lastMoveEvent);
}
示例4: onMouseMove
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent event) {
// There's a weird bug in Chrome on Windows 10 64bit that causes a mouse move event to fire on mouse down so this tries to workaround it
// https://bugs.chromium.org/p/chromium/issues/detail?id=721341
if (startEvent != null && (startEvent.getClientX() != event.getClientX() || startEvent.getClientY() != event.getClientY())) {
event.preventDefault();
event.stopPropagation();
propagateEvent(new PressMoveEvent(event));
}
}
示例5: handleMouseMove
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@UiHandler("self")
void handleMouseMove(MouseMoveEvent e) {
Element top = self.getElement();
Element target;
target = e.getNativeEvent().getEventTarget().cast();
while (!top.equals(target)) {
if (DigestDomImpl.KIND_DIGEST.equals(target.getAttribute(BuilderHelper.KIND_ATTRIBUTE)) ) {
handleTouch(byId.get(target.getAttribute(DigestDomImpl.DIGEST_ID_ATTRIBUTE)) );
return;
}
target = target.getParentElement();
if (target == null) {
break;
}
}
handleTouch(null);
}
示例6: dispatch
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@Override
boolean dispatch(MouseMoveEvent event, Element target) {
//firing MouseCome and MouseLeave events basing on MouseMove
if (target != prevTarget) {
if (prevTarget != null) {
//create and dispatch new MouseLeaveEvent for previous context
mouseComeLeaveHandlers.dispatch(
new MouseLeaveEvent(prevEvent, prevTarget, target), prevTarget);
}
if (target != null) {
//create and dispatch new MouseComeLeaveEvent for current context
mouseComeLeaveHandlers.dispatch(new MouseComeEvent(event, target, prevTarget), target);
}
prevTarget = target;
}
prevEvent = event;
super.dispatch(event, target);
return true;
}
示例7: onMouseMove
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
public void onMouseMove(MouseMoveEvent event) {
//Store the last time the mouse was moved
lastUserActivityMillisec = System.currentTimeMillis();
//If the user is in the forced away mode then we make him go back to the old mode
if( isInForcedAway ) {
isInForcedAway = false;
userStatusQueue.setCurrentUserStatus( userStatusQueue.getPreviousUserStatus() );
} else {
//In case we can do automatic status enforcement
if( userStatusQueue.canDoUserStatusInforcement() ) {
//The actual user status that comes from the server with the room updates is know
if( actualChatUserStatus != null ) {
//The actual visible user status is not the same as set in the local user interface
if( actualChatUserStatus != userStatusQueue.getCurrentUserStatus() ) {
//Force the server status update, forcing the update in any case
userStatusQueue.forceUserStatusToTheServer( userStatusQueue.getCurrentUserStatus() );
}
}
}
}
}
示例8: onMouseMove
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
public void onMouseMove(MouseMoveEvent e) {
e.preventDefault();
mouseCursorX=e.getX();
mouseCursorY=e.getY();
if (mouseDragging) {
mouseDragged(e);
return;
}
mouseSelect(e);
}
示例9: onMouseMove
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@Override
public void onMouseMove(WebPlotView pv, ScreenPt spt, MouseMoveEvent ev) {
if (_mouseDown) {
dragTimer.cancel();
dragTimer.setupCall(spt,ev.getScreenX(), ev.getScreenY());
_lastX= ev.getScreenX();
_lastY= ev.getScreenY();
dragTimer.schedule(10);
// drag(spt,false);
// _mouseInfo.setEnableAllPersistent(true);
}
}
示例10: onMouseMove
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent event) {
if (previousX == event.getX() && previousY == event.getY())
return;
previousX = event.getX();
previousY = event.getY();
showUI();
}
示例11: calculateDockSize
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
private double calculateDockSize(MouseMoveEvent event,
DocksBar docksBar) {
UberfireDockPosition position = docksBar.getPosition();
if (position == UberfireDockPosition.WEST) {
return docksBar.getExpandedBarSize() + (event.getClientX() - getAbsoluteLeft());
}
if (position == UberfireDockPosition.EAST) {
return docksBar.getExpandedBarSize() + (getAbsoluteLeft() - event.getClientX());
}
if (position == UberfireDockPosition.SOUTH) {
return docksBar.getExpandedBarSize() + (getAbsoluteTop() - event.getClientY());
}
return docksBar.getExpandedBarSize();
}
示例12: VerticalSplit
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
public VerticalSplit() {
super();
addDomHandler(new MouseMoveHandler() {
@Override
public void onMouseMove(MouseMoveEvent event) {
if (mouseDown) {
double leftWidthPct = ((event.getClientX() - getContentAbsoluteLeft() - offset) / getContentWidth()) * 100;
double rightWidthPct = 100 - leftWidthPct;
setLeftAreaWidth(leftWidthPct);
setRightAreaWidth(rightWidthPct);
getElement().getStyle().setLeft(leftArea.getOffsetWidth() - 3,
Style.Unit.PX);
onResize.execute();
event.preventDefault();
}
}
},
MouseMoveEvent.getType());
}
示例13: HorizontalSplit
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
public HorizontalSplit() {
super();
addDomHandler(new MouseMoveHandler() {
@Override
public void onMouseMove(MouseMoveEvent event) {
if (mouseDown) {
double topHeightPct = ((event.getClientY() - getContentAbsoluteTop() - offset) / getContentHeight()) * 100;
double bottomHeightPct = 100 - topHeightPct;
setTopAreaHeight(topHeightPct);
setBottomHeight(bottomHeightPct);
getElement().getStyle().setTop(topArea.getOffsetHeight() - 6,
Style.Unit.PX);
onResize.execute();
event.preventDefault();
}
}
},
MouseMoveEvent.getType());
}
示例14: setupDelegatingMouseMoveHandler
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
protected void setupDelegatingMouseMoveHandler() {
final Style style = widgetContainer.getElement().getStyle();
widgetContainer.addDomHandler(new MouseMoveHandler() {
@Override
public void onMouseMove(final MouseMoveEvent event) {
//The DOM Element changes the Cursor, so set to the state determined by the MouseEvent Handlers on GridLayer
style.setCursor(gridLayer.getGridWidgetHandlersState().getCursor());
gridLayer.onNodeMouseMove(new NodeMouseMoveEvent(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();
}
});
}
},
MouseMoveEvent.getType());
}
示例15: testMouseMoveEvent_RightEdge
import com.google.gwt.event.dom.client.MouseMoveEvent; //导入依赖的package包/类
@Test
public void testMouseMoveEvent_RightEdge() {
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 MouseMoveEvent mm1 = mock(MouseMoveEvent.class);
when(mm1.getRelativeX(any(Element.class))).thenReturn(-200);
when(mm1.getRelativeY(any(Element.class))).thenReturn(0);
final NodeMouseMoveEvent nmm1 = new NodeMouseMoveEvent(mm1);
final ArgumentCaptor<Transform> transformArgumentCaptor = ArgumentCaptor.forClass(Transform.class);
mediator.handleEvent(nmd0);
mediator.handleEvent(nmm1);
verify(viewport,
times(1)).setTransform(transformArgumentCaptor.capture());
final Transform result = transformArgumentCaptor.getValue();
assertNotNull(result);
assertEquals(0.0,
result.getTranslateX(),
0.0);
assertEquals(0.0,
result.getTranslateY(),
0.0);
}