javax.swing.Timer.getListeners()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(160)

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

Timer.getListeners介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Removes timer and all listeners. */
private void removeTimer () {
  if (timer!=null) {
    ActionListener[] l = (ActionListener[])timer.getListeners (ActionListener.class);
    for (int i=0; i<l.length; i++) {
      timer.removeActionListener (l[i]);
    }
    timer.stop ();
    timer = null;
  }
}

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

/** Removes timer and all listeners. */
private void removeTimer() {
  if (timer != null) {
    ActionListener[] l = timer.getListeners (ActionListener.class);
    for (int i = 0; i < l.length; i++) {
      timer.removeActionListener(l[i]);
    }
    timer.stop();
    timer = null;
  }
}

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

/** Removes timer and all listeners. */
private void removeTimer() {
  if (timer != null) {
    ActionListener[] l = timer.getListeners(ActionListener.class);
    for (int i = 0; i < l.length; i++) {
      timer.removeActionListener(l[i]);
    }
    timer.stop();
    timer = null;
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Removes timer and all listeners. */
private void removeTimer () {
  if (timer!=null) {
    ActionListener[] l = (ActionListener[])timer.getListeners (ActionListener.class);
    for (int i=0; i<l.length; i++) {
      timer.removeActionListener (l[i]);
    }
    timer.stop ();
    timer = null;
  }
}

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

/**
 * Dispose the dialog
 */
public void dispose() {
  super.dispose();
  JETAComponentCleanser cleanser = new JETAComponentCleanser();
  cleanser.cleanse(this);
  m_timer.stop();
  ActionListener[] als = (ActionListener[]) (m_timer.getListeners(ActionListener.class));
  if (als != null) {
    for (int index = 0; index < als.length; index++) {
      m_timer.removeActionListener(als[index]);
    }
  }
  m_cmdListener = null;
  m_controller = null;
  if (m_validators != null)
    m_validators.clear();
  m_initialFocusComponent = null;
  if (m_listeners != null)
    m_listeners.clear();
  if (m_contentpane != null) {
    m_contentpane.removeAll();
    m_contentpane = null;
  }
  m_primaryPanel = null;
}

代码示例来源:origin: LibraryOfCongress/bagger

@Override
 public void actionPerformed(ActionEvent evt) {
  // check if task is completed or user has clicked cancel button
  if (task.hasUserTriedToCancel() || task.isDone()) {
   // we are done
   progressMonitor.close();
   Toolkit.getDefaultToolkit().beep();
   timer.stop();
   log.info("Stopped the timer");
   // getting an array of Action Listeners from Timer Listener (will have
   // only one element)
   ActionListener[] als = timer.getListeners(ActionListener.class);
   // Removing Action Listener from timer
   if (als.length > 0){
    timer.removeActionListener(als[0]);
   }
   if (longRunningProcess != null && !task.isDone()) {
    log.info("Trying to cancel the long running process: {}", longRunningProcess);
    longRunningProcess.cancel();
   }
  }
 }
}

相关文章