package controller;

import boundary.BuilderApplication;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import model.BuilderModel;

/**
 * The controller to handle altered number weights.
 *
 * @author Cem Unsal
 */
public class BuilderNumberWeightCtrl implements ChangeListener {
  BuilderApplication app;
  BuilderModel model;
  int number;

  /**
   * Create a BuilderMultiplierWeightCtrl, given a BuilderApplication and a
   * BuilderModel for context.
   *
   * @param app
   * @param model
   * @param multiplier The multiplier to which this controller applies.
   */
  public BuilderNumberWeightCtrl(BuilderApplication app, BuilderModel model,
      int number) {
    this.app = app;
    this.model = model;
    this.number = number;
  }

  /**
   * Handle the slider's value changing.
   *
   * @param event Details about the ChangeEvent, including the relevant JSlider.
   */
  @Override
  public void stateChanged(ChangeEvent event) {
    JSlider source = (JSlider) event.getSource();
    int val = source.getValue();
    model.level.rules.numberWeights[number] = val;
    model.takeSnapshot();
  }
}

@@ -245,16 +245,364 @@
 hts.%0A *%0A
+ * Example probability distributions:%0A *%0A * %3Cpre%3E%0A * 16.7%25, 16.7%25, 16.7%25, 16.7%25, 16.7%25, 16.7%25%0A * 1,     1,     1,     1,     1,     1     =%3E 6%0A *%0A * 10%25,   18%25,   18%25,   18%25,   18%25,   18%25%0A * 5,     9,     9,     9,     9,     9     =%3E 50%0A *%0A * 10%25,   20%25,   17.5%25, 17.5%25, 17.5%25, 17.5%25%0A * 4,     8,     7,     7,     7,     7     =%3E 40%0A * %3C/pre%3E%0A *%0A
  * @auth

Add comment about number weights