/**
   * Called when one of the name, origin or destination text field changes value
   *
   * @param field the text field
   */
  protected void textFieldValueChanged(JTextField field) {
    // Check if we are in a quiescent state
    if (quiescent) {
      return;
    }

    if (field == nameTxT) {
      route.setName(nameTxT.getText());
    } else if (field == originTxT) {
      route.setDeparture(originTxT.getText());
    } else if (field == destinationTxT) {
      route.setDestination(destinationTxT.getText());
    }

    routeUpdated();
  }
  /** Test method */
  public static final void main(String... args) throws Exception {

    // =====================
    // Create test data
    // =====================
    final Route route = new Route();
    route.setName("Test route");
    final LinkedList<RouteWaypoint> waypoints = new LinkedList<>();
    route.setWaypoints(waypoints);
    route.setStarttime(new Date());

    int len = 10;
    final boolean[] locked = new boolean[len];
    for (int x = 0; x < len; x++) {
      locked[x] = false;
      RouteWaypoint wp = new RouteWaypoint();
      waypoints.add(wp);

      // Set leg values
      if (x > 0) {
        RouteLeg leg = new RouteLeg();
        leg.setSpeed(12.00 + x);
        leg.setHeading(Heading.RL);
        leg.setXtdPort(185.0);
        leg.setXtdStarboard(185.0);

        wp.setInLeg(leg);
        waypoints.get(x - 1).setOutLeg(leg);
        leg.setStartWp(waypoints.get(x - 1));
        leg.setEndWp(wp);
      }

      wp.setName("WP_00" + x);
      wp.setPos(Position.create(56.02505 + Math.random() * 2.0, 12.37 + Math.random() * 2.0));
    }
    for (int x = 1; x < len; x++) {
      waypoints.get(x).setTurnRad(0.5 + x * 0.2);
    }
    route.calcValues(true);

    // Launch the route properties dialog
    PntTime.init();
    RoutePropertiesDialogCommon dialog = new RoutePropertiesDialogCommon(null, null, route, false);
    dialog.setVisible(true);
  }