]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/function/SingleNumericParameterFunction.java
Version 17, September 2014
[GpsPrune.git] / tim / prune / function / SingleNumericParameterFunction.java
1 package tim.prune.function;
2
3 import tim.prune.App;
4 import tim.prune.GenericFunction;
5
6 /**
7  * Abstract superclass of Functions which just take a
8  * single numeric parameter
9  */
10 public abstract class SingleNumericParameterFunction extends GenericFunction
11 {
12         /** Minimum and maximum allowed values */
13         protected int _minAllowedValue, _maxAllowedValue;
14
15         /** Constructor */
16         public SingleNumericParameterFunction(App inApp, int inMinValue, int inMaxValue)
17         {
18                 super(inApp);
19                 _minAllowedValue = inMinValue;
20                 _maxAllowedValue = inMaxValue;
21         }
22
23         /** Get the current value for display in the dialog */
24         public abstract int getCurrentParamValue();
25
26         /** Get the key for the description label */
27         public abstract String getDescriptionKey();
28
29         /** Callback to trigger the rest of the function once the parameter has been chosen */
30         public abstract void completeFunction(int inParam);
31
32         /** @return minimum allowed value */
33         public int getMinAllowedValue() {return _minAllowedValue;}
34         /** @return maximum allowed value */
35         public int getMaxAllowedValue() {return _maxAllowedValue;}
36 }