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


Java MouseMotionListener.mouseMoved方法代码示例

本文整理汇总了Java中java.awt.event.MouseMotionListener.mouseMoved方法的典型用法代码示例。如果您正苦于以下问题:Java MouseMotionListener.mouseMoved方法的具体用法?Java MouseMotionListener.mouseMoved怎么用?Java MouseMotionListener.mouseMoved使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.event.MouseMotionListener的用法示例。


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

示例1: notifyMouseMotionListeners

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
public void notifyMouseMotionListeners(final MouseEvent e) {
    SwingWorker worker = new SwingWorker<String, Object>() {

        @Override
        public String doInBackground() {
            if (mouseMotionListeners != null) {
                e.setSource(this);
                ListIterator<MouseMotionListener> iter = mouseMotionListeners.listIterator();
                while (iter.hasNext()) {
                    MouseMotionListener listener = iter.next();

                    switch (e.getID()) {
                        case MouseEvent.MOUSE_MOVED:
                            listener.mouseMoved(e);
                            break;
                        case MouseEvent.MOUSE_DRAGGED:
                            listener.mouseDragged(e);
                            break;
                        default:
                            break;
                    }
                }
                iter = null;
            }
            return null;
        }
    };
    worker.execute();
    try {
        worker.get();
    } catch (Exception ie) {
    }
}
 
开发者ID:josmas,项目名称:openwonderland,代码行数:34,代码来源:HUDFrameHeader2D.java

示例2: notifyMouseMotionListeners

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
public void notifyMouseMotionListeners(MouseEvent e) {
    if (mouseMotionListeners != null) {
        e.setSource(this);
        ListIterator<MouseMotionListener> iter = mouseMotionListeners.listIterator();
        while (iter.hasNext()) {
            MouseMotionListener listener = iter.next();

            switch (e.getID()) {
                case MouseEvent.MOUSE_MOVED:
                    listener.mouseMoved(e);
                    break;
                case MouseEvent.MOUSE_DRAGGED:
                    listener.mouseDragged(e);
                    break;
                default:
                    break;
            }
        }
        iter = null;
    }
}
 
开发者ID:josmas,项目名称:openwonderland,代码行数:22,代码来源:HUDView2D.java

示例3: deliverMouseMotionEvent

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
/**
 * Deliver the given mouse motion event to the window.
 *
 * @param event The mouse motion event to deliver.
 */
private void deliverMouseMotionEvent(MouseEvent event) {
    if (mouseMotionListeners == null) {
        return;
    }

    for (MouseMotionListener listener : mouseMotionListeners) {
        switch (event.getID()) {
            case MouseEvent.MOUSE_MOVED:
                listener.mouseMoved(event);
                break;
            case MouseEvent.MOUSE_DRAGGED:
                listener.mouseDragged(event);
                break;
        }
    }
}
 
开发者ID:josmas,项目名称:openwonderland,代码行数:22,代码来源:Window2D.java

示例4: dispatchTo

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
/**
 * Calls appropriate method on the listener based on this events ID.
 * 
 * @param listener the target for dispatch.
 */
public void dispatchTo(final Object listener) {
    final MouseMotionListener mouseMotionListener = (MouseMotionListener) listener;
    switch (getID()) {
        case MouseEvent.MOUSE_DRAGGED:
            mouseMotionListener.mouseDragged(this);
            break;
        case MouseEvent.MOUSE_MOVED:
            mouseMotionListener.mouseMoved(this);
            break;
        default:
            throw new RuntimeException("PMouseMotionEvent with bad ID");
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:19,代码来源:PSwingMouseMotionEvent.java

示例5: fireMouseMotion

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
private static void fireMouseMotion(MouseMotionListener listener, final MouseEvent event) {
  switch (event.getID()) {
    case MouseEvent.MOUSE_DRAGGED:
      listener.mouseDragged(event);
    case MouseEvent.MOUSE_MOVED:
      listener.mouseMoved(event);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:IdeGlassPaneImpl.java

示例6: fireMouseMoveEvent

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
private void fireMouseMoveEvent(MouseEvent e)
{
	for (MouseMotionListener l : mMouseMotionListeners)
		if (e.getID() == MouseEvent.MOUSE_MOVED)
			l.mouseMoved(e);
		else if (e.getID() == MouseEvent.MOUSE_DRAGGED)
			l.mouseDragged(e);
}
 
开发者ID:StarMade,项目名称:SMEditClassic,代码行数:9,代码来源:JGLCanvas.java

示例7: mouseMoved

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
@Override
public void mouseMoved(MouseEvent evt) {
    if(!canDispatch(evt)) {return;}
    MouseEvent e = new MouseEvent(evt.getComponent(), evt.getID(), evt.getWhen(), evt.getModifiers(), evt.getX(), evt.getY(), evt.getClickCount(), false, evt.getButton());
    MouseMotionListener[] listeners = getListenersAndAdaptEvent(e, MouseMotionListener.class);
    for(MouseMotionListener l : listeners) {l.mouseMoved(e);}
}
 
开发者ID:Sharcoux,项目名称:MathEOS,代码行数:8,代码来源:GlobalDispatcher.java

示例8: processMouseMotionEventImpl

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
private void processMouseMotionEventImpl(MouseEvent e, Collection<MouseMotionListener> c) {
    for (MouseMotionListener listener : c) {
        switch (e.getID()) {
            case MouseEvent.MOUSE_DRAGGED:
                listener.mouseDragged(e);
                break;
            case MouseEvent.MOUSE_MOVED:
                listener.mouseMoved(e);
                break;
        }
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:Component.java

示例9: fireMouseMoveEvent

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
private void fireMouseMoveEvent(MouseEvent e) {
    for (MouseMotionListener l : mMouseMotionListeners) {
        if (e.getID() == MouseEvent.MOUSE_MOVED) {
            l.mouseMoved(e);
        } else if (e.getID() == MouseEvent.MOUSE_DRAGGED) {
            l.mouseDragged(e);
        }
    }
}
 
开发者ID:StarMade,项目名称:SMEdit,代码行数:10,代码来源:JGLCanvas.java

示例10: mouseMoved

import java.awt.event.MouseMotionListener; //导入方法依赖的package包/类
@Override
public void mouseMoved(MouseEvent e) {
    MouseMotionListener[] listeners = getListenerAncestor(e, MouseMotionListener.class);
    if(listeners!=null) for(MouseMotionListener l : listeners) l.mouseMoved(e);
}
 
开发者ID:Sharcoux,项目名称:MathEOS,代码行数:6,代码来源:DispatchMouseToParent.java


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