1 package tim.prune.function;
4 import tim.prune.DataSubscriber;
5 import tim.prune.UpdateMessageBroker;
6 import tim.prune.config.Config;
9 * Function to set the width with which lines are drawn
11 public class SetLineWidth extends SingleNumericParameterFunction
16 * @param inApp App object
18 public SetLineWidth(App inApp) {
22 /** @return name key */
23 public String getNameKey() {
24 return "function.setlinewidth";
27 /** @return description key */
28 public String getDescriptionKey() {
29 return "dialog.setlinewidth.text";
32 /** @return the current value to display */
33 public int getCurrentParamValue() {
34 return Config.getConfigInt(Config.KEY_LINE_WIDTH);
42 // Not required, because this function is started from a ChooseSingleParameter function
43 // and goes directly to the completeFunction method.
47 * Complete the function using the given line width parameter
49 public void completeFunction(int inLineWidth)
51 final int currLineWidth = Config.getConfigInt(Config.KEY_LINE_WIDTH);
52 if (inLineWidth >= 1 && inLineWidth <= 4 && inLineWidth != currLineWidth)
54 Config.setConfigInt(Config.KEY_LINE_WIDTH, inLineWidth);
55 UpdateMessageBroker.informSubscribers(DataSubscriber.SELECTION_CHANGED);