Example #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);
    }
  }
Example #2
0
 /** Dispatches a request to repaint the entire main frame. */
 private void repaintMainFrame() {
   SwingUtilities.invokeLater(
       new Runnable() {
         @Override
         public void run() {
           ClientController.this.mainFrame.repaint();
         }
       });
 }
Example #3
0
  /**
   * Tries to find the owning window for the given component.
   *
   * @param aComponent the AWT event to find the owning window for, may be <code>null</code>.
   * @return the owning window, or <code>null</code> if no such window could be found, or a <code>
   *     null</code> component was given.
   */
  public static final Window getOwningWindow(final Component aComponent) {
    if (aComponent == null) {
      return null;
    }

    Window owner = SwingUtilities.getWindowAncestor(aComponent);
    if (owner == null) {
      owner = getCurrentWindow();
    }
    return owner;
  }