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

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

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

MouseListener.mousePressed介绍

[英]Invoked when a mouse button has been pressed on a component.
[中]在组件上按下鼠标按钮时调用。

代码示例

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

MouseEvent me = new MouseEvent(tree, 0, 0, 0, 100, 100, 1, false);
for(MouseListener ml: tree.getMouseListeners()){
  ml.mousePressed(me);
}

代码示例来源:origin: bcdev/beam

public void mousePressed(MouseEvent e) {
//            _pressedEvent = e;
//            startPressedTimer();
      if (_listener != null) {
        _listener.mousePressed(e);
      }
    }

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

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

代码示例来源:origin: net.sf.squirrel-sql.plugins/graph

@Override
public void mousePressed(MouseEvent e)
{
  MouseEvent te = transformMouseEvent(e);
  MouseListener[] mouseListenersBuf = _mouseListeners.toArray(new MouseListener[_mouseListeners.size()]);
  for (MouseListener mouseListener : mouseListenersBuf)
  {
   mouseListener.mousePressed(te);
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

public void mousePressed(MouseEvent e)
{
  e.setSource(AbstractInteractionPlugin.this);
  if (listeners != null)
    for (Iterator it = listeners.iterator(); it.hasNext(); )
      ((MouseListener) it.next()).mousePressed(e);
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-misc-swing

@Override
public void mousePressed(MouseEvent e) {
  if (!isLock()) {
    l.mousePressed(e);
  }
}

代码示例来源:origin: Multibit-Legacy/multibit-hd

@Override
public void mousePressed(MouseEvent e) {
 if (isPopupAllowed()) {
  mouseDelegate.mousePressed(e);
 }
}

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

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

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

@Override
public void mousePressed(com.jogamp.newt.event.MouseEvent me) {
  if (mouseListener != null) {
    mouseListener.mousePressed(convertEvent(me, MouseEvent.MOUSE_PRESSED));
  }
}

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

public void mousePressed(MouseEvent e) {
  for (MouseListener ml : mouseListeners) {
    ml.mousePressed(translate(e));
  }
}

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

public void mousePressed (MouseEvent e) {
  if ( ( (TapPanel) e.getSource () ).isArmPoint ( e.getPoint () ) ) {
    ( (TapPanel) e.getSource () ).setExpanded ( !( (TapPanel) e.getSource () ).isExpanded () );
    e.consume ();
  } else if ( other != null ) {
    other.mousePressed ( e );
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf

public void mousePressed (MouseEvent e) {
  if ( ( (TapPanel) e.getSource () ).isArmPoint ( e.getPoint () ) ) {
    ( (TapPanel) e.getSource () ).setExpanded ( !( (TapPanel) e.getSource () ).isExpanded () );
    e.consume ();
  } else if ( other != null ) {
    other.mousePressed ( e );
  }
}

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

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

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

@Override
public void mousePressed(MouseEvent e) {
  MouseListener[] mls = getMouseListeners();
  if (mls != null && e.getSource() instanceof Component) {
    e = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, ModelComponentDecorator.this);
    for (MouseListener ml : mls) {
      ml.mousePressed(e);
    }
  }
}

代码示例来源:origin: com.googlecode.vfsjfilechooser2/vfsjfilechooser2

public void mousePressed(MouseEvent evt)
{
  if (evt.getSource() instanceof JList)
  {
    // Forward event to Basic
    if (getDoubleClickListener() != null)
    {
      getDoubleClickListener().mousePressed(evt);
    }
  }
}

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

public void mousePressed(MouseEvent e) {
  checkMouseListeners();
  for(int i=0; i<mouseListeners.length; i++) {
    mouseListeners[i].mousePressed(e);
    if(e.isConsumed()) break;
  }
}

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

public void mousePressed(MouseEvent e) {
 checkMouseListeners();
 for (int i = 0; i < mouseListeners.length; i++) {
  mouseListeners[i].mousePressed(e);
  if (e.isConsumed()) {
   break;
  }
 }
}

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

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

代码示例来源:origin: ujmp/universal-java-matrix-package

public void mousePressed(MouseEvent e) {
  if (panel.getMouseListeners() != null && panel.getMouseListeners().length != 0) {
    MouseEvent e2 = new MouseEvent(panel, e.getID(), e.getWhen(), e.getModifiers(), e.getX(), e.getY(),
        e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton());
    for (MouseListener m : panel.getMouseListeners()) {
      m.mousePressed(e2);
    }
  }
}

代码示例来源:origin: org.japura/japura-gui

@Override
public void mousePressed(MouseEvent e) {
 if (isEnabled()) {
  component.requestFocusInWindow();
  if (mouseHandler != null) {
   e.setSource(component);
   mouseHandler.mousePressed(e);
  }
 }
}

相关文章