java.awt.event.MouseMotionListener.mouseMoved()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中java.awt.event.MouseMotionListener.mouseMoved()方法的一些代码示例,展示了MouseMotionListener.mouseMoved()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MouseMotionListener.mouseMoved()方法的具体详情如下:
包路径:java.awt.event.MouseMotionListener
类名称:MouseMotionListener
方法名:mouseMoved

MouseMotionListener.mouseMoved介绍

[英]Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
[中]当鼠标光标移动到组件上但未按下任何按钮时调用。

代码示例

代码示例来源:origin: com.jidesoft/jide-oss

public void mouseMoved(MouseEvent e) {
    if (_listener != null) {
      _listener.mouseMoved(e);
    }
  }
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
  public void mouseMoved(MouseEvent e) {
    for (MouseMotionListener eL : externalListeners) {
      eL.mouseMoved(e);
    }
  }
});

代码示例来源:origin: girtel/Net2Plan

@Override
public void mouseMoved(MouseEvent e) {
  if (plugin instanceof MouseMotionListener)
    ((MouseMotionListener) plugin).mouseMoved(e);
}

代码示例来源:origin: xyz.cofe/docking-frames-core

public void mouseMoved( MouseEvent e ) {
    for( MouseMotionListener m : mouseMotionListeners.toArray( new MouseMotionListener[ mouseMotionListeners.size() ] ))
      m.mouseMoved( e );
  }
};

代码示例来源:origin: sc.fiji/fiji-lib

@Override
  public final void mouseMoved(MouseEvent e) {
    if (isThisTool())
      listener.mouseMoved(e);
  }
}

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

@Override
  public void mouseExited(MouseEvent e) {
    toolTips.getMouseMotionListener().mouseMoved(e);
  }
});

代码示例来源:origin: jzy3d/jzy3d-api

@Override
public void mouseMoved(com.jogamp.newt.event.MouseEvent me) {
  if (mouseMotionListener != null) {
    mouseMotionListener.mouseMoved(convertEvent(me, MouseEvent.MOUSE_MOVED));
  }
}

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

@Override
  public void mouseExited(MouseEvent e) {
    toolTips.getMouseMotionListener().mouseMoved(e);
  }
});

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

@Override
  public void mouseExited(MouseEvent e) {
    toolTips.getMouseMotionListener().mouseMoved(e);
  }
});

代码示例来源:origin: sc.fiji/fiji-lib

@Override
  public final void mouseMoved(MouseEvent e) {
    if (!e.isConsumed())
      listener.mouseMoved(e);
  }
}

代码示例来源:origin: com.github.tornaia/aott-desktop-client-core

@Override
  public void mouseExited(MouseEvent e) {
    toolTips.getMouseMotionListener().mouseMoved(e);
  }
});

代码示例来源:origin: sdedit/sdedit

public void mouseMoved(MouseEvent e) {
  for (MouseMotionListener ml : mouseMotionListeners) {
    try {
      ml.mouseMoved(translate(e));
    } catch (NullPointerException ignored) {
      // TODO
      /* empty */
    }
  }
}

代码示例来源:origin: stackoverflow.com

protected void processMouseMotionEvent(MouseEvent e) {
  MouseMotionListener listener = mouseMotionListener;
  if (listener != null) {
    int id = e.getID();
    switch(id) {
     case MouseEvent.MOUSE_MOVED:
       listener.mouseMoved(e);
       break;
     case MouseEvent.MOUSE_DRAGGED:
       listener.mouseDragged(e);
       break;
    }
  }
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void mouseMoved(MouseEvent e) {
  for (MouseMotionListener listener : eventListenerList.getListeners(MouseMotionListener.class))
    listener.mouseMoved(e);
}

代码示例来源:origin: gurkenlabs/litiengine

@Override
public void mouseMoved(final MouseEvent e) {
 this.setLocation(e);
 final MouseEvent wrappedEvent = this.createEvent(e);
 this.mouseMotionListeners.forEach(listener -> listener.mouseMoved(wrappedEvent));
 for (final Consumer<MouseEvent> cons : this.mouseMovedConsumer) {
  cons.accept(wrappedEvent);
 }
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@Override
  public void mouseMoved(MouseEvent e) {
    MouseMotionListener[] mls = getMouseMotionListeners();
    if (mls != null && e.getSource() instanceof Component) {
      e = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, ModelComponentDecorator.this);
      for (MouseMotionListener mml : mls) {
        mml.mouseMoved(e);
      }
    }
  }
});

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@Override
public void mouseMoved(MouseEvent e) {
  if (e.getSource() instanceof Component) {
    e = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, ModelGrid.this);
    for (MouseMotionListener l : ModelGrid.this.getMouseMotionListeners()) {
      l.mouseMoved(e);
    }
  }
}

代码示例来源:origin: net.sf.jung/jung-visualization

public void mouseMoved(MouseEvent e) {
  checkMouseMotionListeners();
  for(int i=0; i<mouseMotionListeners.length; i++) {
    mouseMotionListeners[i].mouseMoved(e);
    if(e.isConsumed()) break;
  }
}

代码示例来源:origin: jrtom/jung

public void mouseMoved(MouseEvent e) {
 checkMouseMotionListeners();
 for (int i = 0; i < mouseMotionListeners.length; i++) {
  mouseMotionListeners[i].mouseMoved(e);
  if (e.isConsumed()) {
   break;
  }
 }
}

代码示例来源:origin: stackoverflow.com

Component source = null; // TODO set up a valid component
 MouseEvent event = new MouseEvent(source, MouseEvent.MOUSE_ENTERED, System.currentTimeMillis(), InputEvent.ALT_DOWN_MASK, source.getX(), source.getY(), 0, false);
 MouseMotionListener[] mouseMotionListeners = source.getMouseMotionListeners();
 if (mouseMotionListeners!= null && mouseMotionListeners.length > 0) {
   MouseMotionListener mouseMotionListener = mouseMotionListeners[0];
   mouseMotionListener.mouseMoved(event);
 }

相关文章