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());
}
java类com.google.gwt.event.dom.client.MouseMoveHandler的实例源码
VerticalSplit.java 文件源码
项目:appformer
阅读 21
收藏 0
点赞 0
评论 0
HorizontalSplit.java 文件源码
项目:appformer
阅读 22
收藏 0
点赞 0
评论 0
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());
}
BaseDOMElement.java 文件源码
项目:appformer
阅读 24
收藏 0
点赞 0
评论 0
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());
}
GridLienzoScrollHandlerTest.java 文件源码
项目:appformer
阅读 27
收藏 0
点赞 0
评论 0
@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);
}
CompositeGeometryIndexController.java 文件源码
项目:geomajas-project-client-gwt
阅读 24
收藏 0
点赞 0
评论 0
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);
}
}
CompositeGeometryIndexController.java 文件源码
项目:geomajas-project-client-gwt2
阅读 26
收藏 0
点赞 0
评论 0
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);
}
}
CanvasConnector.java 文件源码
项目:vaadincanvas
阅读 22
收藏 0
点赞 0
评论 0
@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);
}
}
});
}
StencilPaletteBuilder.java 文件源码
项目:appformer
阅读 27
收藏 0
点赞 0
评论 0
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());
}
EventsExecutor.java 文件源码
项目:platypus-js
阅读 27
收藏 0
点赞 0
评论 0
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);
}
}
}
}
EventFactory.java 文件源码
项目:qafe-platform
阅读 21
收藏 0
点赞 0
评论 0
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);
}
};
}
PopupCanvas.java 文件源码
项目:QMAClone
阅读 28
收藏 0
点赞 0
评论 0
@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;
}
CompositeGeometryIndexController.java 文件源码
项目:geomajas-project-client-gwt
阅读 27
收藏 0
点赞 0
评论 0
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);
}
}
}
CompositeGeometryIndexController.java 文件源码
项目:geomajas-project-client-gwt2
阅读 26
收藏 0
点赞 0
评论 0
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);
}
}
}
StencilPaletteBuilder.java 文件源码
项目:wires
阅读 23
收藏 0
点赞 0
评论 0
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() );
}
P.java 文件源码
项目:unitimes
阅读 25
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addHandler(handler, MouseMoveEvent.getType());
}
HandlerPanel.java 文件源码
项目:appinventor-extensions
阅读 31
收藏 0
点赞 0
评论 0
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addDomHandler(handler, MouseMoveEvent.getType());
}
ImplPanel.java 文件源码
项目:Wiab.pro
阅读 21
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addDomHandler(handler, MouseMoveEvent.getType());
}
Canvas.java 文件源码
项目:mgwt-traffic-flow
阅读 23
收藏 0
点赞 0
评论 0
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return html.addMouseMoveHandler(handler);
}
TreeView.java 文件源码
项目:r01fb
阅读 23
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
return this.addDomHandler(handler,
MouseMoveEvent.getType());
}
DocWidget.java 文件源码
项目:gerrit
阅读 21
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addDomHandler(handler, MouseMoveEvent.getType());
}
P.java 文件源码
项目:unitime
阅读 23
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addHandler(handler, MouseMoveEvent.getType());
}
Canvas.java 文件源码
项目:appformer
阅读 26
收藏 0
点赞 0
评论 0
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return html.addMouseMoveHandler(handler);
}
GridLienzoScrollHandler.java 文件源码
项目:appformer
阅读 20
收藏 0
点赞 0
评论 0
MouseMoveHandler enablePointerEvents() {
return event -> gridLienzoScrollUI().enablePointerEvents(getDomElementContainer());
}
AbstractInput.java 文件源码
项目:putnami-web-toolkit
阅读 21
收藏 0
点赞 0
评论 0
@Override
public com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return this.addDomHandler(handler, MouseMoveEvent.getType());
}
ListItem.java 文件源码
项目:putnami-web-toolkit
阅读 21
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return this.addDomHandler(handler, MouseMoveEvent.getType());
}
Anchor.java 文件源码
项目:putnami-web-toolkit
阅读 20
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return this.addDomHandler(handler, MouseMoveEvent.getType());
}
ButtonCaption.java 文件源码
项目:gwtoauthlogindemo
阅读 24
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
{
return addMouseMoveHandler(handler);
}
MouseEventsCanvas.java 文件源码
项目:QMAClone
阅读 21
收藏 0
点赞 0
评论 0
@Override
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addDomHandler(handler, MouseMoveEvent.getType());
}
CompositeGeometryIndexController.java 文件源码
项目:geomajas-project-client-gwt
阅读 25
收藏 0
点赞 0
评论 0
public void addMouseMoveHandler(MouseMoveHandler handler) {
moveHandlers.add(handler);
}
GraphicsWidget.java 文件源码
项目:geomajas-project-client-gwt
阅读 25
收藏 0
点赞 0
评论 0
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return widget.addMouseMoveHandler(handler);
}