/** * Indicates whether keyboard manipulation of the slider is allowed. * * * @return Boolean */ public Boolean getCanFocus() { return getAttributeAsBoolean("canFocus"); }
/** * The minimum slider value. The slider value is equal to minValue when the thumb is at the bottom or left of the slider * (unless flipValues is true, in which case the minimum value is at the top/right of the slider) * * * @return float * @see com.smartgwt.client.widgets.Slider#getFlipValues * @see <a href="http://www.smartclient.com/smartgwt/showcase/#controls_category_slider" target="examples">Slider Example</a> */ public float getMinValue() { return getAttributeAsFloat("minValue"); }
/** * The height of the labels used to display the minimum, maximum and current values of the slider. * * * @return int */ public int getLabelHeight() { return getAttributeAsInt("labelHeight"); }
private Tab createRasterStyleTab(final ClientRasterLayerInfo config) { Tab tab = new Tab(MESSAGES.layerConfigurationLayerStyle()); VLayout vl = new VLayout(10); vl.setMargin(10); opacitySlider = new Slider(MESSAGES.layerConfigurationOpacity()); opacitySlider.setMinValue(0); opacitySlider.setMaxValue(100); opacitySlider.setVertical(false); try { opacitySlider.setValue(Float.parseFloat(config.getStyle()) * 100); } catch (NumberFormatException e) { opacitySlider.setValue(100); } vl.addMember(opacitySlider); tab.setPane(vl); return tab; }
/** * Specifies whether the value range of the slider should be flipped so that values increase as the thumb is moved down * (for a vertical slider) or to the left (for a horizontal slider). * Sets the {@link com.smartgwt.client.widgets.Slider#getFlipValues flipValues} property of the slider * * @param flipValues flip slider values?. Default value is false */ public void setFlipValues(Boolean flipValues) { setAttribute("flipValues", flipValues, true); }
/** * Add a valueChanged handler. * <p> * This method is called when the slider value changes. This occurs when the setValue method is called, or when the slider * is moved. Observe this method to be notified when the slider value changes. * * @param handler the valueChanged handler * @return {@link HandlerRegistration} used to remove this handler */ public HandlerRegistration addValueChangedHandler(com.smartgwt.client.widgets.events.ValueChangedHandler handler) { if(getHandlerCount(com.smartgwt.client.widgets.events.ValueChangedEvent.getType()) == 0) setupValueChangedEvent(); return doAddHandler(handler, com.smartgwt.client.widgets.events.ValueChangedEvent.getType()); }
public static Slider getOrCreateRef(JavaScriptObject jsObj) { if(jsObj == null) return null; BaseWidget obj = BaseWidget.getRef(jsObj); if(obj != null) { return (Slider) obj; } else { return new Slider(jsObj); } }
/** * Optional display title for the slider. * * * @return String * @see com.smartgwt.client.widgets.Slider#getShowTitle */ public String getTitle() { return getAttributeAsString("title"); }
/** * The imageType setting for the slider track. * * * @return ImageStyle * @see com.smartgwt.client.types.ImageStyle * @see com.smartgwt.client.widgets.StretchImg#getImageType */ public ImageStyle getTrackImageType() { return EnumUtil.getEnum(ImageStyle.values(), getAttribute("trackImageType")); }
private void saved() { if (form.validate()) { if (layer.getClientLayerInfo() == null) { layer.setClientLayerInfo(layer.getReferencedLayerInfo()); // clone?? } ClientLayerInfo cli = layer.getClientLayerInfo(); cli.setLayerInfo(null); cli.setVisible(defaultVisible.getValueAsBoolean()); cli.setLabel(label.getValueAsString()); cli.setMinimumScale(SensibleScaleConverter.stringToScale(minScale.getValueAsString())); cli.setMaximumScale(SensibleScaleConverter.stringToScale(maxScale.getValueAsString())); if (cli instanceof ClientRasterLayerInfo && opacitySlider != null) { float opacityValue = opacitySlider.getValue() / 100; ((ClientRasterLayerInfo) cli).setStyle(String.valueOf(opacityValue)); } else if (cli instanceof ClientVectorLayerInfo && styleHelper != null) { styleHelper.apply((ClientVectorLayerInfo) cli); } for (WidgetEditorHandler h : widgetEditors) { h.save(layer); } hide(); destroy(); if (callback != null) { callback.execute(true); } } }
/** * The height of the labels used to display the minimum, maximum and current values of the slider. * Sets the {@link com.smartgwt.client.widgets.Slider#getLabelHeight labelHeight} property of the slider * * @param labelHeight new label height. Default value is 20 */ public void setLabelHeight(int labelHeight) { setAttribute("labelHeight", labelHeight, true); }
/** * The text displayed in the label for the maximum value of the slider. If left as null, then slider.maxValue will be * displayed. * * * @return String * @see com.smartgwt.client.widgets.Slider#getShowRange * @see com.smartgwt.client.widgets.Slider#getMaxValue */ public String getMaxValueLabel() { return getAttributeAsString("maxValueLabel"); }
/** * The thickness of the track. This is the width, for a vertical slider, or the height, for a horizontal slider. * Sets the {@link com.smartgwt.client.widgets.Slider#getTrackWidth trackWidth} property of the slider * * @param trackWidth new trackWidth. Default value is 7 */ public void setTrackWidth(int trackWidth) { setAttribute("trackWidth", trackWidth, true); }
/** * The number of discrete values represented by slider. If specified, the range of valid values (between * <code>minValue</code> and <code>maxValue</code>) will be divided into this many steps. As the thumb is moved along the * track it will only select these values and appear to jump between the steps. * * * @return Integer * @see <a href="http://www.smartclient.com/smartgwt/showcase/#controls_category_slider" target="examples">Slider Example</a> */ public Integer getNumValues() { return getAttributeAsInt("numValues"); }
/** * If thumb animation is enabled, should the thumb be animated to its initial value? * * * @return Boolean */ public Boolean getAnimateThumbInit() { return getAttributeAsBoolean("animateThumbInit"); }
/** * The text displayed in the label for the minimum value of the slider. If left as null, then slider.minValue will be * displayed. * * * @return String * @see com.smartgwt.client.widgets.Slider#getShowRange * @see com.smartgwt.client.widgets.Slider#getMinValue */ public String getMinValueLabel() { return getAttributeAsString("minValueLabel"); }
/** * The maximum slider value. The slider value is equal to maxValue when the thumb is at the top or right of the slider * (unless flipValues is true, in which case the maximum value is at the bottom/left of the slider) * * * @return float * @see com.smartgwt.client.widgets.Slider#getFlipValues * @see <a href="http://www.smartclient.com/smartgwt/showcase/#controls_category_slider" target="examples">Slider Example</a> */ public float getMaxValue() { return getAttributeAsFloat("maxValue"); }
/** * Indicates whether keyboard manipulation of the slider is allowed. * * @param canFocus canFocus Default value is true */ public void setCanFocus(Boolean canFocus) { setAttribute("canFocus", canFocus, true); }
/** * If {@link com.smartgwt.client.widgets.Slider#getRoundValues roundValues} is false, the slider value will be rounded to * this number of decimal places. If set to null the value will not be rounded * * * @return int */ public int getRoundPrecision() { return getAttributeAsInt("roundPrecision"); }
/** * Specifies whether the value range of the slider should be flipped so that values increase as the thumb is moved down * (for a vertical slider) or to the left (for a horizontal slider). * * * @return Boolean */ public Boolean getFlipValues() { return getAttributeAsBoolean("flipValues"); }