Exemple #1
0
  public void updateDistanceDraggerConstraints() {
    float min = width * (N.getValue() - 1), max = APERTURE_WIDTH / 2.0f - width;

    // ** Manage book keeping variables for other classes **//
    min_distance = min;
    max_distance = max;

    distanceWidget.setMin(min);
    distanceWidget.setMax(max);

    distanceSetInternally = true;
  }
Exemple #2
0
  public void updateWidthDraggerConstraints() {
    float max,
        max1 = APERTURE_WIDTH / 2.0f - distanceWidgetPosition, // The slit touches the wall
        max2 = distance / 2.0f; // The two slits touch

    DebugPrinter.println(
        "distWidgetPosition-> " + distanceWidgetPosition + " distance->" + distance);

    if (N.getValue() == 1) {
      max = APERTURE_WIDTH / 2.0f;
    } else {
      max = (max1 < max2) ? max1 : max2;
    }
    min_width = 0;
    max_width = max;

    widthWidget.setMin(0);
    widthWidget.setMax(max);
  }