Java 类com.google.gwt.event.dom.client.MouseMoveHandler 实例源码

项目:appformer    文件:VerticalSplit.java   
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());
}
项目:appformer    文件:HorizontalSplit.java   
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());
}
项目:appformer    文件:BaseDOMElement.java   
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());
}
项目:appformer    文件:GridLienzoScrollHandlerTest.java   
@Test
public void testSetupContextSwitcher() {

    final AbsolutePanel domElementContainer = mock(AbsolutePanel.class);
    final LienzoPanel lienzoPanel = mock(LienzoPanel.class);
    final MouseWheelHandler wheelHandler = mock(MouseWheelHandler.class);
    final MouseMoveHandler moveHandler = mock(MouseMoveHandler.class);

    doReturn(domElementContainer).when(gridLienzoPanel).getDomElementContainer();
    doReturn(wheelHandler).when(gridLienzoScrollHandler).disablePointerEvents();
    doReturn(moveHandler).when(gridLienzoScrollHandler).enablePointerEvents();

    gridLienzoScrollHandler.setupContextSwitcher();

    verify(domElementContainer).addDomHandler(wheelHandler, MouseWheelEvent.getType());
    verify(gridLienzoPanel).addMouseMoveHandler(moveHandler);
}
项目:geomajas-project-client-gwt    文件:CompositeGeometryIndexController.java   
public void addMapHandler(AbstractGeometryIndexMapHandler handler) {
    handler.setIndex(index);
    handler.setService(service);
    handler.setEventParser(this);
    if (handler instanceof MapDownHandler) {
        downHandlers.add((MapDownHandler) handler);
    }
    if (handler instanceof MapUpHandler) {
        upHandlers.add((MapUpHandler) handler);
    }
    if (handler instanceof MapDragHandler) {
        dragHandlers.add((MapDragHandler) handler);
    }
    if (handler instanceof MouseOverHandler) {
        overHandlers.add((MouseOverHandler) handler);
    }
    if (handler instanceof MouseOutHandler) {
        outHandlers.add((MouseOutHandler) handler);
    }
    if (handler instanceof MouseMoveHandler) {
        moveHandlers.add((MouseMoveHandler) handler);
    }
    if (handler instanceof DoubleClickHandler) {
        doubleClickHandlers.add((DoubleClickHandler) handler);
    }
}
项目:geomajas-project-client-gwt2    文件:CompositeGeometryIndexController.java   
public void addMapHandler(AbstractGeometryIndexMapHandler handler) {
    handler.setIndex(index);
    handler.setService(service);
    handler.setEventParser(this);
    if (handler instanceof MapDownHandler) {
        downHandlers.add((MapDownHandler) handler);
    }
    if (handler instanceof MapUpHandler) {
        upHandlers.add((MapUpHandler) handler);
    }
    if (handler instanceof MapDragHandler) {
        dragHandlers.add((MapDragHandler) handler);
    }
    if (handler instanceof MouseOverHandler) {
        overHandlers.add((MouseOverHandler) handler);
    }
    if (handler instanceof MouseOutHandler) {
        outHandlers.add((MouseOutHandler) handler);
    }
    if (handler instanceof MouseMoveHandler) {
        moveHandlers.add((MouseMoveHandler) handler);
    }
    if (handler instanceof DoubleClickHandler) {
        doubleClickHandlers.add((DoubleClickHandler) handler);
    }
}
项目:vaadincanvas    文件:CanvasConnector.java   
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
    super.onStateChanged(stateChangeEvent);

    // Only add a mouse move handler if someone is interested in, as
    // otherwise
    // they would generate a large amount of server side traffic.
    if (stateChangeEvent.hasPropertyChanged("listenMouseMove")
            && getState().listenMouseMove)
        getWidget().addMouseMoveHandler(new MouseMoveHandler() {
            @Override
            public void onMouseMove(MouseMoveEvent event) {
                if (getState().listenMouseMove) {
                    MouseEventDetails med = MouseEventDetailsBuilder
                            .buildMouseEventDetails(event.getNativeEvent(),
                                    getWidget().getElement());

                    rpc.mouseMoved(med);
                }
            }
        });
}
项目:appformer    文件:StencilPaletteBuilder.java   
private void attachDragProxyHandlers(final LienzoPanel floatingPanel,
                                     final ShapeDragProxy proxy) {
    final Style style = floatingPanel.getElement().getStyle();
    final HandlerRegistration[] handlerRegs = new HandlerRegistration[2];

    //MouseMoveEvents
    handlerRegs[0] = RootPanel.get().addDomHandler(new MouseMoveHandler() {

                                                       @Override
                                                       public void onMouseMove(final MouseMoveEvent mouseMoveEvent) {
                                                           style.setLeft(mouseMoveEvent.getX() - (floatingPanel.getWidth() / 2),
                                                                         Style.Unit.PX);
                                                           style.setTop(mouseMoveEvent.getY() - (floatingPanel.getHeight() / 2),
                                                                        Style.Unit.PX);
                                                           proxy.onDragPreview(mouseMoveEvent.getX(),
                                                                               mouseMoveEvent.getY());
                                                       }
                                                   },
                                                   MouseMoveEvent.getType());

    //MouseUpEvent
    handlerRegs[1] = RootPanel.get().addDomHandler(new MouseUpHandler() {

                                                       @Override
                                                       public void onMouseUp(final MouseUpEvent mouseUpEvent) {
                                                           handlerRegs[0].removeHandler();
                                                           handlerRegs[1].removeHandler();
                                                           RootPanel.get().remove(floatingPanel);
                                                           proxy.onDragComplete(mouseUpEvent.getX(),
                                                                                mouseUpEvent.getY());
                                                       }
                                                   },
                                                   MouseUpEvent.getType());
}
项目:platypus-js    文件:EventsExecutor.java   
public void setMouseMoved(JavaScriptObject aValue) {
    if (mouseMoved != aValue) {
        if (mouseMoveReg != null) {
            mouseMoveReg.removeHandler();
            mouseMoveReg = null;
        }
        mouseMoved = aValue;
        if (mouseMoved != null) {
            MouseMoveHandler handler = new MouseMoveHandler() {
                @Override
                public void onMouseMove(MouseMoveEvent event) {
                    if (mouseMoved != null || mouseDragged != null) {
                        event.stopPropagation();
                        if (mouseState == MOUSE.NULL || mouseState == MOUSE.MOVED) {
                            mouseState = MOUSE.MOVED;
                            executeEvent(mouseMoved, EventsPublisher.publish(event));
                        } else if (mouseState == MOUSE.PRESSED || mouseState == MOUSE.DRAGGED) {
                            mouseState = MOUSE.DRAGGED;
                            executeEvent(mouseDragged, EventsPublisher.publish(event));
                        }
                    }
                }

            };
            if (component instanceof Widget) {
                mouseMoveReg = ((Widget) component).addDomHandler(handler, MouseMoveEvent.getType());
            } else if (component instanceof HasMouseMoveHandlers) {
                mouseMoveReg = ((HasMouseMoveHandlers) component).addMouseMoveHandler(handler);
            }
        }
    }
}
项目:qafe-platform    文件:EventFactory.java   
public static MouseMoveHandler createOnMouseMoveListener(final EventListenerGVO ev, final List<InputVariableGVO> input) {
    return new MouseMoveHandler() {
        public void onMouseMove(MouseMoveEvent event) {
            Map<String,String> mouseInfo = getMouseInfo(event);
            CallbackHandler.createCallBack(event.getSource(), QAMLConstants.EVENT_ONMOUSE_MOVE, ev, input, mouseInfo);
        }
    };
}
项目:QMAClone    文件:PopupCanvas.java   
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    eventHandlers.put(handler, (DomEvent.Type) MouseMoveEvent.getType());
    if (canvas != null) {
        canvas.addDomHandler(handler, MouseMoveEvent.getType());
    }
    return null;
}
项目:geomajas-project-client-gwt    文件:CompositeGeometryIndexController.java   
public void onMouseMove(MouseMoveEvent event) {
    if (service.getIndexStateService().isEnabled(index)) {
        super.onMouseMove(event); // Make sure we don't forget dragging.
        for (MouseMoveHandler handler : moveHandlers) {
            handler.onMouseMove(event);
        }
    }
}
项目:geomajas-project-client-gwt2    文件:CompositeGeometryIndexController.java   
public void onMouseMove(MouseMoveEvent event) {
    if (service.getIndexStateService().isEnabled(index)) {
        super.onMouseMove(event); // Make sure we don't forget dragging.
        for (MouseMoveHandler handler : moveHandlers) {
            handler.onMouseMove(event);
        }
    }
}
项目:wires    文件:StencilPaletteBuilder.java   
private void attachDragProxyHandlers( final LienzoPanel floatingPanel,
                                      final ShapeDragProxy proxy ) {
    final Style style = floatingPanel.getElement().getStyle();
    final HandlerRegistration[] handlerRegs = new HandlerRegistration[ 2 ];

    //MouseMoveEvents
    handlerRegs[ 0 ] = RootPanel.get().addDomHandler( new MouseMoveHandler() {

        @Override
        public void onMouseMove( final MouseMoveEvent mouseMoveEvent ) {
            style.setLeft( mouseMoveEvent.getX() - ( floatingPanel.getWidth() / 2 ),
                           Style.Unit.PX );
            style.setTop( mouseMoveEvent.getY() - ( floatingPanel.getHeight() / 2 ),
                          Style.Unit.PX );
            proxy.onDragPreview( mouseMoveEvent.getX(),
                                 mouseMoveEvent.getY() );
        }
    }, MouseMoveEvent.getType() );

    //MouseUpEvent
    handlerRegs[ 1 ] = RootPanel.get().addDomHandler( new MouseUpHandler() {

        @Override
        public void onMouseUp( final MouseUpEvent mouseUpEvent ) {
            handlerRegs[ 0 ].removeHandler();
            handlerRegs[ 1 ].removeHandler();
            RootPanel.get().remove( floatingPanel );
            proxy.onDragComplete( mouseUpEvent.getX(),
                                  mouseUpEvent.getY() );
        }
    }, MouseUpEvent.getType() );
}
项目:unitimes    文件:P.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return addHandler(handler, MouseMoveEvent.getType());
}
项目:appinventor-extensions    文件:HandlerPanel.java   
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
  return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:Wiab.pro    文件:ImplPanel.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
  return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:mgwt-traffic-flow    文件:Canvas.java   
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return html.addMouseMoveHandler(handler);
}
项目:r01fb    文件:TreeView.java   
@Override
public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
    return this.addDomHandler(handler,
                              MouseMoveEvent.getType());
}
项目:gerrit    文件:DocWidget.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
  return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:unitime    文件:P.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return addHandler(handler, MouseMoveEvent.getType());
}
项目:appformer    文件:Canvas.java   
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return html.addMouseMoveHandler(handler);
}
项目:appformer    文件:GridLienzoScrollHandler.java   
MouseMoveHandler enablePointerEvents() {
    return event -> gridLienzoScrollUI().enablePointerEvents(getDomElementContainer());
}
项目:putnami-web-toolkit    文件:AbstractInput.java   
@Override
public com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return this.addDomHandler(handler, MouseMoveEvent.getType());
}
项目:putnami-web-toolkit    文件:ListItem.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return this.addDomHandler(handler, MouseMoveEvent.getType());
}
项目:putnami-web-toolkit    文件:Anchor.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return this.addDomHandler(handler, MouseMoveEvent.getType());
}
项目:gwtoauthlogindemo    文件:ButtonCaption.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
{
    return addMouseMoveHandler(handler);
}
项目:QMAClone    文件:MouseEventsCanvas.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:geomajas-project-client-gwt    文件:CompositeGeometryIndexController.java   
public void addMouseMoveHandler(MouseMoveHandler handler) {
    moveHandlers.add(handler);
}
项目:geomajas-project-client-gwt    文件:GraphicsWidget.java   
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return widget.addMouseMoveHandler(handler);
}
项目:geomajas-project-client-gwt2    文件:CompositeGeometryIndexController.java   
public void addMouseMoveHandler(MouseMoveHandler handler) {
    moveHandlers.add(handler);
}
项目:geomajas-project-client-gwt2    文件:MapWidgetImpl.java   
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
    return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:gwtbootstrap3    文件:AbstractButton.java   
@Override
public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
    return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:gwtbootstrap3    文件:Label.java   
@Override
public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
    return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:swarm    文件:BaseButton.java   
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
  return addDomHandler(handler, MouseMoveEvent.getType());
}
项目:GwtGameUi    文件:RenderEngine.java   
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
  return addDomHandler(handler, com.google.gwt.event.dom.client.MouseMoveEvent.getType());
}