public synchronized void sendCommand(ARDrone drone,ControllerButton button) throws IOException {
  List<AssignableControl> commands=map.get(button);
  if (commands == null) {
    return;
  }
  for (Iterator<AssignableControl> it=commands.iterator(); it.hasNext(); ) {
    final AssignableControl assignableCommand=it.next();
    if (assignableCommand.getDelay() > 0) {
      delayCommand(assignableCommand,drone);
    }
 else {
      assignableCommand.sendToDrone(drone);
    }
  }
}

public synchronized void sendCommand ( ARDrone drone , ControllerButton button ) throws IOException { List < AssignableControl > commands = map . get ( button ) ; if ( commands == null ) { return ; } for ( Iterator < AssignableControl > it = commands . iterator ( ) ; it . hasNext ( ) ; ) { final AssignableControl assignableCommand = it . next ( ) ; if ( assignableCommand . getDelay ( ) > 0 ) { delayCommand ( assignableCommand , drone ) ; } else { assignableCommand . sendToDrone ( drone ) ; } } }
called from the update loop in controltower when a button is pressed
