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

x33g5p2x  于2022-01-24 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(104)

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

MouseEvent.paramString介绍

[英]Returns a parameter string identifying this event. This method is useful for event-logging and for debugging.
[中]返回标识此事件的参数字符串。此方法对于事件日志记录和调试非常有用。

代码示例

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

MouseEvent me = ...;
ActionEvent ae = new ActionEvent(me.getSource(), me.getID(), me.paramString());

代码示例来源:origin: senbox-org/snap-desktop

@Override
public void mouseClicked(MouseEvent e) {
  ButtonDef buttonDef = getButtonDef(e.getX(), e.getY());
  if (buttonDef != null) {
    final Action action = buttonDef.getAction();
    action.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));
    e.consume();
  }
}

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

private void fireActionEvent(MouseEvent e) {
  ActionEvent ae = new ActionEvent(e.getSource(), e.getID(),
                   e.paramString(), e.getWhen(),
                   e.getModifiers());
  listener.actionPerformed(ae);
}
private boolean isButtonDown(MouseEvent e) {

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

@Override
public void mouseClicked(MouseEvent e) {
  ButtonDef buttonDef = getButtonDef(e.getX(), e.getY());
  if (buttonDef != null) {
    final Action action = buttonDef.getAction();
    action.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));
    e.consume();
  }
}

代码示例来源:origin: net.sf.sf3jswing/kernel-core

@Override
    public void mouseClicked(MouseEvent e) {
        super.mouseClicked(e);
        setIcon(icon);
        paintImmediately(new Rectangle(getSize()));
        onClickAction.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));
    }
});

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

@Override
  public void mouseClicked(MouseEvent e) {
    if( e.getClickCount() != 2 || e.isPopupTrigger() )
      return;
    int index = locationToIndex(e.getPoint());
    if( index < 0 || index >= getModel().getSize() )
      return;
    Object value = getModel().getElementAt(index);
    if( value instanceof TreeListNode ) {
      TreeListNode node = (TreeListNode) value;
      if( null != node && !node.isExpandable() ) {
        ActionListener al = node.getDefaultAction();
        if( null != al )
          al.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));
      } else if( null != node && node.isExpandable() ) {
        node.setExpanded(!node.isExpanded());
      }
    }
  }
});

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

@Override
  public void mouseClicked(MouseEvent e) {
    if (e.isPopupTrigger() || e.isConsumed()) {
      return;
    }
    int index = locationToIndex(e.getPoint());
    if (index < 0 || index >= getModel().getSize() || e.getButton() != MouseEvent.BUTTON1) {
      return;
    }
    if( e.getClickCount() > 1  ) {
      Object value = getModel().getElementAt(index);
      if( value instanceof ListNode ) {
        ListNode node = (ListNode) value;
        if( null != node ) {
          ActionListener al = node.getDefaultAction();
          if (null != al) {
            al.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));
          }
        }
      }
    } else {
      int row = locationToIndex( e.getPoint() );
      if( row >= 0 && row == getSelectedIndex() ) {
        e.consume();
        clearSelection();
        setSelectedIndex( row );
      }
    }
  }
};

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

@Override
  public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() != 2 || e.isPopupTrigger() || e.isConsumed()) {
      return;
    }
    int index = locationToIndex(e.getPoint());
    if (index < 0 || index >= getModel().getSize()) {
      return;
    }
    Object value = getModel().getElementAt(index);
    if (value instanceof TreeListNode) {
      TreeListNode node = (TreeListNode) value;
      if (null != node && !node.isExpandable()) {
        ActionListener al = node.getDefaultAction();
        if (null != al) {
          al.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));
        }
      } else if (null != node && node.isExpandable()) {
        if (!node.isLoaded()) {
          return;
        }
        node.setExpanded(!node.isExpanded());
      }
    }
  }
});

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

actionListener.actionPerformed(new ActionEvent(e.getSource(), e.getID(), e.paramString()));

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

System.out.println(e.paramString());
MousePanel.this.p = e.getPoint();
MousePanel.this.repaint();

相关文章