예제 #1
0
  /** @see nl.lxtreme.ols.api.devices.CaptureCallback#captureStarted(int, int, int) */
  @Override
  public synchronized void captureStarted(
      final int aSampleRate, final int aChannelCount, final int aChannelMask) {
    final Runnable runner =
        new Runnable() {
          @Override
          public void run() {
            updateActions();
          }
        };

    if (SwingUtilities.isEventDispatchThread()) {
      runner.run();
    } else {
      SwingUtilities.invokeLater(runner);
    }
  }
예제 #2
0
  /**
   * Stops service tracking and disposes of the application window.
   *
   * @param context The context of the bundle.
   */
  public void stop(BundleContext context) {
    Runnable runner =
        new Runnable() {
          // This disposes of the application window.
          public void run() {
            m_shapetracker.close();
            m_frame.setVisible(false);
            m_frame.dispose();
          }
        };

    if (SwingUtilities.isEventDispatchThread()) {
      runner.run();
    } else {
      try {
        javax.swing.SwingUtilities.invokeAndWait(runner);
      } catch (Exception ex) {
        ex.printStackTrace();
      }
    }
  }