Beispiel #1
0
  /** The constructor. */
  public Command() {
    commandThread = new CommandThread();
    commandThread.setRunning(true);

    ExecutorService exec = Executors.newSingleThreadExecutor();
    exec.execute(commandThread);
    exec.shutdown();
  }
Beispiel #2
0
  private void update() {
    commandThread.getData().setPitch(-pitch);
    commandThread.getData().setRoll(-roll);

    if (pitchText != null) {
      pitchText.setText(String.valueOf(-pitch));
      pitchText.update();
    }

    if (rollText != null) {
      rollText.setText(String.valueOf(-roll));
      rollText.update();
    }

    if (canvas != null) canvas.redraw();
  }
Beispiel #3
0
 @Override
 public void dispose() {
   commandThread.setRunning(false);
   super.dispose();
 }