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

x33g5p2x  于2022-01-15 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(215)

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

ActionEvent.getWhen介绍

[英]Returns the timestamp of when this event occurred. Because an ActionEvent is a high-level, semantic event, the timestamp is typically the same as an underlying InputEvent.
[中]返回此事件发生的时间戳。因为ActionEvent是高级语义事件,所以时间戳通常与底层InputEvent相同。

代码示例

代码示例来源:origin: JetBrains/ideavim

public void actionPerformed(@NotNull ActionEvent e) {
  ExTextField target = (ExTextField)getTextComponent(e);
  final Action currentAction = target.getCurrentAction();
  if (currentAction != null) {
   currentAction.actionPerformed(e);
  }
  else {
   KeyStroke key = convert(e);
   if (key != null) {
    final char c = key.getKeyChar();
    if (c > 0) {
     ActionEvent event = new ActionEvent(e.getSource(), e.getID(), "" + c, e.getWhen(), e.getModifiers());
     super.actionPerformed(event);
     target.saveLastEntry();
    }
   }
   else {
    super.actionPerformed(e);
    target.saveLastEntry();
   }
  }
 }
}

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

@Override
  public void actionPerformed( ActionEvent e ) {
    nd.setValue(option);
    if (buttonListener != null) {
      // #34485: some listeners expect that the action source is the option, not the button
      ActionEvent e2 = new ActionEvent(
          option, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers()
        );
      buttonListener.actionPerformed(e2);
    }
    if ((closingOptions == null) || Arrays.asList(closingOptions).contains(option)) {
      haveFinalValue = true;
      setVisible(false);
    }
  }
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

public void actionPerformed(ActionEvent evt)
{
  arrowActionListener.actionPerformed(
    new ActionEvent(this,
      ActionEvent.ACTION_PERFORMED,
      evt.getActionCommand(),
      evt.getWhen(),
      evt.getModifiers()
      )
    );
} //}}}

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

public void actionPerformed(ActionEvent e) {
    final MouseEvent newMouseEvent = new MouseEvent(me.getComponent(),me.getID(), e.getWhen(), me.getModifiers(), me.getX(), me.getY(), clickCounter, me.isPopupTrigger(), button);
    delegate.mouseClicked(newMouseEvent);
    timer = null;
  }
});

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

public void actionPerformed(ActionEvent e)
{
  e = new ActionEvent(
    this,
    ActionEvent.ACTION_PERFORMED,
    e.getActionCommand(),
    e.getWhen(),
    e.getModifiers());

  mal.actionPerformed(e);
}

代码示例来源:origin: net.segoia/java-forms-core

public void onEvent(Object event) {
  if (actionListener != null) {
  ActionEvent ae = (ActionEvent) event;
  ActionEvent newEvent = new ActionEvent(ae.getSource(), ae.getID(), actionName, ae.getWhen(),
    ae.getModifiers());
  actionListener.actionPerformed(newEvent);
  }
}

代码示例来源:origin: ca.mcgill/Sholl_Analysis

@Override
  public void actionPerformed(final ActionEvent e) {
    final MouseEvent me = new MouseEvent((Component) e.getSource(), MouseEvent.MOUSE_CLICKED,
        e.getWhen(), MouseEvent.MOUSE_PRESSED, 0, 0, 0, true);
    helpActionMouseListener.mousePressed(me);
  }
};

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

public CommandActionEvent(ActionEvent e, CustomCommand command) {
  super(e.getSource(), e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers());
  this.command = command;
}

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

private void onModeChanged(ActionEvent e)
{
 _actionListener.actionPerformed(new ActionEvent(this, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers()));
}

代码示例来源:origin: org.microemu/microemu-javase-swing

public MRUActionEvent(Object sourceMRU, ActionEvent orig) {
  super(orig.getSource(), orig.getID(), orig.getActionCommand(), orig.getWhen(), orig.getModifiers());
  this.sourceMRU = sourceMRU;
}

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

final public void actionPerformed(ActionEvent e) {
  if (!delegateActionPerformed(e)) {
    if (_action != null) {
      if (_target == null) {
        _action.actionPerformed(e);
      }
      else {
        _action.actionPerformed(new ActionEvent(getTarget(), e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers()));
      }
    }
  }
}

代码示例来源:origin: com.samskivert/samskivert

@Override
protected void fireActionPerformed (ActionEvent e)
{
  if (_event != null) {
    _event.setWhen(e.getWhen());
    e = _event;
  }
  super.fireActionPerformed(e);
}

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

public void actionPerformed(ActionEvent evt) {
    getDesignerPane().escape(evt.getWhen());
  }
} // End of EscapeAction.

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

public void actionPerformed( ActionEvent e ){
    fireActionEvent( new ActionEvent( action, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers() ));
  }
}

代码示例来源:origin: org.gephi/desktop-io-export

@Override
  public void actionPerformed(ActionEvent e) {
    //System.err.println("actionPerformed: " + option);
    nd.setValue(option);
    if (buttonListener != null) {
      // #34485: some listeners expect that the action source is the option, not the button
      ActionEvent e2 = new ActionEvent(
          option, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers());
      buttonListener.actionPerformed(e2);
    }
    if ((closingOptions == null) || Arrays.asList(closingOptions).contains(option)) {
      haveFinalValue = true;
      setVisible(false);
    }
  }
};

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

public void invokeDeleteNextCharAction(ActionEvent evt) {
  DesignerPane designerPane = webform.getPane();
  Action[] actions = designerPane.getActions();
  for (Action action : actions) {
    if (action != null && action.getValue(Action.NAME) == DesignerPaneBase.deleteNextCharAction) {
      // XXX Pretend the event originated from the DesignerPane, otherwise the action wouldn't work.
      ActionEvent fakeEvt = new ActionEvent(
          designerPane,
          evt.getID(),
          evt.getActionCommand(),
          evt.getWhen(),
          evt.getModifiers());
      action.actionPerformed(fakeEvt);
      break;
    }
  }
}

代码示例来源:origin: ch.epfl.gsn/gsn-core

public void actionPerformed ( ActionEvent actionEvent ) {
 StreamElement streamElement = new StreamElement( EMPTY_FIELD_LIST , EMPTY_FIELD_TYPES , EMPTY_DATA_PART , actionEvent.getWhen( ) );
 if(delayPostingElements){
   streamElementBuffer.add(streamElement);
   synchronized(objectLock){
     objectLock.notifyAll();
   }
 }
 else
   postStreamElement( streamElement );
}

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

public void actionPerformed(ActionEvent ae) 
{
  mal.actionPerformed(new ActionEvent(this, ae.getID(),
    ae.getCommand(), ae.getWhen(), ae.getModifiers() )); 
}

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

@Override
public void actionPerformed(ActionEvent e) {
  if(e != null && e.getSource() == dce){
    super.actionPerformed(new ActionEvent(getEditor(), e.getID(), e.getActionCommand(),e.getWhen(),e.getModifiers()));
  }
  else
    super.actionPerformed(e);
}

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

private void sendButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sendButtonActionPerformed
  KeyEvent e = new KeyEvent((Component) evt.getSource(),evt.getID(), evt.getWhen(), evt.getModifiers(), KeyEvent.VK_ENTER, '\n');
  keyTyped(e);
  outbox.requestFocus();
}//GEN-LAST:event_sendButtonActionPerformed

相关文章