/** * A convenient way to create an options JSONObject. Use SliderOption for keys. * * @param min - default minimum of the slider * @param max - default maximum of the slider * @param defaultValues - default points of each anchor * @return a JSONObject of Slider options */ public static JSONObject getOptions(int min, int max, int[] defaultValues) { JSONObject options = new JSONObject(); options.put(SliderOption.MIN.toString(), new JSONNumber(min)); options.put(SliderOption.MAX.toString(), new JSONNumber(max)); JSONArray vals = intArrayToJSONArray(defaultValues); options.put(SliderOption.VALUES.toString(), vals); return options; }
/** * Sets the maximum possible value for the slider * * @param maximum The maximum to set. */ public void setMaximum(int maximum) { setIntOptionJS(getElement().getId(), SliderOption.MAX.toString(), maximum); }
/** * Gets the maximum possible value for the slider * * @return Returns the maximum. */ public int getMaximum() { return getIntOptionJS(getElement().getId(), SliderOption.MAX.toString()); }