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


Java Event.ONMOUSEMOVE属性代码示例

本文整理汇总了Java中com.google.gwt.user.client.Event.ONMOUSEMOVE属性的典型用法代码示例。如果您正苦于以下问题:Java Event.ONMOUSEMOVE属性的具体用法?Java Event.ONMOUSEMOVE怎么用?Java Event.ONMOUSEMOVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.gwt.user.client.Event的用法示例。


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

示例1: onBrowserEvent

@Override
public void onBrowserEvent(com.google.gwt.user.client.Event event) {
    switch (event.getTypeInt()) {
        case Event.ONMOUSEDOWN:
        case Event.ONTOUCHSTART:
            // rezerwujemy touch dla siebie nic innego nie powinno obslugiwac tego zdarzenia np TouchPageSwitch
            eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));
            pressed = true;
            setPosition(event);
            break;
        case Event.ONTOUCHEND:
        case Event.ONMOUSEUP:
            pressed = false;
            setPosition(event);
            break;
        case Event.ONTOUCHMOVE:
        case Event.ONMOUSEMOVE:
            setPosition(event);
        default:
            break;
    }
    super.onBrowserEvent(event);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:23,代码来源:AbstractMediaScroll.java

示例2: onBrowserEvent

public void onBrowserEvent(Event event) {
	int x = 10 + event.getClientX() + getElement().getOwnerDocument().getScrollLeft();
	int y = 10 + event.getClientY() + getElement().getOwnerDocument().getScrollTop();
	
	switch (DOM.eventGetType(event)) {
	case Event.ONMOUSEMOVE:
		if (iHint.isShowing()) {
			iHint.setPopupPosition(x, y);
		} else {
			iShowHint.cancel();
			iHint.setPopupPosition(x, y);
			iShowHint.schedule(1000);
		}
		break;
	case Event.ONMOUSEOUT:
		iShowHint.cancel();
		if (iHint.isShowing())
			iHideHint.schedule(1000);
		break;
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:HorizontalPanelWithHint.java

示例3: onBrowserEvent

public void onBrowserEvent(Event event) {
	if (iHint.getText().isEmpty()) return;
	iX = 10 + event.getClientX() + getElement().getOwnerDocument().getScrollLeft();
	iY = 10 + event.getClientY() + getElement().getOwnerDocument().getScrollTop();
	
	switch (DOM.eventGetType(event)) {
	case Event.ONMOUSEMOVE:
		if (iInfoPanel.isShowing()) {
			int maxX = Window.getScrollLeft() + Window.getClientWidth() - iInfoPanel.getOffsetWidth() - 10;
			iInfoPanel.setPopupPosition(Math.min(iX, maxX), iY);
		} else if (iInfo.getRowCount() > 0) {
			iShowInfo.cancel();
			iShowInfo.schedule(1000);
		}
		break;
	case Event.ONMOUSEOUT:
		iShowInfo.cancel();
		if (iInfoPanel.isShowing())
			iHideInfo.schedule(1000);
		break;
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:InfoPanelImpl.java

示例4: onBrowserEvent

/**
 * Invoked by GWT whenever a browser event is dispatched to this component.
 */
@Override
public final void onBrowserEvent(Event event) {
  switch (event.getTypeInt()) {
    case Event.ONMOUSEDOWN:
    case Event.ONMOUSEUP:
    case Event.ONMOUSEMOVE:
    case Event.ONMOUSEOVER:
    case Event.ONMOUSEOUT:
      cancelBrowserEvent(event);
      mouseListeners.fireMouseEvent(this, event);
      break;

    case Event.ONCLICK:
      cancelBrowserEvent(event);
      select();
      break;

    default:
      // Ignore unexpected events
      break;
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:25,代码来源:MockComponent.java

示例5: onBrowserEvent

public void onBrowserEvent(Event event) {
	switch (DOM.eventGetType(event)) {
		case Event.ONMOUSEDOWN:
		case Event.ONMOUSEUP:
		case Event.ONMOUSEMOVE:
		case Event.ONMOUSEOVER:
			if (!super.getUrl().equals(urlHover)) {
				super.setUrl(urlHover);
			}
			break;
		case Event.ONMOUSEOUT: {
			if (!super.getUrl().equals(url)) {
				super.setUrl(url);
			}
			break;
		}

	}
	super.onBrowserEvent(event);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:20,代码来源:ImageHover.java

示例6: onBrowserEvent

@Override
public void onBrowserEvent(Event event) {
	
	// If we're not yet dragging, only trigger mouse events if the event occurs
	// in the caption wrapper
	if (this.resizable) {
		switch (event.getTypeInt()) {
		case Event.ONMOUSEDOWN:
		case Event.ONMOUSEUP:
		case Event.ONMOUSEMOVE:
		case Event.ONMOUSEOVER:
		case Event.ONMOUSEOUT:
			
			if (this.dragMode >= 0 || calcDragMode(event.getClientX(),event.getClientY()) >= 0) {
				// paste'n'copy from Widget.onBrowserEvent
				switch (DOM.eventGetType(event)) {
				case Event.ONMOUSEOVER:
					// Only fire the mouse over event if it's coming from outside this
					// widget.
				case Event.ONMOUSEOUT:
					// Only fire the mouse out event if it's leaving this
					// widget.
					Element related = event.getRelatedEventTarget().cast();
					if (related != null && getElement().isOrHasChild(related)) {
						return;
					}
					break;
				}
				DomEvent.fireNativeEvent(event, this, this.getElement());
				return;
			}
			if (this.dragMode<0)
				this.updateCursor(this.dragMode);
		}
	}
	
	super.onBrowserEvent(event);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:38,代码来源:WindowBox.java

示例7: onDragEvent

private void onDragEvent(Event event) {
    if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
        return;
    }

    switch (DOM.eventGetType(event)) {
        case Event.ONTOUCHSTART:
            if (event.getTouches().length() > 1) {
                return;
            }
        case Event.ONMOUSEDOWN:
            beginMovingWindow(event);
            break;
        case Event.ONMOUSEUP:
        case Event.ONTOUCHEND:
        case Event.ONTOUCHCANCEL:
        case Event.ONLOSECAPTURE:
            stopMovingWindow();
            break;
        case Event.ONMOUSEMOVE:
        case Event.ONTOUCHMOVE:
            moveWindow(event);
            break;
        default:
            break;
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:CubaFileUploadProgressWindow.java

示例8: onBrowserEvent

@Override
public void onBrowserEvent(Event event) {
    switch (DOM.eventGetType(event)) {
        case Event.ONMOUSEDOWN:
            captureEvents(event);
            break;
        case Event.ONMOUSEUP:
            releaseCapture(event);
            break;
        case Event.ONMOUSEMOVE:
            handleResize(event);
            break;
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:CubaResizableTextAreaWrapperWidget.java

示例9: asString

public static String asString(Event event) {
  // Start with the event type string
  String string = DOM.eventGetTypeString(event);
  // Next type-specific fields
  switch (event.getTypeInt()) {
  case Event.ONKEYPRESS:
  case Event.ONKEYUP:
  case Event.ONKEYDOWN:
    string += key(event) + modifiers(event);
    break;
  case Event.ONCLICK:
  case Event.ONDBLCLICK:
  case Event.ONMOUSEMOVE:
    string += mousePoint(event) + modifiers(event);
    break;
  case Event.ONMOUSEDOWN:
  case Event.ONMOUSEUP:
    string += mousePoint(event) + mouseButtons(event) + modifiers(event);
    break;
  case Event.ONMOUSEOUT:
    string += mousePoint(event) + modifiers(event) + " to: " + getToElement(event);
    break;
  case Event.ONMOUSEOVER:
    string += mousePoint(event) + modifiers(event) + " from: " + getFromElement(event);
    break;
  case Event.ONMOUSEWHEEL:
    string += " " + getMouseWheelVelocityY(event) + mousePoint(event) + modifiers(event);
    break;
  case Event.ONFOCUS:
  case Event.ONBLUR:
  case Event.ONCHANGE:
  case Event.ONERROR:
  case Event.ONLOAD:
  case Event.ONLOSECAPTURE:
  case Event.ONSCROLL:
    break;
  }
  return string;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:39,代码来源:EventWrapper.java

示例10: onBrowserEvent

public void onBrowserEvent(Event event) {
	if (iDummy) return;
    Element target = DOM.eventGetTarget(event);
    boolean anchor = false;
    for (; target != null; target = DOM.getParent(target)) {
    	String tag = target.getPropertyString("tagName");
    	if ("a".equalsIgnoreCase(tag)) {
    		anchor = true;
    		break;
    	} else if ("div".equalsIgnoreCase(tag)) {
    		break;
    	}
    }
	EventTarget related = event.getRelatedEventTarget();
    switch (DOM.eventGetType(event)) {
	case Event.ONCLICK:
		select(false);
		if (!anchor) {
			MeetingClickEvent e = new MeetingClickEvent(Meeting.this);
			for (MeetingClickHandler h: iMeetingClickHandlers)
				h.onMeetingClick(e);
		}
		break;
	case Event.ONMOUSEOVER:
        if (related == null || !getElement().isOrHasChild((Element)related.cast())) {
			select(true);
        }
		break;
	case Event.ONMOUSEOUT:
        if (related == null || !getElement().isOrHasChild((Element)related.cast())) {
        	select(false);
        }
		break;
	case Event.ONMOUSEMOVE:
		int relativeX = event.getClientX() - getElement().getAbsoluteLeft() + getElement().getScrollLeft() + getElement().getOwnerDocument().getScrollLeft();
		if (relativeX < iLeft - 6 - getDay() * iCellWidth || relativeX > iLeft - 2 - getDay() * iCellWidth + iWidth) {
			select(false);
		}
		break;
	}
    super.onBrowserEvent(event);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:42,代码来源:TimeGrid.java

示例11: onBrowserEvent

@Override
public void onBrowserEvent(Event event) {

	// When de button mouse is released
	if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
		// When de button mouse is released
		mouseX = DOM.eventGetClientX(event);
		mouseY = DOM.eventGetClientY(event);

		// remove dragable item
		Main.get().draggable.clear();

		switch (DOM.eventGetButton(event)) {
			case Event.BUTTON_RIGHT:
				DOM.eventPreventDefault(event); // Prevent to fire event to browser
				flagPopup = true;
				mouseDownX = 0;
				mouseDownY = 0;
				dragged = false;
				Main.get().activeFolderTree.menuPopup.disableAllOptions();
				fireSelection(elementClicked(DOM.eventGetTarget(event)));
				break;
			default:
				flagPopup = false;
				// dragging is enable only if cursor is inside actual item
				dragged = isCursorInsideActualItem(elementClicked(DOM.eventGetTarget(event)));
				mouseDownX = event.getScreenX();
				mouseDownY = event.getClientY();
		}
	} else if (DOM.eventGetType(event) == Event.ONMOUSEMOVE) {
		mouseX = DOM.eventGetClientX(event);
		mouseY = DOM.eventGetClientY(event);
		if (Main.get().activeFolderTree.canDrag() && dragged && mouseDownX > 0 && mouseDownY > 0
				&& evalDragPixelSensibility()) {
			TreeItem actualItem = Main.get().activeFolderTree.getActualItem();
			Main.get().draggable.show(actualItem.getHTML(), OriginPanel.TREE_ROOT);
			Main.get().activeFolderTree.fileBrowserRefreshDone();
			mouseDownX = 0;
			mouseDownY = 0;
			dragged = false;
		}
	} else if (DOM.eventGetType(event) == Event.ONMOUSEUP || DOM.eventGetType(event) == Event.ONCLICK
			|| DOM.eventGetType(event) == Event.ONDBLCLICK) {
		mouseDownX = 0;
		mouseDownY = 0;
		dragged = false; // Always disabling the popup flag
	}

	// Prevent folder creation or renaming propagate actions to other tree nodes
	int action = Main.get().activeFolderTree.getFolderAction();

	if (action != FolderTree.ACTION_CREATE && action != FolderTree.ACTION_RENAME) {
		super.onBrowserEvent(event);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:55,代码来源:ExtendedTree.java

示例12: onBrowserEvent

@Override
public void onBrowserEvent(final Event event) {
    boolean bubble = true;

    final int type = event.getTypeInt();

    final Element target = DOM.eventGetTarget(event);

    if (resizing || resizeBox == target) {
        onResizeEvent(event);
        bubble = false;
    } else if (isClosable() && target == closeBox) {
        if (type == Event.ONCLICK) {
            closeWindow();
        }
        bubble = false;
    } else if (header.isOrHasChild(target) && !dragging) {
        // dblclick handled in connector
        if (type != Event.ONDBLCLICK && draggable) {
            if (type == Event.ONMOUSEDOWN) {
                /*
                 * Prevents accidental selection of window caption or
                 * content. (#12726)
                 */
                event.preventDefault();

                headerDragPending = event;
            } else if (type == Event.ONMOUSEMOVE
                    && headerDragPending != null) {
                // ie won't work unless this is set here
                dragging = true;
                onDragEvent(headerDragPending);
                onDragEvent(event);
                headerDragPending = null;
            } else {
                headerDragPending = null;
            }
            bubble = false;
        }
    } else if (dragging || !contents.isOrHasChild(target)) {
        onDragEvent(event);
        bubble = false;
    }
    /*
     * If clicking on other than the content, move focus to the window.
     * After that this windows e.g. gets all keyboard shortcuts.
     */
    if (type == Event.ONMOUSEDOWN
            && !contentPanel.getElement().isOrHasChild(target)
            && target != closeBox) {
        contentPanel.focus();
    }

    if (!bubble) {
        event.stopPropagation();
    } else {
        // Super.onBrowserEvent takes care of Handlers added by the
        // ClickEventHandler
        super.onBrowserEvent(event);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:61,代码来源:CubaFileUploadProgressWindow.java

示例13: onResizeEvent

private void onResizeEvent(Event event) {
    if (resizable && WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
        switch (event.getTypeInt()) {
            case Event.ONMOUSEDOWN:
            case Event.ONTOUCHSTART:
                showResizingCurtain();
                if (BrowserInfo.get().isIE()) {
                    resizeBox.getStyle().setVisibility(Style.Visibility.HIDDEN);
                }
                resizing = true;
                startX = WidgetUtil.getTouchOrMouseClientX(event);
                startY = WidgetUtil.getTouchOrMouseClientY(event);
                origW = getElement().getOffsetWidth();
                origH = getElement().getOffsetHeight();
                DOM.setCapture(getElement());
                event.preventDefault();
                break;
            case Event.ONMOUSEUP:
            case Event.ONTOUCHEND:
                setSize(event);
            case Event.ONTOUCHCANCEL:
                DOM.releaseCapture(getElement());
            case Event.ONLOSECAPTURE:
                hideResizingCurtain();
                if (BrowserInfo.get().isIE()) {
                    resizeBox.getStyle().clearVisibility();
                }
                resizing = false;
                break;
            case Event.ONMOUSEMOVE:
            case Event.ONTOUCHMOVE:
                if (resizing) {
                    setSize(event);
                    event.preventDefault();
                }
                break;
            default:
                event.preventDefault();
                break;
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:42,代码来源:CubaFileUploadProgressWindow.java


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