javax.swing.JComponent.addMouseMotionListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(177)

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

JComponent.addMouseMotionListener介绍

暂无

代码示例

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

/**
 * Installs the listener to make the list or tree sticky. This method is called by constructor, so you don't need to
 * call it unless you called {@link #uninstall()} to remove the listener.
 */
public void install() {
  _target.addMouseMotionListener(STICKY_MOUSE_MOTION_LISTENER);
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** Start listening to mouse motion on the passed component */
private void attachTo (JComponent comp) {
  assert comp instanceof JTree || comp instanceof JList;
  comp.addMouseListener (this);
  comp.addMouseMotionListener (this);
  refcount++;
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public static final void install(JComponent _c)
{
 _c.addMouseListener(SINGLETON);
 _c.addMouseMotionListener(SINGLETON);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void add(JComponent _comp) {
 if (_comp.getClientProperty("DND_SOURCE") == null) {
  _comp.addMouseListener(this);
  _comp.addMouseMotionListener(this);
  _comp.putClientProperty("DND_SOURCE", this);
 } else
  throw new RuntimeException("Already a Dnd Source");
}

代码示例来源:origin: org.java.net.substance/substance

public void registerListeners() {
  this.component.addMouseListener(this);
  this.component.addMouseMotionListener(this);
  this.component.addFocusListener(this);
}

代码示例来源:origin: net.java.abeille/abeille

public void focusGained(FocusEvent e) {
  JComponent component = (JComponent) e.getSource();
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-mobility-svgcore

void registerMouseController( InputControlManager.MouseController mouseListener) {
  m_animatorView.addMouseListener(mouseListener);
  m_animatorView.addMouseMotionListener(mouseListener);
  //m_animatorView.addMouseWheelListener(mouseListener);
  m_imageContainer.addMouseListener(mouseListener);
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * Installs all listeners, as required. 
 * 
 * @param component target to install required listeners on, must
 *   not be null.
 */
public void install(JComponent component) {
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  component.addComponentListener(this);
}

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

@Override
public void addMouseInputListener( MouseInputListener listener ){
  mouseListeners.add( listener );
  if( view != null ){
    view.getItem().addMouseListener( listener );
    view.getItem().addMouseMotionListener( listener );
  }
}

代码示例来源:origin: protegeproject/protege

public void setComponent(JComponent component) {
  if(this.component != null && this.component != component) {
    this.component.removeMouseListener(mouseListener);
    this.component.removeMouseMotionListener(mouseMotionListener);
  }
  if (this.component != component) {
    this.component = component;
    this.component.addMouseListener(mouseListener);
    this.component.addMouseMotionListener(mouseMotionListener);
  }
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public void setComponent(JComponent component) {
  if(this.component != null && this.component != component) {
    this.component.removeMouseListener(mouseListener);
    this.component.removeMouseMotionListener(mouseMotionListener);
  }
  if (this.component != component) {
    this.component = component;
    this.component.addMouseListener(mouseListener);
    this.component.addMouseMotionListener(mouseMotionListener);
  }
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
protected void installListeners() {
  super.installListeners();
  this.substanceLabelMouseInputListener = this.createMouseInputListener();
  this.iconPane
      .addMouseMotionListener(this.substanceLabelMouseInputListener);
  this.iconPane.addMouseListener(this.substanceLabelMouseInputListener);
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public void setComponent(JComponent component) {
  if(this.component != null && this.component != component) {
    this.component.removeMouseListener(mouseListener);
    this.component.removeMouseMotionListener(mouseMotionListener);
  }
  if (this.component != component) {
    this.component = component;
    this.component.addMouseListener(mouseListener);
    this.component.addMouseMotionListener(mouseMotionListener);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

public void registerComponent(JComponent component) {
  if (Platform.isMac()) return; // CellTips don't work reliably on Mac (see Issue 89216) => disabled
    
  if (!(component instanceof CellTipAware)) {
    throw new RuntimeException("Only components implementing org.netbeans.lib.profiler.ui.components.CellTipAware interface can be registered!"); // NOI18N
  }
  unregisterComponent(component);
  component.addMouseListener(this);
  component.addMouseMotionListener(moveBeforeEnterListener);
  universalCellTipListener.registerForComponent(component);
}

代码示例来源:origin: org.java.net.substance/substance

@Override
protected void installListeners() {
  super.installListeners();
  this.substanceLabelMouseInputListener = this.createMouseInputListener();
  this.iconPane
      .addMouseMotionListener(this.substanceLabelMouseInputListener);
  this.iconPane.addMouseListener(this.substanceLabelMouseInputListener);
}

代码示例来源:origin: org.nuiton/nuiton-widgets

public void install(JComponent attachedComponent) {
  //attachedComponent.addCaretListener(this);
  attachedComponent.addComponentListener(this);
  attachedComponent.addFocusListener(this);
  attachedComponent.addKeyListener(this);
  attachedComponent.addMouseListener(this);
  attachedComponent.addMouseMotionListener(this);
}

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

public void registerComponent(JComponent component) {
  component.removeMouseListener(this);
  component.addMouseListener(this);
  component.removeMouseMotionListener(moveBeforeEnterListener);
  component.addMouseMotionListener(moveBeforeEnterListener);
  component.removeKeyListener(accessibilityKeyListener);
  component.addKeyListener(accessibilityKeyListener);
}

相关文章

JComponent类方法